Add a regression test
This commit is contained in:
parent
f85d3a7e33
commit
e07f36c961
@ -0,0 +1,12 @@
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
type Tait = impl Sized;
|
||||
|
||||
struct One;
|
||||
fn one() -> Tait { One }
|
||||
|
||||
struct Two<T>(T);
|
||||
fn two() -> Tait { Two::<()>(todo!()) }
|
||||
//~^ ERROR concrete type differs from previous defining opaque type use
|
||||
|
||||
fn main() {}
|
@ -0,0 +1,14 @@
|
||||
error: concrete type differs from previous defining opaque type use
|
||||
--> $DIR/different_defining_uses_never_type3.rs:9:13
|
||||
|
|
||||
LL | fn two() -> Tait { Two::<()>(todo!()) }
|
||||
| ^^^^ expected `One`, got `Two<()>`
|
||||
|
|
||||
note: previous use here
|
||||
--> $DIR/different_defining_uses_never_type3.rs:6:20
|
||||
|
|
||||
LL | fn one() -> Tait { One }
|
||||
| ^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
Loading…
x
Reference in New Issue
Block a user