File tree Expand file tree Collapse file tree 3 files changed +56
-0
lines changed
src/test/ui/type-alias-impl-trait Expand file tree Collapse file tree 3 files changed +56
-0
lines changed Original file line number Diff line number Diff line change 1+ // check-pass
2+
3+ #![ feature( type_alias_impl_trait) ]
4+ #![ allow( dead_code) ]
5+
6+ use std:: fmt:: Debug ;
7+
8+ type FooX = impl Debug ;
9+
10+ trait Foo < A > { }
11+
12+ impl Foo < ( ) > for ( ) { }
13+
14+ fn foo ( ) -> impl Foo < FooX > {
15+ ( )
16+ }
17+
18+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ #![ feature( type_alias_impl_trait) ]
2+ #![ allow( dead_code) ]
3+
4+ use std:: fmt:: Debug ;
5+
6+ type FooX = impl Debug ;
7+ //~^ ERROR: could not find defining uses
8+
9+ trait Foo < A > { }
10+
11+ impl Foo < ( ) > for ( ) { }
12+ impl Foo < u32 > for ( ) { }
13+
14+ fn foo ( ) -> impl Foo < FooX > {
15+ //~^ ERROR: the trait bound `(): Foo<impl Debug>` is not satisfied [E0277]
16+ ( )
17+ }
18+
19+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error[E0277]: the trait bound `(): Foo<impl Debug>` is not satisfied
2+ --> $DIR/nested-tait-inference2.rs:14:13
3+ |
4+ LL | fn foo() -> impl Foo<FooX> {
5+ | ^^^^^^^^^^^^^^ the trait `Foo<impl Debug>` is not implemented for `()`
6+ |
7+ = help: the following implementations were found:
8+ <() as Foo<()>>
9+ <() as Foo<u32>>
10+
11+ error: could not find defining uses
12+ --> $DIR/nested-tait-inference2.rs:6:13
13+ |
14+ LL | type FooX = impl Debug;
15+ | ^^^^^^^^^^
16+
17+ error: aborting due to 2 previous errors
18+
19+ For more information about this error, try `rustc --explain E0277`.
You can’t perform that action at this time.
0 commit comments