Skip to content

Commit

Permalink
Add note about possible future improvement
Browse files Browse the repository at this point in the history
Co-authored-by: David Tolnay <dtolnay@gmail.com>
  • Loading branch information
m-ou-se and dtolnay authored Oct 1, 2020
1 parent 84ef603 commit 2140d80
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler/rustc_feature/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ fn find_lang_feature_issue(feature: Symbol) -> Option<NonZeroU32> {
}

const fn to_nonzero(n: Option<u32>) -> Option<NonZeroU32> {
// Can be replaced with `n.and_then(NonZeroU32::new)` if that is ever usable
// in const context. Requires https://github.com/rust-lang/rfcs/pull/2632.
match n {
None => None,
Some(n) => NonZeroU32::new(n),
Expand Down

0 comments on commit 2140d80

Please sign in to comment.