diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
commit | 218caa410aa38c29984be31a5229b9fa717560ee (patch) | |
tree | c54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/rfc-2008-non-exhaustive/borrowck-exhaustive.rs | |
parent | Releasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-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/borrowck-exhaustive.rs')
-rw-r--r-- | src/test/ui/rfc-2008-non-exhaustive/borrowck-exhaustive.rs | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/test/ui/rfc-2008-non-exhaustive/borrowck-exhaustive.rs b/src/test/ui/rfc-2008-non-exhaustive/borrowck-exhaustive.rs deleted file mode 100644 index be775b37f..000000000 --- a/src/test/ui/rfc-2008-non-exhaustive/borrowck-exhaustive.rs +++ /dev/null @@ -1,42 +0,0 @@ -// Test that the borrow checker doesn't consider checking an exhaustive pattern -// as an access. - -// check-pass - -// 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); -} |