add test for earlier drop despite extend lifetime
This commit is contained in:
parent
02443552c5
commit
e26285603c
1 changed files with 11 additions and 0 deletions
|
@ -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
|
// test let-else drops temps before else block
|
||||||
// NOTE: this test has to be the last block in the `main`
|
// NOTE: this test has to be the last block in the `main`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue