Skip to content

Commit bbf8ee1

Browse files
Enforce that dyn* casts are actually pointer-sized
1 parent 3cfc190 commit bbf8ee1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

core/src/marker.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,15 @@ pub trait Destruct {}
809809
#[cfg_attr(not(bootstrap), rustc_deny_explicit_impl)]
810810
pub trait Tuple {}
811811

812+
/// A marker for things
813+
#[unstable(feature = "pointer_sized_trait", issue = "none")]
814+
#[cfg_attr(not(bootstrap), lang = "pointer_sized")]
815+
#[rustc_on_unimplemented(
816+
message = "`{Self}` needs to be a pointer-sized type",
817+
label = "`{Self}` needs to be a pointer-sized type"
818+
)]
819+
pub trait PointerSized {}
820+
812821
/// Implementations of `Copy` for primitive types.
813822
///
814823
/// Implementations that cannot be described in Rust

0 commit comments

Comments
 (0)