about summary refs log tree commit diff
path: root/tests/ui
diff options
context:
space:
mode:
authorDeadbeef <ent3rm4n@gmail.com>2025-06-09 19:28:11 +0800
committerDeadbeef <ent3rm4n@gmail.com>2025-06-09 21:59:20 +0800
commit9b0ad97287c877c992ff15307adcb20c3583cbfb (patch)
tree817721159b7dae0aa97b224efed418d716ee8812 /tests/ui
parent334ba812755b974ecc46713fcdd38836b6182746 (diff)
downloadrust-9b0ad97287c877c992ff15307adcb20c3583cbfb.tar.gz
rust-9b0ad97287c877c992ff15307adcb20c3583cbfb.zip
deduplicate the rest of AST walker functions
Diffstat (limited to 'tests/ui')
-rw-r--r--tests/ui/check-cfg/hrtb-crash.rs7
-rw-r--r--tests/ui/check-cfg/hrtb-crash.stderr13
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/check-cfg/hrtb-crash.rs b/tests/ui/check-cfg/hrtb-crash.rs
new file mode 100644
index 00000000000..f2bce33f9f9
--- /dev/null
+++ b/tests/ui/check-cfg/hrtb-crash.rs
@@ -0,0 +1,7 @@
+// https://github.com/rust-lang/rust/issues/139825
+//@ compile-flags: --check-cfg=cfg(docsrs,test) --crate-type lib
+//@ check-pass
+struct A
+where
+    for<#[cfg(b)] c> u8:;
+//~^ WARN: unexpected `cfg` condition name
diff --git a/tests/ui/check-cfg/hrtb-crash.stderr b/tests/ui/check-cfg/hrtb-crash.stderr
new file mode 100644
index 00000000000..431cf9cf53e
--- /dev/null
+++ b/tests/ui/check-cfg/hrtb-crash.stderr
@@ -0,0 +1,13 @@
+warning: unexpected `cfg` condition name: `b`
+  --> $DIR/hrtb-crash.rs:6:15
+   |
+LL |     for<#[cfg(b)] c> u8:;
+   |               ^ help: found config with similar value: `target_feature = "b"`
+   |
+   = help: expected names are: `FALSE`, `docsrs`, and `test` and 31 more
+   = help: to expect this configuration use `--check-cfg=cfg(b)`
+   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
+   = note: `#[warn(unexpected_cfgs)]` on by default
+
+warning: 1 warning emitted
+