Allow by default, fix tests
This commit is contained in:
parent
6cb09ccf9f
commit
10ee0f68a6
6 changed files with 26 additions and 7 deletions
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue