diff options
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/mod.rs | 14 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 26 |
2 files changed, 20 insertions, 20 deletions
diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index b6f813269cf..cb49ad0905c 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -556,7 +556,7 @@ mod test { segments: vec!( ast::PathSegment { identifier: str_to_ident("d"), - lifetimes: opt_vec::Empty, + lifetimes: Vec::new(), types: opt_vec::Empty, } ), @@ -578,7 +578,7 @@ mod test { segments: vec!( ast::PathSegment { identifier: str_to_ident("b"), - lifetimes: opt_vec::Empty, + lifetimes: Vec::new(), types: opt_vec::Empty, } ), @@ -605,7 +605,7 @@ mod test { segments: vec!( ast::PathSegment { identifier: str_to_ident("b"), - lifetimes: opt_vec::Empty, + lifetimes: Vec::new(), types: opt_vec::Empty, } ), @@ -633,7 +633,7 @@ mod test { ast::PathSegment { identifier: str_to_ident("int"), - lifetimes: opt_vec::Empty, + lifetimes: Vec::new(), types: opt_vec::Empty, } ), @@ -651,7 +651,7 @@ mod test { ast::PathSegment { identifier: str_to_ident("b"), - lifetimes: opt_vec::Empty, + lifetimes: Vec::new(), types: opt_vec::Empty, } ), @@ -671,7 +671,7 @@ mod test { ast::ImpureFn, abi::AbiSet::Rust(), ast::Generics{ // no idea on either of these: - lifetimes: opt_vec::Empty, + lifetimes: Vec::new(), ty_params: opt_vec::Empty, }, ast::P(ast::Block { @@ -689,7 +689,7 @@ mod test { str_to_ident( "b"), lifetimes: - opt_vec::Empty, + Vec::new(), types: opt_vec::Empty } diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index f80fc78b79c..7760ca89eb2 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -958,7 +958,7 @@ impl Parser { lifetimes } else { - opt_vec::Empty + Vec::new() }; let inputs = if self.eat(&token::OROR) { @@ -1015,7 +1015,7 @@ impl Parser { // parse a function type (following the 'fn') pub fn parse_ty_fn_decl(&mut self, allow_variadic: bool) - -> (P<FnDecl>, OptVec<ast::Lifetime>) { + -> (P<FnDecl>, Vec<ast::Lifetime>) { /* (fn) <'lt> (S) -> T @@ -1031,7 +1031,7 @@ impl Parser { self.expect_gt(); lifetimes } else { - opt_vec::Empty + Vec::new() }; let (inputs, variadic) = self.parse_fn_args(false, allow_variadic); @@ -1510,7 +1510,7 @@ impl Parser { segments.push(PathSegmentAndBoundSet { segment: ast::PathSegment { identifier: identifier, - lifetimes: opt_vec::Empty, + lifetimes: Vec::new(), types: opt_vec::Empty, }, bound_set: bound_set @@ -1525,7 +1525,7 @@ impl Parser { self.parse_generic_values_after_lt(); (true, lifetimes, opt_vec::from(types)) } else { - (false, opt_vec::Empty, opt_vec::Empty) + (false, Vec::new(), opt_vec::Empty) } }; @@ -1621,7 +1621,7 @@ impl Parser { // matches lifetimes = ( lifetime ) | ( lifetime , lifetimes ) // actually, it matches the empty one too, but putting that in there // messes up the grammar.... - pub fn parse_lifetimes(&mut self) -> OptVec<ast::Lifetime> { + pub fn parse_lifetimes(&mut self) -> Vec<ast::Lifetime> { /*! * * Parses zero or more comma separated lifetimes. @@ -1630,7 +1630,7 @@ impl Parser { * lists, where we expect something like `<'a, 'b, T>`. */ - let mut res = opt_vec::Empty; + let mut res = Vec::new(); loop { match self.token { token::LIFETIME(_) => { @@ -1995,7 +1995,7 @@ impl Parser { self.expect(&token::LT); self.parse_generic_values_after_lt() } else { - (opt_vec::Empty, Vec::new()) + (Vec::new(), Vec::new()) }; // expr.f() method call @@ -3515,7 +3515,7 @@ impl Parser { } } - fn parse_generic_values_after_lt(&mut self) -> (OptVec<ast::Lifetime>, Vec<P<Ty>> ) { + fn parse_generic_values_after_lt(&mut self) -> (Vec<ast::Lifetime>, Vec<P<Ty>> ) { let lifetimes = self.parse_lifetimes(); let result = self.parse_seq_to_gt( Some(token::COMMA), @@ -4886,7 +4886,7 @@ impl Parser { segments: path.move_iter().map(|identifier| { ast::PathSegment { identifier: identifier, - lifetimes: opt_vec::Empty, + lifetimes: Vec::new(), types: opt_vec::Empty, } }).collect() @@ -4921,7 +4921,7 @@ impl Parser { segments: path.move_iter().map(|identifier| { ast::PathSegment { identifier: identifier, - lifetimes: opt_vec::Empty, + lifetimes: Vec::new(), types: opt_vec::Empty, } }).collect() @@ -4939,7 +4939,7 @@ impl Parser { segments: path.move_iter().map(|identifier| { ast::PathSegment { identifier: identifier, - lifetimes: opt_vec::Empty, + lifetimes: Vec::new(), types: opt_vec::Empty, } }).collect() @@ -4961,7 +4961,7 @@ impl Parser { segments: path.move_iter().map(|identifier| { ast::PathSegment { identifier: identifier, - lifetimes: opt_vec::Empty, + lifetimes: Vec::new(), types: opt_vec::Empty, } }).collect() |
