Skip to content

Commit e07f36c

Browse files
committed
Add a regression test
1 parent f85d3a7 commit e07f36c

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#![feature(type_alias_impl_trait)]
2+
3+
type Tait = impl Sized;
4+
5+
struct One;
6+
fn one() -> Tait { One }
7+
8+
struct Two<T>(T);
9+
fn two() -> Tait { Two::<()>(todo!()) }
10+
//~^ ERROR concrete type differs from previous defining opaque type use
11+
12+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: concrete type differs from previous defining opaque type use
2+
--> $DIR/different_defining_uses_never_type3.rs:9:13
3+
|
4+
LL | fn two() -> Tait { Two::<()>(todo!()) }
5+
| ^^^^ expected `One`, got `Two<()>`
6+
|
7+
note: previous use here
8+
--> $DIR/different_defining_uses_never_type3.rs:6:20
9+
|
10+
LL | fn one() -> Tait { One }
11+
| ^^^
12+
13+
error: aborting due to previous error
14+

0 commit comments

Comments
 (0)