Skip to content

Commit

Permalink
Rollup merge of rust-lang#119601 - nnethercote:Emitter-cleanups, r=ol…
Browse files Browse the repository at this point in the history
…i-obk

`Emitter` cleanups

Some improvements I found while looking at this code.

r? `@oli-obk`
  • Loading branch information
compiler-errors authored Jan 5, 2024
2 parents 3a683f6 + 0bac101 commit d201225
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clippy_lints/src/doc/needless_doctest_main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::doc::{NEEDLESS_DOCTEST_MAIN, TEST_ATTR_IN_DOCTEST};
use clippy_utils::diagnostics::span_lint;
use rustc_ast::{CoroutineKind, Fn, FnRetTy, Item, ItemKind};
use rustc_data_structures::sync::Lrc;
use rustc_errors::emitter::EmitterWriter;
use rustc_errors::emitter::HumanEmitter;
use rustc_errors::DiagCtxt;
use rustc_lint::LateContext;
use rustc_parse::maybe_new_parser_from_source_str;
Expand Down Expand Up @@ -44,7 +44,7 @@ pub fn check(

let fallback_bundle =
rustc_errors::fallback_fluent_bundle(rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec(), false);
let emitter = EmitterWriter::new(Box::new(io::sink()), fallback_bundle);
let emitter = HumanEmitter::new(Box::new(io::sink()), fallback_bundle);
let dcx = DiagCtxt::with_emitter(Box::new(emitter)).disable_warnings();
#[expect(clippy::arc_with_non_send_sync)] // `Lrc` is expected by with_dcx
let sm = Lrc::new(SourceMap::new(FilePathMapping::empty()));
Expand Down

0 comments on commit d201225

Please sign in to comment.