]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #43066 - pornel:patch-1, r=Mark-Simulacrum
authorbors <bors@rust-lang.org>
Thu, 6 Jul 2017 14:46:13 +0000 (14:46 +0000)
committerbors <bors@rust-lang.org>
Thu, 6 Jul 2017 14:46:13 +0000 (14:46 +0000)
Suggest rustup toolchain link

The contributing instructions only explain how to build the compiler, but not how to try it out.

I found `rustup toolchain link` to be super useful for this, so I think it's good to suggest it.

src/libsyntax/ext/tt/macro_rules.rs
src/test/compile-fail/issue-42755.rs [new file with mode: 0644]

index b732f47ce6a93da34d7fdbb87e2169e5d9a376fc..a98a9dd204046994af90dacd3f4ed48c23d19b66 100644 (file)
@@ -299,6 +299,7 @@ fn check_lhs_no_empty_seq(sess: &ParseSess, tts: &[quoted::TokenTree]) -> bool {
             TokenTree::Sequence(span, ref seq) => {
                 if seq.separator.is_none() && seq.tts.iter().all(|seq_tt| {
                     match *seq_tt {
+                        TokenTree::MetaVarDecl(_, _, id) => id.name == "vis",
                         TokenTree::Sequence(_, ref sub_seq) =>
                             sub_seq.op == quoted::KleeneOp::ZeroOrMore,
                         _ => false,
diff --git a/src/test/compile-fail/issue-42755.rs b/src/test/compile-fail/issue-42755.rs
new file mode 100644 (file)
index 0000000..7547c4a
--- /dev/null
@@ -0,0 +1,17 @@
+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(macro_vis_matcher)]
+
+macro_rules! foo {
+    ($($p:vis)*) => {} //~ ERROR repetition matches empty token tree
+}
+
+foo!(a);