summaryrefslogtreecommitdiffstats
path: root/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs
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 /src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs
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 'src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs')
-rw-r--r--src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs51
1 files changed, 0 insertions, 51 deletions
diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs
deleted file mode 100644
index 8f090fe88..000000000
--- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs
+++ /dev/null
@@ -1,51 +0,0 @@
-#![feature(never_type)]
-
-#[non_exhaustive]
-pub enum UninhabitedEnum {
-}
-
-#[non_exhaustive]
-pub struct UninhabitedStruct {
- _priv: !,
-}
-
-#[non_exhaustive]
-pub struct UninhabitedTupleStruct(!);
-
-pub enum UninhabitedVariants {
- #[non_exhaustive] Tuple(!),
- #[non_exhaustive] Struct { x: ! }
-}
-
-pub struct IndirectUninhabitedEnum(UninhabitedEnum);
-
-pub struct IndirectUninhabitedStruct(UninhabitedStruct);
-
-pub struct IndirectUninhabitedTupleStruct(UninhabitedTupleStruct);
-
-pub struct IndirectUninhabitedVariants(UninhabitedVariants);
-
-struct A;
-
-// This test checks that an empty match on a non-exhaustive uninhabited type through a level of
-// indirection from the defining crate will not compile without `#![feature(exhaustive_patterns)]`.
-
-fn cannot_empty_match_on_empty_enum_to_anything(x: IndirectUninhabitedEnum) -> A {
- match x {} //~ ERROR non-exhaustive patterns
-}
-
-fn cannot_empty_match_on_empty_struct_to_anything(x: IndirectUninhabitedStruct) -> A {
- match x {} //~ ERROR non-exhaustive patterns
-}
-
-fn cannot_empty_match_on_empty_tuple_struct_to_anything(x: IndirectUninhabitedTupleStruct) -> A {
- match x {} //~ ERROR non-exhaustive patterns
-}
-
-fn cannot_empty_match_on_enum_with_empty_variants_struct_to_anything(
- x: IndirectUninhabitedVariants,
-) -> A {
- match x {} //~ ERROR non-exhaustive patterns
-}
-
-fn main() {}