blob: 62e4f82a3ffbbdc4638b972b79a77a5a7478f757 [file] [log] [blame]
//@ run-pass
//@ edition: 2024
//@ compile-flags: -Zunstable-options
#![allow(incomplete_features)]
#![feature(ref_pat_eat_one_layer_2024)]
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(&&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;
}
if let Some(Some(&x)) = &Some(&Some(0)) {
let _: u32 = x;
}
if let Some(&mut Some(&x)) = &Some(&mut Some(0)) {
let _: u32 = x;
}
if let Some(&Some(&x)) = &mut Some(&Some(0)) {
let _: u32 = x;
}
if let Some(&Some(x)) = &mut Some(&Some(0)) {
let _: &u32 = x;
}
if let Some(&Some(&mut ref x)) = Some(&Some(&mut 0)) {
let _: &u32 = x;
}
if let Some(Some(&mut x)) = &Some(Some(&mut 0)) {
let _: &u32 = x;
}
if let &Some(Some(x)) = &Some(&mut Some(0)) {
let _: &u32 = x;
}
if let Some(&Some(&x)) = &Some(&mut Some(0)) {
let _: u32 = x;
}
if let Some(&Some(&x)) = &Some(&Some(0)) {
let _: u32 = x;
}
if let Some(&Some(&x)) = &Some(&mut Some(0)) {
let _: u32 = x;
}
if let Some(&Some(Some(&x))) = &Some(Some(&mut Some(0))) {
let _: u32 = x;
}
if let Some(&Some(&x)) = Some(&Some(&mut 0)) {
let _: u32 = x;
}
if let Some(&Some(x)) = &mut Some(Some(0)) {
let _: u32 = x;
}
let &mut x = &&mut 0;
let _: &u32 = x;
let &mut x = &&&&&&&&&&&&&&&&&&&&&&&&&&&&mut 0;
let _: &u32 = x;
let &mut &mut &mut &mut x = &mut &&&&mut &&&mut &mut 0;
let _: &u32 = x;
}