File tree 2 files changed +28
-0
lines changed
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> {
4391
4391
self . token . is_keyword ( keywords:: Extern ) && self . look_ahead ( 1 , |t| t != & token:: ModSep )
4392
4392
}
4393
4393
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
+
4394
4399
fn is_auto_trait_item ( & mut self ) -> bool {
4395
4400
// auto trait
4396
4401
( self . token . is_keyword ( keywords:: Auto )
@@ -4495,6 +4500,7 @@ impl<'a> Parser<'a> {
4495
4500
!self . is_union_item ( ) &&
4496
4501
!self . is_crate_vis ( ) &&
4497
4502
!self . is_extern_non_path ( ) &&
4503
+ !self . is_existential_type_decl ( ) &&
4498
4504
!self . is_auto_trait_item ( ) {
4499
4505
let pth = self . parse_path ( PathStyle :: Expr ) ?;
4500
4506
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