diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2020-10-01 17:32:23 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-01 17:32:23 +0200 |
| commit | 2140d80a9d69cce7a9fb2c90051af4328737a446 (patch) | |
| tree | a480aaacbacfabe38783426bfc069f75ee14fd63 /compiler/rustc_feature/src/lib.rs | |
| parent | 84ef603c8400db203fefd714de963c88e5523424 (diff) | |
| download | rust-2140d80a9d69cce7a9fb2c90051af4328737a446.tar.gz rust-2140d80a9d69cce7a9fb2c90051af4328737a446.zip | |
Add note about possible future improvement
Co-authored-by: David Tolnay <dtolnay@gmail.com>
Diffstat (limited to 'compiler/rustc_feature/src/lib.rs')
| -rw-r--r-- | compiler/rustc_feature/src/lib.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_feature/src/lib.rs b/compiler/rustc_feature/src/lib.rs index c70f3c3cd40..68ac2841fed 100644 --- a/compiler/rustc_feature/src/lib.rs +++ b/compiler/rustc_feature/src/lib.rs @@ -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), |
