Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustc_mir: remove extra space when pretty-printing MIR. #70080

Merged
merged 1 commit into from
Mar 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/librustc_mir/util/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ fn write_mir_sig(

ty::print::with_forced_impl_filename_line(|| {
// see notes on #41697 elsewhere
write!(w, " {}", tcx.def_path_str(src.def_id()))
write!(w, "{}", tcx.def_path_str(src.def_id()))
})?;

if src.promoted.is_none() && is_function {
Expand Down
2 changes: 1 addition & 1 deletion src/test/mir-opt/retag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ fn main() {
// }
// END rustc.main-{{closure}}.EraseRegions.after.mir
// START rustc.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.mir
// fn std::intrinsics::drop_in_place(_1: *mut Test) -> () {
Copy link
Contributor

@oli-obk oli-obk Mar 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get how this is the only test affected. Shouldn't

// fn foo(_1: T, _2: &i32) -> i32{
have been printing the space before this PR, too?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also I just saw that my linked thing is missing a space in the end... Maybe MIR opt tests ignore whitespaces even in the middle of things?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe MIR opt tests ignore whitespaces even in the middle of things?

We were confused by this too, I think that's the case, and I'd rather it not.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we move loads of mir-opt tests to the blessable system the leftover cases that still want to use the manual system should be few enough for that to be doable in a painless way.

// fn std::intrinsics::drop_in_place(_1: *mut Test) -> () {
// ...
// bb0: {
// Retag([raw] _1);
Expand Down