summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormark <markm@cs.wisc.edu>2018-07-13 23:48:15 -0500
committermark <markm@cs.wisc.edu>2018-07-23 21:55:51 -0500
commit10ee0f68a6815fafa69f58daf347f0c2a8339f32 (patch)
tree2f05c5d7b6d538bd3b15d6bc0f91f547b0dcb2c8
parent6cb09ccf9f524590d7cc9f8c97732742446ae2b2 (diff)
downloadrust-10ee0f68a6815fafa69f58daf347f0c2a8339f32.tar.gz
Allow by default, fix tests
-rw-r--r--src/librustc/lint/builtin.rs2
-rw-r--r--src/libsyntax/parse/lexer/mod.rs1
-rw-r--r--src/test/run-pass-fulldeps/auxiliary/procedural_mbe_matching.rs6
-rw-r--r--src/test/ui/issue-39388.stderr4
-rw-r--r--src/test/ui/macros/macro-at-most-once-rep-2015-ques-sep.rs4
-rw-r--r--src/test/ui/macros/macro-at-most-once-rep-2015-ques-sep.stderr16
6 files changed, 26 insertions, 7 deletions
diff --git a/src/librustc/lint/builtin.rs b/src/librustc/lint/builtin.rs
index 495b4d32e06..4184cba7db3 100644
--- a/src/librustc/lint/builtin.rs
+++ b/src/librustc/lint/builtin.rs
@@ -335,7 +335,7 @@ declare_lint! {
pub mod parser {
declare_lint! {
pub QUESTION_MARK_MACRO_SEP,
- Warn,
+ Allow,
"detects the use of `?` as a macro separator"
}
}
diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs
index 9748e2947ee..4b077aa8dd4 100644
--- a/src/libsyntax/parse/lexer/mod.rs
+++ b/src/libsyntax/parse/lexer/mod.rs
@@ -1807,6 +1807,7 @@ mod tests {
raw_identifier_spans: Lock::new(Vec::new()),
registered_diagnostics: Lock::new(ErrorMap::new()),
non_modrs_mods: Lock::new(vec![]),
+ buffered_lints: Lock::new(vec![]),
}
}
diff --git a/src/test/run-pass-fulldeps/auxiliary/procedural_mbe_matching.rs b/src/test/run-pass-fulldeps/auxiliary/procedural_mbe_matching.rs
index 664e9eeb3e0..f1777745e06 100644
--- a/src/test/run-pass-fulldeps/auxiliary/procedural_mbe_matching.rs
+++ b/src/test/run-pass-fulldeps/auxiliary/procedural_mbe_matching.rs
@@ -20,7 +20,7 @@ extern crate rustc_plugin;
use syntax::feature_gate::Features;
use syntax::parse::token::{NtExpr, NtPat};
-use syntax::ast::{Ident, Pat};
+use syntax::ast::{Ident, Pat, NodeId};
use syntax::tokenstream::{TokenTree};
use syntax::ext::base::{ExtCtxt, MacResult, MacEager};
use syntax::ext::build::AstBuilder;
@@ -41,7 +41,9 @@ fn expand_mbe_matches(cx: &mut ExtCtxt, _: Span, args: &[TokenTree])
cx.parse_sess,
&Features::new(),
&[],
- Edition::Edition2015);
+ Edition::Edition2015,
+ // not used...
+ NodeId::new(0));
let map = match TokenTree::parse(cx, &mbe_matcher, args.iter().cloned().collect()) {
Success(map) => map,
Failure(_, tok) => {
diff --git a/src/test/ui/issue-39388.stderr b/src/test/ui/issue-39388.stderr
index a38d38a51ad..dc19487f3af 100644
--- a/src/test/ui/issue-39388.stderr
+++ b/src/test/ui/issue-39388.stderr
@@ -1,7 +1,7 @@
-error: expected one of: `*`, `+`, or `?`
+error: expected `*` or `+`
--> $DIR/issue-39388.rs:14:22
|
-LL | (($($a:tt)*) = ($($b:tt))*) => { //~ ERROR expected one of: `*`, `+`, or `?`
+LL | (($($a:tt)*) = ($($b:tt))*) => { //~ ERROR expected `*` or `+`
| ^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/macros/macro-at-most-once-rep-2015-ques-sep.rs b/src/test/ui/macros/macro-at-most-once-rep-2015-ques-sep.rs
index 4b3dfbdc2e8..2e06b4bd5c2 100644
--- a/src/test/ui/macros/macro-at-most-once-rep-2015-ques-sep.rs
+++ b/src/test/ui/macros/macro-at-most-once-rep-2015-ques-sep.rs
@@ -14,12 +14,16 @@
// compile-flags: --edition=2015
// compile-pass
+#![warn(rust_2018_compatibility)]
+
macro_rules! bar {
($(a)?*) => {} //~WARN using `?` as a separator
+ //~^WARN this was previously accepted
}
macro_rules! baz {
($(a)?+) => {} //~WARN using `?` as a separator
+ //~^WARN this was previously accepted
}
fn main() {
diff --git a/src/test/ui/macros/macro-at-most-once-rep-2015-ques-sep.stderr b/src/test/ui/macros/macro-at-most-once-rep-2015-ques-sep.stderr
index 0ab4138864e..db1872c2413 100644
--- a/src/test/ui/macros/macro-at-most-once-rep-2015-ques-sep.stderr
+++ b/src/test/ui/macros/macro-at-most-once-rep-2015-ques-sep.stderr
@@ -1,12 +1,24 @@
warning: using `?` as a separator is deprecated and will be a hard error in an upcoming edition
- --> $DIR/macro-at-most-once-rep-2015-ques-sep.rs:18:10
+ --> $DIR/macro-at-most-once-rep-2015-ques-sep.rs:20:10
|
LL | ($(a)?*) => {} //~WARN using `?` as a separator
| ^
+ |
+note: lint level defined here
+ --> $DIR/macro-at-most-once-rep-2015-ques-sep.rs:17:9
+ |
+LL | #![warn(rust_2018_compatibility)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^
+ = note: #[warn(question_mark_macro_sep)] implied by #[warn(rust_2018_compatibility)]
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
+ = note: for more information, see issue #48075 <https://github.com/rust-lang/rust/issues/48075>
warning: using `?` as a separator is deprecated and will be a hard error in an upcoming edition
- --> $DIR/macro-at-most-once-rep-2015-ques-sep.rs:22:10
+ --> $DIR/macro-at-most-once-rep-2015-ques-sep.rs:25:10
|
LL | ($(a)?+) => {} //~WARN using `?` as a separator
| ^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
+ = note: for more information, see issue #48075 <https://github.com/rust-lang/rust/issues/48075>