1
Fork 0

Rollup merge of #124511 - nnethercote:rm-extern-crates, r=fee1-dead

Remove many `#[macro_use] extern crate foo` items

This requires the addition of more `use` items, which often make the code more verbose. But they also make the code easier to read, because `#[macro_use]` obscures where macros are defined.

r? `@fee1-dead`
This commit is contained in:
Matthias Krüger 2024-04-30 15:04:08 +02:00 committed by GitHub
commit 784316eadc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
320 changed files with 375 additions and 287 deletions

View file

@ -7,6 +7,7 @@ use rustc_data_structures::fx::FxIndexMap;
use rustc_error_messages::fluent_value_from_str_list_sep_by_and;
use rustc_error_messages::FluentValue;
use rustc_lint_defs::{Applicability, LintExpectationId};
use rustc_macros::{Decodable, Encodable};
use rustc_span::source_map::Spanned;
use rustc_span::symbol::Symbol;
use rustc_span::{Span, DUMMY_SP};
@ -17,6 +18,7 @@ use std::marker::PhantomData;
use std::ops::{Deref, DerefMut};
use std::panic;
use std::thread::panicking;
use tracing::debug;
/// Error type for `DiagInner`'s `suggestions` field, indicating that
/// `.disable_suggestions()` was called on the `DiagInner`.

View file

@ -7,6 +7,7 @@ use crate::{
use rustc_ast as ast;
use rustc_ast_pretty::pprust;
use rustc_hir as hir;
use rustc_macros::Subdiagnostic;
use rustc_span::edition::Edition;
use rustc_span::symbol::{Ident, MacroRulesNormalizedIdent, Symbol};
use rustc_span::Span;

View file

@ -35,6 +35,7 @@ use std::iter;
use std::path::Path;
use termcolor::{Buffer, BufferWriter, ColorChoice, ColorSpec, StandardStream};
use termcolor::{Color, WriteColor};
use tracing::{debug, instrument, trace, warn};
/// Default column width, used in tests and when terminal dimensions cannot be determined.
const DEFAULT_COLUMN_WIDTH: usize = 140;

View file

@ -25,12 +25,6 @@
#![feature(yeet_expr)]
// tidy-alphabetical-end
#[macro_use]
extern crate rustc_macros;
#[macro_use]
extern crate tracing;
extern crate self as rustc_errors;
pub use codes::*;
@ -64,6 +58,7 @@ use rustc_data_structures::stable_hasher::{Hash128, StableHasher};
use rustc_data_structures::sync::{Lock, Lrc};
use rustc_data_structures::AtomicRef;
use rustc_lint_defs::LintExpectationId;
use rustc_macros::{Decodable, Encodable};
use rustc_span::source_map::SourceMap;
use rustc_span::{Loc, Span, DUMMY_SP};
use std::backtrace::{Backtrace, BacktraceStatus};
@ -76,6 +71,7 @@ use std::num::NonZero;
use std::ops::DerefMut;
use std::panic;
use std::path::{Path, PathBuf};
use tracing::debug;
use Level::*;

View file

@ -1,6 +1,7 @@
// Code for annotating snippets.
use crate::{Level, Loc};
use rustc_macros::{Decodable, Encodable};
#[derive(Clone, Debug, PartialOrd, Ord, PartialEq, Eq)]
pub struct Line {

View file

@ -6,6 +6,7 @@ pub use rustc_error_messages::FluentArgs;
use std::borrow::Cow;
use std::env;
use std::error::Report;
use tracing::{debug, trace};
/// Convert diagnostic arguments (a rustc internal type that exists to implement
/// `Encodable`/`Decodable`) into `FluentArgs` which is necessary to perform translation.