new fix method and update tests
This commit is contained in:
parent
9088807dd3
commit
6bdce7bedd
16 changed files with 143 additions and 135 deletions
|
@ -44,6 +44,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||||
candidate: &mut Candidate<'pat, 'tcx>,
|
candidate: &mut Candidate<'pat, 'tcx>,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
// repeatedly simplify match pairs until fixed point is reached
|
// repeatedly simplify match pairs until fixed point is reached
|
||||||
|
debug!("simplify_candidate(candidate={:?})", candidate);
|
||||||
|
let mut new_bindings = Vec::new();
|
||||||
loop {
|
loop {
|
||||||
let match_pairs = mem::take(&mut candidate.match_pairs);
|
let match_pairs = mem::take(&mut candidate.match_pairs);
|
||||||
|
|
||||||
|
@ -56,7 +58,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||||
|
|
||||||
let mut changed = false;
|
let mut changed = false;
|
||||||
for match_pair in match_pairs {
|
for match_pair in match_pairs {
|
||||||
match self.simplify_match_pair(match_pair, candidate) {
|
match self.simplify_match_pair(match_pair, candidate, &mut new_bindings) {
|
||||||
Ok(()) => {
|
Ok(()) => {
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
@ -65,6 +67,23 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// issue #69971: the binding order should be right to left if there are more
|
||||||
|
// bindings after `@` to please the borrow checker
|
||||||
|
// Ex
|
||||||
|
// struct NonCopyStruct {
|
||||||
|
// copy_field: u32,
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// fn foo1(x: NonCopyStruct) {
|
||||||
|
// let y @ NonCopyStruct { copy_field: z } = x;
|
||||||
|
// // the above should turn into
|
||||||
|
// let z = x.copy_field;
|
||||||
|
// let y = x;
|
||||||
|
// }
|
||||||
|
new_bindings.extend_from_slice(&candidate.bindings);
|
||||||
|
mem::swap(&mut candidate.bindings, &mut new_bindings);
|
||||||
|
new_bindings.clear();
|
||||||
|
|
||||||
if !changed {
|
if !changed {
|
||||||
// Move or-patterns to the end, because they can result in us
|
// Move or-patterns to the end, because they can result in us
|
||||||
// creating additional candidates, so we want to test them as
|
// creating additional candidates, so we want to test them as
|
||||||
|
@ -72,6 +91,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||||
candidate
|
candidate
|
||||||
.match_pairs
|
.match_pairs
|
||||||
.sort_by_key(|pair| matches!(*pair.pattern.kind, PatKind::Or { .. }));
|
.sort_by_key(|pair| matches!(*pair.pattern.kind, PatKind::Or { .. }));
|
||||||
|
debug!("simplify_candidate: simplifed {:?}", candidate);
|
||||||
return false; // if we were not able to simplify any, done.
|
return false; // if we were not able to simplify any, done.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -104,6 +124,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||||
&mut self,
|
&mut self,
|
||||||
match_pair: MatchPair<'pat, 'tcx>,
|
match_pair: MatchPair<'pat, 'tcx>,
|
||||||
candidate: &mut Candidate<'pat, 'tcx>,
|
candidate: &mut Candidate<'pat, 'tcx>,
|
||||||
|
bindings: &mut Vec<Binding<'tcx>>,
|
||||||
) -> Result<(), MatchPair<'pat, 'tcx>> {
|
) -> Result<(), MatchPair<'pat, 'tcx>> {
|
||||||
let tcx = self.hir.tcx();
|
let tcx = self.hir.tcx();
|
||||||
match *match_pair.pattern.kind {
|
match *match_pair.pattern.kind {
|
||||||
|
@ -131,20 +152,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
PatKind::Binding { name, mutability, mode, var, ty, ref subpattern, is_primary: _ } => {
|
PatKind::Binding { name, mutability, mode, var, ty, ref subpattern, is_primary: _ } => {
|
||||||
// issue #69971: the binding order should be right to left if there are more
|
bindings.push(Binding {
|
||||||
// bindings after `@` to please the borrow checker
|
|
||||||
// Ex
|
|
||||||
// struct NonCopyStruct {
|
|
||||||
// copy_field: u32,
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// fn foo1(x: NonCopyStruct) {
|
|
||||||
// let y @ NonCopyStruct { copy_field: z } = x;
|
|
||||||
// // the above should turn into
|
|
||||||
// let z = x.copy_field;
|
|
||||||
// let y = x;
|
|
||||||
// }
|
|
||||||
candidate.bindings.insert(0, Binding {
|
|
||||||
name,
|
name,
|
||||||
mutability,
|
mutability,
|
||||||
span: match_pair.pattern.span,
|
span: match_pair.pattern.span,
|
||||||
|
|
|
@ -61,10 +61,10 @@ fn match_tuple(_1: (u32, bool, Option<i32>, u32)) -> u32 {
|
||||||
}
|
}
|
||||||
|
|
||||||
bb9: {
|
bb9: {
|
||||||
StorageLive(_8); // scope 0 at $DIR/exponential-or.rs:8:57: 8:78
|
|
||||||
_8 = (_1.3: u32); // scope 0 at $DIR/exponential-or.rs:8:57: 8:78
|
|
||||||
StorageLive(_7); // scope 0 at $DIR/exponential-or.rs:8:10: 8:21
|
StorageLive(_7); // scope 0 at $DIR/exponential-or.rs:8:10: 8:21
|
||||||
_7 = (_1.0: u32); // scope 0 at $DIR/exponential-or.rs:8:10: 8:21
|
_7 = (_1.0: u32); // scope 0 at $DIR/exponential-or.rs:8:10: 8:21
|
||||||
|
StorageLive(_8); // scope 0 at $DIR/exponential-or.rs:8:57: 8:78
|
||||||
|
_8 = (_1.3: u32); // scope 0 at $DIR/exponential-or.rs:8:57: 8:78
|
||||||
StorageLive(_9); // scope 1 at $DIR/exponential-or.rs:8:83: 8:84
|
StorageLive(_9); // scope 1 at $DIR/exponential-or.rs:8:83: 8:84
|
||||||
_9 = _7; // scope 1 at $DIR/exponential-or.rs:8:83: 8:84
|
_9 = _7; // scope 1 at $DIR/exponential-or.rs:8:83: 8:84
|
||||||
StorageLive(_10); // scope 1 at $DIR/exponential-or.rs:8:87: 8:88
|
StorageLive(_10); // scope 1 at $DIR/exponential-or.rs:8:87: 8:88
|
||||||
|
@ -72,8 +72,8 @@ fn match_tuple(_1: (u32, bool, Option<i32>, u32)) -> u32 {
|
||||||
_0 = BitXor(move _9, move _10); // scope 1 at $DIR/exponential-or.rs:8:83: 8:88
|
_0 = BitXor(move _9, move _10); // scope 1 at $DIR/exponential-or.rs:8:83: 8:88
|
||||||
StorageDead(_10); // scope 1 at $DIR/exponential-or.rs:8:87: 8:88
|
StorageDead(_10); // scope 1 at $DIR/exponential-or.rs:8:87: 8:88
|
||||||
StorageDead(_9); // scope 1 at $DIR/exponential-or.rs:8:87: 8:88
|
StorageDead(_9); // scope 1 at $DIR/exponential-or.rs:8:87: 8:88
|
||||||
StorageDead(_7); // scope 0 at $DIR/exponential-or.rs:8:87: 8:88
|
|
||||||
StorageDead(_8); // scope 0 at $DIR/exponential-or.rs:8:87: 8:88
|
StorageDead(_8); // scope 0 at $DIR/exponential-or.rs:8:87: 8:88
|
||||||
|
StorageDead(_7); // scope 0 at $DIR/exponential-or.rs:8:87: 8:88
|
||||||
goto -> bb10; // scope 0 at $DIR/exponential-or.rs:7:5: 10:6
|
goto -> bb10; // scope 0 at $DIR/exponential-or.rs:7:5: 10:6
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,10 +89,10 @@
|
||||||
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
// + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main), const_param_did: None }, [], Some(promoted[1])) }
|
// + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main), const_param_did: None }, [], Some(promoted[1])) }
|
||||||
(_5.1: &i32) = move _6; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
(_5.1: &i32) = move _6; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
StorageLive(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
|
||||||
_8 = (_5.1: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
|
||||||
StorageLive(_7); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
StorageLive(_7); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
_7 = (_5.0: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
_7 = (_5.0: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
|
StorageLive(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
|
_8 = (_5.1: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
StorageLive(_9); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
StorageLive(_9); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
StorageLive(_10); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
StorageLive(_10); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
StorageLive(_11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
StorageLive(_11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
|
@ -106,8 +106,8 @@
|
||||||
|
|
||||||
bb1: {
|
bb1: {
|
||||||
StorageDead(_9); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
StorageDead(_9); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
StorageDead(_7); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
|
||||||
StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
|
StorageDead(_7); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
_0 = const (); // scope 0 at $DIR/issue-73223.rs:1:11: 9:2
|
_0 = const (); // scope 0 at $DIR/issue-73223.rs:1:11: 9:2
|
||||||
StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:9:1: 9:2
|
StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:9:1: 9:2
|
||||||
return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2
|
return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2
|
||||||
|
@ -133,8 +133,8 @@
|
||||||
_19 = &_20; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
_19 = &_20; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
(_17.1: &&i32) = move _19; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
|
(_17.1: &&i32) = move _19; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
|
||||||
StorageDead(_19); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
|
StorageDead(_19); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
|
||||||
_28 = (_17.1: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
|
||||||
_25 = (_17.0: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
_25 = (_17.0: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
|
_28 = (_17.1: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
_24 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
_24 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
// mir::Constant
|
// mir::Constant
|
||||||
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
|
|
|
@ -138,10 +138,10 @@
|
||||||
(_9.1: &i32) = move _11; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
(_9.1: &i32) = move _11; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
StorageDead(_11); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
StorageDead(_11); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
StorageDead(_10); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
StorageDead(_10); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
StorageLive(_14); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
|
||||||
_14 = (_9.1: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
|
||||||
StorageLive(_13); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
StorageLive(_13); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
_13 = (_9.0: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
_13 = (_9.0: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
|
StorageLive(_14); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
|
_14 = (_9.1: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
StorageLive(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
StorageLive(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
StorageLive(_16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
StorageLive(_16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
StorageLive(_17); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
StorageLive(_17); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
|
@ -159,8 +159,8 @@
|
||||||
bb3: {
|
bb3: {
|
||||||
_8 = const (); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
_8 = const (); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
StorageDead(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
StorageDead(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
StorageDead(_13); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
|
||||||
StorageDead(_14); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
StorageDead(_14); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
|
StorageDead(_13); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
StorageDead(_9); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
StorageDead(_9); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
_0 = const (); // scope 0 at $DIR/issue-73223.rs:1:11: 9:2
|
_0 = const (); // scope 0 at $DIR/issue-73223.rs:1:11: 9:2
|
||||||
|
@ -205,10 +205,10 @@
|
||||||
(_31.1: &&i32) = move _34; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
|
(_31.1: &&i32) = move _34; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
|
||||||
StorageDead(_34); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
|
StorageDead(_34); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
|
||||||
StorageDead(_32); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
|
StorageDead(_32); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
|
||||||
StorageLive(_37); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
|
||||||
_37 = (_31.1: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
|
||||||
StorageLive(_36); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
StorageLive(_36); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
_36 = (_31.0: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
_36 = (_31.0: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
|
StorageLive(_37); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
|
_37 = (_31.1: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
StorageLive(_38); // scope 5 at $SRC_DIR/std/src/macros.rs:LL:COL
|
StorageLive(_38); // scope 5 at $SRC_DIR/std/src/macros.rs:LL:COL
|
||||||
StorageLive(_39); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
StorageLive(_39); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
_39 = _36; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
_39 = _36; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||||
|
@ -284,8 +284,8 @@
|
||||||
_30 = [move _38, move _41]; // scope 5 at $SRC_DIR/std/src/macros.rs:LL:COL
|
_30 = [move _38, move _41]; // scope 5 at $SRC_DIR/std/src/macros.rs:LL:COL
|
||||||
StorageDead(_41); // scope 5 at $SRC_DIR/std/src/macros.rs:LL:COL
|
StorageDead(_41); // scope 5 at $SRC_DIR/std/src/macros.rs:LL:COL
|
||||||
StorageDead(_38); // scope 5 at $SRC_DIR/std/src/macros.rs:LL:COL
|
StorageDead(_38); // scope 5 at $SRC_DIR/std/src/macros.rs:LL:COL
|
||||||
StorageDead(_36); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
|
|
||||||
StorageDead(_37); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
|
StorageDead(_37); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
|
||||||
|
StorageDead(_36); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
|
||||||
_29 = &_30; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
|
_29 = &_30; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
|
||||||
_28 = _29; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
|
_28 = _29; // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
|
||||||
_27 = move _28 as &[std::fmt::ArgumentV1] (Pointer(Unsize)); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
|
_27 = move _28 as &[std::fmt::ArgumentV1] (Pointer(Unsize)); // scope 4 at $SRC_DIR/std/src/macros.rs:LL:COL
|
||||||
|
|
|
@ -78,12 +78,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
bb2: {
|
bb2: {
|
||||||
StorageLive(_15); // scope 1 at $DIR/issue_76432.rs:9:26: 9:32
|
|
||||||
_15 = &(*_2)[2 of 3]; // scope 1 at $DIR/issue_76432.rs:9:26: 9:32
|
|
||||||
StorageLive(_14); // scope 1 at $DIR/issue_76432.rs:9:18: 9:24
|
|
||||||
_14 = &(*_2)[1 of 3]; // scope 1 at $DIR/issue_76432.rs:9:18: 9:24
|
|
||||||
StorageLive(_13); // scope 1 at $DIR/issue_76432.rs:9:10: 9:16
|
StorageLive(_13); // scope 1 at $DIR/issue_76432.rs:9:10: 9:16
|
||||||
_13 = &(*_2)[0 of 3]; // scope 1 at $DIR/issue_76432.rs:9:10: 9:16
|
_13 = &(*_2)[0 of 3]; // scope 1 at $DIR/issue_76432.rs:9:10: 9:16
|
||||||
|
StorageLive(_14); // scope 1 at $DIR/issue_76432.rs:9:18: 9:24
|
||||||
|
_14 = &(*_2)[1 of 3]; // scope 1 at $DIR/issue_76432.rs:9:18: 9:24
|
||||||
|
StorageLive(_15); // scope 1 at $DIR/issue_76432.rs:9:26: 9:32
|
||||||
|
_15 = &(*_2)[2 of 3]; // scope 1 at $DIR/issue_76432.rs:9:26: 9:32
|
||||||
StorageLive(_16); // scope 2 at $DIR/issue_76432.rs:9:38: 9:52
|
StorageLive(_16); // scope 2 at $DIR/issue_76432.rs:9:38: 9:52
|
||||||
StorageLive(_17); // scope 2 at $DIR/issue_76432.rs:9:38: 9:52
|
StorageLive(_17); // scope 2 at $DIR/issue_76432.rs:9:38: 9:52
|
||||||
_17 = &raw const (*_13); // scope 2 at $DIR/issue_76432.rs:9:38: 9:40
|
_17 = &raw const (*_13); // scope 2 at $DIR/issue_76432.rs:9:38: 9:40
|
||||||
|
@ -103,9 +103,9 @@
|
||||||
StorageDead(_18); // scope 2 at $DIR/issue_76432.rs:9:84: 9:85
|
StorageDead(_18); // scope 2 at $DIR/issue_76432.rs:9:84: 9:85
|
||||||
StorageDead(_17); // scope 2 at $DIR/issue_76432.rs:9:84: 9:85
|
StorageDead(_17); // scope 2 at $DIR/issue_76432.rs:9:84: 9:85
|
||||||
StorageDead(_16); // scope 2 at $DIR/issue_76432.rs:9:84: 9:85
|
StorageDead(_16); // scope 2 at $DIR/issue_76432.rs:9:84: 9:85
|
||||||
StorageDead(_13); // scope 1 at $DIR/issue_76432.rs:9:84: 9:85
|
|
||||||
StorageDead(_14); // scope 1 at $DIR/issue_76432.rs:9:84: 9:85
|
|
||||||
StorageDead(_15); // scope 1 at $DIR/issue_76432.rs:9:84: 9:85
|
StorageDead(_15); // scope 1 at $DIR/issue_76432.rs:9:84: 9:85
|
||||||
|
StorageDead(_14); // scope 1 at $DIR/issue_76432.rs:9:84: 9:85
|
||||||
|
StorageDead(_13); // scope 1 at $DIR/issue_76432.rs:9:84: 9:85
|
||||||
StorageDead(_9); // scope 1 at $DIR/issue_76432.rs:11:6: 11:7
|
StorageDead(_9); // scope 1 at $DIR/issue_76432.rs:11:6: 11:7
|
||||||
_0 = const (); // scope 0 at $DIR/issue_76432.rs:6:44: 12:2
|
_0 = const (); // scope 0 at $DIR/issue_76432.rs:6:44: 12:2
|
||||||
StorageDead(_5); // scope 0 at $DIR/issue_76432.rs:12:1: 12:2
|
StorageDead(_5); // scope 0 at $DIR/issue_76432.rs:12:1: 12:2
|
||||||
|
|
|
@ -59,10 +59,10 @@
|
||||||
- }
|
- }
|
||||||
-
|
-
|
||||||
- bb6: {
|
- bb6: {
|
||||||
StorageLive(_16); // scope 0 at $DIR/match-arm-scopes.rs:16:35: 16:36
|
|
||||||
_16 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:16:35: 16:36
|
|
||||||
StorageLive(_15); // scope 0 at $DIR/match-arm-scopes.rs:16:32: 16:33
|
StorageLive(_15); // scope 0 at $DIR/match-arm-scopes.rs:16:32: 16:33
|
||||||
_15 = (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:16:32: 16:33
|
_15 = (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:16:32: 16:33
|
||||||
|
StorageLive(_16); // scope 0 at $DIR/match-arm-scopes.rs:16:35: 16:36
|
||||||
|
_16 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:16:35: 16:36
|
||||||
- goto -> bb21; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
- goto -> bb21; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
||||||
+ goto -> bb16; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
+ goto -> bb16; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
||||||
}
|
}
|
||||||
|
@ -70,17 +70,16 @@
|
||||||
- bb7: {
|
- bb7: {
|
||||||
+ bb4: {
|
+ bb4: {
|
||||||
_0 = const 1_i32; // scope 1 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
_0 = const 1_i32; // scope 1 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
||||||
StorageDead(_5); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
|
||||||
- drop(_7) -> [return: bb20, unwind: bb27]; // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
- drop(_7) -> [return: bb20, unwind: bb27]; // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
||||||
+ drop(_7) -> [return: bb15, unwind: bb22]; // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
+ drop(_7) -> [return: bb15, unwind: bb22]; // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
||||||
}
|
}
|
||||||
|
|
||||||
- bb8: {
|
- bb8: {
|
||||||
+ bb5: {
|
+ bb5: {
|
||||||
StorageLive(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:20: 15:21
|
|
||||||
_8 = &(_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:15:20: 15:21
|
|
||||||
StorageLive(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:17: 15:18
|
StorageLive(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:17: 15:18
|
||||||
_6 = &(_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:15:17: 15:18
|
_6 = &(_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:15:17: 15:18
|
||||||
|
StorageLive(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:20: 15:21
|
||||||
|
_8 = &(_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:15:20: 15:21
|
||||||
- _3 = &shallow (_2.0: bool); // scope 0 at $DIR/match-arm-scopes.rs:14:11: 14:16
|
- _3 = &shallow (_2.0: bool); // scope 0 at $DIR/match-arm-scopes.rs:14:11: 14:16
|
||||||
- _4 = &shallow (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:14:11: 14:16
|
- _4 = &shallow (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:14:11: 14:16
|
||||||
StorageLive(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73
|
StorageLive(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73
|
||||||
|
@ -117,12 +116,12 @@
|
||||||
StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
||||||
- FakeRead(ForMatchGuard, _3); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
- FakeRead(ForMatchGuard, _3); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
||||||
- FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
- FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
||||||
- FakeRead(ForGuardBinding, _8); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
|
||||||
- FakeRead(ForGuardBinding, _6); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
- FakeRead(ForGuardBinding, _6); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
||||||
StorageLive(_7); // scope 0 at $DIR/match-arm-scopes.rs:15:20: 15:21
|
- FakeRead(ForGuardBinding, _8); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
||||||
_7 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:15:20: 15:21
|
|
||||||
StorageLive(_5); // scope 0 at $DIR/match-arm-scopes.rs:15:17: 15:18
|
StorageLive(_5); // scope 0 at $DIR/match-arm-scopes.rs:15:17: 15:18
|
||||||
_5 = (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:15:17: 15:18
|
_5 = (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:15:17: 15:18
|
||||||
|
StorageLive(_7); // scope 0 at $DIR/match-arm-scopes.rs:15:20: 15:21
|
||||||
|
_7 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:15:20: 15:21
|
||||||
- goto -> bb7; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
- goto -> bb7; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
||||||
+ goto -> bb4; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
+ goto -> bb4; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
||||||
}
|
}
|
||||||
|
@ -130,18 +129,18 @@
|
||||||
- bb13: {
|
- bb13: {
|
||||||
+ bb9: {
|
+ bb9: {
|
||||||
StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
||||||
StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
|
||||||
StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
||||||
|
StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
||||||
- falseEdge -> [real: bb2, imaginary: bb3]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73
|
- falseEdge -> [real: bb2, imaginary: bb3]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73
|
||||||
+ goto -> bb1; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73
|
+ goto -> bb1; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73
|
||||||
}
|
}
|
||||||
|
|
||||||
- bb14: {
|
- bb14: {
|
||||||
+ bb10: {
|
+ bb10: {
|
||||||
StorageLive(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:36: 15:37
|
|
||||||
_8 = &(_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:15:36: 15:37
|
|
||||||
StorageLive(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:26: 15:27
|
StorageLive(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:26: 15:27
|
||||||
_6 = &(_2.0: bool); // scope 0 at $DIR/match-arm-scopes.rs:15:26: 15:27
|
_6 = &(_2.0: bool); // scope 0 at $DIR/match-arm-scopes.rs:15:26: 15:27
|
||||||
|
StorageLive(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:36: 15:37
|
||||||
|
_8 = &(_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:15:36: 15:37
|
||||||
- _3 = &shallow (_2.0: bool); // scope 0 at $DIR/match-arm-scopes.rs:14:11: 14:16
|
- _3 = &shallow (_2.0: bool); // scope 0 at $DIR/match-arm-scopes.rs:14:11: 14:16
|
||||||
- _4 = &shallow (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:14:11: 14:16
|
- _4 = &shallow (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:14:11: 14:16
|
||||||
StorageLive(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73
|
StorageLive(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73
|
||||||
|
@ -178,12 +177,12 @@
|
||||||
StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
||||||
- FakeRead(ForMatchGuard, _3); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
- FakeRead(ForMatchGuard, _3); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
||||||
- FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
- FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
||||||
- FakeRead(ForGuardBinding, _8); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
|
||||||
- FakeRead(ForGuardBinding, _6); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
- FakeRead(ForGuardBinding, _6); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
||||||
StorageLive(_7); // scope 0 at $DIR/match-arm-scopes.rs:15:36: 15:37
|
- FakeRead(ForGuardBinding, _8); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
|
||||||
_7 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:15:36: 15:37
|
|
||||||
StorageLive(_5); // scope 0 at $DIR/match-arm-scopes.rs:15:26: 15:27
|
StorageLive(_5); // scope 0 at $DIR/match-arm-scopes.rs:15:26: 15:27
|
||||||
_5 = (_2.0: bool); // scope 0 at $DIR/match-arm-scopes.rs:15:26: 15:27
|
_5 = (_2.0: bool); // scope 0 at $DIR/match-arm-scopes.rs:15:26: 15:27
|
||||||
|
StorageLive(_7); // scope 0 at $DIR/match-arm-scopes.rs:15:36: 15:37
|
||||||
|
_7 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:15:36: 15:37
|
||||||
- goto -> bb7; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
- goto -> bb7; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
||||||
+ goto -> bb4; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
+ goto -> bb4; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
||||||
}
|
}
|
||||||
|
@ -191,8 +190,8 @@
|
||||||
- bb19: {
|
- bb19: {
|
||||||
+ bb14: {
|
+ bb14: {
|
||||||
StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
||||||
StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
|
||||||
StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
||||||
|
StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
||||||
- falseEdge -> [real: bb4, imaginary: bb5]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73
|
- falseEdge -> [real: bb4, imaginary: bb5]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73
|
||||||
+ goto -> bb2; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73
|
+ goto -> bb2; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73
|
||||||
}
|
}
|
||||||
|
@ -200,8 +199,9 @@
|
||||||
- bb20: {
|
- bb20: {
|
||||||
+ bb15: {
|
+ bb15: {
|
||||||
StorageDead(_7); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
StorageDead(_7); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
||||||
StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
StorageDead(_5); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
||||||
StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
||||||
|
StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
||||||
- goto -> bb24; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
- goto -> bb24; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
||||||
+ goto -> bb19; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
+ goto -> bb19; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
||||||
}
|
}
|
||||||
|
@ -209,17 +209,16 @@
|
||||||
- bb21: {
|
- bb21: {
|
||||||
+ bb16: {
|
+ bb16: {
|
||||||
_0 = const 2_i32; // scope 2 at $DIR/match-arm-scopes.rs:16:41: 16:42
|
_0 = const 2_i32; // scope 2 at $DIR/match-arm-scopes.rs:16:41: 16:42
|
||||||
StorageDead(_15); // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42
|
|
||||||
- drop(_16) -> [return: bb23, unwind: bb27]; // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42
|
- drop(_16) -> [return: bb23, unwind: bb27]; // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42
|
||||||
+ drop(_16) -> [return: bb18, unwind: bb22]; // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42
|
+ drop(_16) -> [return: bb18, unwind: bb22]; // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42
|
||||||
}
|
}
|
||||||
|
|
||||||
- bb22: {
|
- bb22: {
|
||||||
+ bb17: {
|
+ bb17: {
|
||||||
StorageLive(_16); // scope 0 at $DIR/match-arm-scopes.rs:16:19: 16:20
|
|
||||||
_16 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:16:19: 16:20
|
|
||||||
StorageLive(_15); // scope 0 at $DIR/match-arm-scopes.rs:16:16: 16:17
|
StorageLive(_15); // scope 0 at $DIR/match-arm-scopes.rs:16:16: 16:17
|
||||||
_15 = (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:16:16: 16:17
|
_15 = (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:16:16: 16:17
|
||||||
|
StorageLive(_16); // scope 0 at $DIR/match-arm-scopes.rs:16:19: 16:20
|
||||||
|
_16 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:16:19: 16:20
|
||||||
- goto -> bb21; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
- goto -> bb21; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
||||||
+ goto -> bb16; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
+ goto -> bb16; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
||||||
}
|
}
|
||||||
|
@ -227,6 +226,7 @@
|
||||||
- bb23: {
|
- bb23: {
|
||||||
+ bb18: {
|
+ bb18: {
|
||||||
StorageDead(_16); // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42
|
StorageDead(_16); // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42
|
||||||
|
StorageDead(_15); // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42
|
||||||
- goto -> bb24; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
- goto -> bb24; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
||||||
+ goto -> bb19; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
+ goto -> bb19; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6
|
||||||
}
|
}
|
||||||
|
@ -239,8 +239,8 @@
|
||||||
|
|
||||||
- bb25: {
|
- bb25: {
|
||||||
+ bb20: {
|
+ bb20: {
|
||||||
StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
|
||||||
StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
||||||
|
StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
|
||||||
- drop(_2) -> [return: bb26, unwind: bb28]; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2
|
- drop(_2) -> [return: bb26, unwind: bb28]; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2
|
||||||
+ drop(_2) -> [return: bb21, unwind: bb23]; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2
|
+ drop(_2) -> [return: bb21, unwind: bb23]; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
error[E0507]: cannot move out of `f.1` which is behind a shared reference
|
error[E0507]: cannot move out of `f.0` which is behind a shared reference
|
||||||
--> $DIR/borrowck-move-error-with-note.rs:11:11
|
--> $DIR/borrowck-move-error-with-note.rs:11:11
|
||||||
|
|
|
|
||||||
LL | match *f {
|
LL | match *f {
|
||||||
|
|
|
@ -97,18 +97,6 @@ LL | B::U(D(s)) => (),
|
||||||
| data moved here
|
| data moved here
|
||||||
| move occurs because `s` has type `String`, which does not implement the `Copy` trait
|
| move occurs because `s` has type `String`, which does not implement the `Copy` trait
|
||||||
|
|
||||||
error[E0507]: cannot move out of `*x.1` which is behind a shared reference
|
|
||||||
--> $DIR/move-errors.rs:92:11
|
|
||||||
|
|
|
||||||
LL | match x {
|
|
||||||
| ^
|
|
||||||
...
|
|
||||||
LL | (D(s), &t) => (),
|
|
||||||
| -
|
|
||||||
| |
|
|
||||||
| data moved here
|
|
||||||
| move occurs because `t` has type `String`, which does not implement the `Copy` trait
|
|
||||||
|
|
||||||
error[E0509]: cannot move out of type `D`, which implements the `Drop` trait
|
error[E0509]: cannot move out of type `D`, which implements the `Drop` trait
|
||||||
--> $DIR/move-errors.rs:92:11
|
--> $DIR/move-errors.rs:92:11
|
||||||
|
|
|
|
||||||
|
@ -121,6 +109,18 @@ LL | (D(s), &t) => (),
|
||||||
| data moved here
|
| data moved here
|
||||||
| move occurs because `s` has type `String`, which does not implement the `Copy` trait
|
| move occurs because `s` has type `String`, which does not implement the `Copy` trait
|
||||||
|
|
||||||
|
error[E0507]: cannot move out of `*x.1` which is behind a shared reference
|
||||||
|
--> $DIR/move-errors.rs:92:11
|
||||||
|
|
|
||||||
|
LL | match x {
|
||||||
|
| ^
|
||||||
|
...
|
||||||
|
LL | (D(s), &t) => (),
|
||||||
|
| -
|
||||||
|
| |
|
||||||
|
| data moved here
|
||||||
|
| move occurs because `t` has type `String`, which does not implement the `Copy` trait
|
||||||
|
|
||||||
error[E0509]: cannot move out of type `F`, which implements the `Drop` trait
|
error[E0509]: cannot move out of type `F`, which implements the `Drop` trait
|
||||||
--> $DIR/move-errors.rs:102:11
|
--> $DIR/move-errors.rs:102:11
|
||||||
|
|
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ error[E0382]: use of partially moved value
|
||||||
--> $DIR/borrowck-move-and-move.rs:15:9
|
--> $DIR/borrowck-move-and-move.rs:15:9
|
||||||
|
|
|
|
||||||
LL | let a @ (b, c) = (U, U);
|
LL | let a @ (b, c) = (U, U);
|
||||||
| ^^^^^-^^^^
|
| ^^^^^^^^-^
|
||||||
| | |
|
| | |
|
||||||
| | value partially moved here
|
| | value partially moved here
|
||||||
| value used here after partial move
|
| value used here after partial move
|
||||||
|
@ -22,7 +22,7 @@ error[E0382]: use of partially moved value
|
||||||
--> $DIR/borrowck-move-and-move.rs:17:9
|
--> $DIR/borrowck-move-and-move.rs:17:9
|
||||||
|
|
|
|
||||||
LL | let a @ (b, c) = (u(), u());
|
LL | let a @ (b, c) = (u(), u());
|
||||||
| ^^^^^-^^^^
|
| ^^^^^^^^-^
|
||||||
| | |
|
| | |
|
||||||
| | value partially moved here
|
| | value partially moved here
|
||||||
| value used here after partial move
|
| value used here after partial move
|
||||||
|
@ -63,7 +63,7 @@ error[E0382]: use of partially moved value
|
||||||
--> $DIR/borrowck-move-and-move.rs:27:9
|
--> $DIR/borrowck-move-and-move.rs:27:9
|
||||||
|
|
|
|
||||||
LL | xs @ [a, .., b] => {}
|
LL | xs @ [a, .., b] => {}
|
||||||
| ^^^^^^-^^^^^^^^
|
| ^^^^^^^^^^^^^-^
|
||||||
| | |
|
| | |
|
||||||
| | value partially moved here
|
| | value partially moved here
|
||||||
| value used here after partial move
|
| value used here after partial move
|
||||||
|
|
|
@ -262,7 +262,7 @@ error[E0382]: use of partially moved value
|
||||||
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:26:9
|
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:26:9
|
||||||
|
|
|
|
||||||
LL | let a @ (mut b @ ref mut c, d @ ref e) = (U, U);
|
LL | let a @ (mut b @ ref mut c, d @ ref e) = (U, U);
|
||||||
| ^^^^^-----------------^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^---------^
|
||||||
| | |
|
| | |
|
||||||
| | value partially moved here
|
| | value partially moved here
|
||||||
| value used here after partial move
|
| value used here after partial move
|
||||||
|
@ -273,7 +273,7 @@ error[E0382]: use of partially moved value
|
||||||
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:35:9
|
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:35:9
|
||||||
|
|
|
|
||||||
LL | let a @ (mut b @ ref mut c, d @ ref e) = (u(), u());
|
LL | let a @ (mut b @ ref mut c, d @ ref e) = (u(), u());
|
||||||
| ^^^^^-----------------^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^---------^
|
||||||
| | |
|
| | |
|
||||||
| | value partially moved here
|
| | value partially moved here
|
||||||
| value used here after partial move
|
| value used here after partial move
|
||||||
|
@ -284,7 +284,7 @@ error[E0382]: use of partially moved value
|
||||||
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:49:9
|
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:49:9
|
||||||
|
|
|
|
||||||
LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {}
|
LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {}
|
||||||
| ^^^^^^^^^^-----------------^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------^^
|
||||||
| | |
|
| | |
|
||||||
| | value partially moved here
|
| | value partially moved here
|
||||||
| value used here after partial move
|
| value used here after partial move
|
||||||
|
@ -292,14 +292,14 @@ LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {}
|
||||||
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
|
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
|
||||||
help: borrow this field in the pattern to avoid moving the value
|
help: borrow this field in the pattern to avoid moving the value
|
||||||
|
|
|
|
||||||
LL | a @ Some((ref mut b @ ref mut c, d @ ref e)) => {}
|
LL | a @ Some((mut b @ ref mut c, ref d @ ref e)) => {}
|
||||||
| ^^^
|
| ^^^
|
||||||
|
|
||||||
error[E0382]: use of partially moved value
|
error[E0382]: use of partially moved value
|
||||||
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:67:9
|
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:67:9
|
||||||
|
|
|
|
||||||
LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {}
|
LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {}
|
||||||
| ^^^^^^^^^^-----------------^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------^^
|
||||||
| | |
|
| | |
|
||||||
| | value partially moved here
|
| | value partially moved here
|
||||||
| value used here after partial move
|
| value used here after partial move
|
||||||
|
@ -307,14 +307,14 @@ LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {}
|
||||||
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
|
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
|
||||||
help: borrow this field in the pattern to avoid moving the value
|
help: borrow this field in the pattern to avoid moving the value
|
||||||
|
|
|
|
||||||
LL | a @ Some((ref mut b @ ref mut c, d @ ref e)) => {}
|
LL | a @ Some((mut b @ ref mut c, ref d @ ref e)) => {}
|
||||||
| ^^^
|
| ^^^
|
||||||
|
|
||||||
error[E0382]: use of partially moved value
|
error[E0382]: use of partially moved value
|
||||||
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:16:11
|
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:16:11
|
||||||
|
|
|
|
||||||
LL | fn f2(mut a @ (b @ ref c, mut d @ ref e): (U, U)) {}
|
LL | fn f2(mut a @ (b @ ref c, mut d @ ref e): (U, U)) {}
|
||||||
| ^^^^^^^^^---------^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^-------------^
|
||||||
| | |
|
| | |
|
||||||
| | value partially moved here
|
| | value partially moved here
|
||||||
| value used here after partial move
|
| value used here after partial move
|
||||||
|
|
|
@ -237,7 +237,7 @@ error[E0382]: borrow of partially moved value
|
||||||
--> $DIR/borrowck-pat-by-move-and-ref.rs:32:9
|
--> $DIR/borrowck-pat-by-move-and-ref.rs:32:9
|
||||||
|
|
|
|
||||||
LL | let ref mut a @ [b, mut c] = [U, U];
|
LL | let ref mut a @ [b, mut c] = [U, U];
|
||||||
| ^^^^^^^^^^^^^-^^^^^^^^
|
| ^^^^^^^^^^^^^^^^-----^
|
||||||
| | |
|
| | |
|
||||||
| | value partially moved here
|
| | value partially moved here
|
||||||
| value borrowed here after partial move
|
| value borrowed here after partial move
|
||||||
|
@ -279,7 +279,7 @@ error[E0382]: borrow of partially moved value
|
||||||
--> $DIR/borrowck-pat-by-move-and-ref.rs:44:9
|
--> $DIR/borrowck-pat-by-move-and-ref.rs:44:9
|
||||||
|
|
|
|
||||||
LL | let ref mut a @ [b, mut c] = [u(), u()];
|
LL | let ref mut a @ [b, mut c] = [u(), u()];
|
||||||
| ^^^^^^^^^^^^^-^^^^^^^^
|
| ^^^^^^^^^^^^^^^^-----^
|
||||||
| | |
|
| | |
|
||||||
| | value partially moved here
|
| | value partially moved here
|
||||||
| value borrowed here after partial move
|
| value borrowed here after partial move
|
||||||
|
@ -290,7 +290,7 @@ error[E0382]: borrow of partially moved value
|
||||||
--> $DIR/borrowck-pat-by-move-and-ref.rs:61:9
|
--> $DIR/borrowck-pat-by-move-and-ref.rs:61:9
|
||||||
|
|
|
|
||||||
LL | ref mut a @ Some([b, mut c]) => {}
|
LL | ref mut a @ Some([b, mut c]) => {}
|
||||||
| ^^^^^^^^^^^^^^^^^^-^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^-----^^
|
||||||
| | |
|
| | |
|
||||||
| | value partially moved here
|
| | value partially moved here
|
||||||
| value borrowed here after partial move
|
| value borrowed here after partial move
|
||||||
|
@ -298,7 +298,7 @@ LL | ref mut a @ Some([b, mut c]) => {}
|
||||||
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
|
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
|
||||||
help: borrow this field in the pattern to avoid moving the value
|
help: borrow this field in the pattern to avoid moving the value
|
||||||
|
|
|
|
||||||
LL | ref mut a @ Some([ref b, mut c]) => {}
|
LL | ref mut a @ Some([b, ref mut c]) => {}
|
||||||
| ^^^
|
| ^^^
|
||||||
|
|
||||||
error[E0382]: borrow of partially moved value
|
error[E0382]: borrow of partially moved value
|
||||||
|
@ -350,7 +350,7 @@ error[E0382]: borrow of partially moved value
|
||||||
--> $DIR/borrowck-pat-by-move-and-ref.rs:82:9
|
--> $DIR/borrowck-pat-by-move-and-ref.rs:82:9
|
||||||
|
|
|
|
||||||
LL | ref mut a @ Some([b, mut c]) => {}
|
LL | ref mut a @ Some([b, mut c]) => {}
|
||||||
| ^^^^^^^^^^^^^^^^^^-^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^-----^^
|
||||||
| | |
|
| | |
|
||||||
| | value partially moved here
|
| | value partially moved here
|
||||||
| value borrowed here after partial move
|
| value borrowed here after partial move
|
||||||
|
@ -358,7 +358,7 @@ LL | ref mut a @ Some([b, mut c]) => {}
|
||||||
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
|
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
|
||||||
help: borrow this field in the pattern to avoid moving the value
|
help: borrow this field in the pattern to avoid moving the value
|
||||||
|
|
|
|
||||||
LL | ref mut a @ Some([ref b, mut c]) => {}
|
LL | ref mut a @ Some([b, ref mut c]) => {}
|
||||||
| ^^^
|
| ^^^
|
||||||
|
|
||||||
error[E0382]: borrow of moved value
|
error[E0382]: borrow of moved value
|
||||||
|
@ -397,7 +397,7 @@ error[E0382]: borrow of partially moved value
|
||||||
--> $DIR/borrowck-pat-by-move-and-ref.rs:22:11
|
--> $DIR/borrowck-pat-by-move-and-ref.rs:22:11
|
||||||
|
|
|
|
||||||
LL | fn f3(ref mut a @ [b, mut c]: [U; 2]) {}
|
LL | fn f3(ref mut a @ [b, mut c]: [U; 2]) {}
|
||||||
| ^^^^^^^^^^^^^-^^^^^^^^
|
| ^^^^^^^^^^^^^^^^-----^
|
||||||
| | |
|
| | |
|
||||||
| | value partially moved here
|
| | value partially moved here
|
||||||
| value borrowed here after partial move
|
| value borrowed here after partial move
|
||||||
|
|
|
@ -442,12 +442,12 @@ error[E0502]: cannot borrow value as immutable because it is also borrowed as mu
|
||||||
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:123:9
|
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:123:9
|
||||||
|
|
|
|
||||||
LL | let ref a @ (ref mut b, ref mut c) = (U, U);
|
LL | let ref a @ (ref mut b, ref mut c) = (U, U);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^---------^
|
| ^^^^^^^^^---------^^^^^^^^^^^^
|
||||||
| | |
|
| | |
|
||||||
| | mutable borrow occurs here
|
| | mutable borrow occurs here
|
||||||
| immutable borrow occurs here
|
| immutable borrow occurs here
|
||||||
...
|
...
|
||||||
LL | *c = U;
|
LL | *b = U;
|
||||||
| ------ mutable borrow later used here
|
| ------ mutable borrow later used here
|
||||||
|
|
||||||
error[E0502]: cannot borrow value as immutable because it is also borrowed as mutable
|
error[E0502]: cannot borrow value as immutable because it is also borrowed as mutable
|
||||||
|
@ -466,12 +466,12 @@ error[E0502]: cannot borrow value as immutable because it is also borrowed as mu
|
||||||
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:135:9
|
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:135:9
|
||||||
|
|
|
|
||||||
LL | let ref a @ (ref mut b, ref mut c) = (U, U);
|
LL | let ref a @ (ref mut b, ref mut c) = (U, U);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^---------^
|
| ^^^^^^^^^---------^^^^^^^^^^^^
|
||||||
| | |
|
| | |
|
||||||
| | mutable borrow occurs here
|
| | mutable borrow occurs here
|
||||||
| immutable borrow occurs here
|
| immutable borrow occurs here
|
||||||
...
|
LL |
|
||||||
LL | *c = U;
|
LL | *b = U;
|
||||||
| ------ mutable borrow later used here
|
| ------ mutable borrow later used here
|
||||||
|
|
||||||
error[E0382]: borrow of moved value
|
error[E0382]: borrow of moved value
|
||||||
|
|
|
@ -74,6 +74,6 @@ fn main() {
|
||||||
};
|
};
|
||||||
lam((mk(19), mk(20), mk(21), mk(22)));
|
lam((mk(19), mk(20), mk(21), mk(22)));
|
||||||
}
|
}
|
||||||
let expected = [2, 3, 6, 5, 7, 8, 12, 11, 9, 10, 13, 18, 14, 15, 16, 17, 19, 21, 20, 22, 4, 1];
|
let expected = [2, 3, 6, 5, 7, 8, 12, 11, 9, 10, 18, 13, 14, 15, 16, 17, 21, 19, 20, 22, 4, 1];
|
||||||
assert_eq!(&*d.borrow(), &expected);
|
assert_eq!(&*d.borrow(), &expected);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,9 @@ LL | }
|
||||||
| -
|
| -
|
||||||
| |
|
| |
|
||||||
| `d2` dropped here while still borrowed
|
| `d2` dropped here while still borrowed
|
||||||
| borrow might be used here, when `d2` is dropped and runs the `Drop` code for type `D`
|
| borrow might be used here, when `d1` is dropped and runs the `Drop` code for type `D`
|
||||||
|
|
|
||||||
|
= note: values in a scope are dropped in the opposite order they are defined
|
||||||
|
|
||||||
error[E0597]: `d1` does not live long enough
|
error[E0597]: `d1` does not live long enough
|
||||||
--> $DIR/dropck_direct_cycle_with_drop.rs:38:19
|
--> $DIR/dropck_direct_cycle_with_drop.rs:38:19
|
||||||
|
@ -20,9 +22,7 @@ LL | }
|
||||||
| -
|
| -
|
||||||
| |
|
| |
|
||||||
| `d1` dropped here while still borrowed
|
| `d1` dropped here while still borrowed
|
||||||
| borrow might be used here, when `d2` is dropped and runs the `Drop` code for type `D`
|
| borrow might be used here, when `d1` is dropped and runs the `Drop` code for type `D`
|
||||||
|
|
|
||||||
= note: values in a scope are dropped in the opposite order they are defined
|
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ error[E0597]: `x` does not live long enough
|
||||||
--> $DIR/send-is-not-static-std-sync-2.rs:31:25
|
--> $DIR/send-is-not-static-std-sync-2.rs:31:25
|
||||||
|
|
|
|
||||||
LL | let (_tx, rx) = {
|
LL | let (_tx, rx) = {
|
||||||
| -- borrow later used here
|
| --- borrow later used here
|
||||||
...
|
...
|
||||||
LL | let _ = tx.send(&x);
|
LL | let _ = tx.send(&x);
|
||||||
| ^^ borrowed value does not live long enough
|
| ^^ borrowed value does not live long enough
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue