mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 14:31:55 +00:00
add test for earlier drop despite extend lifetime
This commit is contained in:
parent
02443552c5
commit
e26285603c
@ -74,6 +74,17 @@ fn main() {
|
||||
};
|
||||
}
|
||||
}
|
||||
{
|
||||
fn must_pass() {
|
||||
let rc = Rc::new(());
|
||||
let &None = &Some(Rc::clone(&rc)) else {
|
||||
Rc::try_unwrap(rc).unwrap();
|
||||
return;
|
||||
};
|
||||
unreachable!();
|
||||
}
|
||||
must_pass();
|
||||
}
|
||||
{
|
||||
// test let-else drops temps before else block
|
||||
// NOTE: this test has to be the last block in the `main`
|
||||
|
Loading…
Reference in New Issue
Block a user