Skip to content

Commit 2a054a5

Browse files
authored
Unrolled build for #146391
Rollup merge of #146391 - beepster4096:trimnt, r=saethlin Trim paths less in MIR dumping With this PR, the paths MIR dump filters and that are printed at the start of a dump file are no longer trimmed. They don't include the crate that is being compiled, however.
2 parents 7ad23f4 + 90e74de commit 2a054a5

6 files changed

+12
-10
lines changed

compiler/rustc_middle/src/mir/pretty.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ impl<'dis, 'de, 'tcx> MirDumper<'dis, 'de, 'tcx> {
7878
pub fn new(tcx: TyCtxt<'tcx>, pass_name: &'static str, body: &Body<'tcx>) -> Option<Self> {
7979
let dump_enabled = if let Some(ref filters) = tcx.sess.opts.unstable_opts.dump_mir {
8080
// see notes on #41697 below
81-
let node_path =
82-
ty::print::with_forced_impl_filename_line!(tcx.def_path_str(body.source.def_id()));
81+
let node_path = ty::print::with_no_trimmed_paths!(
82+
ty::print::with_forced_impl_filename_line!(tcx.def_path_str(body.source.def_id()))
83+
);
8384
filters.split('|').any(|or_filter| {
8485
or_filter.split('&').all(|and_filter| {
8586
let and_filter_trimmed = and_filter.trim();
@@ -173,9 +174,10 @@ impl<'dis, 'de, 'tcx> MirDumper<'dis, 'de, 'tcx> {
173174
// trigger `type_of`, and this can run while we are already attempting to evaluate `type_of`.
174175
pub fn dump_mir_to_writer(&self, body: &Body<'tcx>, w: &mut dyn io::Write) -> io::Result<()> {
175176
// see notes on #41697 above
176-
let def_path = ty::print::with_forced_impl_filename_line!(
177-
self.tcx().def_path_str(body.source.def_id())
178-
);
177+
let def_path =
178+
ty::print::with_no_trimmed_paths!(ty::print::with_forced_impl_filename_line!(
179+
self.tcx().def_path_str(body.source.def_id())
180+
));
179181
// ignore-tidy-odd-backticks the literal below is fine
180182
write!(w, "// MIR for `{def_path}")?;
181183
match body.source.promoted {

tests/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.panic-abort.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// MIR for `drop_in_place` after SimplifyCfg-make_shim
1+
// MIR for `std::ptr::drop_in_place` after SimplifyCfg-make_shim
22

33
fn drop_in_place(_1: *mut Test) -> () {
44
let mut _0: ();

tests/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.panic-unwind.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// MIR for `drop_in_place` after SimplifyCfg-make_shim
1+
// MIR for `std::ptr::drop_in_place` after SimplifyCfg-make_shim
22

33
fn drop_in_place(_1: *mut Test) -> () {
44
let mut _0: ();

tests/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String;42].AddMovesForPackedDrops.before.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// MIR for `drop_in_place` before AddMovesForPackedDrops
1+
// MIR for `std::ptr::drop_in_place` before AddMovesForPackedDrops
22

33
fn drop_in_place(_1: *mut [String; 42]) -> () {
44
let mut _0: ();

tests/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// MIR for `drop_in_place` before AddMovesForPackedDrops
1+
// MIR for `std::ptr::drop_in_place` before AddMovesForPackedDrops
22

33
fn drop_in_place(_1: *mut [String]) -> () {
44
let mut _0: ();

tests/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// MIR for `drop_in_place` before AddMovesForPackedDrops
1+
// MIR for `std::ptr::drop_in_place` before AddMovesForPackedDrops
22

33
fn drop_in_place(_1: *mut Vec<i32>) -> () {
44
let mut _0: ();

0 commit comments

Comments
 (0)