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

Fix ICE checking for feature gated const fn #7128

Merged
merged 1 commit into from
Apr 27, 2021

Conversation

Jarcho
Copy link
Contributor

@Jarcho Jarcho commented Apr 25, 2021

fixes: #7126
changelog: Fix ICE in missing_const_for_fn when using a feature-gated const fn

@rust-highfive
Copy link

r? @giraffate

(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 Apr 25, 2021
// `rustc_mir::const_eval::is_const_fn` should return false for unstably const functions.
unreachable!();
// Unstable const fn with the feature enabled.
msrv.is_none()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the return value change here depending on whether MSRV is set?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no stable rust version where the function is const as there's no stability attribute. If the MSRV is set, then the function is clearly not const. If it's not set, then the question becomes is the function const now, which is true.

@flip1995
Copy link
Member

@bors r+

Thanks! I also want to get this into the out of cycle sync: rust-lang/rust#84610

@bors
Copy link
Contributor

bors commented Apr 27, 2021

📌 Commit db7ad64 has been approved by flip1995

@bors
Copy link
Contributor

bors commented Apr 27, 2021

⌛ Testing commit db7ad64 with merge 7c7683c...

@bors
Copy link
Contributor

bors commented Apr 27, 2021

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: flip1995
Pushing 7c7683c to master...

@bors bors merged commit 7c7683c into rust-lang:master Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
5 participants