summaryrefslogtreecommitdiffstats
path: root/tests/ui/rfc-2008-non-exhaustive/borrowck-exhaustive.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/rfc-2008-non-exhaustive/borrowck-exhaustive.rs')
-rw-r--r--tests/ui/rfc-2008-non-exhaustive/borrowck-exhaustive.rs44
1 files changed, 0 insertions, 44 deletions
diff --git a/tests/ui/rfc-2008-non-exhaustive/borrowck-exhaustive.rs b/tests/ui/rfc-2008-non-exhaustive/borrowck-exhaustive.rs
deleted file mode 100644
index b9ff24c76..000000000
--- a/tests/ui/rfc-2008-non-exhaustive/borrowck-exhaustive.rs
+++ /dev/null
@@ -1,44 +0,0 @@
-// Test that the borrow checker doesn't consider checking an exhaustive pattern
-// as an access.
-
-// check-pass
-
-#![allow(dropping_references)]
-
-// aux-build:monovariants.rs
-extern crate monovariants;
-
-use monovariants::ExhaustiveMonovariant;
-
-enum Local {
- Variant(u32),
-}
-
-#[non_exhaustive]
-enum LocalNonExhaustive {
- Variant(u32),
-}
-
-fn main() {
- let mut x = ExhaustiveMonovariant::Variant(1);
- let y = &mut x;
- match x {
- ExhaustiveMonovariant::Variant(_) => {},
- _ => {},
- }
- drop(y);
- let mut x = Local::Variant(1);
- let y = &mut x;
- match x {
- Local::Variant(_) => {},
- _ => {},
- }
- drop(y);
- let mut x = LocalNonExhaustive::Variant(1);
- let y = &mut x;
- match x {
- LocalNonExhaustive::Variant(_) => {},
- _ => {},
- }
- drop(y);
-}