// This is a minified example from Crater breakage observed when attempting to // stabilize never type, nstoddard/webgl-gui @ 22f0169f. // // This particular test case currently fails as the inference to `()` rather // than `!` happens as a result of an `as` cast, which is not currently tracked. // Crater did not find many cases of this occuring, but it is included for // awareness. // // revisions: nofallback fallback //[nofallback] check-pass //[fallback] check-fail #![cfg_attr(fallback, feature(never_type_fallback))] use std::marker::PhantomData; fn main() { let error = Closure::wrap(Box::new(move || { //[fallback]~^ ERROR type mismatch resolving panic!("Can't connect to server."); }) as Box); } struct Closure(PhantomData); impl Closure { fn wrap(data: Box) -> Closure { todo!() } }