Skip to content

Commit 5eeeb0b

Browse files
authored
Rollup merge of #88406 - spastorino:tait-nest-infer-test, r=oli-obk
Tait nest infer test r? `@oli-obk` Related to #86727
2 parents cd20fbd + d7a777f commit 5eeeb0b

File tree

3 files changed

+56
-0
lines changed

3 files changed

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