about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2025-06-10 16:54:51 +0200
committerGitHub <noreply@github.com>2025-06-10 16:54:51 +0200
commit407b81caf4ce4b02d065886308cf85b4722795c4 (patch)
treec79acdebed883bffd898bd944a48af98d1d1e19d /tests
parente8be230f1ff21e00d54dd45f4f3119ca35ec2196 (diff)
parent9b0ad97287c877c992ff15307adcb20c3583cbfb (diff)
downloadrust-407b81caf4ce4b02d065886308cf85b4722795c4.tar.gz
rust-407b81caf4ce4b02d065886308cf85b4722795c4.zip
Rollup merge of #142240 - fee1-dead-contrib:push-zkkzoxlymslv, r=oli-obk
deduplicate the rest of AST walker functions

After this, we can tidy things up and deduplicate the visitor traits themselves too.

Fixes rust-lang/rust#139825, apparently

r? ``@oli-obk``
Diffstat (limited to 'tests')
-rw-r--r--tests/crashes/139825.rs5
-rw-r--r--tests/ui/check-cfg/hrtb-crash.rs7
-rw-r--r--tests/ui/check-cfg/hrtb-crash.stderr13
3 files changed, 20 insertions, 5 deletions
diff --git a/tests/crashes/139825.rs b/tests/crashes/139825.rs
deleted file mode 100644
index 8c5b6b80f0b..00000000000
--- a/tests/crashes/139825.rs
+++ /dev/null
@@ -1,5 +0,0 @@
-//@ known-bug: #139825
-//@compile-flags: --check-cfg=cfg(docsrs,test) --crate-type lib
-struct a
-where
-    for<#[cfg(b)] c> u8:;
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
+