Skip to content

Commit

Permalink
Add test for issue-63279
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Nov 12, 2019
1 parent 412f000 commit 74d45af
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/test/ui/type-alias-impl-trait/issue-63279.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#![feature(type_alias_impl_trait)]

type Closure = impl FnOnce(); //~ ERROR: type mismatch resolving

fn c() -> Closure {
|| -> Closure { || () }
}

fn main() {}
13 changes: 13 additions & 0 deletions src/test/ui/type-alias-impl-trait/issue-63279.stderr
Original file line number Diff line number Diff line change
@@ -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

error: aborting due to previous error

For more information about this error, try `rustc --explain E0271`.

0 comments on commit 74d45af

Please sign in to comment.