forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a9ab2e5
commit c6c2f11
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
src/test/ui/type-alias-impl-trait/type-alias-impl-trait-fn-type.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() {} |
9 changes: 9 additions & 0 deletions
9
src/test/ui/type-alias-impl-trait/type-alias-impl-trait-fn-type.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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`. |