Skip to content

Commit c6c2f11

Browse files
committed
Test tait use in a fn type
1 parent a9ab2e5 commit c6c2f11

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#![feature(type_alias_impl_trait)]
2+
#![allow(dead_code)]
3+
4+
// FIXME: this is ruled out for now but should work
5+
6+
type Foo = fn() -> impl Send;
7+
//~^ ERROR: `impl Trait` not allowed outside of function and method return types
8+
9+
fn make_foo() -> Foo {
10+
|| 15
11+
}
12+
13+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0562]: `impl Trait` not allowed outside of function and method return types
2+
--> $DIR/type-alias-impl-trait-fn-type.rs:6:20
3+
|
4+
LL | type Foo = fn() -> impl Send;
5+
| ^^^^^^^^^
6+
7+
error: aborting due to previous error
8+
9+
For more information about this error, try `rustc --explain E0562`.

0 commit comments

Comments
 (0)