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

Use write!-style syntax for MIR assert terminator #71021

Merged
merged 1 commit into from
Apr 12, 2020

Conversation

robojumper
Copy link
Contributor

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @jonas-schievink (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 11, 2020
@robojumper
Copy link
Contributor Author

The Debug implementation (#71000 (comment)) could not be changed as it is used for user-facing errors as well (via

impl fmt::Display for InterpError<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
// Forward `Display` to `Debug`.
fmt::Debug::fmt(self, f)
}
}
impl fmt::Debug for InterpError<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
use InterpError::*;
match *self {
Unsupported(ref msg) => write!(f, "{:?}", msg),
InvalidProgram(ref msg) => write!(f, "{:?}", msg),
UndefinedBehavior(ref msg) => write!(f, "{:?}", msg),
ResourceExhaustion(ref msg) => write!(f, "{:?}", msg),
MachineStop(ref msg) => write!(f, "{:?}", msg),
}
}
}
)

@jonas-schievink
Copy link
Contributor

Thanks, looks good!

@bors r+

@bors
Copy link
Contributor

bors commented Apr 11, 2020

📌 Commit b78ff99 has been approved by jonas-schievink

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 11, 2020
Centril added a commit to Centril/rust that referenced this pull request Apr 11, 2020
… r=jonas-schievink

Use write!-style syntax for MIR assert terminator

Fixes rust-lang#71000.

r? @jonas-schievink
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 11, 2020
Rollup of 5 pull requests

Successful merges:

 - rust-lang#70644 (Clean up `ModuleConfig` initialization)
 - rust-lang#70937 (Fix staticlib name for *-pc-windows-gnu targets)
 - rust-lang#70996 (Add or_insert_with_key to Entry of HashMap/BTreeMap)
 - rust-lang#71020 (Store UNICODE_VERSION as a tuple)
 - rust-lang#71021 (Use write!-style syntax for MIR assert terminator)

Failed merges:

r? @ghost
@bors bors merged commit d8dcdec into rust-lang:master Apr 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Assert MIR terminators are printed incorrectly
4 participants