mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
Add regression test
This commit is contained in:
parent
dcacfe7395
commit
ef52dc7bb8
10
tests/ui/type-alias-impl-trait/nested_in_closure.rs
Normal file
10
tests/ui/type-alias-impl-trait/nested_in_closure.rs
Normal 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
|
||||
};
|
||||
}
|
28
tests/ui/type-alias-impl-trait/nested_in_closure.stderr
Normal file
28
tests/ui/type-alias-impl-trait/nested_in_closure.stderr
Normal 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
|
||||
|
Loading…
Reference in New Issue
Block a user