10 files changed +10
-19
lines changed Original file line number Diff line number Diff line change 175
175
#![ feature( const_mut_refs) ]
176
176
#![ feature( const_precise_live_drops) ]
177
177
#![ feature( const_ptr_write) ]
178
- #![ feature( const_trait_impl) ]
179
178
#![ feature( const_try) ]
180
179
#![ feature( decl_macro) ]
181
180
#![ feature( dropck_eyepatch) ]
Original file line number Diff line number Diff line change @@ -245,7 +245,6 @@ use self::Ordering::*;
245
245
append_const_msg
246
246
) ]
247
247
#[ rustc_diagnostic_item = "PartialEq" ]
248
- #[ const_trait]
249
248
pub trait PartialEq < Rhs : ?Sized = Self > {
250
249
/// This method tests for `self` and `other` values to be equal, and is used
251
250
/// by `==`.
@@ -1475,8 +1474,7 @@ mod impls {
1475
1474
macro_rules! partial_eq_impl {
1476
1475
( $( $t: ty) * ) => ( $(
1477
1476
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1478
- #[ rustc_const_unstable( feature = "const_cmp" , issue = "92391" ) ]
1479
- impl const PartialEq for $t {
1477
+ impl PartialEq for $t {
1480
1478
#[ inline]
1481
1479
fn eq( & self , other: & $t) -> bool { ( * self ) == ( * other) }
1482
1480
#[ inline]
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ const fn escape_ascii<const N: usize>(byte: u8) -> ([ascii::Char; N], Range<u8>)
60
60
const fn escape_unicode < const N : usize > ( c : char ) -> ( [ ascii:: Char ; N ] , Range < u8 > ) {
61
61
const { assert ! ( N >= 10 && N < u8 :: MAX as usize ) } ;
62
62
63
- let c = u32 :: from ( c ) ;
63
+ let c = c as u32 ;
64
64
65
65
// OR-ing `1` ensures that for `c == 0` the code computes that
66
66
// one digit should be printed.
Original file line number Diff line number Diff line change @@ -515,7 +515,9 @@ impl CStr {
515
515
#[ inline]
516
516
#[ must_use]
517
517
const fn as_non_null_ptr ( & self ) -> NonNull < c_char > {
518
- NonNull :: from ( & self . inner ) . as_non_null_ptr ( )
518
+ // FIXME(effects) replace with `NonNull::from`
519
+ // SAFETY: a reference is never null
520
+ unsafe { NonNull :: new_unchecked ( & self . inner as * const [ c_char ] as * mut [ c_char ] ) } . as_non_null_ptr ( )
519
521
}
520
522
521
523
/// Returns the length of `self`. Like C's `strlen`, this does not include the nul terminator.
Original file line number Diff line number Diff line change 214
214
#![ feature( const_mut_refs) ]
215
215
#![ feature( const_precise_live_drops) ]
216
216
#![ feature( const_refs_to_cell) ]
217
- #![ feature( const_trait_impl) ]
218
217
#![ feature( decl_macro) ]
219
218
#![ feature( deprecated_suggestion) ]
220
219
#![ feature( doc_cfg) ]
221
220
#![ feature( doc_cfg_hide) ]
222
221
#![ feature( doc_notable_trait) ]
223
- #![ feature( effects) ]
224
222
#![ feature( extern_types) ]
225
223
#![ feature( f128) ]
226
224
#![ feature( f16) ]
Original file line number Diff line number Diff line change @@ -944,7 +944,6 @@ marker_impls! {
944
944
#[ lang = "destruct" ]
945
945
#[ rustc_on_unimplemented( message = "can't drop `{Self}`" , append_const_msg) ]
946
946
#[ rustc_deny_explicit_impl( implement_via_object = false ) ]
947
- #[ const_trait]
948
947
pub trait Destruct { }
949
948
950
949
/// A marker for tuple types.
Original file line number Diff line number Diff line change @@ -33,7 +33,6 @@ use super::{IntErrorKind, ParseIntError};
33
33
reason = "implementation detail which may disappear or be replaced at any time" ,
34
34
issue = "none"
35
35
) ]
36
- #[ const_trait]
37
36
pub unsafe trait ZeroablePrimitive : Sized + Copy + private:: Sealed {
38
37
#[ doc( hidden) ]
39
38
type NonZeroInner : Sized + Copy ;
@@ -47,7 +46,6 @@ macro_rules! impl_zeroable_primitive {
47
46
reason = "implementation detail which may disappear or be replaced at any time" ,
48
47
issue = "none"
49
48
) ]
50
- #[ const_trait]
51
49
pub trait Sealed { }
52
50
53
51
$(
@@ -70,14 +68,14 @@ macro_rules! impl_zeroable_primitive {
70
68
reason = "implementation detail which may disappear or be replaced at any time" ,
71
69
issue = "none"
72
70
) ]
73
- impl const private:: Sealed for $primitive { }
71
+ impl private:: Sealed for $primitive { }
74
72
75
73
#[ unstable(
76
74
feature = "nonzero_internals" ,
77
75
reason = "implementation detail which may disappear or be replaced at any time" ,
78
76
issue = "none"
79
77
) ]
80
- unsafe impl const ZeroablePrimitive for $primitive {
78
+ unsafe impl ZeroablePrimitive for $primitive {
81
79
type NonZeroInner = private:: $NonZeroInner;
82
80
}
83
81
) +
Original file line number Diff line number Diff line change 73
73
append_const_msg
74
74
) ]
75
75
#[ doc( alias = "+" ) ]
76
- #[ const_trait]
77
76
pub trait Add < Rhs = Self > {
78
77
/// The resulting type after applying the `+` operator.
79
78
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -95,8 +94,7 @@ pub trait Add<Rhs = Self> {
95
94
macro_rules! add_impl {
96
95
( $( $t: ty) * ) => ( $(
97
96
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
98
- #[ rustc_const_unstable( feature = "const_ops" , issue = "90080" ) ]
99
- impl const Add for $t {
97
+ impl Add for $t {
100
98
type Output = $t;
101
99
102
100
#[ inline]
Original file line number Diff line number Diff line change @@ -282,7 +282,7 @@ impl<'a> Context<'a> {
282
282
pub const fn ext ( & mut self ) -> & mut dyn Any {
283
283
// FIXME: this field makes Context extra-weird about unwind safety
284
284
// can we justify AssertUnwindSafe if we stabilize this? do we care?
285
- match & mut * self . ext {
285
+ match & mut self . ext . 0 {
286
286
ExtData :: Some ( data) => * data,
287
287
ExtData :: None ( unit) => unit,
288
288
}
@@ -356,7 +356,7 @@ impl<'a> ContextBuilder<'a> {
356
356
#[ rustc_const_unstable( feature = "const_waker" , issue = "102012" ) ]
357
357
#[ unstable( feature = "context_ext" , issue = "123392" ) ]
358
358
pub const fn from ( cx : & ' a mut Context < ' _ > ) -> Self {
359
- let ext = match & mut * cx. ext {
359
+ let ext = match & mut cx. ext . 0 {
360
360
ExtData :: Some ( ext) => ExtData :: Some ( * ext) ,
361
361
ExtData :: None ( ( ) ) => ExtData :: None ( ( ) ) ,
362
362
} ;
Original file line number Diff line number Diff line change 284
284
#![ feature( cfi_encoding) ]
285
285
#![ feature( concat_idents) ]
286
286
#![ feature( const_mut_refs) ]
287
- #![ feature( const_trait_impl) ]
288
287
#![ feature( decl_macro) ]
289
288
#![ feature( deprecated_suggestion) ]
290
289
#![ feature( doc_cfg) ]
0 commit comments