-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#[lang_item]
for core::ptr::Unique
#112662
Conversation
Are you using this just for diagnostics, or is correctness in Miri dependent on always being able to know what a |
It is the latter, this will be semantically relevant. I just felt that a diagnostic item would be less heavy-weight. Do we need T-lang approval for a lang item?
|
No, they're compiler-internal details so there's no stability guarantee or anything, not that that would matter for Miri or anything. I think my approval should be sufficient. |
Okay, in that case -- @Vanille-N looks like I guessed wrong and a lang item is preferable here. Sorry for that. |
My understanding is that both the compiler and tools should work, perhaps with degraded diagnostics, if all diagnostic items are stripped from the standard library -- but the compiler (and by extension, compiler-adjacent tools) should be allowed to depend on the existence and well-formedness of a lang item. We don't expect the compiler to work the |
yeah, branching on the happy path should be a lang item |
This seems to be the minimum needed for use by Miri, but there's probably more that should be added.
This compiles after some |
This comment has been minimized.
This comment has been minimized.
I wouldn't worry about it,
No, the lang item doesn't have to exist.
How would you test this, other than implementing |
rustc_diagnostic_item
for core::ptr::Unique
#[lang_item]
for core::ptr::Unique
it has one generic parameter, just use Exact(1) |
LGTM, please squash the commits then we can land this. :) |
@bors r=RalfJung |
…mpiler-errors Rollup of 7 pull requests Successful merges: - rust-lang#111074 (Relax implicit `T: Sized` bounds on `BufReader<T>`, `BufWriter<T>` and `LineWriter<T>`) - rust-lang#112226 (std: available_parallelism using native netbsd api first) - rust-lang#112474 (Support 128-bit enum variant in debuginfo codegen) - rust-lang#112662 (`#[lang_item]` for `core::ptr::Unique`) - rust-lang#112665 (Make assumption functions in new solver take `Binder<'tcx, Clause<'tcx>>`) - rust-lang#112684 (Disable alignment checks on i686-pc-windows-msvc) - rust-lang#112706 (Add `SyntaxContext::is_root`) r? `@ghost` `@rustbot` modify labels: rollup
Add retag in MIR transform: `Adt` for `Unique` may contain a reference Following rust-lang#112662 , `may_contain_reference` in `rustc_mir_transform::add_retag` underapproximates too much the types that require retagging. r? `@RalfJung`
Add retag in MIR transform: `Adt` for `Unique` may contain a reference Following rust-lang#112662 , `may_contain_reference` in `rustc_mir_transform::add_retag` underapproximates too much the types that require retagging. r? ``@RalfJung``
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 anAdtDef
represents aUnique
.r? @RalfJung
Draft: making a lang item