diff options
| author | Dan Robertson <dan@dlrobertson.com> | 2019-02-18 18:34:42 +0000 |
|---|---|---|
| committer | Dan Robertson <dan@dlrobertson.com> | 2019-02-18 22:22:19 +0000 |
| commit | f8b6449f80b75c8d42b1ebbe4c1fb6d4bfec7ace (patch) | |
| tree | 8a4ae10c6521f02d9afa274d155682c25e1551be /src/libsyntax | |
| parent | 684b09ba7f7b2e163a198fd843128e7260e24e6c (diff) | |
| download | rust-f8b6449f80b75c8d42b1ebbe4c1fb6d4bfec7ace.tar.gz rust-f8b6449f80b75c8d42b1ebbe4c1fb6d4bfec7ace.zip | |
Fix style nits
Fix style nits discovered in reading code.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 7 | ||||
| -rw-r--r-- | src/libsyntax/mut_visit.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 3 |
3 files changed, 10 insertions, 2 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index ab62dd2bc9b..9c4945d74db 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -640,19 +640,26 @@ pub enum PatKind { /// If the `..` pattern fragment is present, then `Option<usize>` denotes its position. /// `0 <= position <= subpats.len()`. Tuple(Vec<P<Pat>>, Option<usize>), + /// A `box` pattern. Box(P<Pat>), + /// A reference pattern (e.g., `&mut (a, b)`). Ref(P<Pat>, Mutability), + /// A literal. Lit(P<Expr>), + /// A range pattern (e.g., `1...2`, `1..=2` or `1..2`). Range(P<Expr>, P<Expr>, Spanned<RangeEnd>), + /// `[a, b, ..i, y, z]` is represented as: /// `PatKind::Slice(box [a, b], Some(i), box [y, z])` Slice(Vec<P<Pat>>, Option<P<Pat>>, Vec<P<Pat>>), + /// Parentheses in patterns used for grouping (i.e., `(PAT)`). Paren(P<Pat>), + /// A macro pattern; pre-expansion. Mac(Mac), } diff --git a/src/libsyntax/mut_visit.rs b/src/libsyntax/mut_visit.rs index 1e5eb0992bd..fd7003d30a1 100644 --- a/src/libsyntax/mut_visit.rs +++ b/src/libsyntax/mut_visit.rs @@ -1037,7 +1037,7 @@ pub fn noop_visit_pat<T: MutVisitor>(pat: &mut P<Pat>, vis: &mut T) { vis.visit_expr(e1); vis.visit_expr(e2); vis.visit_span(span); - }, + } PatKind::Slice(before, slice, after) => { visit_vec(before, |pat| vis.visit_pat(pat)); visit_opt(slice, |slice| vis.visit_pat(slice)); diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index e22047938e5..b1fb38d8eaf 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -4173,7 +4173,8 @@ impl<'a> Parser<'a> { err.emit(); self.bump(); } else if self.eat(&token::BinOp(token::Or)) { - // No op. + // This is a No-op. Continue the loop to parse the next + // pattern. } else { return Ok(pats); } |
