From 80dbe58efc7152cc9925012de0e568f36a9893a8 Mon Sep 17 00:00:00 2001 From: varkor Date: Mon, 28 May 2018 15:23:16 +0100 Subject: Use ParamBounds in WhereRegionPredicate --- src/libsyntax/parse/parser.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/libsyntax/parse/parser.rs') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index ce79735fff5..66e48512065 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1610,7 +1610,7 @@ impl<'a> Parser<'a> { s.print_mutability(mut_ty.mutbl)?; s.popen()?; s.print_type(&mut_ty.ty)?; - s.print_bounds(" +", &bounds)?; + s.print_type_bounds(" +", &bounds)?; s.pclose() }); err.span_suggestion_with_applicability( @@ -4790,10 +4790,10 @@ impl<'a> Parser<'a> { // Parse bounds of a lifetime parameter `BOUND + BOUND + BOUND`, possibly with trailing `+`. // BOUND = LT_BOUND (e.g. `'a`) - fn parse_lt_param_bounds(&mut self) -> Vec { + fn parse_lt_param_bounds(&mut self) -> ParamBounds { let mut lifetimes = Vec::new(); while self.check_lifetime() { - lifetimes.push(self.expect_lifetime()); + lifetimes.push(ast::ParamBound::Outlives(self.expect_lifetime())); if !self.eat_plus() { break @@ -4868,9 +4868,7 @@ impl<'a> Parser<'a> { let lifetime = self.expect_lifetime(); // Parse lifetime parameter. let bounds = if self.eat(&token::Colon) { - self.parse_lt_param_bounds().iter() - .map(|bound| ast::ParamBound::Outlives(*bound)) - .collect() + self.parse_lt_param_bounds() } else { Vec::new() }; -- cgit 1.4.1-3-g733a5