about summary refs log tree commit diff
path: root/tests/ui/cfg
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-07-28 08:36:51 +0200
committerGitHub <noreply@github.com>2025-07-28 08:36:51 +0200
commita08ced3856e297b9576a2ec697c5bcb8983a24c4 (patch)
treed2bd04fa247bb98edf7006943d56263598bf4cbc /tests/ui/cfg
parenta9f58bff03969533800491c24b4f538b6b53c609 (diff)
parente9959aa74e23eb340d6c9e9a4eab807be03b028f (diff)
downloadrust-a08ced3856e297b9576a2ec697c5bcb8983a24c4.tar.gz
rust-a08ced3856e297b9576a2ec697c5bcb8983a24c4.zip
Rollup merge of #144151 - Kivooeo:issue1, r=jieyouxu
`tests/ui/issues/`: The Issues Strike Back [1/N]

I believe I’ve finally brought [my program](https://github.com/Kivooeo/test-manager) to life -- it now handles multiple test moves in one go: plain moves first, then a gentle touch on each file depends on given options. The process should be much smoother now.

Of course, I won’t rush through everything in a few days -- that would be unkind to `@Oneirical.` I’ll pace myself. And also I can't have more than one such PR because `issues.txt` will conflict with previous parts after merging them which is not fun as well.

This PR is just that: first commit - moves; second - regression comments and the occasional .stderr reblesses, also issue.txt and tidy changes. Nothing special, but progress nonetheless. This is for the purpose of preserving test file history during restructuring

Part of https://github.com/rust-lang/rust/issues/133895.

r? `@jieyouxu`
Diffstat (limited to 'tests/ui/cfg')
-rw-r--r--tests/ui/cfg/conditional-compilation-struct-11085.rs46
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/ui/cfg/conditional-compilation-struct-11085.rs b/tests/ui/cfg/conditional-compilation-struct-11085.rs
new file mode 100644
index 00000000000..cd6dded54d3
--- /dev/null
+++ b/tests/ui/cfg/conditional-compilation-struct-11085.rs
@@ -0,0 +1,46 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/11085
+
+//@ run-pass
+
+#![allow(dead_code)]
+
+struct Foo {
+    #[cfg(false)]
+    bar: baz,
+    foo: isize,
+}
+
+struct Foo2 {
+    #[cfg(all())]
+    foo: isize,
+}
+
+enum Bar1 {
+    Bar1_1,
+    #[cfg(false)]
+    Bar1_2(NotAType),
+}
+
+enum Bar2 {
+    #[cfg(false)]
+    Bar2_1(NotAType),
+}
+
+enum Bar3 {
+    Bar3_1 {
+        #[cfg(false)]
+        foo: isize,
+        bar: isize,
+    }
+}
+
+pub fn main() {
+    let _f = Foo { foo: 3 };
+    let _f = Foo2 { foo: 3 };
+
+    match Bar1::Bar1_1 {
+        Bar1::Bar1_1 => {}
+    }
+
+    let _f = Bar3::Bar3_1 { bar: 3 };
+}