1 // This test verifies that never type fallback preserves the following code in a
2 // compiling state. This pattern is fairly common in the wild, notably seen in
3 // wasmtime v0.16. Typically this is some closure wrapper that expects a
4 // collection of 'known' signatures, and -> ! is not included in that set.
6 // This test is specifically targeted by the unit type fallback when
7 // encountering a set of obligations like `?T: Foo` and `Trait::Projection =
8 // ?T`. In the code below, these are `R: Bar` and `Fn::Output = R`.
10 // revisions: nofallback fallback
13 #![cfg_attr(fallback, feature(never_type_fallback))]
19 fn foo<R: Bar>(_: impl Fn() -> R) {}