@@ -141,7 +141,9 @@ unsafe impl<T: Sync + ?Sized> Send for &T {}
141
141
) ]
142
142
#[ fundamental] // for Default, for example, which requires that `[T]: !Default` be evaluatable
143
143
#[ rustc_specialization_trait]
144
- #[ rustc_deny_explicit_impl( implement_via_object = false ) ]
144
+ #[ cfg_attr( bootstrap, rustc_deny_explicit_impl( implement_via_object = false ) ) ]
145
+ #[ cfg_attr( not( bootstrap) , rustc_deny_explicit_impl) ]
146
+ #[ cfg_attr( not( bootstrap) , rustc_do_not_implement_via_object) ]
145
147
#[ rustc_coinductive]
146
148
pub trait Sized {
147
149
// Empty.
@@ -181,7 +183,9 @@ pub trait Sized {
181
183
/// [^1]: Formerly known as *object safe*.
182
184
#[ unstable( feature = "unsize" , issue = "18598" ) ]
183
185
#[ lang = "unsize" ]
184
- #[ rustc_deny_explicit_impl( implement_via_object = false ) ]
186
+ #[ cfg_attr( bootstrap, rustc_deny_explicit_impl( implement_via_object = false ) ) ]
187
+ #[ cfg_attr( not( bootstrap) , rustc_deny_explicit_impl) ]
188
+ #[ cfg_attr( not( bootstrap) , rustc_do_not_implement_via_object) ]
185
189
pub trait Unsize < T : ?Sized > {
186
190
// Empty.
187
191
}
@@ -815,7 +819,9 @@ impl<T: ?Sized> StructuralPartialEq for PhantomData<T> {}
815
819
reason = "this trait is unlikely to ever be stabilized, use `mem::discriminant` instead"
816
820
) ]
817
821
#[ lang = "discriminant_kind" ]
818
- #[ rustc_deny_explicit_impl( implement_via_object = false ) ]
822
+ #[ cfg_attr( bootstrap, rustc_deny_explicit_impl( implement_via_object = false ) ) ]
823
+ #[ cfg_attr( not( bootstrap) , rustc_deny_explicit_impl) ]
824
+ #[ cfg_attr( not( bootstrap) , rustc_do_not_implement_via_object) ]
819
825
pub trait DiscriminantKind {
820
826
/// The type of the discriminant, which must satisfy the trait
821
827
/// bounds required by `mem::Discriminant`.
@@ -956,7 +962,9 @@ marker_impls! {
956
962
#[ unstable( feature = "const_destruct" , issue = "133214" ) ]
957
963
#[ lang = "destruct" ]
958
964
#[ rustc_on_unimplemented( message = "can't drop `{Self}`" , append_const_msg) ]
959
- #[ rustc_deny_explicit_impl( implement_via_object = false ) ]
965
+ #[ cfg_attr( bootstrap, rustc_deny_explicit_impl( implement_via_object = false ) ) ]
966
+ #[ cfg_attr( not( bootstrap) , rustc_deny_explicit_impl) ]
967
+ #[ cfg_attr( not( bootstrap) , rustc_do_not_implement_via_object) ]
960
968
#[ cfg_attr( not( bootstrap) , const_trait) ]
961
969
pub trait Destruct { }
962
970
@@ -967,7 +975,9 @@ pub trait Destruct {}
967
975
#[ unstable( feature = "tuple_trait" , issue = "none" ) ]
968
976
#[ lang = "tuple_trait" ]
969
977
#[ diagnostic:: on_unimplemented( message = "`{Self}` is not a tuple" ) ]
970
- #[ rustc_deny_explicit_impl( implement_via_object = false ) ]
978
+ #[ cfg_attr( bootstrap, rustc_deny_explicit_impl( implement_via_object = false ) ) ]
979
+ #[ cfg_attr( not( bootstrap) , rustc_deny_explicit_impl) ]
980
+ #[ cfg_attr( not( bootstrap) , rustc_do_not_implement_via_object) ]
971
981
pub trait Tuple { }
972
982
973
983
/// A marker for pointer-like types.
@@ -1068,7 +1078,9 @@ marker_impls! {
1068
1078
reason = "internal trait for implementing various traits for all function pointers"
1069
1079
) ]
1070
1080
#[ lang = "fn_ptr_trait" ]
1071
- #[ rustc_deny_explicit_impl( implement_via_object = false ) ]
1081
+ #[ cfg_attr( bootstrap, rustc_deny_explicit_impl( implement_via_object = false ) ) ]
1082
+ #[ cfg_attr( not( bootstrap) , rustc_deny_explicit_impl) ]
1083
+ #[ cfg_attr( not( bootstrap) , rustc_do_not_implement_via_object) ]
1072
1084
pub trait FnPtr : Copy + Clone {
1073
1085
/// Returns the address of the function pointer.
1074
1086
#[ lang = "fn_ptr_addr" ]
0 commit comments