Skip to content
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
merged 2 commits into from
Nov 23, 2021

Conversation

nbdd0121
Copy link
Contributor

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

@rustbot 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
@rust-highfive
Copy link
Collaborator

r? @wesleywiser

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 22, 2021
@rust-log-analyzer

This comment has been minimized.

@oli-obk
Copy link
Contributor

oli-obk commented Nov 23, 2021

r? @oli-obk

@bors r rollup

@bors
Copy link
Contributor

bors commented Nov 23, 2021

📌 Commit 6f38568 has been approved by oli-obk

@bors 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
@bors
Copy link
Contributor

bors commented Nov 23, 2021

☔ The latest upstream changes (presumably #91159) made this pull request unmergeable. Please resolve the merge conflicts.

@bors 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
@bors bors merged commit a26c2c7 into rust-lang:master Nov 23, 2021
@rustbot rustbot added this to the 1.58.0 milestone Nov 23, 2021
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants