about summary refs log tree commit diff
path: root/tests/ui/macros
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2024-09-18 17:44:32 +0200
committerUrgau <urgau@numericable.fr>2024-10-01 10:01:09 +0200
commit57b9b1f9745a56943cc0aebc4c3ec487945f044e (patch)
tree54688059c287db2d7f2a33ed6205fe9b3673ab4d /tests/ui/macros
parentc3ce4e66a5732a5b89c9f495b44357bf6b29d424 (diff)
downloadrust-57b9b1f9745a56943cc0aebc4c3ec487945f044e.tar.gz
rust-57b9b1f9745a56943cc0aebc4c3ec487945f044e.zip
Use `ast::NestedMetaItem` when evaluating cfg predicate
Diffstat (limited to 'tests/ui/macros')
-rw-r--r--tests/ui/macros/cfg.rs2
-rw-r--r--tests/ui/macros/cfg.stderr4
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/ui/macros/cfg.rs b/tests/ui/macros/cfg.rs
index 2aac50a9d01..387cc0ba8e2 100644
--- a/tests/ui/macros/cfg.rs
+++ b/tests/ui/macros/cfg.rs
@@ -1,6 +1,6 @@
 fn main() {
     cfg!(); //~ ERROR macro requires a cfg-pattern
-    cfg!(123); //~ ERROR expected identifier
+    cfg!(123); //~ ERROR unsupported literal
     cfg!(foo = 123); //~ ERROR literal in `cfg` predicate value must be a string
     cfg!(foo, bar); //~ ERROR expected 1 cfg-pattern
 }
diff --git a/tests/ui/macros/cfg.stderr b/tests/ui/macros/cfg.stderr
index 2633d5f720d..5c21497dc5d 100644
--- a/tests/ui/macros/cfg.stderr
+++ b/tests/ui/macros/cfg.stderr
@@ -6,11 +6,11 @@ LL |     cfg!();
    |
    = note: this error originates in the macro `cfg` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error: expected identifier, found `123`
+error[E0565]: unsupported literal
   --> $DIR/cfg.rs:3:10
    |
 LL |     cfg!(123);
-   |          ^^^ expected identifier
+   |          ^^^
 
 error[E0565]: literal in `cfg` predicate value must be a string
   --> $DIR/cfg.rs:4:16