File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -4391,6 +4391,11 @@ impl<'a> Parser<'a> {
43914391 self.token.is_keyword(keywords::Extern) && self.look_ahead(1, |t| t != &token::ModSep)
43924392 }
43934393
4394+ fn is_existential_type_decl(&self) -> bool {
4395+ self.token.is_keyword(keywords::Existential) &&
4396+ self.look_ahead(1, |t| t.is_keyword(keywords::Type))
4397+ }
4398+
43944399 fn is_auto_trait_item(&mut self) -> bool {
43954400 // auto trait
43964401 (self.token.is_keyword(keywords::Auto)
@@ -4495,6 +4500,7 @@ impl<'a> Parser<'a> {
44954500 !self.is_union_item() &&
44964501 !self.is_crate_vis() &&
44974502 !self.is_extern_non_path() &&
4503+ !self.is_existential_type_decl() &&
44984504 !self.is_auto_trait_item() {
44994505 let pth = self.parse_path(PathStyle::Expr)?;
45004506
Original file line number Diff line number Diff line change 1+ // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+ // file at the top-level directory of this distribution and at
3+ // http://rust-lang.org/COPYRIGHT.
4+ //
5+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+ // option. This file may not be copied, modified, or distributed
9+ // except according to those terms.
10+
11+ // compile-pass
12+
13+ #![feature(existential_type)]
14+
15+ use std::fmt::Debug;
16+
17+ fn main() {
18+ existential type Existential: Debug;
19+
20+ fn f() -> Existential {}
21+ println!("{:?}", f());
22+ }
You can’t perform that action at this time.
0 commit comments