Rollup merge of #88197 - spastorino:tait-test-fn-type, r=oli-obk

Test tait use in a fn type

r? `@oli-obk`

I thought this was going to work but doesn't, quickly checked with Niko and he told me that we ruled this out for now. I'm not exactly sure why and how but here we have a test with a FIXME :)

Related to #86727
This commit is contained in:
Jack Huey 2021-08-21 20:56:38 -04:00 committed by GitHub
commit 1d0d7c34e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View file

@ -0,0 +1,13 @@
#![feature(type_alias_impl_trait)]
#![allow(dead_code)]
// FIXME: this is ruled out for now but should work
type Foo = fn() -> impl Send;
//~^ ERROR: `impl Trait` not allowed outside of function and method return types
fn make_foo() -> Foo {
|| 15
}
fn main() {}

View file

@ -0,0 +1,9 @@
error[E0562]: `impl Trait` not allowed outside of function and method return types
--> $DIR/type-alias-impl-trait-fn-type.rs:6:20
|
LL | type Foo = fn() -> impl Send;
| ^^^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0562`.