Skip to content

Commit ef52dc7

Browse files
committed
Add regression test
1 parent dcacfe7 commit ef52dc7

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#![feature(type_alias_impl_trait)]
2+
3+
fn main() {
4+
let x = || {
5+
type Tait = impl Sized;
6+
let y: Tait = ();
7+
//~^ ERROR: item constrains opaque type that is not in its signature
8+
//~| ERROR: item constrains opaque type that is not in its signature
9+
};
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
error: item constrains opaque type that is not in its signature
2+
--> $DIR/nested_in_closure.rs:6:23
3+
|
4+
LL | let y: Tait = ();
5+
| ^^
6+
|
7+
= note: this item must have the opaque type in its signature in order to be able to register hidden types
8+
note: this item must have the opaque type in its signature in order to be able to register hidden types
9+
--> $DIR/nested_in_closure.rs:3:4
10+
|
11+
LL | fn main() {
12+
| ^^^^
13+
14+
error: item constrains opaque type that is not in its signature
15+
--> $DIR/nested_in_closure.rs:6:23
16+
|
17+
LL | let y: Tait = ();
18+
| ^^
19+
|
20+
= note: this item must have the opaque type in its signature in order to be able to register hidden types
21+
note: this item must have the opaque type in its signature in order to be able to register hidden types
22+
--> $DIR/nested_in_closure.rs:4:13
23+
|
24+
LL | let x = || {
25+
| ^^
26+
27+
error: aborting due to 2 previous errors
28+

0 commit comments

Comments
 (0)