diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2019-11-13 00:37:00 +0900 |
|---|---|---|
| committer | Yuki Okushi <huyuumi.dev@gmail.com> | 2019-11-13 00:37:00 +0900 |
| commit | 74d45afbf5473d1b255629e786e074060dcc7ec2 (patch) | |
| tree | f75e56639756605a80d75855025262bc1d71fe19 | |
| parent | 412f0006f520357d220882b57eef501999b44c9a (diff) | |
| download | rust-74d45afbf5473d1b255629e786e074060dcc7ec2.tar.gz rust-74d45afbf5473d1b255629e786e074060dcc7ec2.zip | |
Add test for issue-63279
| -rw-r--r-- | src/test/ui/type-alias-impl-trait/issue-63279.rs | 9 | ||||
| -rw-r--r-- | src/test/ui/type-alias-impl-trait/issue-63279.stderr | 13 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/test/ui/type-alias-impl-trait/issue-63279.rs b/src/test/ui/type-alias-impl-trait/issue-63279.rs new file mode 100644 index 00000000000..586ff7a3158 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/issue-63279.rs @@ -0,0 +1,9 @@ +#![feature(type_alias_impl_trait)] + +type Closure = impl FnOnce(); //~ ERROR: type mismatch resolving + +fn c() -> Closure { + || -> Closure { || () } +} + +fn main() {} diff --git a/src/test/ui/type-alias-impl-trait/issue-63279.stderr b/src/test/ui/type-alias-impl-trait/issue-63279.stderr new file mode 100644 index 00000000000..a5065241fc7 --- /dev/null +++ b/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 + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0271`. |
