diff options
| author | bors <bors@rust-lang.org> | 2018-09-14 09:47:21 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-09-14 09:47:21 +0000 |
| commit | dfabe4b88509bfff1eca9060ccc9a4d28ee394e8 (patch) | |
| tree | 7f637c2857e19dfbcc17254c011e644de2306e65 /src/libcore | |
| parent | fccde0018a618eb6f45d2a3c97f629809994dff6 (diff) | |
| parent | a94c16614c3a43d609a437afa92ef5ae7d3965ea (diff) | |
Auto merge of #54032 - oli-obk:layout_scalar_ranges, r=eddyb
Add forever unstable attribute to allow specifying arbitrary scalar ranges r? @eddyb for the first commit and @nikomatsakis for the second one
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/nonzero.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libcore/nonzero.rs b/src/libcore/nonzero.rs index cc36ea7f713..30067d7e163 100644 --- a/src/libcore/nonzero.rs +++ b/src/libcore/nonzero.rs @@ -14,7 +14,8 @@ use ops::CoerceUnsized; /// A wrapper type for raw pointers and integers that will never be /// NULL or 0 that might allow certain optimizations. -#[lang = "non_zero"] +#[cfg_attr(stage0, lang = "non_zero")] +#[cfg_attr(not(stage0), rustc_layout_scalar_valid_range_start(1))] #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)] #[repr(transparent)] pub(crate) struct NonZero<T>(pub(crate) T); |
