Closed
Description
As of rustc 1.29.0-nightly (874dec2 2018-07-21) the following works:
#![feature(existential_type)]
use std::fmt::Debug;
existential type Existential: Debug;
fn main() {
fn f() -> Existential {}
println!("{:?}", f());
}
But the following does not parse. I would expect this to be equivalent to the above except for Existential
in scope just within main
, but if this is disallowed by the RFC then it should produce a better error message.
#![feature(existential_type)]
use std::fmt::Debug;
fn main() {
existential type Existential: Debug;
fn f() -> Existential {}
println!("{:?}", f());
}
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `type`
--> src/main.rs:6:17
|
6 | existential type Existential: Debug;
| ^^^^ expected one of 8 possible tokens here
error[E0425]: cannot find value `existential` in this scope
--> src/main.rs:6:5
|
6 | existential type Existential: Debug;
| ^^^^^^^^^^^ not found in this scope
Mentioning the existential types tracking issue #34511
Mentioning @oli-obk and @cramertj
Metadata
Metadata
Assignees
Labels
No labels