Auto merge of #125434 - nnethercote:rm-more-extern-tracing, r=jackh726

Remove more `#[macro_use] extern crate tracing`

Because explicit importing of macros via use items is nicer (more standard and readable) than implicit importing via `#[macro_use]`. Continuing the work from #124511 and #124914.

r? `@jackh726`
This commit is contained in:
bors 2024-05-23 21:36:54 +00:00
commit 8679004993
194 changed files with 193 additions and 65 deletions

View File

@ -16,6 +16,7 @@ use rustc_middle::{bug, span_bug, ty::Instance};
use rustc_span::{Pos, Span};
use rustc_target::abi::*;
use rustc_target::asm::*;
use tracing::debug;
use libc::{c_char, c_uint};
use smallvec::SmallVec;

View File

@ -18,6 +18,7 @@ use rustc_codegen_ssa::back::archive::{
get_native_object_symbols, try_extract_macho_fat_archive, ArArchiveBuilder,
ArchiveBuildFailure, ArchiveBuilder, ArchiveBuilderBuilder, UnknownArchiveKind,
};
use tracing::trace;
use rustc_session::cstore::DllImport;
use rustc_session::Session;

View File

@ -20,6 +20,7 @@ use rustc_middle::bug;
use rustc_middle::dep_graph::WorkProduct;
use rustc_middle::middle::exported_symbols::{SymbolExportInfo, SymbolExportLevel};
use rustc_session::config::{self, CrateType, Lto};
use tracing::{debug, info};
use std::collections::BTreeMap;
use std::ffi::{CStr, CString};

View File

@ -35,6 +35,7 @@ use rustc_session::Session;
use rustc_span::symbol::sym;
use rustc_span::InnerSpan;
use rustc_target::spec::{CodeModel, RelocModel, SanitizerSet, SplitDebuginfo, TlsModel};
use tracing::debug;
use crate::llvm::diagnostic::OptimizationDiagnosticKind;
use libc::{c_char, c_int, c_void, size_t};

View File

@ -30,6 +30,7 @@ use std::borrow::Cow;
use std::iter;
use std::ops::Deref;
use std::ptr;
use tracing::{debug, instrument};
// All Builders must have an llfn associated with them
#[must_use]

View File

@ -12,6 +12,7 @@ use crate::value::Value;
use rustc_middle::ty::layout::{FnAbiOf, HasTyCtxt};
use rustc_middle::ty::{self, Instance, TypeVisitableExt};
use tracing::debug;
/// Codegens a reference to a fn/method item, monomorphizing and
/// inlining as it goes.

View File

