about summary refs log tree commit diff
path: root/tests/ui/rust-2024
diff options
context:
space:
mode:
authorPeter Jaszkowiak <p.jaszkow@gmail.com>2024-11-25 21:50:26 -0700
committerPeter Jaszkowiak <p.jaszkow@gmail.com>2024-11-25 22:29:14 -0700
commit44f4f67f460a3b3c9bb34851d3d812fbdba81936 (patch)
tree3cdb0d6a403ddb3a2f3c590da97863ea865ba2e1 /tests/ui/rust-2024
parent7db7489f9bc274cb60c4956bfa56de0185eb1b9b (diff)
downloadrust-44f4f67f460a3b3c9bb34851d3d812fbdba81936.tar.gz
rust-44f4f67f460a3b3c9bb34851d3d812fbdba81936.zip
fix confusing diagnostic for reserved `##`
Diffstat (limited to 'tests/ui/rust-2024')
-rw-r--r--tests/ui/rust-2024/reserved-guarded-strings-lexing.rs24
-rw-r--r--tests/ui/rust-2024/reserved-guarded-strings-lexing.stderr48
-rw-r--r--tests/ui/rust-2024/reserved-guarded-strings-migration.fixed20
-rw-r--r--tests/ui/rust-2024/reserved-guarded-strings-migration.rs20
-rw-r--r--tests/ui/rust-2024/reserved-guarded-strings-migration.stderr40
-rw-r--r--tests/ui/rust-2024/reserved-guarded-strings.rs14
-rw-r--r--tests/ui/rust-2024/reserved-guarded-strings.stderr28
7 files changed, 97 insertions, 97 deletions
diff --git a/tests/ui/rust-2024/reserved-guarded-strings-lexing.rs b/tests/ui/rust-2024/reserved-guarded-strings-lexing.rs
index 83e0dcbb4be..43413f7470e 100644
--- a/tests/ui/rust-2024/reserved-guarded-strings-lexing.rs
+++ b/tests/ui/rust-2024/reserved-guarded-strings-lexing.rs
@@ -26,24 +26,24 @@ macro_rules! demo7 {
 
 fn main() {
     demo3!(## "foo");
-    //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
     demo4!(### "foo");
-    //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
-    //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
     demo4!(## "foo"#);
-    //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
     demo7!(### "foo"###);
-    //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
-    //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
-    //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
-    //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
 
     demo5!(###"foo"#);
@@ -56,14 +56,14 @@ fn main() {
     demo5!(#"foo"###);
     //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
-    //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
-    //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
     demo4!("foo"###);
-    //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
-    //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
 
     // Non-ascii identifiers
diff --git a/tests/ui/rust-2024/reserved-guarded-strings-lexing.stderr b/tests/ui/rust-2024/reserved-guarded-strings-lexing.stderr
index e2e1ac42f05..4d54a08617b 100644
--- a/tests/ui/rust-2024/reserved-guarded-strings-lexing.stderr
+++ b/tests/ui/rust-2024/reserved-guarded-strings-lexing.stderr
@@ -28,7 +28,7 @@ error: identifiers cannot contain emoji: `🙃`
 LL |     demo3!(🙃#"");
    |            ^^
 
-warning: will be parsed as a guarded string in Rust 2024
+warning: reserved token in Rust 2024
   --> $DIR/reserved-guarded-strings-lexing.rs:28:12
    |
 LL |     demo3!(## "foo");
@@ -41,12 +41,12 @@ note: the lint level is defined here
    |
 LL | #![warn(rust_2024_guarded_string_incompatible_syntax)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
+help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
    |
 LL |     demo3!(# # "foo");
    |             +
 
-warning: will be parsed as a guarded string in Rust 2024
+warning: reserved token in Rust 2024
   --> $DIR/reserved-guarded-strings-lexing.rs:31:12
    |
 LL |     demo4!(### "foo");
@@ -54,12 +54,12 @@ LL |     demo4!(### "foo");
    |
    = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
    = note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
-help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
+help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
    |
 LL |     demo4!(# ## "foo");
    |             +
 
-warning: will be parsed as a guarded string in Rust 2024
+warning: reserved token in Rust 2024
   --> $DIR/reserved-guarded-strings-lexing.rs:31:13
    |
 LL |     demo4!(### "foo");
@@ -67,12 +67,12 @@ LL |     demo4!(### "foo");
    |
    = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
    = note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
-help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
+help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
    |
 LL |     demo4!(## # "foo");
    |              +
 
-warning: will be parsed as a guarded string in Rust 2024
+warning: reserved token in Rust 2024
   --> $DIR/reserved-guarded-strings-lexing.rs:36:12
    |
 LL |     demo4!(## "foo"#);
@@ -80,12 +80,12 @@ LL |     demo4!(## "foo"#);
    |
    = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
    = note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
-help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
+help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
    |
 LL |     demo4!(# # "foo"#);
    |             +
 
-warning: will be parsed as a guarded string in Rust 2024
+warning: reserved token in Rust 2024
   --> $DIR/reserved-guarded-strings-lexing.rs:39:12
    |
 LL |     demo7!(### "foo"###);
@@ -93,12 +93,12 @@ LL |     demo7!(### "foo"###);
    |
    = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
    = note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
-help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
+help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
    |
 LL |     demo7!(# ## "foo"###);
    |             +
 
-warning: will be parsed as a guarded string in Rust 2024
+warning: reserved token in Rust 2024
   --> $DIR/reserved-guarded-strings-lexing.rs:39:13
    |
 LL |     demo7!(### "foo"###);
@@ -106,12 +106,12 @@ LL |     demo7!(### "foo"###);
    |
    = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
    = note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
-help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
+help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
    |
 LL |     demo7!(## # "foo"###);
    |              +
 
-warning: will be parsed as a guarded string in Rust 2024
+warning: reserved token in Rust 2024
   --> $DIR/reserved-guarded-strings-lexing.rs:39:21
    |
 LL |     demo7!(### "foo"###);
@@ -119,12 +119,12 @@ LL |     demo7!(### "foo"###);
    |
    = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
    = note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
-help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
+help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
    |
 LL |     demo7!(### "foo"# ##);
    |                      +
 
-warning: will be parsed as a guarded string in Rust 2024
+warning: reserved token in Rust 2024
   --> $DIR/reserved-guarded-strings-lexing.rs:39:22
    |
 LL |     demo7!(### "foo"###);
@@ -132,7 +132,7 @@ LL |     demo7!(### "foo"###);
    |
    = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
    = note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
-help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
+help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
    |
 LL |     demo7!(### "foo"## #);
    |                       +
@@ -189,7 +189,7 @@ help: insert whitespace here to avoid this being parsed as a guarded string in R
 LL |     demo5!(# "foo"###);
    |             +
 
-warning: will be parsed as a guarded string in Rust 2024
+warning: reserved token in Rust 2024
   --> $DIR/reserved-guarded-strings-lexing.rs:56:18
    |
 LL |     demo5!(#"foo"###);
@@ -197,12 +197,12 @@ LL |     demo5!(#"foo"###);
    |
    = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
    = note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
-help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
+help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
    |
 LL |     demo5!(#"foo"# ##);
    |                   +
 
-warning: will be parsed as a guarded string in Rust 2024
+warning: reserved token in Rust 2024
   --> $DIR/reserved-guarded-strings-lexing.rs:56:19
    |
 LL |     demo5!(#"foo"###);
@@ -210,12 +210,12 @@ LL |     demo5!(#"foo"###);
    |
    = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
    = note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
-help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
+help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
    |
 LL |     demo5!(#"foo"## #);
    |                    +
 
-warning: will be parsed as a guarded string in Rust 2024
+warning: reserved token in Rust 2024
   --> $DIR/reserved-guarded-strings-lexing.rs:63:17
    |
 LL |     demo4!("foo"###);
@@ -223,12 +223,12 @@ LL |     demo4!("foo"###);
    |
    = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
    = note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
-help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
+help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
    |
 LL |     demo4!("foo"# ##);
    |                  +
 
-warning: will be parsed as a guarded string in Rust 2024
+warning: reserved token in Rust 2024
   --> $DIR/reserved-guarded-strings-lexing.rs:63:18
    |
 LL |     demo4!("foo"###);
@@ -236,7 +236,7 @@ LL |     demo4!("foo"###);
    |
    = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
    = note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
-help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
+help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
    |
 LL |     demo4!("foo"## #);
    |                   +
diff --git a/tests/ui/rust-2024/reserved-guarded-strings-migration.fixed b/tests/ui/rust-2024/reserved-guarded-strings-migration.fixed
index d92df7b5375..ef00ed3f610 100644
--- a/tests/ui/rust-2024/reserved-guarded-strings-migration.fixed
+++ b/tests/ui/rust-2024/reserved-guarded-strings-migration.fixed
@@ -38,28 +38,28 @@ fn main() {
     demo2!("foo"#);
 
     demo3!(# # "foo");
-    //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
     demo4!(# # # "foo");
-    //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
-    //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
     demo4!(# # "foo"#);
-    //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
     demo6!(# # # "foo"# #);
-    //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
-    //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
-    //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
 
     demo4!("foo"# # #);
-    //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
-    //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
 
     demo2!(# "");
@@ -94,6 +94,6 @@ fn main() {
     //~| WARNING hard error in Rust 2024
     //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
-    //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
 }
diff --git a/tests/ui/rust-2024/reserved-guarded-strings-migration.rs b/tests/ui/rust-2024/reserved-guarded-strings-migration.rs
index 5905f2abe32..cf2d8716ad2 100644
--- a/tests/ui/rust-2024/reserved-guarded-strings-migration.rs
+++ b/tests/ui/rust-2024/reserved-guarded-strings-migration.rs
@@ -38,28 +38,28 @@ fn main() {
     demo2!("foo"#);
 
     demo3!(## "foo");
-    //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
     demo4!(### "foo");
-    //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
-    //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
     demo4!(## "foo"#);
-    //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
     demo6!(### "foo"##);
-    //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
-    //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
-    //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
 
     demo4!("foo"###);
-    //~^ WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~^ WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
-    //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
 
     demo2!(#"");
@@ -94,6 +94,6 @@ fn main() {
     //~| WARNING hard error in Rust 2024
     //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
-    //~| WARNING parsed as a guarded string in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
+    //~| WARNING reserved token in Rust 2024 [rust_2024_guarded_string_incompatible_syntax]
     //~| WARNING hard error in Rust 2024
 }
diff --git a/tests/ui/rust-2024/reserved-guarded-strings-migration.stderr b/tests/ui/rust-2024/reserved-guarded-strings-migration.stderr
index d7f8e5c9b4b..b17ae941ef4 100644
--- a/tests/ui/rust-2024/reserved-guarded-strings-migration.stderr
+++ b/tests/ui/rust-2024/reserved-guarded-strings-migration.stderr
@@ -1,4 +1,4 @@
-warning: will be parsed as a guarded string in Rust 2024
+warning: reserved token in Rust 2024
   --> $DIR/reserved-guarded-strings-migration.rs:40:12
    |
 LL |     demo3!(## "foo");
@@ -11,12 +11,12 @@ note: the lint level is defined here
    |
 LL | #![warn(rust_2024_guarded_string_incompatible_syntax)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
+help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
    |
 LL |     demo3!(# # "foo");
    |             +
 
-warning: will be parsed as a guarded string in Rust 2024
+warning: reserved token in Rust 2024
   --> $DIR/reserved-guarded-strings-migration.rs:43:12
    |
 LL |     demo4!(### "foo");
@@ -24,12 +24,12 @@ LL |     demo4!(### "foo");
    |
    = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
    = note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
-help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
+help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
    |
 LL |     demo4!(# ## "foo");
    |             +
 
-warning: will be parsed as a guarded string in Rust 2024
+warning: reserved token in Rust 2024
   --> $DIR/reserved-guarded-strings-migration.rs:43:13
    |
 LL |     demo4!(### "foo");
@@ -37,12 +37,12 @@ LL |     demo4!(### "foo");
    |
    = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
    = note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
-help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
+help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
    |
 LL |     demo4!(## # "foo");
    |              +
 
-warning: will be parsed as a guarded string in Rust 2024
+warning: reserved token in Rust 2024
   --> $DIR/reserved-guarded-strings-migration.rs:48:12
    |
 LL |     demo4!(## "foo"#);
@@ -50,12 +50,12 @@ LL |     demo4!(## "foo"#);
    |
    = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
    = note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
-help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
+help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
    |
 LL |     demo4!(# # "foo"#);
    |             +
 
-warning: will be parsed as a guarded string in Rust 2024
+warning: reserved token in Rust 2024
   --> $DIR/reserved-guarded-strings-migration.rs:51:12
    |
 LL |     demo6!(### "foo"##);
@@ -63,12 +63,12 @@ LL |     demo6!(### "foo"##);
    |
    = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
    = note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
-help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
+help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
    |
 LL |     demo6!(# ## "foo"##);
    |             +
 
-warning: will be parsed as a guarded string in Rust 2024
+warning: reserved token in Rust 2024
   --> $DIR/reserved-guarded-strings-migration.rs:51:13
    |
 LL |     demo6!(### "foo"##);
@@ -76,12 +76,12 @@ LL |     demo6!(### "foo"##);
    |
    = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
    = note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
-help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
+help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
    |
 LL |     demo6!(## # "foo"##);
    |              +
 
-warning: will be parsed as a guarded string in Rust 2024
+warning: reserved token in Rust 2024
   --> $DIR/reserved-guarded-strings-migration.rs:51:21
    |
 LL |     demo6!(### "foo"##);
@@ -89,12 +89,12 @@ LL |     demo6!(### "foo"##);
    |
    = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
    = note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
-help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
+help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
    |
 LL |     demo6!(### "foo"# #);
    |                      +
 
-warning: will be parsed as a guarded string in Rust 2024
+warning: reserved token in Rust 2024
   --> $DIR/reserved-guarded-strings-migration.rs:59:17
    |
 LL |     demo4!("foo"###);
@@ -102,12 +102,12 @@ LL |     demo4!("foo"###);
    |
    = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
    = note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
-help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
+help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
    |
 LL |     demo4!("foo"# ##);
    |                  +
 
-warning: will be parsed as a guarded string in Rust 2024
+warning: reserved token in Rust 2024
   --> $DIR/reserved-guarded-strings-migration.rs:59:18
    |
 LL |     demo4!("foo"###);
@@ -115,7 +115,7 @@ LL |     demo4!("foo"###);
    |
    = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
    = note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
-help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
+help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
    |
 LL |     demo4!("foo"## #);
    |                   +
@@ -276,7 +276,7 @@ help: insert whitespace here to avoid this being parsed as a guarded string in R
 LL |     demo5!(## "foo"##);
    |              +
 
-warning: will be parsed as a guarded string in Rust 2024
+warning: reserved token in Rust 2024
   --> $DIR/reserved-guarded-strings-migration.rs:92:19
    |
 LL |     demo5!(##"foo"##);
@@ -284,7 +284,7 @@ LL |     demo5!(##"foo"##);
    |
    = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
    = note: for more information, see issue #123735 <https://github.com/rust-lang/rust/issues/123735>
-help: insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
+help: insert whitespace here to avoid this being parsed as a forbidden token in Rust 2024
    |
 LL |     demo5!(##"foo"# #);
    |                    +
diff --git a/tests/ui/rust-2024/reserved-guarded-strings.rs b/tests/ui/rust-2024/reserved-guarded-strings.rs
index 878881c1d24..ae68d34cb86 100644
--- a/tests/ui/rust-2024/reserved-guarded-strings.rs
+++ b/tests/ui/rust-2024/reserved-guarded-strings.rs
@@ -46,13 +46,13 @@ fn main() {
     //~^ ERROR prefix `blah` is unknown
     //~| ERROR invalid string literal
 
-    demo2!(## "foo"); //~ ERROR invalid string literal
-    demo3!("foo"###); //~ ERROR invalid string literal
-    demo3!(### "foo"); //~ ERROR invalid string literal
-    demo3!(## "foo"#); //~ ERROR invalid string literal
+    demo2!(## "foo"); //~ reserved multi-hash token is forbidden
+    demo3!("foo"###); //~ reserved multi-hash token is forbidden
+    demo3!(### "foo"); //~ reserved multi-hash token is forbidden
+    demo3!(## "foo"#); //~ reserved multi-hash token is forbidden
     demo5!(### "foo"###);
-    //~^ ERROR invalid string literal
-    //~| ERROR invalid string literal
+    //~^ reserved multi-hash token is forbidden
+    //~| reserved multi-hash token is forbidden
 
     demo1!(#""); //~ ERROR invalid string literal
     demo1!(#""#); //~ ERROR invalid string literal
@@ -65,7 +65,7 @@ fn main() {
     demo1!(###"foo"###); //~ ERROR invalid string literal
     demo2!(#"foo"###);
     //~^ ERROR invalid string literal
-    //~| ERROR invalid string literal
+    //~| ERROR reserved multi-hash token is forbidden
 
     // More than 255 hashes
     demon!(####################################################################################################################################################################################################################################################################"foo");
diff --git a/tests/ui/rust-2024/reserved-guarded-strings.stderr b/tests/ui/rust-2024/reserved-guarded-strings.stderr
index c8f8557b0f4..0f3b06147c4 100644
--- a/tests/ui/rust-2024/reserved-guarded-strings.stderr
+++ b/tests/ui/rust-2024/reserved-guarded-strings.stderr
@@ -34,73 +34,73 @@ help: consider inserting whitespace here
 LL |     demo2!(blah# "xx"#);
    |                 +
 
-error: invalid string literal
+error: reserved multi-hash token is forbidden
   --> $DIR/reserved-guarded-strings.rs:49:12
    |
 LL |     demo2!(## "foo");
    |            ^^
    |
-   = note: unprefixed guarded string literals are reserved for future use since Rust 2024
+   = note: sequences of two or more # are reserved for future use since Rust 2024
 help: consider inserting whitespace here
    |
 LL |     demo2!(# # "foo");
    |             +
 
-error: invalid string literal
+error: reserved multi-hash token is forbidden
   --> $DIR/reserved-guarded-strings.rs:50:17
    |
 LL |     demo3!("foo"###);
    |                 ^^
    |
-   = note: unprefixed guarded string literals are reserved for future use since Rust 2024
+   = note: sequences of two or more # are reserved for future use since Rust 2024
 help: consider inserting whitespace here
    |
 LL |     demo3!("foo"# ##);
    |                  +
 
-error: invalid string literal
+error: reserved multi-hash token is forbidden
   --> $DIR/reserved-guarded-strings.rs:51:12
    |
 LL |     demo3!(### "foo");
    |            ^^
    |
-   = note: unprefixed guarded string literals are reserved for future use since Rust 2024
+   = note: sequences of two or more # are reserved for future use since Rust 2024
 help: consider inserting whitespace here
    |
 LL |     demo3!(# ## "foo");
    |             +
 
-error: invalid string literal
+error: reserved multi-hash token is forbidden
   --> $DIR/reserved-guarded-strings.rs:52:12
    |
 LL |     demo3!(## "foo"#);
    |            ^^
    |
-   = note: unprefixed guarded string literals are reserved for future use since Rust 2024
+   = note: sequences of two or more # are reserved for future use since Rust 2024
 help: consider inserting whitespace here
    |
 LL |     demo3!(# # "foo"#);
    |             +
 
-error: invalid string literal
+error: reserved multi-hash token is forbidden
   --> $DIR/reserved-guarded-strings.rs:53:12
    |
 LL |     demo5!(### "foo"###);
    |            ^^
    |
-   = note: unprefixed guarded string literals are reserved for future use since Rust 2024
+   = note: sequences of two or more # are reserved for future use since Rust 2024
 help: consider inserting whitespace here
    |
 LL |     demo5!(# ## "foo"###);
    |             +
 
-error: invalid string literal
+error: reserved multi-hash token is forbidden
   --> $DIR/reserved-guarded-strings.rs:53:21
    |
 LL |     demo5!(### "foo"###);
    |                     ^^
    |
-   = note: unprefixed guarded string literals are reserved for future use since Rust 2024
+   = note: sequences of two or more # are reserved for future use since Rust 2024
 help: consider inserting whitespace here
    |
 LL |     demo5!(### "foo"# ##);
@@ -226,13 +226,13 @@ help: consider inserting whitespace here
 LL |     demo2!(# "foo"###);
    |             +
 
-error: invalid string literal
+error: reserved multi-hash token is forbidden
   --> $DIR/reserved-guarded-strings.rs:66:19
    |
 LL |     demo2!(#"foo"###);
    |                   ^^
    |
-   = note: unprefixed guarded string literals are reserved for future use since Rust 2024
+   = note: sequences of two or more # are reserved for future use since Rust 2024
 help: consider inserting whitespace here
    |
 LL |     demo2!(#"foo"## #);