diff --git a/src/librustc/ty/maps.rs b/src/librustc/ty/maps.rs index 1fd9e8f73756e..f448ca8934732 100644 --- a/src/librustc/ty/maps.rs +++ b/src/librustc/ty/maps.rs @@ -592,7 +592,7 @@ macro_rules! define_map_struct { output: $output:tt) => { define_map_struct! { tcx: $tcx, - ready: ([pub] $attrs $name), + ready: ([] $attrs $name), input: ($($input)*), output: $output } diff --git a/src/librustc_mir/util/pretty.rs b/src/librustc_mir/util/pretty.rs index 14f277d1767bb..eaba573dcd2e5 100644 --- a/src/librustc_mir/util/pretty.rs +++ b/src/librustc_mir/util/pretty.rs @@ -324,7 +324,9 @@ fn write_mir_sig(tcx: TyCtxt, src: MirSource, mir: &Mir, w: &mut Write) MirSource::Promoted(_, i) => write!(w, "{:?} in", i)? } - write!(w, " {}", tcx.node_path_str(src.item_id()))?; + item_path::with_forced_impl_filename_line(|| { // see notes on #41697 elsewhere + write!(w, " {}", tcx.node_path_str(src.item_id())) + })?; if let MirSource::Fn(_) = src { write!(w, "(")?; diff --git a/src/test/run-pass/issue-41697.rs b/src/test/mir-opt/issue-41697.rs similarity index 97% rename from src/test/run-pass/issue-41697.rs rename to src/test/mir-opt/issue-41697.rs index d59b6a16562ac..47eeffe35a83e 100644 --- a/src/test/run-pass/issue-41697.rs +++ b/src/test/mir-opt/issue-41697.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// compile-flags:-Zdump-mir=NEVER_MATCHED - // Regression test for #41697. Using dump-mir was triggering // artificial cycles: during type-checking, we had to get the MIR for // the constant expressions in `[u8; 2]`, which in turn would trigger