about summary refs log tree commit diff
path: root/tests/ui/parser
diff options
context:
space:
mode:
authorTrevor Gross <tmgross@umich.edu>2024-07-30 23:04:23 -0400
committerTrevor Gross <tmgross@umich.edu>2025-06-12 07:57:12 +0000
commit841f7ce69ac503fb9566deeefbbd273c1587f4e6 (patch)
tree287ebf2ad29bbaa5af7669b894864bef1c5ebb9d /tests/ui/parser
parent208cb5da15d5a8378efff6d44a5ffa53fd51bbbc (diff)
downloadrust-841f7ce69ac503fb9566deeefbbd273c1587f4e6.tar.gz
rust-841f7ce69ac503fb9566deeefbbd273c1587f4e6.zip
Make `missing_fragment_specifier` an unconditional error
This was attempted in [1] then reverted in [2] because of fallout.
Recently, this was made an edition-dependent error in [3].

Make missing fragment specifiers an unconditional error again.

[1]: https://github.com/rust-lang/rust/pull/75516
[2]: https://github.com/rust-lang/rust/pull/80210
[3]: https://github.com/rust-lang/rust/pull/128006
Diffstat (limited to 'tests/ui/parser')
-rw-r--r--tests/ui/parser/macro/issue-33569.rs1
-rw-r--r--tests/ui/parser/macro/issue-33569.stderr24
2 files changed, 8 insertions, 17 deletions
diff --git a/tests/ui/parser/macro/issue-33569.rs b/tests/ui/parser/macro/issue-33569.rs
index 069d181e962..e0a5352ab06 100644
--- a/tests/ui/parser/macro/issue-33569.rs
+++ b/tests/ui/parser/macro/issue-33569.rs
@@ -2,7 +2,6 @@ macro_rules! foo {
     { $+ } => { //~ ERROR expected identifier, found `+`
                 //~^ ERROR missing fragment specifier
                 //~| ERROR missing fragment specifier
-                //~| WARN this was previously accepted
         $(x)(y) //~ ERROR expected one of: `*`, `+`, or `?`
     }
 }
diff --git a/tests/ui/parser/macro/issue-33569.stderr b/tests/ui/parser/macro/issue-33569.stderr
index d1b6abfeeeb..0d53c04c1c9 100644
--- a/tests/ui/parser/macro/issue-33569.stderr
+++ b/tests/ui/parser/macro/issue-33569.stderr
@@ -5,7 +5,7 @@ LL |     { $+ } => {
    |        ^
 
 error: expected one of: `*`, `+`, or `?`
-  --> $DIR/issue-33569.rs:6:13
+  --> $DIR/issue-33569.rs:5:13
    |
 LL |         $(x)(y)
    |             ^^^
@@ -15,27 +15,19 @@ error: missing fragment specifier
    |
 LL |     { $+ } => {
    |        ^
-
-error: missing fragment specifier
-  --> $DIR/issue-33569.rs:2:8
    |
-LL |     { $+ } => {
-   |        ^
+   = note: fragment specifiers must be provided
+   = help: valid fragment specifiers are `ident`, `block`, `stmt`, `expr`, `pat`, `ty`, `lifetime`, `literal`, `path`, `meta`, `tt`, `item` and `vis`, along with `expr_2021` and `pat_param` for edition compatibility
+help: try adding a specifier here
    |
-   = 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>
-   = note: `#[deny(missing_fragment_specifier)]` on by default
+LL |     { $+:spec } => {
+   |         +++++
 
-error: aborting due to 4 previous errors
-
-Future incompatibility report: Future breakage diagnostic:
 error: missing fragment specifier
   --> $DIR/issue-33569.rs:2:8
    |
 LL |     { $+ } => {
    |        ^
-   |
-   = 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>
-   = note: `#[deny(missing_fragment_specifier)]` on by default
+
+error: aborting due to 4 previous errors