-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
remove support for extern-block const intrinsics #132492
Conversation
This comment has been minimized.
This comment has been minimized.
760e111
to
7ca60f4
Compare
This comment has been minimized.
This comment has been minimized.
223e7bb
to
57ed415
Compare
This comment has been minimized.
This comment has been minimized.
4565d04
to
7231200
Compare
This comment has been minimized.
This comment has been minimized.
7231200
to
d60ea80
Compare
}); | ||
} | ||
Some(ConstStability { level: StabilityLevel::Stable { .. }, .. }) => { | ||
// All good. | ||
// All good. Note that a `#[rustc_const_stable]` intrinsic (meaning it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When would an intrinsic be marked as rustc_const_stable
but not rustc_const_stable_intrinsic
? I cannot seem to find any example in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
transmute
is such an intrinsic. It seems silly to require both attributes.
d60ea80
to
f0efcbf
Compare
☔ The latest upstream changes (presumably #132586) made this pull request unmergeable. Please resolve the merge conflicts. |
f0efcbf
to
a6601ae
Compare
☔ The latest upstream changes (presumably #132603) made this pull request unmergeable. Please resolve the merge conflicts. |
r=me after rebase, sorry for taking a bit to review this lol @rustbot author |
a6601ae
to
a741b33
Compare
Review within 2.5 days, that's pretty fast I would say. :) Thanks! @bors r=compiler-errors |
…kingjubilee Rollup of 11 pull requests Successful merges: - rust-lang#131153 (Improve duplicate derive Copy/Clone diagnostics) - rust-lang#132025 (fix suggestion for diagnostic error E0027) - rust-lang#132303 (More tests for non-exhaustive C-like enums in FFI) - rust-lang#132492 (remove support for extern-block const intrinsics) - rust-lang#132587 (Revert "Avoid nested replacement ranges" from rust-lang#129346.) - rust-lang#132596 ([rustdoc] Fix `--show-coverage` when JSON output format is used) - rust-lang#132598 (Clippy: Move some attribute lints to be early pass (post expansion)) - rust-lang#132601 (Update books) - rust-lang#132606 (Improve example of `impl Pattern for &[char]`) - rust-lang#132608 (document `type_implements_trait`) - rust-lang#132609 (docs: fix grammar in doc comment at unix/process.rs) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#132492 - RalfJung:const-intrinsics, r=compiler-errors remove support for extern-block const intrinsics This converts all const-callable intrinsics into the "new" form of a regular `fn` with `#[rustc_intrinsic]` attribute. That simplifies some of the logic since those functions can be marked `const fn` like regular functions, so intrinsics no longer need a special case to be considered const-callable at all. I also added a new attribute `#[rustc_const_stable_intrinsic]` to mark an intrinsic as being ready to be exposed on stable. Previously we used the `#[rustc_const_stable_indirect]` attribute for that, but that attribute had a dual role -- when used on a regular function, it is an entirely safe marker to make this function part of recursive const stability, but on an intrinsic it is a trusted marker requiring special care. It's not great for the same attribute to be sometimes fully checked and safe, and sometimes trusted and requiring special care, so I split this into two attributes. This also fixes rust-lang#122652 by accepting intrinsics as const-stable if they have a fallback body that is recursively const-stable. The library changes are best reviewed with whitespace hidden. r? `@compiler-errors`
Very nice! Thanks, Ralf. This'll make refactor-to-intrinsic so much nicer, not needing to add a scary "looks like it's making a stability promise" attribute to stuff that used to just be normal code. |
This converts all const-callable intrinsics into the "new" form of a regular
fn
with#[rustc_intrinsic]
attribute. That simplifies some of the logic since those functions can be markedconst fn
like regular functions, so intrinsics no longer need a special case to be considered const-callable at all.I also added a new attribute
#[rustc_const_stable_intrinsic]
to mark an intrinsic as being ready to be exposed on stable. Previously we used the#[rustc_const_stable_indirect]
attribute for that, but that attribute had a dual role -- when used on a regular function, it is an entirely safe marker to make this function part of recursive const stability, but on an intrinsic it is a trusted marker requiring special care. It's not great for the same attribute to be sometimes fully checked and safe, and sometimes trusted and requiring special care, so I split this into two attributes.This also fixes #122652 by accepting intrinsics as const-stable if they have a fallback body that is recursively const-stable.
The library changes are best reviewed with whitespace hidden.
r? @compiler-errors