about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-02-20 10:14:28 +0000
committerbors <bors@rust-lang.org>2019-02-20 10:14:28 +0000
commitf66e4697ae286985ddefc53c3a047614568458bb (patch)
tree656e63ba3f96698e771c822a90670f7eb608aa51 /src/libsyntax
parent74e35d270067afff72034312065c48e6d8cfba67 (diff)
parenta1a17f5c6663a6a22a58505a6a925b44dfc016e9 (diff)
downloadrust-f66e4697ae286985ddefc53c3a047614568458bb.tar.gz
rust-f66e4697ae286985ddefc53c3a047614568458bb.zip
Auto merge of #58578 - kennytm:rollup, r=kennytm
Rollup of 24 pull requests

Successful merges:

 - #56470 (Modify doctest's auto-`fn main()` to allow `Result`s)
 - #58044 (Make overflowing and wrapping negation const)
 - #58303 (Improve stability tags display)
 - #58336 (Fix search results interactions)
 - #58384 (Fix tables display)
 - #58392 (Use less explicit shifting in std::net::ip)
 - #58409 (rustdoc: respect alternate flag when formatting impl trait)
 - #58456 (Remove no longer accurate diagnostic code about NLL)
 - #58528 (Don't use an allocation for ItemId in StmtKind)
 - #58530 (Monomorphize less code in fs::{read|write})
 - #58534 (Mention capping forbid lints)
 - #58536 (Remove UB in pointer tests)
 - #58538 (Add missing fmt structs examples)
 - #58539 (Add alias methods to PathBuf for underlying OsString (#58234))
 - #58544 (Fix doc for rustc "-g" flag)
 - #58545 (Add regression test for a specialization-related ICE (#39448))
 - #58546 (librustc_codegen_llvm => 2018)
 - #58551 (Explain a panic in test case net::tcp::tests::double_bind)
 - #58553 (Use more impl header lifetime elision)
 - #58562 (Fix style nits)
 - #58565 (Fix typo in std::future::Future docs)
 - #58568 (Fix a transposition in driver.rs.)
 - #58569 (Reduce Some Code Repetitions like `(n << amt) >> amt`)
 - #58576 (Stabilize iter::successors and iter::from_fn)
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs7
-rw-r--r--src/libsyntax/mut_visit.rs2
-rw-r--r--src/libsyntax/parse/parser.rs3
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);
             }