-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Refactor Translator #142650
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Refactor Translator #142650
Conversation
rustbot has assigned @petrochenkov. Use |
Some changes occurred in compiler/rustc_codegen_ssa
cc @davidtwco, @compiler-errors, @TaKO8Ki
cc @davidtwco, @compiler-errors, @TaKO8Ki Some changes occurred in src/tools/rustfmt cc @rust-lang/rustfmt Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
Looks reasonable to me. |
(bors forgot to post a comment about the merge conflicts) |
Reminder, once the PR becomes ready for a review, use |
4a86853
to
3388d83
Compare
Rebased and renamed to FatalOnlyEmitter. @rustbot ready |
@bors r+ |
Rollup of 9 pull requests Successful merges: - #142331 (Add `trim_prefix` and `trim_suffix` methods for both `slice` and `str` types.) - #142491 (Rework #[cold] attribute parser) - #142494 (Fix missing docs in `rustc_attr_parsing`) - #142495 (Better template for `#[repr]` attributes) - #142497 (Fix random failure when JS code is executed when the whole file was not read yet) - #142575 (Ensure copy* intrinsics also perform the static self-init checks) - #142650 (Refactor Translator) - #142713 (mbe: Refactor transcription) - #142755 (rustdoc: Remove `FormatRenderer::cache`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 9 pull requests Successful merges: - #142331 (Add `trim_prefix` and `trim_suffix` methods for both `slice` and `str` types.) - #142491 (Rework #[cold] attribute parser) - #142494 (Fix missing docs in `rustc_attr_parsing`) - #142495 (Better template for `#[repr]` attributes) - #142497 (Fix random failure when JS code is executed when the whole file was not read yet) - #142575 (Ensure copy* intrinsics also perform the static self-init checks) - #142650 (Refactor Translator) - #142713 (mbe: Refactor transcription) - #142755 (rustdoc: Remove `FormatRenderer::cache`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #142650 - camsteffen:refactor-translator, r=petrochenkov Refactor Translator My main motivation was to simplify the usage of `SilentEmitter` for users like rustfmt. A few refactoring opportunities arose along the way. * Replace `Translate` trait with `Translator` struct * Replace `Emitter: Translate` with `Emitter::translator` * Split `SilentEmitter` into `FatalOnlyEmitter` and `SilentEmitter`
My main motivation was to simplify the usage of
SilentEmitter
for users like rustfmt. A few refactoring opportunities arose along the way.Translate
trait withTranslator
structEmitter: Translate
withEmitter::translator
SilentEmitter
intoFatalOnlyEmitter
andSilentEmitter