Skip to content

Commit 2140d80

Browse files
m-ou-sedtolnay
andauthored
Add note about possible future improvement
Co-authored-by: David Tolnay <[email protected]>
1 parent 84ef603 commit 2140d80

File tree

1 file changed

+2
-0
lines changed
  • compiler/rustc_feature/src

1 file changed

+2
-0
lines changed

compiler/rustc_feature/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ fn find_lang_feature_issue(feature: Symbol) -> Option<NonZeroU32> {
113113
}
114114

115115
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.
116118
match n {
117119
None => None,
118120
Some(n) => NonZeroU32::new(n),

0 commit comments

Comments
 (0)