diff options
| author | bors <bors@rust-lang.org> | 2020-02-10 10:47:39 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-02-10 10:47:39 +0000 |
| commit | 4d1241f5158ffd66730e094d8f199ed654ed52ae (patch) | |
| tree | 911cdc3247d263b7f8364c275ebc04a2eb867e64 /src/libcore | |
| parent | 840bdc349d2885a5173269b653025192969cfebc (diff) | |
| parent | 18c6d39b5500909f38da7b76d1c51d54300c535e (diff) | |
Auto merge of #69012 - Dylan-DPC:rollup-13qn0fq, r=Dylan-DPC
Rollup of 6 pull requests Successful merges: - #68694 (Reduce the number of `RefCell`s in `InferCtxt`.) - #68966 (Improve performance of coherence checks) - #68976 (Make `num::NonZeroX::new` an unstable `const fn`) - #68992 (Correctly parse `mut a @ b`) - #69005 (Small graphviz improvements for the new dataflow framework) - #69006 (parser: Keep current and previous tokens precisely) Failed merges: r? @ghost
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/num/mod.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index ed37b48b3e8..3ae8f0f7870 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -69,8 +69,9 @@ assert_eq!(size_of::<Option<core::num::", stringify!($Ty), ">>(), size_of::<", s /// Creates a non-zero if the given value is not zero. #[$stability] + #[rustc_const_unstable(feature = "const_nonzero_int_methods", issue = "53718")] #[inline] - pub fn new(n: $Int) -> Option<Self> { + pub const fn new(n: $Int) -> Option<Self> { if n != 0 { // SAFETY: we just checked that there's no `0` Some(unsafe { Self(n) }) |
