syntax: make the closure type f: |uint| -> bool
syntax obsolete
This commit is contained in:
parent
865aabb662
commit
58b0d7479f
2 changed files with 18 additions and 16 deletions
|
@ -1227,32 +1227,29 @@ impl<'a> Parser<'a> {
|
|||
|
||||
*/
|
||||
|
||||
let unsafety = self.parse_unsafety();
|
||||
let ty_closure_span = self.last_span;
|
||||
|
||||
let lifetime_defs = self.parse_legacy_lifetime_defs(lifetime_defs);
|
||||
// To be helpful, parse the closure type as ever
|
||||
let _ = self.parse_unsafety();
|
||||
|
||||
let inputs = if self.eat(&token::OrOr) {
|
||||
Vec::new()
|
||||
} else {
|
||||
let _ = self.parse_legacy_lifetime_defs(lifetime_defs);
|
||||
|
||||
if !self.eat(&token::OrOr) {
|
||||
self.expect_or();
|
||||
|
||||
let inputs = self.parse_seq_to_before_or(
|
||||
let _ = self.parse_seq_to_before_or(
|
||||
&token::Comma,
|
||||
|p| p.parse_arg_general(false));
|
||||
self.expect_or();
|
||||
inputs
|
||||
};
|
||||
}
|
||||
|
||||
let bounds = self.parse_colon_then_ty_param_bounds(BoundParsingMode::Bare);
|
||||
let _ = self.parse_colon_then_ty_param_bounds(BoundParsingMode::Bare);
|
||||
|
||||
let output = self.parse_ret_ty();
|
||||
let decl = P(FnDecl {
|
||||
inputs: inputs,
|
||||
output: output,
|
||||
variadic: false
|
||||
});
|
||||
let _ = self.parse_ret_ty();
|
||||
|
||||
panic!("stub");
|
||||
self.obsolete(ty_closure_span, ObsoleteClosureType);
|
||||
|
||||
TyInfer
|
||||
}
|
||||
|
||||
pub fn parse_unsafety(&mut self) -> Unsafety {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue