diff options
| author | varkor <github@varkor.com> | 2018-05-28 15:23:16 +0100 |
|---|---|---|
| committer | varkor <github@varkor.com> | 2018-06-20 12:23:07 +0100 |
| commit | 80dbe58efc7152cc9925012de0e568f36a9893a8 (patch) | |
| tree | e89f04a4b5be6b90df921ecc4506ab1e604438ea /src/libsyntax/parse | |
| parent | aed530a457dd937fa633dfe52cf07811196d3173 (diff) | |
| download | rust-80dbe58efc7152cc9925012de0e568f36a9893a8.tar.gz rust-80dbe58efc7152cc9925012de0e568f36a9893a8.zip | |
Use ParamBounds in WhereRegionPredicate
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 10 |
1 files changed, 4 insertions, 6 deletions
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<Lifetime> { + 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() }; |
