Skip to content

Commit

Permalink
Add a regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Oct 7, 2022
1 parent f85d3a7 commit e07f36c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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() {}
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e07f36c

Please sign in to comment.