rust/tests/ui/match/ref_pat_everywhere-fail.rs
2024-05-10 13:47:34 -04:00

12 lines
300 B
Rust

#![allow(incomplete_features)]
#![feature(ref_pat_everywhere)]
pub fn main() {
if let Some(&x) = Some(0) {
//~^ ERROR: mismatched types [E0308]
let _: u32 = x;
}
if let Some(&mut x) = Some(&0) {
//~^ ERROR: mismatched types [E0308]
let _: u32 = x;
}
}