Skip to content

Commit 74d45af

Browse files
committed
Add test for issue-63279
1 parent 412f000 commit 74d45af

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#![feature(type_alias_impl_trait)]
2+
3+
type Closure = impl FnOnce(); //~ ERROR: type mismatch resolving
4+
5+
fn c() -> Closure {
6+
|| -> Closure { || () }
7+
}
8+
9+
fn main() {}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
error[E0271]: type mismatch resolving `<[closure@$DIR/issue-63279.rs:6:5: 6:28] as std::ops::FnOnce<()>>::Output == ()`
2+
--> $DIR/issue-63279.rs:3:1
3+
|
4+
LL | type Closure = impl FnOnce();
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected opaque type, found ()
6+
|
7+
= note: expected type `Closure`
8+
found type `()`
9+
= note: the return type of a function must have a statically known size
10+
11+
error: aborting due to previous error
12+
13+
For more information about this error, try `rustc --explain E0271`.

0 commit comments

Comments
 (0)