Skip to content

Commit a73c7ec

Browse files
authored
Rollup merge of rust-lang#107769 - compiler-errors:pointer-like, r=eholk
Rename `PointerSized` to `PointerLike` The old name was unnecessarily vague. This PR renames a nightly language feature that I added, so I don't think it needs any additional approval, though anyone can feel free to speak up if you dislike the rename. It's still unsatisfying that we don't the user which of {size, alignment} is wrong, but this trait really is just a stepping stone for a more generalized mechanism to create `dyn*`, just meant for nightly testing, so I don't think it really deserves additional diagnostic machinery for now. Fixes rust-lang#107696, cc ``@RalfJung`` r? ``@eholk``
2 parents a7f0d87 + 0f5a13a commit a73c7ec

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

core/src/marker.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -872,13 +872,14 @@ pub trait Destruct {}
872872
pub trait Tuple {}
873873

874874
/// A marker for things
875-
#[unstable(feature = "pointer_sized_trait", issue = "none")]
876-
#[lang = "pointer_sized"]
875+
#[unstable(feature = "pointer_like_trait", issue = "none")]
876+
#[cfg_attr(bootstrap, lang = "pointer_sized")]
877+
#[cfg_attr(not(bootstrap), lang = "pointer_like")]
877878
#[rustc_on_unimplemented(
878-
message = "`{Self}` needs to be a pointer-sized type",
879-
label = "`{Self}` needs to be a pointer-sized type"
879+
message = "`{Self}` needs to have the same alignment and size as a pointer",
880+
label = "`{Self}` needs to be a pointer-like type"
880881
)]
881-
pub trait PointerSized {}
882+
pub trait PointerLike {}
882883

883884
/// Implementations of `Copy` for primitive types.
884885
///

0 commit comments

Comments
 (0)