-
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
[nll] attr-0.1.0 regression #53569
Comments
Assigning myself since I've done some work in this locally. But I have a lot going on ATM, so anyone else can feel free to take it. The issue is the same as #47917, #49822 and #52782 but for enums. I have plans to move all of this checking to happen in/after |
#![feature(nll)]
#![allow(dead_code)]
struct S<'a> {
value: &'a Value,
}
struct Value {
data: u32,
}
impl<'a> S<'a> {
fn get(&self) -> Result<&'a mut Value, String> {
unimplemented!();
}
fn at(&self) {
let v = self.get();
if let Ok(Value { ref mut data }) = v {
let _res : &'a u32 = data;
}
}
}
fn main() {
} |
Hmm, looking a bit more closely, I would say that this is a subtle situation. I agree with @matthewjasper that this is basically a "dangly paths" situation (cc #52782). That said, @matthewjasper, I'm not sure I understood the fix you were proposing. =) Let me lay out what is happening, as best as I understand it:
|
Removing nomination but we do have to settle on a plan |
@nikomatsakis @matthewjasper @pnkfelix It's not clear to me that this has sufficient momentum or decision-making to land for RC1 -- should this be pushed back to RC2, or is this truly a blocking issue? |
(Since not everyone will follow the comments on every linked PR: this can be addressed by PR #54324, but we closed that because we are anticipating a better, broader fix from @matthewjasper , previewed here: master...matthewjasper:better-drop-access ) |
[NLL] Rework checking for borrows conflicting with drops Previously, we would split the drop access into multiple checks for each field of a struct/tuple/closure and through `Box` dereferences. This changes this to check if the borrow is accessed by the drop in `places_conflict`. We also now handle enums containing `Drop` types. Closes #53569 r? @nikomatsakis cc @pnkfelix
Found during a crater run
Minimized reproduction
The text was updated successfully, but these errors were encountered: