diff options
Diffstat (limited to 'tests/ui/pattern/usefulness/auxiliary')
-rw-r--r-- | tests/ui/pattern/usefulness/auxiliary/empty.rs | 10 | ||||
-rw-r--r-- | tests/ui/pattern/usefulness/auxiliary/hidden.rs | 14 | ||||
-rw-r--r-- | tests/ui/pattern/usefulness/auxiliary/unstable.rs | 23 |
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, +} |