Add a regression test

This commit is contained in:
Oli Scherer 2022-10-05 09:18:00 +00:00
parent f85d3a7e33
commit e07f36c961
2 changed files with 26 additions and 0 deletions

View File

@ -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() {}

View File

@ -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