diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-02-08 07:13:26 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-08 07:13:26 +0100 |
| commit | fabefe3f313f3aec7f2172ced923d1fa9708d0b2 (patch) | |
| tree | 0c50e323b94f3afd30f3f38784f0e2f2d3c8fa6c /library/core/src | |
| parent | b16a321b25d436daa43397df39f1d5065f0fb15f (diff) | |
| parent | 2b70cbb8a5935a8fbc8d52d7e8304f8eefeb2d21 (diff) | |
| download | rust-fabefe3f313f3aec7f2172ced923d1fa9708d0b2.tar.gz rust-fabefe3f313f3aec7f2172ced923d1fa9708d0b2.zip | |
Rollup merge of #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 #107696, cc ``@RalfJung``
r? ``@eholk``
Diffstat (limited to 'library/core/src')
| -rw-r--r-- | library/core/src/marker.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs index 74055602ec2..e11bca5962a 100644 --- a/library/core/src/marker.rs +++ b/library/core/src/marker.rs @@ -872,13 +872,14 @@ pub trait Destruct {} pub trait Tuple {} /// A marker for things -#[unstable(feature = "pointer_sized_trait", issue = "none")] -#[lang = "pointer_sized"] +#[unstable(feature = "pointer_like_trait", issue = "none")] +#[cfg_attr(bootstrap, lang = "pointer_sized")] +#[cfg_attr(not(bootstrap), lang = "pointer_like")] #[rustc_on_unimplemented( - message = "`{Self}` needs to be a pointer-sized type", - label = "`{Self}` needs to be a pointer-sized type" + message = "`{Self}` needs to have the same alignment and size as a pointer", + label = "`{Self}` needs to be a pointer-like type" )] -pub trait PointerSized {} +pub trait PointerLike {} /// Implementations of `Copy` for primitive types. /// |
