mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-17 01:13:11 +00:00
Test tait use in a fn type
This commit is contained in:
parent
a9ab2e5539
commit
c6c2f11ab6
@ -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() {}
|
@ -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`.
|
Loading…
Reference in New Issue
Block a user