d437a111f5
- Make temporaries in if-let guards be the same variable in MIR when the guard is duplicated due to or-patterns. - Change the "destruction scope" for match arms to be the arm scope rather than the arm body scope. - Add tests.
20 lines
299 B
Rust
20 lines
299 B
Rust
// check-pass
|
|
|
|
#![feature(if_let_guard)]
|
|
|
|
fn split_last(_: &()) -> Option<(&i32, &i32)> {
|
|
None
|
|
}
|
|
|
|
fn assign_twice() {
|
|
loop {
|
|
match () {
|
|
#[allow(irrefutable_let_patterns)]
|
|
() if let _ = split_last(&()) => {}
|
|
_ => {}
|
|
}
|
|
}
|
|
}
|
|
|
|
fn main() {}
|