Fix tests and assertions; add some comments

This commit is contained in:
Nick Cameron 2018-10-11 21:15:18 +13:00
parent 59cb1705d7
commit 63ac2aae51
26 changed files with 274 additions and 187 deletions

View file

@ -95,7 +95,7 @@ pub fn add_type_ascription_to_parameter() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, TypeckTables")]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn add_type_ascription_to_parameter() {
let closure = |x: u32| x + 1u32;

View file

@ -22,7 +22,7 @@ fn main() {
// START rustc.main.SimplifyCfg-qualify-consts.after.mir
// let mut _0: ();
// ...
// let _2: &'10_1rs i32;
// let _2: &'11_1rs i32;
// ...
// let _1: i32;
// ...
@ -31,10 +31,10 @@ fn main() {
// _1 = const 3i32;
// FakeRead(ForLet, _1);
// StorageLive(_2);
// _2 = &'10_1rs _1;
// _2 = &'11_1rs _1;
// FakeRead(ForLet, _2);
// _0 = ();
// EndRegion('10_1rs);
// EndRegion('11_1rs);
// StorageDead(_2);
// StorageDead(_1);
// return;

View file

@ -27,9 +27,9 @@ fn main() {
// START rustc.main.SimplifyCfg-qualify-consts.after.mir
// let mut _0: ();
// ...
// let _7: &'23_3rs bool;
// let _7: &'26_3rs bool;
// ...
// let _3: &'23_1rs bool;
// let _3: &'26_1rs bool;
// ...
// let _2: bool;
// ...
@ -47,7 +47,7 @@ fn main() {
// _2 = const true;
// FakeRead(ForLet, _2);
// StorageLive(_3);
// _3 = &'23_1rs _2;
// _3 = &'26_1rs _2;
// FakeRead(ForLet, _3);
// StorageLive(_5);
// _5 = _2;
@ -59,7 +59,7 @@ fn main() {
// bb4: {
// _0 = ();
// StorageDead(_5);
// EndRegion('23_1rs);
// EndRegion('26_1rs);
// StorageDead(_3);
// StorageDead(_2);
// return;
@ -68,12 +68,12 @@ fn main() {
// _4 = ();
// StorageDead(_5);
// StorageLive(_7);
// _7 = &'23_3rs _2;
// _7 = &'26_3rs _2;
// FakeRead(ForLet, _7);
// _1 = ();
// EndRegion('23_3rs);
// EndRegion('26_3rs);
// StorageDead(_7);
// EndRegion('23_1rs);
// EndRegion('26_1rs);
// StorageDead(_3);
// StorageDead(_2);
// goto -> bb1;

View file

@ -28,9 +28,9 @@ fn main() {
// START rustc.main.SimplifyCfg-qualify-consts.after.mir
// let mut _0: ();
// ...
// let _7: &'26_3rs bool;
// let _7: &'30_3rs bool;
// ...
// let _3: &'26_1rs bool;
// let _3: &'30_1rs bool;
// ...
// let mut _1: bool;
// ...
@ -48,7 +48,7 @@ fn main() {
// bb2: {
// _1 = const true;
// StorageLive(_3);
// _3 = &'26_1rs _1;
// _3 = &'30_1rs _1;
// FakeRead(ForLet, _3);
// StorageLive(_5);
// _5 = _1;
@ -60,7 +60,7 @@ fn main() {
// bb4: {
// _0 = ();
// StorageDead(_5);
// EndRegion('26_1rs);
// EndRegion('30_1rs);
// StorageDead(_3);
// StorageDead(_1);
// return;
@ -69,12 +69,12 @@ fn main() {
// _4 = ();
// StorageDead(_5);
// StorageLive(_7);
// _7 = &'26_3rs _1;
// _7 = &'30_3rs _1;
// FakeRead(ForLet, _7);
// _2 = ();
// EndRegion('26_3rs);
// EndRegion('30_3rs);
// StorageDead(_7);
// EndRegion('26_1rs);
// EndRegion('30_1rs);
// StorageDead(_3);
// goto -> bb1;
// }

View file

@ -32,9 +32,9 @@ fn foo(i: i32) {
// START rustc.main.SimplifyCfg-qualify-consts.after.mir
// let mut _0: ();
// ...
// let _6: &'26_4rs i32;
// let _6: &'31_4rs i32;
// ...
// let _3: &'26_2rs i32;
// let _3: &'31_2rs i32;
// ...
// let _2: i32;
// ...
@ -50,7 +50,7 @@ fn foo(i: i32) {
// _2 = const 0i32;
// FakeRead(ForLet, _2);
// StorageLive(_3);
// _3 = &'26_2rs _2;
// _3 = &'31_2rs _2;
// FakeRead(ForLet, _3);
// StorageLive(_5);
// _5 = (*_3);
@ -62,18 +62,18 @@ fn foo(i: i32) {
// bb2: {
// StorageDead(_5);
// StorageLive(_6);
// _6 = &'26_4rs _2;
// _6 = &'31_4rs _2;
// FakeRead(ForLet, _6);
// _0 = ();
// EndRegion('26_4rs);
// EndRegion('31_4rs);
// StorageDead(_6);
// EndRegion('26_2rs);
// EndRegion('31_2rs);
// StorageDead(_3);
// StorageDead(_2);
// drop(_1) -> [return: bb4, unwind: bb1];
// }
// bb3: {
// EndRegion('26_2rs);
// EndRegion('31_2rs);
// drop(_1) -> bb1;
// }
// bb4: {

View file

@ -33,15 +33,15 @@ fn foo<F>(f: F) where F: FnOnce() -> i32 {
// let _1: D;
// ...
// let mut _2: ();
// let mut _3: [closure@NodeId(28) d:&'14s D];
// let mut _4: &'14s D;
// let mut _3: [closure@NodeId(28) d:&'18s D];
// let mut _4: &'18s D;
// bb0: {
// StorageLive(_1);
// _1 = D::{{constructor}}(const 0i32,);
// FakeRead(ForLet, _1);
// StorageLive(_3);
// StorageLive(_4);
// _4 = &'14s _1;
// _4 = &'18s _1;
// _3 = [closure@NodeId(28)] { d: move _4 };
// StorageDead(_4);
// _2 = const foo(move _3) -> [return: bb2, unwind: bb3];
@ -50,13 +50,13 @@ fn foo<F>(f: F) where F: FnOnce() -> i32 {
// resume;
// }
// bb2: {
// EndRegion('14s);
// EndRegion('18s);
// StorageDead(_3);
// _0 = ();
// drop(_1) -> [return: bb4, unwind: bb1];
// }
// bb3: {
// EndRegion('14s);
// EndRegion('18s);
// drop(_1) -> bb1;
// }
// bb4: {
@ -67,11 +67,11 @@ fn foo<F>(f: F) where F: FnOnce() -> i32 {
// END rustc.main.SimplifyCfg-qualify-consts.after.mir
// START rustc.main-{{closure}}.SimplifyCfg-qualify-consts.after.mir
// fn main::{{closure}}(_1: [closure@NodeId(28) d:&'14s D]) -> i32 {
// fn main::{{closure}}(_1: [closure@NodeId(28) d:&'18s D]) -> i32 {
// let mut _0: i32;
//
// bb0: {
// _0 = ((*(_1.0: &'14s D)).0: i32);
// _0 = ((*(_1.0: &'18s D)).0: i32);
// return;
// }
// END rustc.main-{{closure}}.SimplifyCfg-qualify-consts.after.mir

View file

@ -33,15 +33,15 @@ fn foo<F>(f: F) where F: FnOnce() -> i32 {
// let _1: D;
// ...
// let mut _2: ();
// let mut _3: [closure@NodeId(33) d:&'19s D];
// let mut _4: &'19s D;
// let mut _3: [closure@NodeId(33) d:&'24s D];
// let mut _4: &'24s D;
// bb0: {
// StorageLive(_1);
// _1 = D::{{constructor}}(const 0i32,);
// FakeRead(ForLet, _1);
// StorageLive(_3);
// StorageLive(_4);
// _4 = &'19s _1;
// _4 = &'24s _1;
// _3 = [closure@NodeId(33)] { d: move _4 };
// StorageDead(_4);
// _2 = const foo(move _3) -> [return: bb2, unwind: bb3];
@ -50,13 +50,13 @@ fn foo<F>(f: F) where F: FnOnce() -> i32 {
// resume;
// }
// bb2: {
// EndRegion('19s);
// EndRegion('24s);
// StorageDead(_3);
// _0 = ();
// drop(_1) -> [return: bb4, unwind: bb1];
// }
// bb3: {
// EndRegion('19s);
// EndRegion('24s);
// drop(_1) -> bb1;
// }
// bb4: {
@ -66,17 +66,17 @@ fn foo<F>(f: F) where F: FnOnce() -> i32 {
// END rustc.main.SimplifyCfg-qualify-consts.after.mir
// START rustc.main-{{closure}}.SimplifyCfg-qualify-consts.after.mir
// fn main::{{closure}}(_1: [closure@NodeId(33) d:&'19s D]) -> i32 {
// fn main::{{closure}}(_1: [closure@NodeId(33) d:&'24s D]) -> i32 {
// let mut _0: i32;
// ...
// let _2: &'16_0rs D;
// let _2: &'21_0rs D;
// ...
// bb0: {
// StorageLive(_2);
// _2 = &'16_0rs (*(_1.0: &'19s D));
// _2 = &'21_0rs (*(_1.0: &'24s D));
// FakeRead(ForLet, _2);
// _0 = ((*_2).0: i32);
// EndRegion('16_0rs);
// EndRegion('21_0rs);
// StorageDead(_2);
// return;
// }

View file

@ -70,14 +70,14 @@ fn foo<F>(f: F) where F: FnOnce() -> i32 {
// fn main::{{closure}}(_1: [closure@NodeId(33) d:D]) -> i32 {
// let mut _0: i32;
// ...
// let _2: &'16_0rs D;
// let _2: &'21_0rs D;
// ...
// bb0: {
// StorageLive(_2);
// _2 = &'16_0rs (_1.0: D);
// _2 = &'21_0rs (_1.0: D);
// FakeRead(ForLet, _2);
// _0 = ((*_2).0: i32);
// EndRegion('16_0rs);
// EndRegion('21_0rs);
// StorageDead(_2);
// drop(_1) -> [return: bb2, unwind: bb1];
// }

View file

@ -31,18 +31,18 @@ fn foo<F>(f: F) where F: FnOnce() -> i32 {
// fn main() -> () {
// let mut _0: ();
// ...
// let _2: &'21_1rs D;
// let _2: &'26_1rs D;
// ...
// let _1: D;
// ...
// let mut _3: ();
// let mut _4: [closure@NodeId(33) r:&'19s D];
// let mut _4: [closure@NodeId(33) r:&'24s D];
// bb0: {
// StorageLive(_1);
// _1 = D::{{constructor}}(const 0i32,);
// FakeRead(ForLet, _1);
// StorageLive(_2);
// _2 = &'21_1rs _1;
// _2 = &'26_1rs _1;
// FakeRead(ForLet, _2);
// StorageLive(_4);
// _4 = [closure@NodeId(33)] { r: _2 };
@ -52,16 +52,16 @@ fn foo<F>(f: F) where F: FnOnce() -> i32 {
// resume;
// }
// bb2: {
// EndRegion('19s);
// EndRegion('24s);
// StorageDead(_4);
// _0 = ();
// EndRegion('21_1rs);
// EndRegion('26_1rs);
// StorageDead(_2);
// drop(_1) -> [return: bb4, unwind: bb1];
// }
// bb3: {
// EndRegion('19s);
// EndRegion('21_1rs);
// EndRegion('24s);
// EndRegion('26_1rs);
// drop(_1) -> bb1;
// }
// bb4: {
@ -72,11 +72,11 @@ fn foo<F>(f: F) where F: FnOnce() -> i32 {
// END rustc.main.SimplifyCfg-qualify-consts.after.mir
// START rustc.main-{{closure}}.SimplifyCfg-qualify-consts.after.mir
// fn main::{{closure}}(_1: [closure@NodeId(33) r:&'19s D]) -> i32 {
// fn main::{{closure}}(_1: [closure@NodeId(33) r:&'24s D]) -> i32 {
// let mut _0: i32;
//
// bb0: {
// _0 = ((*(_1.0: &'21_1rs D)).0: i32);
// _0 = ((*(_1.0: &'26_1rs D)).0: i32);
// return;
// }
// }

View file

@ -41,7 +41,7 @@ fn main() {
// fn main() -> () {
// let mut _0: ();
// ...
// let mut _4: &'33_0rs i32;
// let mut _4: &'37_0rs i32;
// ...
// let _2: i32;
// ...
@ -79,14 +79,14 @@ fn main() {
// bb5: {
// _0 = ();
// StorageDead(_7);
// EndRegion('33_0rs);
// EndRegion('37_0rs);
// StorageDead(_4);
// StorageDead(_2);
// StorageDead(_1);
// return;
// }
// bb6: {
// _4 = &'33_0rs _2;
// _4 = &'37_0rs _2;
// _6 = ();
// StorageDead(_7);
// _1 = const true;

View file

@ -45,24 +45,24 @@ fn query() -> bool { true }
// scope 1 {
// }
// scope 2 {
// let _2: S<'36_0rs>;
// let _2: S<'49_0rs>;
// }
// let mut _1: ();
// let mut _3: std::cell::Cell<std::option::Option<&'36_0rs S<'36_0rs>>>;
// let mut _4: std::option::Option<&'36_0rs S<'36_0rs>>;
// let mut _3: std::cell::Cell<std::option::Option<&'49_0rs S<'49_0rs>>>;
// let mut _4: std::option::Option<&'49_0rs S<'49_0rs>>;
// let mut _5: ();
// let mut _6: &'17s std::cell::Cell<std::option::Option<&'36_0rs S<'36_0rs>>>;
// let mut _7: std::option::Option<&'36_0rs S<'36_0rs>>;
// let mut _8: &'36_0rs S<'36_0rs>;
// let mut _9: &'36_0rs S<'36_0rs>;
// let mut _6: &'25s std::cell::Cell<std::option::Option<&'49_0rs S<'49_0rs>>>;
// let mut _7: std::option::Option<&'49_0rs S<'49_0rs>>;
// let mut _8: &'49_0rs S<'49_0rs>;
// let mut _9: &'49_0rs S<'49_0rs>;
// let mut _10: ();
// let mut _11: bool;
// let mut _12: !;
// let mut _13: ();
// let mut _14: &'34s std::cell::Cell<std::option::Option<&'36_0rs S<'36_0rs>>>;
// let mut _15: std::option::Option<&'36_0rs S<'36_0rs>>;
// let mut _16: &'36_0rs S<'36_0rs>;
// let mut _17: &'36_0rs S<'36_0rs>;
// let mut _14: &'47s std::cell::Cell<std::option::Option<&'49_0rs S<'49_0rs>>>;
// let mut _15: std::option::Option<&'49_0rs S<'49_0rs>>;
// let mut _16: &'49_0rs S<'49_0rs>;
// let mut _17: &'49_0rs S<'49_0rs>;
// bb0: {
// goto -> bb1;
// }
@ -73,7 +73,7 @@ fn query() -> bool { true }
// StorageLive(_2);
// StorageLive(_3);
// StorageLive(_4);
// _4 = std::option::Option<&'36_0rs S<'36_0rs>>::None;
// _4 = std::option::Option<&'49_0rs S<'49_0rs>>::None;
// _3 = const <std::cell::Cell<T>>::new(move _4) -> [return: bb4, unwind: bb3];
// }
// bb3: {
@ -81,22 +81,22 @@ fn query() -> bool { true }
// }
// bb4: {
// StorageDead(_4);
// _2 = S<'36_0rs> { r: move _3 };
// _2 = S<'49_0rs> { r: move _3 };
// StorageDead(_3);
// FakeRead(ForLet, _2);
// StorageLive(_6);
// _6 = &'17s (_2.0: std::cell::Cell<std::option::Option<&'36_0rs S<'36_0rs>>>);
// _6 = &'25s (_2.0: std::cell::Cell<std::option::Option<&'49_0rs S<'49_0rs>>>);
// StorageLive(_7);
// StorageLive(_8);
// StorageLive(_9);
// _9 = &'36_0rs _2;
// _8 = &'36_0rs (*_9);
// _7 = std::option::Option<&'36_0rs S<'36_0rs>>::Some(move _8,);
// _9 = &'49_0rs _2;
// _8 = &'49_0rs (*_9);
// _7 = std::option::Option<&'49_0rs S<'49_0rs>>::Some(move _8,);
// StorageDead(_8);
// _5 = const <std::cell::Cell<T>>::set(move _6, move _7) -> [return: bb5, unwind: bb3];
// }
// bb5: {
// EndRegion('17s);
// EndRegion('25s);
// StorageDead(_7);
// StorageDead(_6);
// StorageDead(_9);
@ -109,7 +109,7 @@ fn query() -> bool { true }
// bb7: {
// _0 = ();
// StorageDead(_11);
// EndRegion('36_0rs);
// EndRegion('49_0rs);
// StorageDead(_2);
// return;
// }
@ -117,23 +117,23 @@ fn query() -> bool { true }
// _10 = ();
// StorageDead(_11);
// StorageLive(_14);
// _14 = &'34s (_2.0: std::cell::Cell<std::option::Option<&'36_0rs S<'36_0rs>>>);
// _14 = &'47s (_2.0: std::cell::Cell<std::option::Option<&'49_0rs S<'49_0rs>>>);
// StorageLive(_15);
// StorageLive(_16);
// StorageLive(_17);
// _17 = &'36_0rs _2;
// _16 = &'36_0rs (*_17);
// _15 = std::option::Option<&'36_0rs S<'36_0rs>>::Some(move _16,);
// _17 = &'49_0rs _2;
// _16 = &'49_0rs (*_17);
// _15 = std::option::Option<&'49_0rs S<'49_0rs>>::Some(move _16,);
// StorageDead(_16);
// _13 = const <std::cell::Cell<T>>::set(move _14, move _15) -> [return: bb9, unwind: bb3];
// }
// bb9: {
// EndRegion('34s);
// EndRegion('47s);
// StorageDead(_15);
// StorageDead(_14);
// StorageDead(_17);
// _1 = ();
// EndRegion('36_0rs);
// EndRegion('49_0rs);
// StorageDead(_2);
// goto -> bb1;
// }

View file

@ -41,16 +41,16 @@ unsafe impl<'a, #[may_dangle] 'b> Drop for D1<'a, 'b> {
// Notes on the MIR output below:
//
// 1. The `EndRegion('10s)` is allowed to precede the `drop(_3)`
// 1. The `EndRegion('13s)` is allowed to precede the `drop(_3)`
// solely because of the #[may_dangle] mentioned above.
//
// 2. Regarding the occurrence of `EndRegion('12ds)` *after* `StorageDead(_6)`
// (where we have borrows `&'12ds _6`): Eventually:
// 2. Regarding the occurrence of `EndRegion('15ds)` *after* `StorageDead(_6)`
// (where we have borrows `&'15ds _6`): Eventually:
//
// i. this code should be rejected (by mir-borrowck), or
//
// ii. the MIR code generation should be changed so that the
// EndRegion('12ds)` precedes `StorageDead(_6)` in the
// EndRegion('15ds)` precedes `StorageDead(_6)` in the
// control-flow. (Note: arielb1 views drop+storagedead as one
// unit, and does not see this option as a useful avenue to
// explore.), or
@ -66,13 +66,13 @@ unsafe impl<'a, #[may_dangle] 'b> Drop for D1<'a, 'b> {
// START rustc.main.QualifyAndPromoteConstants.before.mir
// fn main() -> () {
// let mut _0: ();
// let mut _1: &'12ds S1;
// let mut _2: D1<'12ds, '10s>;
// let mut _3: &'12ds S1;
// let mut _4: &'12ds S1;
// let mut _1: &'15ds S1;
// let mut _2: D1<'15ds, '13s>;
// let mut _3: &'15ds S1;
// let mut _4: &'15ds S1;
// let _5: S1;
// let mut _6: &'10s S1;
// let mut _7: &'10s S1;
// let mut _6: &'13s S1;
// let mut _7: &'13s S1;
// let _8: S1;
// bb0: {
// StorageLive(_2);
@ -80,19 +80,19 @@ unsafe impl<'a, #[may_dangle] 'b> Drop for D1<'a, 'b> {
// StorageLive(_4);
// StorageLive(_5);
// _5 = S1::{{constructor}}(const "ex1",);
// _4 = &'12ds _5;
// _3 = &'12ds (*_4);
// _4 = &'15ds _5;
// _3 = &'15ds (*_4);
// StorageLive(_6);
// StorageLive(_7);
// StorageLive(_8);
// _8 = S1::{{constructor}}(const "dang1",);
// _7 = &'10s _8;
// _6 = &'10s (*_7);
// _2 = D1<'12ds, '10s>::{{constructor}}(move _3, move _6);
// EndRegion('10s);
// _7 = &'13s _8;
// _6 = &'13s (*_7);
// _2 = D1<'15ds, '13s>::{{constructor}}(move _3, move _6);
// EndRegion('13s);
// StorageDead(_6);
// StorageDead(_3);
// _1 = (_2.0: &'12ds S1);
// _1 = (_2.0: &'15ds S1);
// drop(_2) -> [return: bb2, unwind: bb1];
// }
// bb1: {
@ -104,7 +104,7 @@ unsafe impl<'a, #[may_dangle] 'b> Drop for D1<'a, 'b> {
// StorageDead(_8);
// StorageDead(_4);
// StorageDead(_5);
// EndRegion('12ds);
// EndRegion('15ds);
// _0 = ();
// return;
// }
@ -114,29 +114,29 @@ unsafe impl<'a, #[may_dangle] 'b> Drop for D1<'a, 'b> {
// START rustc.main.QualifyAndPromoteConstants.after.mir
// fn main() -> (){
// let mut _0: ();
// let mut _1: &'12ds S1;
// let mut _2: D1<'12ds, '10s>;
// let mut _3: &'12ds S1;
// let mut _4: &'12ds S1;
// let mut _1: &'15ds S1;
// let mut _2: D1<'15ds, '13s>;
// let mut _3: &'15ds S1;
// let mut _4: &'15ds S1;
// let _5: S1;
// let mut _6: &'10s S1;
// let mut _7: &'10s S1;
// let mut _6: &'13s S1;
// let mut _7: &'13s S1;
// let _8: S1;
// bb0: {
// StorageLive(_2);
// StorageLive(_3);
// StorageLive(_4);
// _4 = &'12ds (promoted[1]: S1);
// _3 = &'12ds (*_4);
// _4 = &'15ds (promoted[1]: S1);
// _3 = &'15ds (*_4);
// StorageLive(_6);
// StorageLive(_7);
// _7 = &'10s (promoted[0]: S1);
// _6 = &'10s (*_7);
// _2 = D1<'12ds, '10s>::{{constructor}}(move _3, move _6);
// EndRegion('10s);
// _7 = &'13s (promoted[0]: S1);
// _6 = &'13s (*_7);
// _2 = D1<'15ds, '13s>::{{constructor}}(move _3, move _6);
// EndRegion('13s);
// StorageDead(_6);
// StorageDead(_3);
// _1 = (_2.0: &'12ds S1);
// _1 = (_2.0: &'15ds S1);
// drop(_2) -> [return: bb2, unwind: bb1];
// }
// bb1: {
@ -146,7 +146,7 @@ unsafe impl<'a, #[may_dangle] 'b> Drop for D1<'a, 'b> {
// StorageDead(_2);
// StorageDead(_7);
// StorageDead(_4);
// EndRegion('12ds);
// EndRegion('15ds);
// _0 = ();
// return;
// }

View file

@ -40,19 +40,19 @@ fn main() {
// ...
// bb0: {
// ...
// Validate(Suspend(ReScope(Node(ItemLocalId(10)))), [_1: i32]);
// Validate(Suspend(ReScope(Node(ItemLocalId(13)))), [_1: i32]);
// _6 = &ReErased mut _1;
// Validate(Acquire, [(*_6): i32/ReScope(Node(ItemLocalId(10)))]);
// Validate(Suspend(ReScope(Node(ItemLocalId(10)))), [(*_6): i32/ReScope(Node(ItemLocalId(10)))]);
// Validate(Acquire, [(*_6): i32/ReScope(Node(ItemLocalId(13)))]);
// Validate(Suspend(ReScope(Node(ItemLocalId(13)))), [(*_6): i32/ReScope(Node(ItemLocalId(13)))]);
// _5 = &ReErased mut (*_6);
// Validate(Acquire, [(*_5): i32/ReScope(Node(ItemLocalId(10)))]);
// Validate(Release, [_2: (), _3: &ReScope(Node(ItemLocalId(10))) Test, _5: &ReScope(Node(ItemLocalId(10))) mut i32]);
// Validate(Acquire, [(*_5): i32/ReScope(Node(ItemLocalId(13)))]);
// Validate(Release, [_2: (), _3: &ReScope(Node(ItemLocalId(13))) Test, _5: &ReScope(Node(ItemLocalId(13))) mut i32]);
// _2 = const Test::foo(move _3, move _5) -> bb1;
// }
//
// bb1: {
// Validate(Acquire, [_2: ()]);
// EndRegion(ReScope(Node(ItemLocalId(10))));
// EndRegion(ReScope(Node(ItemLocalId(13))));
// ...
// return;
// }
@ -64,11 +64,11 @@ fn main() {
// bb0: {
// Validate(Acquire, [_1: &ReFree(DefId(0/1:11 ~ validate_1[317d]::main[0]::{{closure}}[0]), BrEnv) [closure@NodeId(65)], _2: &ReFree(DefId(0/1:11 ~ validate_1[317d]::main[0]::{{closure}}[0]), BrAnon(0)) mut i32]);
// StorageLive(_3);
// Validate(Suspend(ReScope(Remainder { block: ItemLocalId(25), first_statement_index: 0 })), [(*_2): i32]);
// Validate(Suspend(ReScope(Remainder { block: ItemLocalId(31), first_statement_index: 0 })), [(*_2): i32]);
// _3 = &ReErased (*_2);
// Validate(Acquire, [(*_3): i32/ReScope(Remainder { block: ItemLocalId(25), first_statement_index: 0 }) (imm)]);
// Validate(Acquire, [(*_3): i32/ReScope(Remainder { block: ItemLocalId(31), first_statement_index: 0 }) (imm)]);
// _0 = (*_3);
// EndRegion(ReScope(Remainder { block: ItemLocalId(25), first_statement_index: 0 }));
// EndRegion(ReScope(Remainder { block: ItemLocalId(31), first_statement_index: 0 }));
// StorageDead(_3);
// return;
// }

View file

@ -48,27 +48,27 @@ fn main() {
// StorageLive(_1);
// _1 = Test { x: const 0i32 };
// StorageLive(_2);
// Validate(Suspend(ReScope(Remainder { block: ItemLocalId(20), first_statement_index: 3 })), [_1: Test]);
// Validate(Suspend(ReScope(Remainder { block: ItemLocalId(24), first_statement_index: 3 })), [_1: Test]);
// _2 = &ReErased _1;
// Validate(Acquire, [(*_2): Test/ReScope(Remainder { block: ItemLocalId(20), first_statement_index: 3 }) (imm)]);
// Validate(Acquire, [(*_2): Test/ReScope(Remainder { block: ItemLocalId(24), first_statement_index: 3 }) (imm)]);
// StorageLive(_4);
// StorageLive(_5);
// Validate(Suspend(ReScope(Node(ItemLocalId(18)))), [((*_2).0: i32): i32/ReScope(Remainder { block: ItemLocalId(20), first_statement_index: 3 }) (imm)]);
// Validate(Suspend(ReScope(Node(ItemLocalId(22)))), [((*_2).0: i32): i32/ReScope(Remainder { block: ItemLocalId(24), first_statement_index: 3 }) (imm)]);
// _5 = &ReErased ((*_2).0: i32);
// Validate(Acquire, [(*_5): i32/ReScope(Node(ItemLocalId(18))) (imm)]);
// Validate(Suspend(ReScope(Node(ItemLocalId(18)))), [(*_5): i32/ReScope(Node(ItemLocalId(18))) (imm)]);
// Validate(Acquire, [(*_5): i32/ReScope(Node(ItemLocalId(22))) (imm)]);
// Validate(Suspend(ReScope(Node(ItemLocalId(22)))), [(*_5): i32/ReScope(Node(ItemLocalId(22))) (imm)]);
// _4 = &ReErased (*_5);
// Validate(Acquire, [(*_4): i32/ReScope(Node(ItemLocalId(18))) (imm)]);
// Validate(Release, [_3: (), _4: &ReScope(Node(ItemLocalId(18))) i32]);
// Validate(Acquire, [(*_4): i32/ReScope(Node(ItemLocalId(22))) (imm)]);
// Validate(Release, [_3: (), _4: &ReScope(Node(ItemLocalId(22))) i32]);
// _3 = const foo(move _4) -> bb1;
// }
// bb1: {
// Validate(Acquire, [_3: ()]);
// EndRegion(ReScope(Node(ItemLocalId(18))));
// EndRegion(ReScope(Node(ItemLocalId(22))));
// StorageDead(_4);
// StorageDead(_5);
// _0 = ();
// EndRegion(ReScope(Remainder { block: ItemLocalId(20), first_statement_index: 3 }));
// EndRegion(ReScope(Remainder { block: ItemLocalId(24), first_statement_index: 3 }));
// StorageDead(_2);
// StorageDead(_1);
// return;

View file

@ -53,12 +53,12 @@ fn main() {
// StorageLive(_3);
// StorageLive(_4);
// StorageLive(_5);
// Validate(Suspend(ReScope(Node(ItemLocalId(12)))), [(*_2): i32]);
// Validate(Suspend(ReScope(Node(ItemLocalId(16)))), [(*_2): i32]);
// _5 = &ReErased mut (*_2);
// Validate(Acquire, [(*_5): i32/ReScope(Node(ItemLocalId(12)))]);
// Validate(Acquire, [(*_5): i32/ReScope(Node(ItemLocalId(16)))]);
// _4 = move _5 as *mut i32 (Misc);
// _3 = move _4;
// EndRegion(ReScope(Node(ItemLocalId(12))));
// EndRegion(ReScope(Node(ItemLocalId(16))));
// StorageDead(_4);
// StorageDead(_5);
// Validate(Release, [_0: bool, _3: *mut i32]);