Skip to content

Commit d7a777f

Browse files
committed
Add nested TAIT inference test that fails
1 parent 5c7400c commit d7a777f

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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() {}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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`.

0 commit comments

Comments
 (0)