From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../two-phase-control-flow-split-before-activation.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/ui/borrowck/two-phase-control-flow-split-before-activation.rs (limited to 'tests/ui/borrowck/two-phase-control-flow-split-before-activation.rs') diff --git a/tests/ui/borrowck/two-phase-control-flow-split-before-activation.rs b/tests/ui/borrowck/two-phase-control-flow-split-before-activation.rs new file mode 100644 index 000000000..0b20e1945 --- /dev/null +++ b/tests/ui/borrowck/two-phase-control-flow-split-before-activation.rs @@ -0,0 +1,15 @@ +// run-pass + +fn main() { + let mut a = 0; + let mut b = 0; + let p = if maybe() { + &mut a + } else { + &mut b + }; + use_(p); +} + +fn maybe() -> bool { false } +fn use_(_: T) { } -- cgit v1.2.3