-
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
Split inline const to two feature gates and mark expression position inline const complete #91140
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rustbot
added
F-inline_const
Inline constants (aka: const blocks, const expressions, anonymous constants)
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Nov 22, 2021
r? @wesleywiser (rust-highfive has picked a reviewer for you, use r? to override) |
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Nov 22, 2021
This comment has been minimized.
This comment has been minimized.
nbdd0121
force-pushed
the
const_typeck
branch
from
November 22, 2021 22:17
63d46a0
to
6f38568
Compare
📌 Commit 6f38568 has been approved by |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Nov 23, 2021
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Nov 23, 2021
Split inline const to two feature gates and mark expression position inline const complete This PR splits inline const in pattern position into its own `#![feature(inline_const_pat)]` feature gate, and make the usage in expression position complete. I think I have resolved most outstanding issues related to `inline_const` with rust-lang#89561 and other PRs. The only thing left that I am aware of is rust-lang#90150 and the lack of lifetime checks when inline const is used in pattern position (FIXME in rust-lang#89561). Implementation-wise when used in pattern position it has to be lowered during MIR building while in expression position it's evaluated only when monomorphizing (just like normal consts), so it makes some sense to separate it into two feature gates so one can progress without being blocked by another. `@rustbot` label: T-compiler F-inline_const
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Nov 23, 2021
…askrgr Rollup of 6 pull requests Successful merges: - rust-lang#90856 (Suggestion to wrap inner types using 'allocator_api' in tuple) - rust-lang#91103 (Inhibit clicks on summary's children) - rust-lang#91137 (Give people a single link they can click in the contributing guide) - rust-lang#91140 (Split inline const to two feature gates and mark expression position inline const complete) - rust-lang#91148 (Use `derive_default_enum` in the compiler) - rust-lang#91153 (kernel_copy: avoid panic on unexpected OS error) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
☔ The latest upstream changes (presumably #91159) made this pull request unmergeable. Please resolve the merge conflicts. |
bors
added
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
and removed
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
labels
Nov 23, 2021
11 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
F-inline_const
Inline constants (aka: const blocks, const expressions, anonymous constants)
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR splits inline const in pattern position into its own
#![feature(inline_const_pat)]
feature gate, and make the usage in expression position complete.I think I have resolved most outstanding issues related to
inline_const
with #89561 and other PRs. The only thing left that I am aware of is #90150 and the lack of lifetime checks when inline const is used in pattern position (FIXME in #89561). Implementation-wise when used in pattern position it has to be lowered during MIR building while in expression position it's evaluated only when monomorphizing (just like normal consts), so it makes some sense to separate it into two feature gates so one can progress without being blocked by another.@rustbot label: T-compiler F-inline_const