Allow by default, fix tests · rust-lang/rust@10ee0f6 (original) (raw)
File tree
6 files changed
lines changed
- run-pass-fulldeps/auxiliary
6 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -335,7 +335,7 @@ declare_lint! { | ||
335 | 335 | pub mod parser { |
336 | 336 | declare_lint! { |
337 | 337 | pub QUESTION_MARK_MACRO_SEP, |
338 | -Warn, | |
338 | +Allow, | |
339 | 339 | "detects the use of `?` as a macro separator" |
340 | 340 | } |
341 | 341 | } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1807,6 +1807,7 @@ mod tests { | ||
1807 | 1807 | raw_identifier_spans: Lock::new(Vec::new()), |
1808 | 1808 | registered_diagnostics: Lock::new(ErrorMap::new()), |
1809 | 1809 | non_modrs_mods: Lock::new(vec![]), |
1810 | +buffered_lints: Lock::new(vec![]), | |
1810 | 1811 | } |
1811 | 1812 | } |
1812 | 1813 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -20,7 +20,7 @@ extern crate rustc_plugin; | ||
20 | 20 | |
21 | 21 | use syntax::feature_gate::Features; |
22 | 22 | use syntax::parse::token::{NtExpr, NtPat}; |
23 | -use syntax::ast::{Ident, Pat}; | |
23 | +use syntax::ast::{Ident, Pat, NodeId}; | |
24 | 24 | use syntax::tokenstream::{TokenTree}; |
25 | 25 | use syntax::ext::base::{ExtCtxt, MacResult, MacEager}; |
26 | 26 | use syntax::ext::build::AstBuilder; |
@@ -41,7 +41,9 @@ fn expand_mbe_matches(cx: &mut ExtCtxt, _: Span, args: &[TokenTree]) | ||
41 | 41 | cx.parse_sess, |
42 | 42 | &Features::new(), |
43 | 43 | &[], |
44 | -Edition::Edition2015); | |
44 | +Edition::Edition2015, | |
45 | +// not used... | |
46 | +NodeId::new(0)); | |
45 | 47 | let map = match TokenTree::parse(cx, &mbe_matcher, args.iter().cloned().collect()) { |
46 | 48 | Success(map) => map, |
47 | 49 | Failure(_, tok) => { |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
1 | -error: expected one of: `*`, `+`, or `?` | |
1 | +error: expected `*` or `+` | |
2 | 2 | --> $DIR/issue-39388.rs:14:22 |
3 | 3 | | |
4 | -LL | (($($a:tt)*) = ($($b:tt))*) => { //~ ERROR expected one of: `*`, `+`, or `?` | |
4 | +LL | (($($a:tt)*) = ($($b:tt))*) => { //~ ERROR expected `*` or `+` | |
5 | 5 | | ^^^^^^^ |
6 | 6 | |
7 | 7 | error: aborting due to previous error |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -14,12 +14,16 @@ | ||
14 | 14 | // compile-flags: --edition=2015 |
15 | 15 | // compile-pass |
16 | 16 | |
17 | +#![warn(rust_2018_compatibility)] | |
18 | + | |
17 | 19 | macro_rules! bar { |
18 | 20 | ($(a)?*) => {} //~WARN using `?` as a separator |
21 | +//~^WARN this was previously accepted | |
19 | 22 | } |
20 | 23 | |
21 | 24 | macro_rules! baz { |
22 | 25 | ($(a)?+) => {} //~WARN using `?` as a separator |
26 | +//~^WARN this was previously accepted | |
23 | 27 | } |
24 | 28 | |
25 | 29 | fn main() { |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
1 | 1 | warning: using `?` as a separator is deprecated and will be a hard error in an upcoming edition |
2 | - --> $DIR/macro-at-most-once-rep-2015-ques-sep.rs🔞10 | |
2 | + --> $DIR/macro-at-most-once-rep-2015-ques-sep.rs:20:10 | |
3 | 3 | | |
4 | 4 | LL | ($(a)?*) => {} //~WARN using `?` as a separator |
5 | 5 | | ^ |
6 | + | | |
7 | +note: lint level defined here | |
8 | + --> $DIR/macro-at-most-once-rep-2015-ques-sep.rs:17:9 | |
9 | + | | |
10 | +LL | #![warn(rust_2018_compatibility)] | |
11 | + | ^^^^^^^^^^^^^^^^^^^^^^^ | |
12 | + = note: #[warn(question_mark_macro_sep)] implied by #[warn(rust_2018_compatibility)] | |
13 | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition! | |
14 | + = note: for more information, see issue #48075 https://github.com/rust-lang/rust/issues/48075 | |
6 | 15 | |
7 | 16 | warning: using `?` as a separator is deprecated and will be a hard error in an upcoming edition |
8 | - --> $DIR/macro-at-most-once-rep-2015-ques-sep.rs:22:10 | |
17 | + --> $DIR/macro-at-most-once-rep-2015-ques-sep.rs:25:10 | |
9 | 18 | | |
10 | 19 | LL | ($(a)?+) => {} //~WARN using `?` as a separator |
11 | 20 | | ^ |
21 | + | | |
22 | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition! | |
23 | + = note: for more information, see issue #48075 https://github.com/rust-lang/rust/issues/48075 | |
12 | 24 |