diff options
| author | Crazycolorz5 <Crazycolorz5@gmail.com> | 2018-05-25 17:36:23 -0400 |
|---|---|---|
| committer | Crazycolorz5 <Crazycolorz5@gmail.com> | 2018-06-04 22:25:01 -0400 |
| commit | a5dc83d9708d83c9bdbbeb6fd7f12ceab2d92633 (patch) | |
| tree | 10af295c7f38dbfb2ae6c5e6d6cf362bc606d7ce /src/libsyntax/parse | |
| parent | 7a9ffa730740c18d23918add84c40bdf77f17dc0 (diff) | |
| download | rust-a5dc83d9708d83c9bdbbeb6fd7f12ceab2d92633.tar.gz rust-a5dc83d9708d83c9bdbbeb6fd7f12ceab2d92633.zip | |
Tidy fixes.
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 10 | ||||
| -rw-r--r-- | src/libsyntax/parse/token.rs | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index a398962f66a..a5129998e0f 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -880,11 +880,11 @@ impl<'a> Parser<'a> { false } } - + /// Expect and consume a `+`. if `+=` is seen, replace it with a `=` /// and continue. If a `+` is not seen, return false. /// - /// This is using when token splitting += into +. + /// This is using when token splitting += into +. /// See issue 47856 for an example of when this may occur. fn eat_plus(&mut self) -> bool { self.expected_tokens.push(TokenType::Token(token::BinOp(token::Plus))); @@ -901,8 +901,8 @@ impl<'a> Parser<'a> { _ => false, } } - - + + /// Checks to see if the next token is either `+` or `+=`. /// Otherwise returns false. fn check_plus(&mut self) -> bool { @@ -1679,7 +1679,7 @@ impl<'a> Parser<'a> { let poly_trait_ref = PolyTraitRef::new(generic_params, path, lo.to(self.prev_span)); let mut bounds = vec![TraitTyParamBound(poly_trait_ref, TraitBoundModifier::None)]; if parse_plus { - self.eat_plus(); // `+` or `+=` gets split and `+` is discarded + self.eat_plus(); // `+`, or `+=` gets split and `+` is discarded bounds.append(&mut self.parse_ty_param_bounds()?); } Ok(TyKind::TraitObject(bounds, TraitObjectSyntax::None)) diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 18665b99e21..b4300feced4 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -224,7 +224,7 @@ impl Token { _ => false, } } - + pub fn is_like_plus(&self) -> bool { match *self { BinOp(Plus) | BinOpEq(Plus) => true, |
