rust/tests/ui/match/ref_pat_everywhere.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
548 B
Rust
Raw Normal View History

//@ run-pass
#![allow(incomplete_features)]
2024-04-02 10:54:29 -05:00
#![feature(ref_pat_everywhere)]
pub fn main() {
if let Some(Some(&x)) = &Some(&Some(0)) {
let _: u32 = x;
}
if let Some(&Some(x)) = &Some(Some(0)) {
let _: u32 = x;
}
if let Some(Some(&mut x)) = &mut Some(&mut Some(0)) {
let _: u32 = x;
}
2024-04-02 10:54:29 -05:00
if let Some(Some(&x)) = &Some(&mut Some(0)) {
let _: u32 = x;
}
if let &Some(x) = &mut Some(0) {
let _: u32 = x;
}
if let Some(&x) = &mut Some(0) {
let _: u32 = x;
}
}