@@ -141,7 +141,9 @@ unsafe impl<T: Sync + ?Sized> Send for &T {}
141141) ]
142142#[ fundamental] // for Default, for example, which requires that `[T]: !Default` be evaluatable
143143#[ 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) ]
145147#[ rustc_coinductive]
146148pub trait Sized {
147149 // Empty.
@@ -181,7 +183,9 @@ pub trait Sized {
181183/// [^1]: Formerly known as *object safe*.
182184#[ unstable( feature = "unsize" , issue = "18598" ) ]
183185#[ 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) ]
185189pub trait Unsize < T : ?Sized > {
186190 // Empty.
187191}
@@ -815,7 +819,9 @@ impl<T: ?Sized> StructuralPartialEq for PhantomData<T> {}
815819 reason = "this trait is unlikely to ever be stabilized, use `mem::discriminant` instead"
816820) ]
817821#[ 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) ]
819825pub trait DiscriminantKind {
820826 /// The type of the discriminant, which must satisfy the trait
821827 /// bounds required by `mem::Discriminant`.
@@ -956,7 +962,9 @@ marker_impls! {
956962#[ unstable( feature = "const_destruct" , issue = "133214" ) ]
957963#[ lang = "destruct" ]
958964#[ 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) ]
960968#[ cfg_attr( not( bootstrap) , const_trait) ]
961969pub trait Destruct { }
962970
@@ -967,7 +975,9 @@ pub trait Destruct {}
967975#[ unstable( feature = "tuple_trait" , issue = "none" ) ]
968976#[ lang = "tuple_trait" ]
969977#[ 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) ]
971981pub trait Tuple { }
972982
973983/// A marker for pointer-like types.
@@ -1068,7 +1078,9 @@ marker_impls! {
10681078 reason = "internal trait for implementing various traits for all function pointers"
10691079) ]
10701080#[ 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) ]
10721084pub trait FnPtr : Copy + Clone {
10731085 /// Returns the address of the function pointer.
10741086 #[ lang = "fn_ptr_addr" ]
0 commit comments