]> git.lizzy.rs Git - rust.git/blob - tests/ui/never_type/impl_trait_fallback4.rs
Rollup merge of #107615 - notriddle:notriddle/nbsp, r=GuillaumeGomez
[rust.git] / tests / ui / never_type / impl_trait_fallback4.rs
1 #![feature(type_alias_impl_trait)]
2
3 trait T {
4     type Assoc: Cake;
5 }
6
7 trait Cake: std::fmt::Display {
8     fn cake() -> Self;
9 }
10
11 type Foo = impl T;
12
13 fn foo() -> impl T {
14     //~^ ERROR `(): T` is not satisfied
15     panic!()
16 }
17
18 fn a() -> Foo {
19     foo()
20 }
21
22 fn main() {
23     println!("{}", <Foo as T>::Assoc::cake());
24 }