Skip to content

generate MIR for the nightlies' standard library #38350

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

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
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
9 changes: 9 additions & 0 deletions src/bootstrap/bin/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,15 @@ fn main() {
cmd.arg("-C").arg(format!("link-args={}", rpath));
}
}

// Generate MIR for all functions in the Rust libraries
// Since users will never build the stdlib themselves, they can't
// obtain an stdlib with full MIR. Thus we simply emit MIR always
// for the stdlib
// Don't do this for stage0 yet, since always_encode_mir isn't part of it yet
if stage != "0" {
cmd.arg("-Zalways_encode_mir");
Copy link
Member

Choose a reason for hiding this comment

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

Isn't it dashes, not underscores? 😆

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nope, this was the correct version (especially since it worked)

Copy link
Member

Choose a reason for hiding this comment

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

That's... weird? It sounds like a bug, let me check something.

Copy link
Member

Choose a reason for hiding this comment

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

Ah no we accept both underscores and dashes, but only dashes are canonical (I tried with -C debug-assertions and -C debug_assertions, both appear to work).

}
}

// Actually run the compiler!
Expand Down