We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 84ef603 commit 2140d80Copy full SHA for 2140d80
compiler/rustc_feature/src/lib.rs
@@ -113,6 +113,8 @@ fn find_lang_feature_issue(feature: Symbol) -> Option<NonZeroU32> {
113
}
114
115
const fn to_nonzero(n: Option<u32>) -> Option<NonZeroU32> {
116
+ // Can be replaced with `n.and_then(NonZeroU32::new)` if that is ever usable
117
+ // in const context. Requires https://github.com/rust-lang/rfcs/pull/2632.
118
match n {
119
None => None,
120
Some(n) => NonZeroU32::new(n),
0 commit comments