Skip to content

Commit 19240af

Browse files
Add rustc_do_not_implement_via_object
1 parent 3098538 commit 19240af

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

core/src/marker.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ pub trait Sized {
174174
#[unstable(feature = "unsize", issue = "18598")]
175175
#[lang = "unsize"]
176176
#[rustc_deny_explicit_impl]
177+
#[cfg_attr(not(bootstrap), rustc_do_not_implement_via_object)]
177178
pub trait Unsize<T: ?Sized> {
178179
// Empty.
179180
}
@@ -855,6 +856,7 @@ impl<T: ?Sized> StructuralEq for PhantomData<T> {}
855856
)]
856857
#[lang = "discriminant_kind"]
857858
#[rustc_deny_explicit_impl]
859+
#[cfg_attr(not(bootstrap), rustc_do_not_implement_via_object)]
858860
pub trait DiscriminantKind {
859861
/// The type of the discriminant, which must satisfy the trait
860862
/// bounds required by `mem::Discriminant`.
@@ -960,6 +962,7 @@ marker_impls! {
960962
#[lang = "destruct"]
961963
#[rustc_on_unimplemented(message = "can't drop `{Self}`", append_const_msg)]
962964
#[rustc_deny_explicit_impl]
965+
#[cfg_attr(not(bootstrap), rustc_do_not_implement_via_object)]
963966
#[const_trait]
964967
pub trait Destruct {}
965968

@@ -971,6 +974,7 @@ pub trait Destruct {}
971974
#[lang = "tuple_trait"]
972975
#[rustc_on_unimplemented(message = "`{Self}` is not a tuple")]
973976
#[rustc_deny_explicit_impl]
977+
#[cfg_attr(not(bootstrap), rustc_do_not_implement_via_object)]
974978
pub trait Tuple {}
975979

976980
/// A marker for pointer-like types.

core/src/mem/transmutability.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use crate::marker::ConstParamTy;
77
/// notwithstanding whatever safety checks you have asked the compiler to [`Assume`] are satisfied.
88
#[unstable(feature = "transmutability", issue = "99571")]
99
#[lang = "transmute_trait"]
10+
#[cfg_attr(not(bootstrap), rustc_do_not_implement_via_object)]
1011
pub unsafe trait BikeshedIntrinsicFrom<Src, Context, const ASSUME: Assume = { Assume::NOTHING }>
1112
where
1213
Src: ?Sized,

core/src/ptr/metadata.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ use crate::hash::{Hash, Hasher};
5151
/// [`to_raw_parts`]: *const::to_raw_parts
5252
#[lang = "pointee_trait"]
5353
#[rustc_deny_explicit_impl]
54+
#[cfg_attr(not(bootstrap), rustc_do_not_implement_via_object)]
5455
pub trait Pointee {
5556
/// The type for metadata in pointers and references to `Self`.
5657
#[lang = "metadata_type"]

0 commit comments

Comments
 (0)