File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
src/test/ui/type-alias-impl-trait Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change
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 ( ) { }
Original file line number Diff line number Diff line change
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`.
You can’t perform that action at this time.
0 commit comments