@@ -1051,9 +1051,7 @@ impl<'a> Parser<'a> {
1051
1051
let lifetime_defs = self . parse_late_bound_lifetime_defs ( ) ;
1052
1052
1053
1053
// examine next token to decide to do
1054
- if self . eat_keyword_noexpect ( keywords:: Proc ) {
1055
- self . parse_proc_type ( lifetime_defs)
1056
- } else if self . token_is_bare_fn_keyword ( ) || self . token_is_closure_keyword ( ) {
1054
+ if self . token_is_bare_fn_keyword ( ) || self . token_is_closure_keyword ( ) {
1057
1055
self . parse_ty_bare_fn_or_ty_closure ( lifetime_defs)
1058
1056
} else if self . check ( & token:: ModSep ) ||
1059
1057
self . token . is_ident ( ) ||
@@ -1121,35 +1119,6 @@ impl<'a> Parser<'a> {
1121
1119
} ) )
1122
1120
}
1123
1121
1124
- /// Parses a procedure type (`proc`). The initial `proc` keyword must
1125
- /// already have been parsed.
1126
- pub fn parse_proc_type ( & mut self , lifetime_defs : Vec < ast:: LifetimeDef > ) -> Ty_ {
1127
- /*
1128
-
1129
- proc <'lt> (S) [:Bounds] -> T
1130
- ^~~^ ^~~~^ ^ ^~~~~~~~^ ^
1131
- | | | | |
1132
- | | | | Return type
1133
- | | | Bounds
1134
- | | Argument types
1135
- | Legacy lifetimes
1136
- the `proc` keyword (already consumed)
1137
-
1138
- */
1139
-
1140
- let proc_span = self . last_span ;
1141
-
1142
- // To be helpful, parse the proc as ever
1143
- let _ = self . parse_legacy_lifetime_defs ( lifetime_defs) ;
1144
- let _ = self . parse_fn_args ( false , false ) ;
1145
- let _ = self . parse_colon_then_ty_param_bounds ( BoundParsingMode :: Bare ) ;
1146
- let _ = self . parse_ret_ty ( ) ;
1147
-
1148
- self . obsolete ( proc_span, ObsoleteSyntax :: ProcType ) ;
1149
-
1150
- TyInfer
1151
- }
1152
-
1153
1122
/// Parses an obsolete closure kind (`&:`, `&mut:`, or `:`).
1154
1123
pub fn parse_obsolete_closure_kind ( & mut self ) {
1155
1124
let lo = self . span . lo ;
@@ -1522,8 +1491,6 @@ impl<'a> Parser<'a> {
1522
1491
let e = self . parse_expr ( ) ;
1523
1492
self . expect ( & token:: CloseDelim ( token:: Paren ) ) ;
1524
1493
TyTypeof ( e)
1525
- } else if self . eat_keyword_noexpect ( keywords:: Proc ) {
1526
- self . parse_proc_type ( Vec :: new ( ) )
1527
1494
} else if self . eat_lt ( ) {
1528
1495
// QUALIFIED PATH `<TYPE as TRAIT_REF>::item`
1529
1496
let self_type = self . parse_ty_sum ( ) ;
@@ -2285,12 +2252,6 @@ impl<'a> Parser<'a> {
2285
2252
if self . eat_keyword ( keywords:: Move ) {
2286
2253
return self . parse_lambda_expr ( CaptureByValue ) ;
2287
2254
}
2288
- if self . eat_keyword_noexpect ( keywords:: Proc ) {
2289
- let span = self . last_span ;
2290
- let _ = self . parse_proc_decl ( ) ;
2291
- let _ = self . parse_expr ( ) ;
2292
- return self . obsolete_expr ( span, ObsoleteSyntax :: ProcExpr ) ;
2293
- }
2294
2255
if self . eat_keyword ( keywords:: If ) {
2295
2256
return self . parse_if_expr ( ) ;
2296
2257
}
@@ -4645,23 +4606,6 @@ impl<'a> Parser<'a> {
4645
4606
} )
4646
4607
}
4647
4608
4648
- /// Parses the `(arg, arg) -> return_type` header on a procedure.
4649
- fn parse_proc_decl ( & mut self ) -> P < FnDecl > {
4650
- let inputs =
4651
- self . parse_unspanned_seq ( & token:: OpenDelim ( token:: Paren ) ,
4652
- & token:: CloseDelim ( token:: Paren ) ,
4653
- seq_sep_trailing_allowed ( token:: Comma ) ,
4654
- |p| p. parse_fn_block_arg ( ) ) ;
4655
-
4656
- let output = self . parse_ret_ty ( ) ;
4657
-
4658
- P ( FnDecl {
4659
- inputs : inputs,
4660
- output : output,
4661
- variadic : false
4662
- } )
4663
- }
4664
-
4665
4609
/// Parse the name and optional generic types of a function header.
4666
4610
fn parse_fn_header ( & mut self ) -> ( Ident , ast:: Generics ) {
4667
4611
let id = self . parse_ident ( ) ;
0 commit comments