1 // revisions: nofallback fallback
5 #![allow(unused_assignments)]
6 #![allow(unused_variables)]
7 #![allow(unreachable_code)]
8 // Test various cases where we permit an unconstrained variable
9 // to fallback based on control-flow. In all of these cases,
10 // the type variable winds up being the target of both a `!` coercion
11 // and a coercion from a non-`!` variable, and hence falls back to `()`.
12 #![cfg_attr(fallback, feature(never_type, never_type_fallback))]
18 impl UnitDefault for u32 {
19 fn default() -> Self {
24 impl UnitDefault for () {
34 x = UnitDefault::default();
46 x = UnitDefault::default();
52 UnitDefault::default()
58 fn if_then_else_rev() {
62 UnitDefault::default()
67 let _x = match Ok(UnitDefault::default()) {
74 let _x = match Ok(UnitDefault::default()) {
85 break UnitDefault::default();
95 break UnitDefault::default();