-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed as not planned
Labels
C-bugCategory: This is a bug.Category: This is a bug.
Description
I tried this code:
pub struct Stuff {
integer: i32,
}
fn main() {
let stuff = Stuff { integer: 42 };
std::thread::spawn(|| {
let _integer_copy: i32 = stuff.integer;
});
}
It gives "error[E0713]: borrow may still be in use when destructor runs" and "error[E0505]: cannot move out of stuff
because it is borrowed" instead of simply copying the integer. I assume it is a bit of an ambiguity in how https://doc.rust-lang.org/reference/types/closure.html#capture-precision/disjoint-captures should be implemented.
EDIT: Ok, my original version of this looked weird and complicated but it turns out to have nothing at all to do with Drop. I think I'm just brain-farting on how this case is supposed to work.
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.