@ -19,6 +19,7 @@ use rustc_target::spec::Target;
use libc::{c_char, c_uint};
use std::fmt::Write;
use tracing::debug;
/*
* A note on nomenclature of linking: "extern", "foreign", and "upcall".

View File

@ -25,6 +25,7 @@ use rustc_target::abi::{
Align, AlignFromBytesError, HasDataLayout, Primitive, Scalar, Size, WrappingRange,
};
use std::ops::Range;
use tracing::{debug, instrument, trace};
pub fn const_alloc_to_llvm<'ll>(
cx: &CodegenCx<'ll, '_>,

View File

@ -9,6 +9,7 @@ use rustc_middle::mir::coverage::{
};
use rustc_middle::ty::Instance;
use rustc_span::Symbol;
use tracing::{debug, instrument};
/// Holds all of the coverage mapping data associated with a function instance,
/// collected during traversal of `Coverage` statements in the function's MIR.

View File

@ -14,6 +14,7 @@ use rustc_middle::mir;
use rustc_middle::ty::{self, TyCtxt};
use rustc_span::def_id::DefIdSet;
use rustc_span::Symbol;
use tracing::debug;
/// Generates and exports the Coverage Map.
///

View File

@ -17,6 +17,7 @@ use rustc_middle::mir::coverage::CoverageKind;
use rustc_middle::ty::layout::HasTyCtxt;
use rustc_middle::ty::Instance;
use rustc_target::abi::{Align, Size};
use tracing::{debug, instrument};
use std::cell::RefCell;

View File

@ -41,6 +41,7 @@ use rustc_symbol_mangling::typeid_for_trait_ref;
use rustc_target::abi::{Align, Size};
use rustc_target::spec::DebuginfoKind;
use smallvec::smallvec;
use tracing::{debug, instrument};
use libc::{c_char, c_longlong, c_uint};
use std::borrow::Cow;

View File

@ -42,6 +42,7 @@ use std::cell::OnceCell;
use std::cell::RefCell;
use std::iter;
use std::ops::Range;
use tracing::debug;
mod create_scope_map;
pub mod gdb;

View File

@ -6,7 +6,7 @@ use super::CodegenUnitDebugContext;
use rustc_hir::def_id::DefId;
use rustc_middle::ty::layout::{HasParamEnv, LayoutOf};
use rustc_middle::ty::{self, Ty};
use trace;
use tracing::trace;
use crate::common::CodegenCx;
use crate::llvm;

View File

@ -24,6 +24,7 @@ use rustc_data_structures::fx::FxIndexSet;
use rustc_middle::ty::{Instance, Ty};
use rustc_sanitizers::{cfi, kcfi};
use smallvec::SmallVec;
use tracing::debug;
/// Declare a function.
///

View File

@ -21,6 +21,7 @@ use rustc_middle::{bug, span_bug};
use rustc_span::{sym, Span, Symbol};
use rustc_target::abi::{self, Align, Float, HasDataLayout, Primitive, Size};
use rustc_target::spec::{HasTargetSpec, PanicStrategy};
use tracing::debug;
use std::cmp::Ordering;

View File

@ -15,9 +15,6 @@
#![feature(let_chains)]
#![feature(impl_trait_in_assoc_type)]
#[macro_use]
extern crate tracing;
use back::owned_target_machine::OwnedTargetMachine;
use back::write::{create_informational_target_machine, create_target_machine};

View File

@ -13,6 +13,7 @@ use rustc_middle::ty::layout::{FnAbiOf, LayoutOf};
use rustc_middle::ty::{self, Instance, TypeVisitableExt};
use rustc_session::config::CrateType;
use rustc_target::spec::RelocModel;
use tracing::debug;
impl<'tcx> PreDefineMethods<'tcx> for CodegenCx<'_, 'tcx> {
fn predefine_static(

View File

@ -8,6 +8,7 @@ use rustc_middle::ty::{self, Ty, TypeVisitableExt};
use rustc_target::abi::{Abi, Align, FieldsShape};
use rustc_target::abi::{Float, Int, Pointer};
use rustc_target::abi::{Scalar, Size, Variants};
use tracing::debug;
use std::fmt::Write;

View File

@ -37,6 +37,7 @@ use rustc_span::{Span, Symbol};
use std::borrow::Cow;
use std::fmt;
use thin_vec::ThinVec;
use tracing::debug;
#[allow(missing_docs)]
pub fn assert_module_sources(tcx: TyCtxt<'_>, set_reuse: &dyn Fn(&mut CguReuseTracker)) {

View File

@ -52,6 +52,7 @@ use std::ops::Deref;
use std::path::{Path, PathBuf};
use std::process::{ExitStatus, Output, Stdio};
use std::{env, fmt, fs, io, mem, str};
use tracing::{debug, info, warn};
pub fn ensure_removed(dcx: &DiagCtxt, path: &Path) {
if let Err(e) = fs::remove_file(path) {

View File

@ -22,6 +22,7 @@ use rustc_session::Session;
use rustc_target::spec::{Cc, LinkOutputKind, LinkerFlavor, Lld};
use cc::windows_registry;
use tracing::{debug, warn};
/// Disables non-English messages from localized linkers.
/// Such messages may cause issues with text encoding on Windows (#35785)

View File

@ -3,6 +3,7 @@ use rustc_data_structures::fx::FxHashSet;
use rustc_fs_util::try_canonicalize;
use std::ffi::OsString;
use std::path::{Path, PathBuf};
use tracing::debug;
pub struct RPathConfig<'a> {
pub libs: &'a [&'a Path],

View File

@ -18,6 +18,7 @@ use rustc_middle::ty::{GenericArgKind, GenericArgsRef};
use rustc_middle::util::Providers;
use rustc_session::config::{CrateType, OomStrategy};
use rustc_target::spec::{SanitizerSet, TlsModel};
use tracing::debug;
pub fn threshold(tcx: TyCtxt<'_>) -> SymbolExportLevel {
crates_export_threshold(tcx.crate_types())

View File

@ -49,6 +49,7 @@ use std::str;
use std::sync::mpsc::{channel, Receiver, Sender};
use std::sync::Arc;
use std::thread;
use tracing::debug;
const PRE_LTO_BC_EXT: &str = "pre-lto.bc";

View File

@ -45,6 +45,7 @@ use std::collections::BTreeSet;
use std::time::{Duration, Instant};
use itertools::Itertools;
use tracing::{debug, info};
pub fn bin_op_to_icmp_predicate(op: BinOp, signed: bool) -> IntPredicate {
match op {

View File

@ -15,9 +15,6 @@
//! The backend-agnostic functions of this crate use functions defined in various traits that
//! have to be implemented by each backend.
#[macro_use]
extern crate tracing;
use rustc_ast as ast;
use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::fx::FxIndexMap;

View File

@ -5,6 +5,7 @@ use rustc_middle::ty::{self, GenericArgKind, Ty};
use rustc_session::config::Lto;
use rustc_symbol_mangling::typeid_for_trait_ref;
use rustc_target::abi::call::FnAbi;
use tracing::{debug, instrument};
#[derive(Copy, Clone, Debug)]
pub struct VirtualIndex(u64);

View File

@ -11,6 +11,7 @@ use rustc_middle::mir::visit::{MutatingUseContext, NonMutatingUseContext, PlaceC
use rustc_middle::mir::{self, DefLocation, Location, TerminatorKind};
use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf};
use rustc_middle::{bug, span_bug};
use tracing::debug;
pub fn non_ssa_locals<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
fx: &FunctionCx<'a, 'tcx, Bx>,

View File

@ -24,6 +24,7 @@ use rustc_span::{source_map::Spanned, sym, Span};
use rustc_target::abi::call::{ArgAbi, FnAbi, PassMode, Reg};
use rustc_target::abi::{self, HasDataLayout, WrappingRange};
use rustc_target::spec::abi::Abi;
use tracing::{debug, info};
use std::cmp;

View File

@ -7,6 +7,8 @@ use rustc_index::IndexVec;
use rustc_middle::mir;
use rustc_middle::ty::print::with_no_trimmed_paths;
use std::ops::{Index, IndexMut};
use tracing::{debug, warn};
pub(super) struct Locals<'tcx, V> {
values: IndexVec<mir::Local, LocalRef<'tcx, V>>,
}

View File

@ -10,6 +10,7 @@ use rustc_middle::ty::layout::{FnAbiOf, HasTyCtxt, TyAndLayout};
use rustc_middle::ty::{self, Instance, Ty, TyCtxt, TypeFoldable, TypeVisitableExt};
use rustc_middle::{bug, span_bug};
use rustc_target::abi::call::{FnAbi, PassMode};
use tracing::{debug, instrument};
use std::iter;

View File

@ -16,6 +16,7 @@ use std::fmt;
use arrayvec::ArrayVec;
use either::Either;
use tracing::debug;
/// The representation of a Rust value. The enum variant is in fact
/// uniquely determined by the value's type, but is kept as a

View File

@ -12,6 +12,7 @@ use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf, TyAndLayout};
use rustc_middle::ty::{self, Ty};
use rustc_target::abi::{Align, FieldsShape, Int, Pointer, Size, TagEncoding};
use rustc_target::abi::{VariantIdx, Variants};
use tracing::{debug, instrument};
/// The location and extra runtime properties of the place.
///
@ -159,9 +160,9 @@ impl<'a, 'tcx, V: CodegenObject> PlaceRef<'tcx, V> {
bx.inbounds_ptradd(self.val.llval, bx.const_usize(offset.bytes()))
};
let val = PlaceValue {
llval,
llval,
llextra: if bx.cx().type_has_metadata(field.ty) { self.val.llextra } else { None },
align: effective_field_align,
align: effective_field_align,
};
val.with_type(field)
};
@ -408,9 +409,9 @@ impl<'a, 'tcx, V: CodegenObject> PlaceRef<'tcx, V> {
};
let llval = bx.inbounds_gep(
bx.cx().backend_type(self.layout),
self.val.llval,
&[bx.cx().const_usize(0), llindex],
bx.cx().backend_type(self.layout),
self.val.llval,
&[bx.cx().const_usize(0), llindex],
);
let align = self.val.align.restrict_for_offset(offset);
PlaceValue::new_sized(llval, align).with_type(layout)

View File

@ -17,6 +17,7 @@ use rustc_span::{Span, DUMMY_SP};
use rustc_target::abi::{self, FieldIdx, FIRST_VARIANT};
use arrayvec::ArrayVec;
use tracing::{debug, instrument};
impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
#[instrument(level = "trace", skip(self, bx))]

View File

@ -1,6 +1,7 @@
use rustc_middle::mir::{self, NonDivergingIntrinsic};
use rustc_middle::span_bug;
use rustc_session::config::OptLevel;
use tracing::instrument;
use super::FunctionCx;
use super::LocalRef;

View File

@ -9,6 +9,7 @@ use rustc_middle::span_bug;
use rustc_middle::ty;
use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf};
use rustc_middle::ty::Instance;
use tracing::debug;
pub trait MonoItemExt<'a, 'tcx> {
fn define<Bx: BuilderMethods<'a, 'tcx>>(&self, cx: &'a Bx::CodegenCx);

View File

@ -9,6 +9,7 @@ use rustc_middle::bug;
use rustc_middle::ty::print::{with_no_trimmed_paths, with_no_visible_paths};
use rustc_middle::ty::{self, Ty};
use rustc_target::abi::WrappingRange;
use tracing::{debug, trace};
pub fn size_and_align_of_dst<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
bx: &mut Bx,

View File

@ -1,6 +1,7 @@
use std::sync::atomic::Ordering::Relaxed;
use either::{Left, Right};
use tracing::{debug, instrument, trace};
use rustc_hir::def::DefKind;
use rustc_middle::bug;

View File

@ -21,6 +21,7 @@ use rustc_span::symbol::{sym, Symbol};
use rustc_span::Span;
use rustc_target::abi::{Align, Size};
use rustc_target::spec::abi::Abi as CallAbi;
use tracing::debug;
use crate::errors::{LongRunning, LongRunningWarn};
use crate::fluent_generated as fluent;

View File

@ -6,6 +6,7 @@ use rustc_middle::mir::interpret::InterpErrorInfo;
use rustc_middle::query::{Key, TyCtxtAt};
use rustc_middle::ty::{self, Ty, TyCtxt};
use rustc_target::abi::VariantIdx;
use tracing::instrument;
use crate::interpret::{format_interp_error, InterpCx};

View File

@ -6,6 +6,7 @@ use rustc_middle::ty::layout::{LayoutCx, LayoutOf, TyAndLayout};
use rustc_middle::ty::{self, ScalarInt, Ty, TyCtxt};
use rustc_span::DUMMY_SP;
use rustc_target::abi::{Abi, VariantIdx};
use tracing::{debug, instrument, trace};
use super::eval_queries::{mk_eval_cx_to_read_const_val, op_to_const};
use super::machine::CompileTimeEvalContext;

View File

@ -10,6 +10,7 @@ use rustc_middle::ty::{self, FloatTy, Ty};
use rustc_middle::{bug, span_bug};
use rustc_target::abi::Integer;
use rustc_type_ir::TyKind::*;
use tracing::trace;
use super::{
err_inval, throw_ub, throw_ub_custom, util::ensure_monomorphic_enough, FnVal, ImmTy, Immediate,

View File

@ -6,6 +6,7 @@ use rustc_middle::ty::layout::{LayoutOf, PrimitiveExt};
use rustc_middle::ty::{self, ScalarInt, Ty};
use rustc_target::abi::{self, TagEncoding};
use rustc_target::abi::{VariantIdx, Variants};
use tracing::{instrument, trace};
use super::{
err_ub, throw_ub, ImmTy, InterpCx, InterpResult, Machine, Readable, Scalar, Writeable,

View File

@ -2,6 +2,7 @@ use std::cell::Cell;
use std::{fmt, mem};
use either::{Either, Left, Right};
use tracing::{debug, info, info_span, instrument, trace};
use hir::CRATE_HIR_ID;
use rustc_errors::DiagCtxt;

View File

@ -23,6 +23,7 @@ use rustc_middle::query::TyCtxtAt;
use rustc_middle::ty::layout::TyAndLayout;
use rustc_span::def_id::LocalDefId;
use rustc_span::sym;
use tracing::{instrument, trace};
use super::{err_ub, AllocId, Allocation, InterpCx, MPlaceTy, Machine, MemoryKind, PlaceTy};
use crate::const_eval;

View File

@ -14,6 +14,7 @@ use rustc_middle::{
};
use rustc_span::symbol::{sym, Symbol};
use rustc_target::abi::Size;
use tracing::trace;
use super::{
err_inval, err_ub_custom, err_unsup_format, memory::MemoryKind, throw_inval, throw_ub_custom,

View File

@ -21,6 +21,8 @@ use rustc_middle::mir::display_allocation;
use rustc_middle::ty::{self, Instance, ParamEnv, Ty, TyCtxt};
use rustc_target::abi::{Align, HasDataLayout, Size};
use tracing::{debug, instrument, trace};
use crate::fluent_generated as fluent;
use super::{

View File

@ -4,6 +4,7 @@
use std::assert_matches::assert_matches;
use either::{Either, Left, Right};
use tracing::trace;
use rustc_hir::def::Namespace;
use rustc_middle::mir::interpret::ScalarSizeMismatch;

View File

@ -7,6 +7,7 @@ use rustc_middle::ty::layout::{LayoutOf, TyAndLayout};
use rustc_middle::ty::{self, FloatTy, ScalarInt};
use rustc_middle::{bug, span_bug};
use rustc_span::symbol::sym;
use tracing::trace;
use super::{err_ub, throw_ub, ImmTy, InterpCx, Machine};

View File

@ -5,6 +5,7 @@
use std::assert_matches::assert_matches;
use either::{Either, Left, Right};
use tracing::{instrument, trace};
use rustc_ast::Mutability;
use rustc_middle::mir;

View File

@ -18,6 +18,8 @@ use rustc_middle::{bug, span_bug};
use rustc_target::abi::Size;
use rustc_target::abi::{self, VariantIdx};
use tracing::{debug, instrument};
use super::{
throw_ub, throw_unsup_format, InterpCx, InterpResult, MPlaceTy, Machine, MemPlaceMeta, OpTy,
Provenance, Scalar,

View File

@ -3,6 +3,7 @@
//! The main entry point is the `step` method.
use either::Either;
use tracing::{info, instrument, trace};
use rustc_index::IndexSlice;
use rustc_middle::mir;

View File

@ -1,6 +1,7 @@
use std::borrow::Cow;
use either::Either;
use tracing::trace;
use rustc_middle::span_bug;
use rustc_middle::{

View File

@ -2,6 +2,7 @@ use rustc_middle::mir::interpret::{InterpResult, Pointer};
use rustc_middle::ty::layout::LayoutOf;
use rustc_middle::ty::{self, Ty, TyCtxt};
use rustc_target::abi::{Align, Size};
use tracing::trace;
use super::util::ensure_monomorphic_enough;
use super::{InterpCx, Machine};

View File

@ -7,6 +7,7 @@ use rustc_middle::ty::{
self, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor,
};
use std::ops::ControlFlow;
use tracing::debug;
use super::{throw_inval, InterpCx, MPlaceTy, MemPlaceMeta, MemoryKind};

View File

@ -8,6 +8,7 @@ use std::fmt::Write;
use std::num::NonZero;
use either::{Left, Right};
use tracing::trace;
use hir::def::DefKind;
use rustc_ast::Mutability;

View File

@ -6,6 +6,7 @@ use rustc_middle::mir::interpret::InterpResult;
use rustc_middle::ty::{self, Ty};
use rustc_target::abi::FieldIdx;
use rustc_target::abi::{FieldsShape, VariantIdx, Variants};
use tracing::trace;
use std::num::NonZero;

View File

@ -14,9 +14,6 @@
#![feature(yeet_expr)]
#![feature(if_let_guard)]
#[macro_use]
extern crate tracing;
pub mod const_eval;
mod errors;
pub mod interpret;

View File

@ -20,6 +20,8 @@ use rustc_type_ir::visit::{TypeSuperVisitable, TypeVisitor};
use std::mem;
use std::ops::Deref;
use tracing::{debug, instrument, trace};
use super::ops::{self, NonConstOp, Status};
use super::qualifs::{self, HasMutInterior, NeedsDrop, NeedsNonConstDrop};
use super::resolver::FlowSensitiveAnalysis;

View File

@ -19,6 +19,7 @@ use rustc_session::parse::feature_err;
use rustc_span::symbol::sym;
use rustc_span::{BytePos, Pos, Span, Symbol};
use rustc_trait_selection::traits::SelectionContext;
use tracing::debug;
use super::ConstCx;
use crate::errors;

View File

@ -2,6 +2,7 @@ use rustc_middle::mir::visit::Visitor;
use rustc_middle::mir::{self, BasicBlock, Location};
use rustc_middle::ty::{Ty, TyCtxt};
use rustc_span::{symbol::sym, Span};
use tracing::trace;
use super::check::Qualifs;
use super::ops::{self, NonConstOp};

View File

@ -13,6 +13,7 @@ use rustc_middle::ty::{self, AdtDef, GenericArgsRef, Ty};
use rustc_trait_selection::traits::{
ImplSource, Obligation, ObligationCause, ObligationCtxt, SelectionContext,
};
use tracing::{instrument, trace};
use super::ConstCx;

View File

@ -1,6 +1,7 @@
use rustc_middle::mir::*;
use rustc_middle::ty::{self, TyCtxt};
use rustc_target::abi::Align;
use tracing::debug;
/// Returns `true` if this place is allowed to be less aligned
/// than its containing struct (because it is within a packed

View File

@ -5,6 +5,7 @@ use rustc_middle::query::TyCtxtAt;
use rustc_middle::ty::layout::LayoutOf;
use rustc_middle::ty::{self, Mutability};
use rustc_span::symbol::Symbol;
use tracing::trace;
use crate::const_eval::{mk_eval_cx_to_read_const_val, CanAccessMutGlobal, CompileTimeEvalContext};
use crate::interpret::*;

View File

@ -5,9 +5,6 @@
#![feature(type_alias_impl_trait)]
#![allow(internal_features)]
#[macro_use]
extern crate tracing;
use fluent_bundle::FluentResource;
use fluent_syntax::parser::ParserError;
use icu_provider_adapters::fallback::{LocaleFallbackProvider, LocaleFallbacker};
@ -20,6 +17,7 @@ use std::fmt;
use std::fs;
use std::io;
use std::path::{Path, PathBuf};
use tracing::{instrument, trace};
#[cfg(not(parallel_compiler))]
use std::cell::LazyCell as Lazy;

View File

@ -49,10 +49,10 @@ use rustc_middle::ty::TyCtxt;
use rustc_middle::{bug, span_bug};
use rustc_span::symbol::{sym, Symbol};
use rustc_span::Span;
use std::env;
use std::fs::{self, File};
use std::io::{BufWriter, Write};
use tracing::debug;
#[allow(missing_docs)]
pub fn assert_dep_graph(tcx: TyCtxt<'_>) {

View File

@ -6,9 +6,6 @@
#![feature(rustdoc_internals)]
#![allow(internal_features)]
#[macro_use]
extern crate tracing;
mod assert_dep_graph;
mod errors;
mod persist;

View File

@ -33,6 +33,7 @@ use rustc_middle::ty::TyCtxt;
use rustc_span::symbol::{sym, Symbol};
use rustc_span::Span;
use thin_vec::ThinVec;
use tracing::debug;
const LOADED_FROM_DISK: Symbol = sym::loaded_from_disk;
const EXCEPT: Symbol = sym::except;

View File

@ -19,6 +19,7 @@ use std::env;
use std::fs;
use std::io::{self, Read};
use std::path::{Path, PathBuf};
use tracing::debug;
/// The first few bytes of files generated by incremental compilation.
const FILE_MAGIC: &[u8] = b"RSIC";

View File

@ -125,6 +125,7 @@ use std::path::{Path, PathBuf};
use std::time::{Duration, SystemTime, UNIX_EPOCH};
use rand::{thread_rng, RngCore};
use tracing::debug;
#[cfg(test)]
mod tests;

View File

@ -12,6 +12,7 @@ use rustc_session::Session;
use rustc_span::ErrorGuaranteed;
use std::path::{Path, PathBuf};
use std::sync::Arc;
use tracing::{debug, warn};
use super::data::*;
use super::file_format;

View File

@ -11,6 +11,7 @@ use rustc_serialize::Encodable as RustcEncodable;
use rustc_session::Session;
use std::fs;
use std::sync::Arc;
use tracing::debug;
use super::data::*;
use super::dirty_clean;

View File

@ -10,6 +10,7 @@ use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
use rustc_session::Session;
use std::fs as std_fs;
use std::path::Path;
use tracing::debug;
/// Copies a CGU work product to the incremental compilation directory, so next compilation can
/// find and reuse it.

View File

@ -11,7 +11,6 @@ use rustc_data_structures::sync::Lrc;
use rustc_errors::registry::Registry;
use rustc_errors::{DiagCtxt, ErrorGuaranteed};
use rustc_lint::LintStore;
use rustc_middle::ty;
use rustc_middle::ty::CurrentGcx;
use rustc_middle::util::Providers;
@ -28,6 +27,7 @@ use rustc_span::FileName;
use std::path::PathBuf;
use std::result;
use std::sync::Arc;
use tracing::trace;
pub type Result<T> = result::Result<T, ErrorGuaranteed>;

View File

@ -4,9 +4,6 @@
#![feature(thread_spawn_unchecked)]
#![feature(try_blocks)]
#[macro_use]
extern crate tracing;
mod callbacks;
mod errors;
pub mod interface;

View File

@ -39,6 +39,7 @@ use std::io::{self, BufWriter, Write};
use std::path::{Path, PathBuf};
use std::sync::LazyLock;
use std::{env, fs, iter};
use tracing::{info, instrument};
pub fn parse<'a>(sess: &'a Session) -> PResult<'a, ast::Crate> {
let krate = sess.time("parse_crate", || match &sess.io.input {

View File

@ -1,5 +1,4 @@
use crate::errors;
use info;
use rustc_ast as ast;
use rustc_codegen_ssa::traits::CodegenBackend;
#[cfg(parallel_compiler)]
@ -23,6 +22,7 @@ use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::OnceLock;
use std::thread;
use std::{env, iter};
use tracing::info;
/// Function pointer type that constructs a new CodegenBackend.
pub type MakeBackendFn = fn() -> Box<dyn CodegenBackend>;

View File

@ -70,6 +70,7 @@ use rustc_target::abi::Abi;
use rustc_trait_selection::infer::{InferCtxtExt, TyCtxtInferExt};
use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt as _;
use rustc_trait_selection::traits::{self, misc::type_allowed_to_implement_copy};
use tracing::debug;
use crate::nonstandard_style::{method_context, MethodLateContext};

View File

@ -39,10 +39,10 @@ use rustc_span::edit_distance::find_best_match_for_names;
use rustc_span::symbol::{sym, Ident, Symbol};
use rustc_span::Span;
use rustc_target::abi;
use std::cell::Cell;
use std::iter;
use std::slice;
use tracing::debug;
mod diagnostics;

View File

@ -9,6 +9,7 @@ use rustc_errors::{elided_lifetime_in_path_suggestion, DiagArgValue, MultiSpan};
use rustc_middle::middle::stability;
use rustc_session::lint::{BuiltinLintDiag, Lint};
use rustc_span::BytePos;
use tracing::debug;
use crate::{lints, EarlyContext, LintContext as _};

View File

@ -26,6 +26,7 @@ use rustc_session::lint::{BufferedEarlyLint, LintBuffer, LintPass};
use rustc_session::Session;
use rustc_span::symbol::Ident;
use rustc_span::Span;
use tracing::debug;
macro_rules! lint_callback { ($cx:expr, $f:ident, $($args:expr),*) => ({
$cx.pass.$f(&$cx.context, $($args),*);

View File

@ -8,6 +8,7 @@ use rustc_middle::ty::{self, Instance, Ty, TyCtxt};
use rustc_session::declare_lint;
use rustc_span::{sym, Span, Symbol};
use rustc_target::abi::FIRST_VARIANT;
use tracing::{debug, instrument};
use crate::lints::{BuiltinClashingExtern, BuiltinClashingExternSub};
use crate::{types, LintVec};

View File

@ -15,6 +15,7 @@ use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::hygiene::{ExpnKind, MacroKind};
use rustc_span::symbol::{kw, sym, Symbol};
use rustc_span::Span;
use tracing::debug;
declare_tool_lint! {
/// The `default_hash_type` lint detects use of [`std::collections::HashMap`]/[`std::collections::HashSet`],

View File

@ -26,9 +26,9 @@ use rustc_middle::ty::{self, TyCtxt};
use rustc_session::lint::LintPass;
use rustc_session::Session;
use rustc_span::Span;
use std::any::Any;
use std::cell::Cell;
use tracing::debug;
/// Extract the [`LintStore`] from [`Session`].
///

View File

@ -41,6 +41,7 @@ use rustc_session::parse::feature_err;
use rustc_session::Session;
use rustc_span::symbol::{sym, Symbol};
use rustc_span::{Span, DUMMY_SP};
use tracing::{debug, instrument};
use crate::errors::{
MalformedAttribute, MalformedAttributeSub, OverruledAttribute, OverruledAttributeSub,

View File

@ -39,9 +39,6 @@
#![feature(rustc_attrs)]
#![allow(internal_features)]
#[macro_use]
extern crate tracing;
mod async_fn_in_trait;
pub mod builtin;
mod context;

View File

@ -31,9 +31,9 @@ use rustc_span::{Span, Symbol};
use rustc_target::abi::{Abi, Size, WrappingRange};
use rustc_target::abi::{Integer, TagEncoding, Variants};
use rustc_target::spec::abi::Abi as SpecAbi;
use std::iter;
use std::ops::ControlFlow;
use tracing::debug;
declare_lint! {
/// The `unused_comparisons` lint detects comparisons made useless by

View File

@ -22,6 +22,7 @@ use rustc_span::symbol::{kw, sym};
use rustc_span::{BytePos, Span};
use std::iter;
use std::ops::ControlFlow;
use tracing::instrument;
declare_lint! {
/// The `unused_must_use` lint detects unused result of a type flagged as

View File

@ -27,6 +27,7 @@ use rustc_span::edition::Edition;
use rustc_span::symbol::{sym, Symbol};
use rustc_span::{Span, DUMMY_SP};
use rustc_target::spec::{PanicStrategy, Target, TargetTriple};
use tracing::{debug, info, trace};
use proc_macro::bridge::client::ProcMacro;
use std::error::Error;

View File

@ -65,6 +65,7 @@ use rustc_middle::ty::TyCtxt;
use rustc_session::config::CrateType;
use rustc_session::cstore::CrateDepKind;
use rustc_session::cstore::LinkagePreference::{self, RequireDynamic, RequireStatic};
use tracing::info;
pub(crate) fn calculate(tcx: TyCtxt<'_>) -> Dependencies {
tcx.crate_types()

View File

@ -20,9 +20,6 @@
extern crate proc_macro;
#[macro_use]
extern crate tracing;
pub use rmeta::provide;
mod dependency_format;

View File

@ -231,6 +231,7 @@ use rustc_session::Session;
use rustc_span::symbol::Symbol;
use rustc_span::Span;
use rustc_target::spec::{Target, TargetTriple};
use tracing::{debug, info};
use snap::read::FrameDecoder;
use std::borrow::Cow;

View File

@ -28,6 +28,7 @@ use rustc_session::cstore::{CrateSource, ExternCrate};
use rustc_session::Session;
use rustc_span::symbol::kw;
use rustc_span::{BytePos, Pos, SpanData, SpanDecoder, SyntaxContext, DUMMY_SP};
use tracing::debug;
use proc_macro::bridge::client::ProcMacro;
use std::iter::TrustedLen;

View File

@ -33,6 +33,7 @@ use std::collections::hash_map::Entry;
use std::fs::File;
use std::io::{Read, Seek, Write};
use std::path::{Path, PathBuf};
use tracing::{debug, instrument, trace};
pub(super) struct EncodeContext<'a, 'tcx> {
opaque: opaque::FileEncoder,

View File

@ -2,6 +2,7 @@ use crate::rmeta::*;
use rustc_hir::def::CtorOf;
use rustc_index::Idx;
use tracing::trace;
pub(super) trait IsDefault: Default {
fn is_default(&self) -> bool;

View File

@ -10,6 +10,7 @@ use rustc_hir::def_id::{DefId, DefPathHash};
use rustc_session::StableCrateId;
use rustc_span::def_id::{CrateNum, LocalDefId};
use rustc_span::{ExpnHash, ExpnId, DUMMY_SP};
use tracing::instrument;
macro_rules! declare_hooks {
($($(#[$attr:meta])*hook $name:ident($($arg:ident: $K:ty),*) -> $V:ty;)*) => {

View File

@ -63,9 +63,6 @@
#![feature(yeet_expr)]
// tidy-alphabetical-end
#[macro_use]
extern crate tracing;
#[cfg(test)]
mod tests;

View File

@ -12,6 +12,7 @@ use rustc_session::lint::{
use rustc_session::Session;
use rustc_span::hygiene::{ExpnKind, MacroKind};
use rustc_span::{symbol, DesugaringKind, Span, Symbol, DUMMY_SP};
use tracing::instrument;
use crate::ty::TyCtxt;

View File

@ -13,6 +13,7 @@ use rustc_hir as hir;
use rustc_hir::{HirId, HirIdMap, Node};
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
use rustc_span::{Span, DUMMY_SP};
use tracing::debug;
use std::fmt;
use std::ops::Deref;

Some files were not shown because too many files have changed in this diff Show More