-
Notifications
You must be signed in to change notification settings - Fork 13k
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
ICE: mir_borrowck encountered mutable promoted #52671
Comments
cc @nagisa seems like /~https://github.com/rust-lang/rust/pull/52597/files#diff-5b4d01d26caf43976125ba0f877e78c0R1856 we need to report an error instead of panicking as originally written |
Oh it's probably because we do promote |
created a fix in #52673, but I have no minimal repro and no time today |
To clarify: you're making this an error? I don't see why we can't allow |
good point |
This ICE is currently causing errors in the |
I have tried building trying a stage2 build now still can't repro on regex, but can repro on OPs file now. #![feature(nll)]
fn main() {
let y: &'static mut [u8; 0] = &mut [];
} |
ok, fix exists now |
…tebank Try to fix an ICE might fix #52671
It looks like we've fixed the ICE here but there's still a change in behavior here, as well as a faulty diagnostic; this is while compiling cargo-registry from crates.io (at least the version in rustc-perf).
|
…r=pnkfelix [NLL] Allow conflicting borrows of promoted length zero arrays This is currently overkill as there's no way to create two conflicting borrows of any promoted. It is possible that the following code might not fail due to const eval in the future (@oli-obk?). In which case either the array marked needs to not be promoted, or to be checked for conflicts ```rust static mut A: () = { let mut y = None; let z; let mut done_y = false; loop { let x = &mut [1]; // < this array if done_y { z = x; break; } y = Some(x); done_y = true; } some_const_fn(y, z); // some_const_fn expects that y to not alias z. }; ``` r? @pnkfelix @nikomatsakis closes rust-lang#52671 cc rust-lang#51823
Error:
This only happens after #52597 cc @oli-obk. The code that triggered this is here.
The text was updated successfully, but these errors were encountered: