summaryrefslogtreecommitdiffstats
path: root/tests/ui/pattern/usefulness/auxiliary
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/ui/pattern/usefulness/auxiliary
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/pattern/usefulness/auxiliary')
-rw-r--r--tests/ui/pattern/usefulness/auxiliary/empty.rs10
-rw-r--r--tests/ui/pattern/usefulness/auxiliary/hidden.rs14
-rw-r--r--tests/ui/pattern/usefulness/auxiliary/unstable.rs23
3 files changed, 47 insertions, 0 deletions
diff --git a/tests/ui/pattern/usefulness/auxiliary/empty.rs b/tests/ui/pattern/usefulness/auxiliary/empty.rs
new file mode 100644
index 000000000..29a03c9e8
--- /dev/null
+++ b/tests/ui/pattern/usefulness/auxiliary/empty.rs
@@ -0,0 +1,10 @@
+#![crate_type = "rlib"]
+pub enum EmptyForeignEnum {}
+
+pub struct VisiblyUninhabitedForeignStruct {
+ pub field: EmptyForeignEnum,
+}
+
+pub struct SecretlyUninhabitedForeignStruct {
+ _priv: EmptyForeignEnum,
+}
diff --git a/tests/ui/pattern/usefulness/auxiliary/hidden.rs b/tests/ui/pattern/usefulness/auxiliary/hidden.rs
new file mode 100644
index 000000000..364514ba1
--- /dev/null
+++ b/tests/ui/pattern/usefulness/auxiliary/hidden.rs
@@ -0,0 +1,14 @@
+pub enum HiddenEnum {
+ A,
+ B,
+ #[doc(hidden)]
+ C,
+}
+
+#[derive(Default)]
+pub struct HiddenStruct {
+ pub one: u8,
+ pub two: bool,
+ #[doc(hidden)]
+ pub hide: usize,
+}
diff --git a/tests/ui/pattern/usefulness/auxiliary/unstable.rs b/tests/ui/pattern/usefulness/auxiliary/unstable.rs
new file mode 100644
index 000000000..a06b3a6e4
--- /dev/null
+++ b/tests/ui/pattern/usefulness/auxiliary/unstable.rs
@@ -0,0 +1,23 @@
+#![feature(staged_api)]
+#![stable(feature = "stable_test_feature", since = "1.0.0")]
+
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
+pub enum UnstableEnum {
+ #[stable(feature = "stable_test_feature", since = "1.0.0")]
+ Stable,
+ #[stable(feature = "stable_test_feature", since = "1.0.0")]
+ Stable2,
+ #[unstable(feature = "unstable_test_feature", issue = "none")]
+ Unstable,
+}
+
+#[derive(Default)]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
+pub struct UnstableStruct {
+ #[stable(feature = "stable_test_feature", since = "1.0.0")]
+ pub stable: bool,
+ #[stable(feature = "stable_test_feature", since = "1.0.0")]
+ pub stable2: usize,
+ #[unstable(feature = "unstable_test_feature", issue = "none")]
+ pub unstable: u8,
+}