Skip to content

Commit 1d0d7c3

Browse files
authored
Rollup merge of rust-lang#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 rust-lang#86727
2 parents 66b04c6 + c6c2f11 commit 1d0d7c3

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)