-
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
Add feature gate for mut refs in const fn #66606
Conversation
This comment has been minimized.
This comment has been minimized.
src/test/ui/consts/const-eval/feature-gate-const_fn_mut_refs.rs
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
A test for |
This comment has been minimized.
This comment has been minimized.
Seems like rebase gone wrong? |
Yep D: I think I fixed it |
| ^ | ||
| | ||
= note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 | ||
= help: add `#![feature(const_fn)]` to the crate attributes to enable |
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.
Hmm... it's quite unfortunate that the wrong feature gate is suggested.
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.
yes :( I'd like to fix it
Edit: I think I found how to do it, working on 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.
I was able to fix it when mutable borrows are done inside constant contexts but not when they are function arguments. This is because that check is done by the const fn qualification and it always suggests the const_fn
flag.
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Yes, please retire it and all references to it. |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@bors r+ |
📌 Commit e01ad6a has been approved by |
⌛ Testing commit e01ad6a with merge 4e66dc63b5d28752120b745e005c12fa59ae8db6... |
☀️ Test successful - checks-azure |
👀 Test was successful, but fast-forwarding failed: 422 Update is not a fast forward |
@bors retry |
…n, r=oli-obk Add feature gate for mut refs in const fn r? @oli-obk
Rollup of 10 pull requests Successful merges: - #66606 (Add feature gate for mut refs in const fn) - #66841 (Add `{f32,f64}::approx_unchecked_to<Int>` unsafe methods) - #67009 (Emit coercion suggestions in more places) - #67052 (Ditch `parse_in_attr`) - #67071 (Do not ICE on closure typeck) - #67078 (accept union inside enum if not followed by identifier) - #67090 (Change "either" to "any" in Layout::from_size_align's docs) - #67092 (Fix comment typos in src/libcore/alloc.rs) - #67094 (get rid of __ in field names) - #67102 (Add note to src/ci/docker/README.md about multiple docker images) Failed merges: - #67101 (use `#[allow(unused_attributes)]` to paper over incr.comp problem) r? @ghost
r? @oli-obk