Skip to content

Commit 8522c99

Browse files
Rollup merge of rust-lang#112662 - Vanille-N:symbol_unique, r=RalfJung
`#[lang_item]` for `core::ptr::Unique` Tree Borrows is about to introduce experimental special handling of `core::ptr::Unique` in Miri to give it a semantics. As of now there does not seem to be a clean way (i.e. other than `&format!("{adt:?}") == "std::ptr::Unique"`) to check if an `AdtDef` represents a `Unique`. r? `@RalfJung` Draft: making a lang item
2 parents 98c855f + e27e48e commit 8522c99

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/src/ptr/unique.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ use crate::ptr::NonNull;
3232
)]
3333
#[doc(hidden)]
3434
#[repr(transparent)]
35+
// Lang item used experimentally by Miri to define the semantics of `Unique`.
36+
#[cfg_attr(not(bootstrap), lang = "ptr_unique")]
3537
pub struct Unique<T: ?Sized> {
3638
pointer: NonNull<T>,
3739
// NOTE: this marker has no consequences for variance, but is necessary

0 commit comments

Comments
 (0)