about summary refs log tree commit diff
path: root/library/core/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-06-16 12:53:22 -0700
committerGitHub <noreply@github.com>2023-06-16 12:53:22 -0700
commit38fc6be325f57e6e149bc2b60985870d48280018 (patch)
tree98d25201d17e038df5ac49bf46a47da086689eeb /library/core/src
parent3eb8c2ae10cb47a99e7f9baed9158cedc783536f (diff)
parentdc3e91c6c2e3d5ae2287fd8332ecb6b7b7cee743 (diff)
downloadrust-38fc6be325f57e6e149bc2b60985870d48280018.tar.gz
rust-38fc6be325f57e6e149bc2b60985870d48280018.zip
Rollup merge of #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
Diffstat (limited to 'library/core/src')
-rw-r--r--library/core/src/ptr/unique.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/library/core/src/ptr/unique.rs b/library/core/src/ptr/unique.rs
index a853f15edb7..ff7e91d3ec3 100644
--- a/library/core/src/ptr/unique.rs
+++ b/library/core/src/ptr/unique.rs
@@ -32,6 +32,8 @@ use crate::ptr::NonNull;
 )]
 #[doc(hidden)]
 #[repr(transparent)]
+// Lang item used experimentally by Miri to define the semantics of `Unique`.
+#[cfg_attr(not(bootstrap), lang = "ptr_unique")]
 pub struct Unique<T: ?Sized> {
     pointer: NonNull<T>,
     // NOTE: this marker has no consequences for variance, but is necessary