mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
25 lines
439 B
Rust
25 lines
439 B
Rust
// Check that temporaries in if-let guards are correctly scoped.
|
|
|
|
//@ build-pass
|
|
// -Zvalidate-mir
|
|
|
|
#![feature(if_let_guard)]
|
|
|
|
fn fun() {
|
|
match 0 {
|
|
_ => (),
|
|
_ if let Some(s) = std::convert::identity(&Some(String::new())) => {}
|
|
_ => (),
|
|
}
|
|
}
|
|
|
|
fn funner() {
|
|
match 0 {
|
|
_ => (),
|
|
_ | _ if let Some(s) = std::convert::identity(&Some(String::new())) => {}
|
|
_ => (),
|
|
}
|
|
}
|
|
|
|
fn main() {}
|