Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rust-lang/rust
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: pnkfelix/rust
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: extra-2pb-info
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 3 commits
  • 9 files changed
  • 1 contributor

Commits on Dec 14, 2022

  1. Copy the full SHA
    a0025a9 View commit details

Commits on Dec 17, 2022

  1. address tidy's concerns, and add an aside about output for BorrowKind…

    …::Unique while we're at it.
    pnkfelix committed Dec 17, 2022
    Copy the full SHA
    d68329c View commit details
  2. Copy the full SHA
    4164551 View commit details
4 changes: 3 additions & 1 deletion compiler/rustc_middle/src/mir/mod.rs
Original file line number Diff line number Diff line change
@@ -2022,7 +2022,9 @@ impl<'tcx> Debug for Rvalue<'tcx> {
let kind_str = match borrow_kind {
BorrowKind::Shared => "",
BorrowKind::Shallow => "shallow ",
BorrowKind::Mut { .. } | BorrowKind::Unique => "mut ",
BorrowKind::Unique => "mut ", // FIXME should this say `/*uniq*/mut`?
BorrowKind::Mut { allow_two_phase_borrow: false } => "mut ",
BorrowKind::Mut { allow_two_phase_borrow: true } => "/*2pb*/mut ",
};

// When printing regions, add trailing space if necessary.
2 changes: 1 addition & 1 deletion src/test/mir-opt/derefer_complex_case.main.Derefer.diff
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@
StorageLive(_8); // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
StorageLive(_9); // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
_9 = &mut _4; // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
_8 = &mut (*_9); // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
_8 = &/*2pb*/mut (*_9); // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
_7 = <std::slice::Iter<'_, i32> as Iterator>::next(move _8) -> bb3; // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
// mir::Constant
// + span: $DIR/derefer_complex_case.rs:6:17: 6:26
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@
StorageLive(_5); // scope 1 at $DIR/simple.rs:+2:10: +2:18
StorageLive(_6); // scope 1 at $DIR/simple.rs:+2:10: +2:18
_6 = &mut _2; // scope 1 at $DIR/simple.rs:+2:10: +2:18
_5 = &mut (*_6); // scope 1 at $DIR/simple.rs:+2:10: +2:18
_5 = &/*2pb*/mut (*_6); // scope 1 at $DIR/simple.rs:+2:10: +2:18
- _3 = move _4(move _5) -> bb1; // scope 1 at $DIR/simple.rs:+2:5: +2:19
+ _3 = move _1(move _5) -> bb1; // scope 1 at $DIR/simple.rs:+2:5: +2:19
}
Original file line number Diff line number Diff line change
@@ -82,7 +82,7 @@
StorageLive(_10); // scope 3 at $DIR/funky_arms.rs:+13:17: +13:26
_10 = ((_7 as Some).0: usize); // scope 3 at $DIR/funky_arms.rs:+13:17: +13:26
StorageLive(_11); // scope 3 at $DIR/funky_arms.rs:+15:43: +15:46
_11 = &mut (*_1); // scope 3 at $DIR/funky_arms.rs:+15:43: +15:46
_11 = &/*2pb*/mut (*_1); // scope 3 at $DIR/funky_arms.rs:+15:43: +15:46
StorageLive(_12); // scope 3 at $DIR/funky_arms.rs:+15:48: +15:51
_12 = _2; // scope 3 at $DIR/funky_arms.rs:+15:48: +15:51
StorageLive(_13); // scope 3 at $DIR/funky_arms.rs:+15:53: +15:57
@@ -115,7 +115,7 @@

bb8: {
StorageLive(_18); // scope 2 at $DIR/funky_arms.rs:+17:46: +17:49
_18 = &mut (*_1); // scope 2 at $DIR/funky_arms.rs:+17:46: +17:49
_18 = &/*2pb*/mut (*_1); // scope 2 at $DIR/funky_arms.rs:+17:46: +17:49
StorageLive(_19); // scope 2 at $DIR/funky_arms.rs:+17:51: +17:54
_19 = _2; // scope 2 at $DIR/funky_arms.rs:+17:51: +17:54
StorageLive(_20); // scope 2 at $DIR/funky_arms.rs:+17:56: +17:60
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ fn a(_1: &mut [T]) -> &mut [T] {
StorageLive(_2); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
StorageLive(_3); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
StorageLive(_4); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
_4 = &mut (*_1); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
_4 = &/*2pb*/mut (*_1); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
StorageLive(_5); // scope 1 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
_5 = &mut (*_4); // scope 1 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
_3 = &mut (*_5); // scope 1 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ fn b(_1: &mut Box<T>) -> &mut T {
StorageLive(_2); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
StorageLive(_3); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
StorageLive(_4); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
_4 = &mut (*_1); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
_4 = &/*2pb*/mut (*_1); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
StorageLive(_5); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
StorageLive(_6); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_7 = deref_copy (*_4); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
2 changes: 1 addition & 1 deletion src/test/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.diff
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
StorageLive(_6); // scope 1 at $DIR/nrvo_simple.rs:+2:10: +2:18
- _6 = &mut _2; // scope 1 at $DIR/nrvo_simple.rs:+2:10: +2:18
+ _6 = &mut _0; // scope 1 at $DIR/nrvo_simple.rs:+2:10: +2:18
_5 = &mut (*_6); // scope 1 at $DIR/nrvo_simple.rs:+2:10: +2:18
_5 = &/*2pb*/mut (*_6); // scope 1 at $DIR/nrvo_simple.rs:+2:10: +2:18
_3 = move _4(move _5) -> bb1; // scope 1 at $DIR/nrvo_simple.rs:+2:5: +2:19
}

Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@
- StorageLive(_8); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- StorageLive(_9); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
_9 = &mut _4; // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
_8 = &mut (*_9); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
_8 = &/*2pb*/mut (*_9); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
_7 = <std::ops::Range<i32> as Iterator>::next(move _8) -> bb3; // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
// mir::Constant
// + span: $DIR/remove_storage_markers.rs:10:14: 10:19
Original file line number Diff line number Diff line change
@@ -68,7 +68,7 @@ fn main() -> () {
StorageLive(_6); // scope 1 at $DIR/retag.rs:+3:29: +3:35
StorageLive(_7); // scope 1 at $DIR/retag.rs:+3:29: +3:35
_7 = &mut _1; // scope 1 at $DIR/retag.rs:+3:29: +3:35
_6 = &mut (*_7); // scope 1 at $DIR/retag.rs:+3:29: +3:35
_6 = &/*2pb*/mut (*_7); // scope 1 at $DIR/retag.rs:+3:29: +3:35
_3 = Test::foo(move _4, move _6) -> [return: bb1, unwind: bb8]; // scope 1 at $DIR/retag.rs:+3:17: +3:36
// mir::Constant
// + span: $DIR/retag.rs:33:25: 33:28