-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Emitter cleanups #121783
Merged
Merged
Emitter cleanups #121783
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In practice, 'a and 'b and 'c are always the same. This change makes `UnusedExterns` more like `ArtifactNotification`, which uses a single lifetime 'a in multiple ways.
This `HumanEmitter` is only created to test if it supports colour. The diagnostic width isn't relevant.
It only has two call sites, and one of those doesn't set the source map.
Because it's now the only constructor.
They have the same signature, and the former just calls the latter.
And likewise with `ColorConfig::suggests_using_colors`. They both have a single call site. And note that `BufWriter::supports_color()` always returns false, which enables a small bit of constant folding along the way.
Because `HumanEmitter::new` is enough, in conjunction with the (renamed) `stderr_destination` function.
They are so similar to `JsonEmitter::new` it's not worth having separate functions, it makes the code harder to read.
Use `derive(Setters)` to derive setters, and then change `JsonEmitter::new` to only have the arguments that are always used.
It took me a while to work this out.
rustbot
added
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
labels
Feb 29, 2024
Some changes occurred in src/tools/rustfmt cc @rust-lang/rustfmt Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
oli-obk
approved these changes
Feb 29, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a nit
Thanks for continueing to work on this. I totally forgot about it after my last refactors
I avoided the @bors r=oli-obk |
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
Feb 29, 2024
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 29, 2024
…llaumeGomez Rollup of 7 pull requests Successful merges: - rust-lang#119748 (Increase visibility of `join_path` and `split_paths`) - rust-lang#120820 (Enable CMPXCHG16B, SSE3, SAHF/LAHF and 128-bit Atomics (in nightly) in Windows x64) - rust-lang#121000 (pattern_analysis: rework how we hide empty private fields) - rust-lang#121376 (Skip unnecessary comparison with half-open range patterns) - rust-lang#121596 (Use volatile access instead of `#[used]` for `on_tls_callback`) - rust-lang#121669 (Count stashed errors again) - rust-lang#121783 (Emitter cleanups) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 29, 2024
Rollup merge of rust-lang#121783 - nnethercote:emitter-cleanups, r=oli-obk Emitter cleanups Some cleanups I made when reading emitter code. In particular, `HumanEmitter` and `JsonEmitter` have gone from three constructors to one. r? `@oli-obk`
adpaco-aws
added a commit
to model-checking/kani
that referenced
this pull request
Mar 4, 2024
Upgrades the Rust toolchain to `nightly-2024-03-01`. The Rust compiler PRs that triggered changes in this upgrades are: * rust-lang/rust#121516 * rust-lang/rust#121598 * rust-lang/rust#121489 * rust-lang/rust#121783
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Mar 7, 2024
…i-obk Emitter cleanups Some cleanups I made when reading emitter code. In particular, `HumanEmitter` and `JsonEmitter` have gone from three constructors to one. r? `@oli-obk`
calebcartwright
pushed a commit
to calebcartwright/rust
that referenced
this pull request
Jun 22, 2024
…i-obk Emitter cleanups Some cleanups I made when reading emitter code. In particular, `HumanEmitter` and `JsonEmitter` have gone from three constructors to one. r? `@oli-obk`
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.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some cleanups I made when reading emitter code. In particular,
HumanEmitter
andJsonEmitter
have gone from three constructors to one.r? @oli-obk