Some((ref best_token, _)) if best_token.span.lo() >= token.span.lo() => {}
_ => best_failure = Some((token, msg)),
},
- Error(err_sp, ref msg) => cx.span_fatal(err_sp.substitute_dummy(sp), &msg[..]),
+ Error(err_sp, ref msg) => {
+ let span = err_sp.substitute_dummy(sp);
+ cx.struct_span_err(span, &msg).emit();
+ return DummyResult::any(span);
+ }
}
// The matcher was not `Success(..)`ful.
-macro_rules! test { ($a, $b) => (()); } //~ ERROR missing fragment
+macro_rules! test {
+ ($a, $b) => {
+ //~^ ERROR missing fragment
+ //~| ERROR missing fragment
+ //~| WARN this was previously accepted
+ ()
+ };
+}
fn main() {
test!()
error: missing fragment specifier
- --> $DIR/macro-match-nonterminal.rs:1:24
+ --> $DIR/macro-match-nonterminal.rs:2:8
|
-LL | macro_rules! test { ($a, $b) => (()); }
- | ^
+LL | ($a, $b) => {
+ | ^
-error: aborting due to previous error
+error: missing fragment specifier
+ --> $DIR/macro-match-nonterminal.rs:2:10
+ |
+LL | ($a, $b) => {
+ | ^^
+ |
+ = note: `#[deny(missing_fragment_specifier)]` on by default
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>
+
+error: aborting due to 2 previous errors
+fn main() {}
+
macro_rules! foo {
{ $+ } => { //~ ERROR expected identifier, found `+`
//~^ ERROR missing fragment specifier
error: expected identifier, found `+`
- --> $DIR/issue-33569.rs:2:8
+ --> $DIR/issue-33569.rs:4:8
|
LL | { $+ } => {
| ^
error: expected one of: `*`, `+`, or `?`
- --> $DIR/issue-33569.rs:4:13
+ --> $DIR/issue-33569.rs:6:13
|
LL | $(x)(y)
| ^^^
error: missing fragment specifier
- --> $DIR/issue-33569.rs:2:8
+ --> $DIR/issue-33569.rs:4:8
|
LL | { $+ } => {
| ^