Add regression test

This commit is contained in:
Oli Scherer 2023-06-29 07:47:29 +00:00
parent dcacfe7395
commit ef52dc7bb8
2 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,10 @@
#![feature(type_alias_impl_trait)]
fn main() {
let x = || {
type Tait = impl Sized;
let y: Tait = ();
//~^ ERROR: item constrains opaque type that is not in its signature
//~| ERROR: item constrains opaque type that is not in its signature
};
}

View File

@ -0,0 +1,28 @@
error: item constrains opaque type that is not in its signature
--> $DIR/nested_in_closure.rs:6:23
|
LL | let y: Tait = ();
| ^^
|
= note: this item must have the opaque type in its signature in order to be able to register hidden types
note: this item must have the opaque type in its signature in order to be able to register hidden types
--> $DIR/nested_in_closure.rs:3:4
|
LL | fn main() {
| ^^^^
error: item constrains opaque type that is not in its signature
--> $DIR/nested_in_closure.rs:6:23
|
LL | let y: Tait = ();
| ^^
|
= note: this item must have the opaque type in its signature in order to be able to register hidden types
note: this item must have the opaque type in its signature in order to be able to register hidden types
--> $DIR/nested_in_closure.rs:4:13
|
LL | let x = || {
| ^^
error: aborting due to 2 previous errors