-
Notifications
You must be signed in to change notification settings - Fork 13.3k
internal compiler error: librustc_mir/transform/elaborate_drops.rs — drop of untracked, uninitialized value #48962
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
Comments
Similar error message as #41073, but no unions are obvious in this code. |
Worth noting: without the
I think this results not from NLL per se but rather MIR borrowck. |
It seems like the "move" analysis is wrong here -- |
Yep. For example, this code is accepted (but should not be): #![feature(nll)]
fn main() {
let mut src = &mut (22, 44);
{src};
src.0 = 66;
} Similarly, this code will ICE: #![feature(nll)]
struct Node {
elem: i32,
next: Option<Box<Node>>,
}
fn main() {
let mut node = Node {
elem: 5,
next: None,
};
let mut src = &mut node;
{src};
src.next = None;
} The difference is that the latter code encounters drop elaboration. |
Mentoring instructionsThe problem is that we have a mir assignment like so:
we have to check the rust/src/librustc_mir/borrow_check/mod.rs Lines 963 to 976 in a04b88d
But if you read the source for that function, it has a crucial bug: rust/src/librustc_mir/borrow_check/mod.rs Lines 1440 to 1445 in a04b88d
In particular, trace through what will happen with a place like rust/src/librustc_mir/borrow_check/mod.rs Line 1454 in a04b88d
and then into this match arm rust/src/librustc_mir/borrow_check/mod.rs Line 1466 in a04b88d
at which point we fall through to here: rust/src/librustc_mir/borrow_check/mod.rs Line 1498 in a04b88d
so then if place was rust/src/librustc_mir/borrow_check/mod.rs Line 1450 in a04b88d
What we need to do is to change how rust/src/librustc_mir/borrow_check/mod.rs Lines 1485 to 1487 in a04b88d
Basically, we would do almost the same thing as the arm for fields, except that we don't care about the type of |
cc @rust-lang/wg-compiler-nll -- haven't fixed an NLL bug in a while? Here's a fresh one, complete with mentoring instructions! Come and get it while it's hot! |
Hello, I will take this one |
@retep007 👍 feel free to pop in on gitter with any questions. |
fixes move analysis Fixed compiler error by correct checking when dereferencing Fix #48962 r? @nikomatsakis
UPDATE: Mentoring instructions can be found here
The text was updated successfully, but these errors were encountered: