#![feature(never_patterns)] #![allow(incomplete_features)] enum Void {} fn main() {} macro_rules! never { () => { ! } } fn parse(x: Void) { match None:: { None => {} Some(!), } match None:: { Some(!), None => {} } match None:: { None => {} Some(!) } match None:: { Some(!) //~^ ERROR expected `,` following `match` arm None => {} } match None:: { Some(!) if true //~^ ERROR expected `,` following `match` arm //~| ERROR guard on a never pattern None => {} } match None:: { Some(!) if true, //~^ ERROR guard on a never pattern None => {} } match None:: { Some(!) <= //~^ ERROR expected one of } match x { never!(), } match x { never!() if true, //~^ ERROR guard on a never pattern } match x { never!() } match &x { &never!(), } match None:: { Some(never!()), None => {} } match x { ! } match &x { &! } let res: Result = Ok(false); let Ok(_) = res; let Ok(_) | Err(!) = &res; // Disallowed; see #82048. //~^ ERROR top-level or-patterns are not allowed in `let` bindings let (Ok(_) | Err(!)) = &res; let (Ok(_) | Err(&!)) = res.as_ref(); }