Skip to content

Commit 10ee0f6

Browse files
committed
Allow by default, fix tests
1 parent 6cb09cc commit 10ee0f6

File tree

6 files changed

+26
-7
lines changed

6 files changed

+26
-7
lines changed

src/librustc/lint/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ declare_lint! {
335335
pub mod parser {
336336
declare_lint! {
337337
pub QUESTION_MARK_MACRO_SEP,
338-
Warn,
338+
Allow,
339339
"detects the use of `?` as a macro separator"
340340
}
341341
}

src/libsyntax/parse/lexer/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1807,6 +1807,7 @@ mod tests {
18071807
raw_identifier_spans: Lock::new(Vec::new()),
18081808
registered_diagnostics: Lock::new(ErrorMap::new()),
18091809
non_modrs_mods: Lock::new(vec![]),
1810+
buffered_lints: Lock::new(vec![]),
18101811
}
18111812
}
18121813

src/test/run-pass-fulldeps/auxiliary/procedural_mbe_matching.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ extern crate rustc_plugin;
2020

2121
use syntax::feature_gate::Features;
2222
use syntax::parse::token::{NtExpr, NtPat};
23-
use syntax::ast::{Ident, Pat};
23+
use syntax::ast::{Ident, Pat, NodeId};
2424
use syntax::tokenstream::{TokenTree};
2525
use syntax::ext::base::{ExtCtxt, MacResult, MacEager};
2626
use syntax::ext::build::AstBuilder;
@@ -41,7 +41,9 @@ fn expand_mbe_matches(cx: &mut ExtCtxt, _: Span, args: &[TokenTree])
4141
cx.parse_sess,
4242
&Features::new(),
4343
&[],
44-
Edition::Edition2015);
44+
Edition::Edition2015,
45+
// not used...
46+
NodeId::new(0));
4547
let map = match TokenTree::parse(cx, &mbe_matcher, args.iter().cloned().collect()) {
4648
Success(map) => map,
4749
Failure(_, tok) => {

src/test/ui/issue-39388.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
error: expected one of: `*`, `+`, or `?`
1+
error: expected `*` or `+`
22
--> $DIR/issue-39388.rs:14:22
33
|
4-
LL | (($($a:tt)*) = ($($b:tt))*) => { //~ ERROR expected one of: `*`, `+`, or `?`
4+
LL | (($($a:tt)*) = ($($b:tt))*) => { //~ ERROR expected `*` or `+`
55
| ^^^^^^^
66

77
error: aborting due to previous error

src/test/ui/macros/macro-at-most-once-rep-2015-ques-sep.rs

+4
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@
1414
// compile-flags: --edition=2015
1515
// compile-pass
1616

17+
#![warn(rust_2018_compatibility)]
18+
1719
macro_rules! bar {
1820
($(a)?*) => {} //~WARN using `?` as a separator
21+
//~^WARN this was previously accepted
1922
}
2023

2124
macro_rules! baz {
2225
($(a)?+) => {} //~WARN using `?` as a separator
26+
//~^WARN this was previously accepted
2327
}
2428

2529
fn main() {
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
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:18:10
2+
--> $DIR/macro-at-most-once-rep-2015-ques-sep.rs:20:10
33
|
44
LL | ($(a)?*) => {} //~WARN using `?` as a separator
55
| ^
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>
615

716
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
918
|
1019
LL | ($(a)?+) => {} //~WARN using `?` as a separator
1120
| ^
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>
1224

0 commit comments

Comments
 (0)