We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 412f000 commit 74d45afCopy full SHA for 74d45af
src/test/ui/type-alias-impl-trait/issue-63279.rs
@@ -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() {}
src/test/ui/type-alias-impl-trait/issue-63279.stderr
@@ -0,0 +1,13 @@
+error[E0271]: type mismatch resolving `<[closure@$DIR/issue-63279.rs:6:5: 6:28] as std::ops::FnOnce<()>>::Output == ()`
+ --> $DIR/issue-63279.rs:3:1
+ |
+LL | type Closure = impl FnOnce();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected opaque type, found ()
+ = note: expected type `Closure`
+ found type `()`
+ = 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