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

Define and use a print_maybe_styled! macro in libsyntax/diagnostic.rs #26846

Merged
merged 1 commit into from
Jul 29, 2015

Conversation

ftxqxd
Copy link
Contributor

@ftxqxd ftxqxd commented Jul 7, 2015

EmitterWriter::print_maybe_styled was basically always used with format!, so this macro makes some code cleaner. It should also remove some unnecessary allocations (most print_maybe_styled invocations allocated a String previously, whereas the new macro uses write_fmt to write the formatted string directly to the terminal).

This probably could have been part of #26838, but it’s too late now. It’s also rebased on #26838’s branch because otherwise pretty much all of the changes in this PR would conflict with the other PR’s changes.

@rust-highfive
Copy link
Collaborator

r? @pnkfelix

(rust_highfive has picked a reviewer for you, use r? to override)

@bors
Copy link
Contributor

bors commented Jul 17, 2015

☔ The latest upstream changes (presumably #27066) made this pull request unmergeable. Please resolve the merge conflicts.

@pnkfelix
Copy link
Member

This seems basically fine, r=me after the rebase.

`EmitterWriter::print_maybe_styled` was basically always used with `format!`, so
this macro makes some code cleaner. It should also remove some unnecessary
allocations (most `print_maybe_styled` invocations allocated a `String`
previously, whereas the new macro uses `write_fmt` to write the formatted string
directly to the terminal).

This probably could have been part of rust-lang#26838, but it’s too late now.
@ftxqxd ftxqxd force-pushed the print-maybe-styled-macro branch from aa75c67 to 3ebf706 Compare July 18, 2015 01:12
@ftxqxd
Copy link
Contributor Author

ftxqxd commented Jul 18, 2015

Rebased.

@ftxqxd
Copy link
Contributor Author

ftxqxd commented Jul 26, 2015

@pnkfelix Ping

@pnkfelix
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jul 28, 2015

📌 Commit 3ebf706 has been approved by pnkfelix

@bors
Copy link
Contributor

bors commented Jul 29, 2015

⌛ Testing commit 3ebf706 with merge 8d432fb...

bors added a commit that referenced this pull request Jul 29, 2015
`EmitterWriter::print_maybe_styled` was basically always used with `format!`, so this macro makes some code cleaner. It should also remove some unnecessary allocations (most `print_maybe_styled` invocations allocated a `String` previously, whereas the new macro uses `write_fmt` to write the formatted string directly to the terminal).

This probably could have been part of #26838, but it’s too late now. It’s also rebased on #26838’s branch because otherwise pretty much all of the changes in this PR would conflict with the other PR’s changes.
@bors bors merged commit 3ebf706 into rust-lang:master Jul 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants