-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Use AnonConst for asm! constants #83916
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Well, what are the alternatives? With array repeat expressions not being promotion points any more, and stdarch switching away from
Note that this affects other situations as well, such as array repeat expressions. We certainly want to fix this in the future. If this is for now "good enough" elsewhere, then why not for IMO we should just do the same kind of post-monomorphization evaluation that we do for associated consts and promoteds (AFAIK that would be rather easy to implement, we already have those codepaths for associated consts and promoteds), but @lcnr has plans to ensure that there are no post-monomorphization failures which (to my knowledge) needs a lot of design still. |
This comment has been minimized.
This comment has been minimized.
@bors r+ |
📌 Commit 32be124 has been approved by |
This PR is not about syntax, but it seems inconsistent to me that If On the other hand, if |
Use AnonConst for asm! constants This replaces the old system which used explicit promotion. See rust-lang#83169 for more background. The syntax for `const` operands is still the same as before: `const <expr>`. Fixes rust-lang#83169 Because the implementation is heavily based on inline consts, we suffer from the same issues: - We lose the ability to use expressions derived from generics. See the deleted tests in `src/test/ui/asm/const.rs`. - We are hitting the same ICEs as inline consts, for example rust-lang#78174. It is unlikely that we will be able to stabilize this before inline consts are stabilized.
The way |
Rollup of 8 pull requests Successful merges: - rust-lang#83476 (Add strong_count mutation methods to Rc) - rust-lang#83634 (Do not emit the advanced diagnostics on macros) - rust-lang#83816 (Trigger `unused_doc_comments` on macros at once) - rust-lang#83916 (Use AnonConst for asm! constants) - rust-lang#83935 (forbid `impl Trait` in generic param defaults) - rust-lang#83936 (Disable using non-ascii identifiers in extern blocks.) - rust-lang#83945 (Add suggestion to reborrow mutable references when they're moved in a for loop) - rust-lang#83954 (Do not ICE when closure is involved in Trait Alias Impl Trait) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Use AnonConst for asm! constants This replaces the old system which used explicit promotion. See rust-lang#83169 for more background. The syntax for `const` operands is still the same as before: `const <expr>`. Fixes rust-lang#83169 Because the implementation is heavily based on inline consts, we suffer from the same issues: - We lose the ability to use expressions derived from generics. See the deleted tests in `src/test/ui/asm/const.rs`. - We are hitting the same ICEs as inline consts, for example rust-lang#78174. It is unlikely that we will be able to stabilize this before inline consts are stabilized.
This replaces the old system which used explicit promotion. See #83169 for more background.
The syntax for
const
operands is still the same as before:const <expr>
.Fixes #83169
Because the implementation is heavily based on inline consts, we suffer from the same issues:
src/test/ui/asm/const.rs
.ReErased
to a region vid" forlet const { "foo" } = "foo"
#78174. It is unlikely that we will be able to stabilize this before inline consts are stabilized.