1
Fork 0

Always import all tracing macros for the entire crate instead of piecemeal by module

This commit is contained in:
Oli Scherer 2022-08-31 13:09:26 +00:00
parent d3b22c7267
commit ee3c835018
88 changed files with 76 additions and 119 deletions

View file

@ -26,6 +26,9 @@
#[macro_use] #[macro_use]
extern crate rustc_macros; extern crate rustc_macros;
#[macro_use]
extern crate tracing;
pub mod util { pub mod util {
pub mod classify; pub mod classify;
pub mod comments; pub mod comments;

View file

@ -9,7 +9,6 @@ use rustc_span::symbol::{kw, sym, Symbol};
use rustc_span::Span; use rustc_span::Span;
use std::ascii; use std::ascii;
use tracing::debug;
pub enum LitError { pub enum LitError {
NotLiteral, NotLiteral,

View file

@ -11,8 +11,6 @@ use rustc_session::Session;
use rustc_span::source_map::SourceMap; use rustc_span::source_map::SourceMap;
use rustc_span::{Span, DUMMY_SP}; use rustc_span::{Span, DUMMY_SP};
use tracing::debug;
/// A visitor that walks over the HIR and collects `Node`s into a HIR map. /// A visitor that walks over the HIR and collects `Node`s into a HIR map.
pub(super) struct NodeCollector<'a, 'hir> { pub(super) struct NodeCollector<'a, 'hir> {
/// Source map /// Source map

View file

@ -13,7 +13,6 @@ use rustc_span::symbol::{kw, Ident};
use rustc_span::{BytePos, Span, DUMMY_SP}; use rustc_span::{BytePos, Span, DUMMY_SP};
use smallvec::smallvec; use smallvec::smallvec;
use tracing::debug;
impl<'a, 'hir> LoweringContext<'a, 'hir> { impl<'a, 'hir> LoweringContext<'a, 'hir> {
#[instrument(level = "trace", skip(self))] #[instrument(level = "trace", skip(self))]

View file

@ -11,8 +11,6 @@ use rustc_span::source_map::Spanned;
use rustc_span::symbol::sym; use rustc_span::symbol::sym;
use rustc_span::Span; use rustc_span::Span;
use tracing::debug;
macro_rules! gate_feature_fn { macro_rules! gate_feature_fn {
($visitor: expr, $has_feature: expr, $span: expr, $name: expr, $explain: expr, $help: expr) => {{ ($visitor: expr, $has_feature: expr, $span: expr, $name: expr, $explain: expr, $help: expr) => {{
let (visitor, has_feature, span, name, explain, help) = let (visitor, has_feature, span, name, explain, help) =

View file

@ -12,6 +12,9 @@
#![feature(let_else)] #![feature(let_else)]
#![recursion_limit = "256"] #![recursion_limit = "256"]
#[macro_use]
extern crate tracing;
pub mod ast_validation; pub mod ast_validation;
mod errors; mod errors;
pub mod feature_gate; pub mod feature_gate;

View file

@ -6,7 +6,6 @@ use rustc_errors::Diagnostic;
use rustc_middle::ty::RegionVid; use rustc_middle::ty::RegionVid;
use smallvec::SmallVec; use smallvec::SmallVec;
use std::collections::BTreeMap; use std::collections::BTreeMap;
use tracing::debug;
use crate::MirBorrowckCtxt; use crate::MirBorrowckCtxt;

View file

@ -16,6 +16,9 @@
extern crate proc_macro; extern crate proc_macro;
#[macro_use]
extern crate tracing;
use crate::deriving::*; use crate::deriving::*;
use rustc_expand::base::{MacroExpanderFn, ResolverExpand, SyntaxExtensionKind}; use rustc_expand::base::{MacroExpanderFn, ResolverExpand, SyntaxExtensionKind};

View file

@ -335,7 +335,7 @@ pub fn expand_test_or_bench(
// extern crate test // extern crate test
let test_extern = cx.item(sp, test_id, ast::AttrVec::new(), ast::ItemKind::ExternCrate(None)); let test_extern = cx.item(sp, test_id, ast::AttrVec::new(), ast::ItemKind::ExternCrate(None));
tracing::debug!("synthetic test item:\n{}\n", pprust::item_to_string(&test_const)); debug!("synthetic test item:\n{}\n", pprust::item_to_string(&test_const));
if is_stmt { if is_stmt {
vec![ vec![

View file

@ -15,7 +15,6 @@ use rustc_span::{Span, DUMMY_SP};
use rustc_target::spec::PanicStrategy; use rustc_target::spec::PanicStrategy;
use smallvec::{smallvec, SmallVec}; use smallvec::{smallvec, SmallVec};
use thin_vec::thin_vec; use thin_vec::thin_vec;
use tracing::debug;
use std::{iter, mem}; use std::{iter, mem};

View file

@ -19,7 +19,6 @@ use rustc_target::asm::*;
use libc::{c_char, c_uint}; use libc::{c_char, c_uint};
use smallvec::SmallVec; use smallvec::SmallVec;
use tracing::debug;
impl<'ll, 'tcx> AsmBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> { impl<'ll, 'tcx> AsmBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> {
fn codegen_inline_asm( fn codegen_inline_asm(

View file

@ -190,10 +190,10 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder {
let output_path_z = rustc_fs_util::path_to_c_string(&output_path); let output_path_z = rustc_fs_util::path_to_c_string(&output_path);
tracing::trace!("invoking LLVMRustWriteImportLibrary"); trace!("invoking LLVMRustWriteImportLibrary");
tracing::trace!(" dll_name {:#?}", dll_name_z); trace!(" dll_name {:#?}", dll_name_z);
tracing::trace!(" output_path {}", output_path.display()); trace!(" output_path {}", output_path.display());
tracing::trace!( trace!(
" import names: {}", " import names: {}",
dll_imports dll_imports
.iter() .iter()

View file

@ -18,7 +18,6 @@ use rustc_middle::dep_graph::WorkProduct;
use rustc_middle::middle::exported_symbols::{SymbolExportInfo, SymbolExportLevel}; use rustc_middle::middle::exported_symbols::{SymbolExportInfo, SymbolExportLevel};
use rustc_session::cgu_reuse_tracker::CguReuse; use rustc_session::cgu_reuse_tracker::CguReuse;
use rustc_session::config::{self, CrateType, Lto}; use rustc_session::config::{self, CrateType, Lto};
use tracing::{debug, info};
use std::ffi::{CStr, CString}; use std::ffi::{CStr, CString};
use std::fs::File; use std::fs::File;

View file

@ -28,7 +28,6 @@ use rustc_session::Session;
use rustc_span::symbol::sym; use rustc_span::symbol::sym;
use rustc_span::InnerSpan; use rustc_span::InnerSpan;
use rustc_target::spec::{CodeModel, RelocModel, SanitizerSet, SplitDebuginfo}; use rustc_target::spec::{CodeModel, RelocModel, SanitizerSet, SplitDebuginfo};
use tracing::debug;
use libc::{c_char, c_int, c_uint, c_void, size_t}; use libc::{c_char, c_int, c_uint, c_void, size_t};
use std::ffi::CString; use std::ffi::CString;

View file

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

View file

@ -11,7 +11,6 @@ use crate::context::CodegenCx;
use crate::llvm; use crate::llvm;
use crate::value::Value; use crate::value::Value;
use rustc_codegen_ssa::traits::*; use rustc_codegen_ssa::traits::*;
use tracing::debug;
use rustc_middle::ty::layout::{FnAbiOf, HasTyCtxt}; use rustc_middle::ty::layout::{FnAbiOf, HasTyCtxt};
use rustc_middle::ty::{self, Instance, TypeVisitable}; use rustc_middle::ty::{self, Instance, TypeVisitable};

View file

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

View file

@ -23,7 +23,6 @@ use rustc_target::abi::{
AddressSpace, Align, HasDataLayout, Primitive, Scalar, Size, WrappingRange, AddressSpace, Align, HasDataLayout, Primitive, Scalar, Size, WrappingRange,
}; };
use std::ops::Range; use std::ops::Range;
use tracing::debug;
pub fn const_alloc_to_llvm<'ll>(cx: &CodegenCx<'ll, '_>, alloc: ConstAllocation<'_>) -> &'ll Value { pub fn const_alloc_to_llvm<'ll>(cx: &CodegenCx<'ll, '_>, alloc: ConstAllocation<'_>) -> &'ll Value {
let alloc = alloc.inner(); let alloc = alloc.inner();

View file

@ -16,8 +16,6 @@ use rustc_middle::ty::TyCtxt;
use std::ffi::CString; use std::ffi::CString;
use tracing::debug;
/// Generates and exports the Coverage Map. /// Generates and exports the Coverage Map.
/// ///
/// Rust Coverage Map generation supports LLVM Coverage Mapping Format versions /// Rust Coverage Map generation supports LLVM Coverage Mapping Format versions

View file

@ -28,7 +28,6 @@ use std::cell::RefCell;
use std::ffi::CString; use std::ffi::CString;
use std::iter; use std::iter;
use tracing::debug;
pub mod mapgen; pub mod mapgen;

View file

@ -39,7 +39,6 @@ use smallvec::SmallVec;
use std::cell::OnceCell; use std::cell::OnceCell;
use std::cell::RefCell; use std::cell::RefCell;
use std::iter; use std::iter;
use tracing::debug;
mod create_scope_map; mod create_scope_map;
pub mod gdb; pub mod gdb;

View file

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

View file

@ -22,7 +22,6 @@ use rustc_codegen_ssa::traits::TypeMembershipMethods;
use rustc_middle::ty::Ty; use rustc_middle::ty::Ty;
use rustc_symbol_mangling::typeid::typeid_for_fnabi; use rustc_symbol_mangling::typeid::typeid_for_fnabi;
use smallvec::SmallVec; use smallvec::SmallVec;
use tracing::debug;
/// Declare a function. /// Declare a function.
/// ///

View file

@ -15,7 +15,6 @@ use rustc_span::symbol::Symbol;
use rustc_target::spec::{MergeFunctions, PanicStrategy}; use rustc_target::spec::{MergeFunctions, PanicStrategy};
use smallvec::{smallvec, SmallVec}; use smallvec::{smallvec, SmallVec};
use std::ffi::{CStr, CString}; use std::ffi::{CStr, CString};
use tracing::debug;
use std::mem; use std::mem;
use std::path::Path; use std::path::Path;

View file

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

View file

@ -11,7 +11,6 @@ use rustc_target::abi::{Abi, AddressSpace, Align, FieldsShape};
use rustc_target::abi::{Int, Pointer, F32, F64}; use rustc_target::abi::{Int, Pointer, F32, F64};
use rustc_target::abi::{PointeeInfo, Scalar, Size, TyAbiInterface, Variants}; use rustc_target::abi::{PointeeInfo, Scalar, Size, TyAbiInterface, Variants};
use smallvec::{smallvec, SmallVec}; use smallvec::{smallvec, SmallVec};
use tracing::debug;
use std::fmt::Write; use std::fmt::Write;

View file

@ -5,6 +5,9 @@
#![deny(rustc::untranslatable_diagnostic)] #![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)] #![deny(rustc::diagnostic_outside_of_impl)]
#[macro_use]
extern crate tracing;
use fluent_bundle::FluentResource; use fluent_bundle::FluentResource;
use fluent_syntax::parser::ParserError; use fluent_syntax::parser::ParserError;
use rustc_data_structures::sync::Lrc; use rustc_data_structures::sync::Lrc;
@ -16,7 +19,6 @@ use std::fmt;
use std::fs; use std::fs;
use std::io; use std::io;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use tracing::{instrument, trace};
#[cfg(not(parallel_compiler))] #[cfg(not(parallel_compiler))]
use std::cell::LazyCell as Lazy; use std::cell::LazyCell as Lazy;

View file

@ -12,7 +12,6 @@ use std::fmt::{self, Debug};
use std::marker::PhantomData; use std::marker::PhantomData;
use std::ops::{Deref, DerefMut}; use std::ops::{Deref, DerefMut};
use std::thread::panicking; use std::thread::panicking;
use tracing::debug;
/// Used for emitting structured error messages and other diagnostic information. /// Used for emitting structured error messages and other diagnostic information.
/// ///

View file

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

View file

@ -15,6 +15,9 @@
#[macro_use] #[macro_use]
extern crate rustc_macros; extern crate rustc_macros;
#[macro_use]
extern crate tracing;
extern crate proc_macro as pm; extern crate proc_macro as pm;
mod placeholders; mod placeholders;

View file

@ -32,7 +32,6 @@ use rustc_span::Span;
use std::borrow::Cow; use std::borrow::Cow;
use std::collections::hash_map::Entry; use std::collections::hash_map::Entry;
use std::{mem, slice}; use std::{mem, slice};
use tracing::debug;
pub(crate) struct ParserAnyMacro<'a> { pub(crate) struct ParserAnyMacro<'a> {
parser: Parser<'a>, parser: Parser<'a>,

View file

@ -15,7 +15,6 @@ use rustc_span::symbol::{kw, sym, Symbol};
use std::fmt::{self, Write}; use std::fmt::{self, Write};
use std::hash::Hash; use std::hash::Hash;
use tracing::debug;
/// The `DefPathTable` maps `DefIndex`es to `DefKey`s and vice versa. /// The `DefPathTable` maps `DefIndex`es to `DefKey`s and vice versa.
/// Internally the `DefPathTable` holds a tree of `DefKey`s, where each `DefKey` /// Internally the `DefPathTable` holds a tree of `DefKey`s, where each `DefKey`

View file

@ -17,6 +17,9 @@
#[macro_use] #[macro_use]
extern crate rustc_macros; extern crate rustc_macros;
#[macro_use]
extern crate tracing;
#[macro_use] #[macro_use]
extern crate rustc_data_structures; extern crate rustc_data_structures;

View file

@ -332,7 +332,7 @@ pub fn create_compiler_and_run<R>(config: Config, f: impl FnOnce(&Compiler) -> R
// JUSTIFICATION: before session exists, only config // JUSTIFICATION: before session exists, only config
#[allow(rustc::bad_opt_access)] #[allow(rustc::bad_opt_access)]
pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Send) -> R { pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Send) -> R {
tracing::trace!("run_compiler"); trace!("run_compiler");
util::run_in_thread_pool_with_globals( util::run_in_thread_pool_with_globals(
config.opts.edition, config.opts.edition,
config.opts.unstable_opts.threads, config.opts.unstable_opts.threads,

View file

@ -8,6 +8,9 @@
#![deny(rustc::untranslatable_diagnostic)] #![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)] #![deny(rustc::diagnostic_outside_of_impl)]
#[macro_use]
extern crate tracing;
mod callbacks; mod callbacks;
mod errors; mod errors;
pub mod interface; pub mod interface;

View file

@ -38,7 +38,6 @@ use rustc_span::symbol::{sym, Symbol};
use rustc_span::FileName; use rustc_span::FileName;
use rustc_trait_selection::traits; use rustc_trait_selection::traits;
use rustc_typeck as typeck; use rustc_typeck as typeck;
use tracing::{info, warn};
use std::any::Any; use std::any::Any;
use std::cell::RefCell; use std::cell::RefCell;
@ -165,7 +164,7 @@ pub fn create_resolver(
krate: &ast::Crate, krate: &ast::Crate,
crate_name: &str, crate_name: &str,
) -> BoxedResolver { ) -> BoxedResolver {
tracing::trace!("create_resolver"); trace!("create_resolver");
BoxedResolver::new(sess, move |sess, resolver_arenas| { BoxedResolver::new(sess, move |sess, resolver_arenas| {
Resolver::new(sess, krate, crate_name, metadata_loader, resolver_arenas) Resolver::new(sess, krate, crate_name, metadata_loader, resolver_arenas)
}) })
@ -279,7 +278,7 @@ pub fn configure_and_expand(
crate_name: &str, crate_name: &str,
resolver: &mut Resolver<'_>, resolver: &mut Resolver<'_>,
) -> Result<ast::Crate> { ) -> Result<ast::Crate> {
tracing::trace!("configure_and_expand"); trace!("configure_and_expand");
pre_expansion_lint(sess, lint_store, resolver.registered_tools(), &krate, crate_name); pre_expansion_lint(sess, lint_store, resolver.registered_tools(), &krate, crate_name);
rustc_builtin_macros::register_builtin_macros(resolver); rustc_builtin_macros::register_builtin_macros(resolver);

View file

@ -166,7 +166,7 @@ impl<'tcx> Queries<'tcx> {
pub fn expansion( pub fn expansion(
&self, &self,
) -> Result<&Query<(Lrc<ast::Crate>, Rc<RefCell<BoxedResolver>>, Lrc<LintStore>)>> { ) -> Result<&Query<(Lrc<ast::Crate>, Rc<RefCell<BoxedResolver>>, Lrc<LintStore>)>> {
tracing::trace!("expansion"); trace!("expansion");
self.expansion.compute(|| { self.expansion.compute(|| {
let crate_name = self.crate_name()?.peek().clone(); let crate_name = self.crate_name()?.peek().clone();
let (krate, lint_store) = self.register_plugins()?.take(); let (krate, lint_store) = self.register_plugins()?.take();

View file

@ -1,3 +1,4 @@
use info;
use libloading::Library; use libloading::Library;
use rustc_ast as ast; use rustc_ast as ast;
use rustc_codegen_ssa::traits::CodegenBackend; use rustc_codegen_ssa::traits::CodegenBackend;
@ -31,7 +32,6 @@ use std::path::{Path, PathBuf};
use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::OnceLock; use std::sync::OnceLock;
use std::thread; use std::thread;
use tracing::info;
/// Function pointer type that constructs a new CodegenBackend. /// Function pointer type that constructs a new CodegenBackend.
pub type MakeBackendFn = fn() -> Box<dyn CodegenBackend>; pub type MakeBackendFn = fn() -> Box<dyn CodegenBackend>;

View file

@ -59,7 +59,6 @@ use rustc_trait_selection::traits::{self, misc::can_type_implement_copy};
use crate::nonstandard_style::{method_context, MethodLateContext}; use crate::nonstandard_style::{method_context, MethodLateContext};
use std::fmt::Write; use std::fmt::Write;
use tracing::{debug, trace};
// hardwired lints from librustc_middle // hardwired lints from librustc_middle
pub use rustc_session::lint::builtin::*; pub use rustc_session::lint::builtin::*;

View file

@ -45,7 +45,6 @@ use rustc_span::lev_distance::find_best_match_for_name;
use rustc_span::symbol::{sym, Ident, Symbol}; use rustc_span::symbol::{sym, Ident, Symbol};
use rustc_span::{BytePos, Span}; use rustc_span::{BytePos, Span};
use rustc_target::abi; use rustc_target::abi;
use tracing::debug;
use std::cell::Cell; use std::cell::Cell;
use std::iter; use std::iter;
@ -417,7 +416,7 @@ impl LintStore {
None => { None => {
// 1. The tool is currently running, so this lint really doesn't exist. // 1. The tool is currently running, so this lint really doesn't exist.
// FIXME: should this handle tools that never register a lint, like rustfmt? // FIXME: should this handle tools that never register a lint, like rustfmt?
tracing::debug!("lints={:?}", self.by_name.keys().collect::<Vec<_>>()); debug!("lints={:?}", self.by_name.keys().collect::<Vec<_>>());
let tool_prefix = format!("{}::", tool_name); let tool_prefix = format!("{}::", tool_name);
return if self.by_name.keys().any(|lint| lint.starts_with(&tool_prefix)) { return if self.by_name.keys().any(|lint| lint.starts_with(&tool_prefix)) {
self.no_lint_suggestion(&complete_name) self.no_lint_suggestion(&complete_name)
@ -510,7 +509,7 @@ impl LintStore {
CheckLintNameResult::Tool(Err((Some(slice::from_ref(id)), complete_name))) CheckLintNameResult::Tool(Err((Some(slice::from_ref(id)), complete_name)))
} }
Some(other) => { Some(other) => {
tracing::debug!("got renamed lint {:?}", other); debug!("got renamed lint {:?}", other);
CheckLintNameResult::NoLint(None) CheckLintNameResult::NoLint(None)
} }
} }

View file

@ -26,7 +26,6 @@ use rustc_span::symbol::Ident;
use rustc_span::Span; use rustc_span::Span;
use std::slice; use std::slice;
use tracing::debug;
macro_rules! run_early_pass { ($cx:expr, $f:ident, $($args:expr),*) => ({ macro_rules! run_early_pass { ($cx:expr, $f:ident, $($args:expr),*) => ({
$cx.pass.$f(&$cx.context, $($args),*); $cx.pass.$f(&$cx.context, $($args),*);

View file

@ -12,7 +12,6 @@ use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::hygiene::{ExpnKind, MacroKind}; use rustc_span::hygiene::{ExpnKind, MacroKind};
use rustc_span::symbol::{kw, sym, Symbol}; use rustc_span::symbol::{kw, sym, Symbol};
use rustc_span::Span; use rustc_span::Span;
use tracing::debug;
declare_tool_lint! { declare_tool_lint! {
pub rustc::DEFAULT_HASH_TYPES, pub rustc::DEFAULT_HASH_TYPES,

View file

@ -29,7 +29,6 @@ use rustc_span::Span;
use std::any::Any; use std::any::Any;
use std::cell::Cell; use std::cell::Cell;
use std::slice; use std::slice;
use tracing::debug;
/// Extract the `LintStore` from the query context. /// Extract the `LintStore` from the query context.
/// This function exists because we've erased `LintStore` as `dyn Any` in the context. /// This function exists because we've erased `LintStore` as `dyn Any` in the context.

View file

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

View file

@ -42,6 +42,8 @@
extern crate rustc_middle; extern crate rustc_middle;
#[macro_use] #[macro_use]
extern crate rustc_session; extern crate rustc_session;
#[macro_use]
extern crate tracing;
mod array_into_iter; mod array_into_iter;
pub mod builtin; pub mod builtin;

View file

@ -19,7 +19,6 @@ use rustc_target::spec::abi::Abi as SpecAbi;
use std::cmp; use std::cmp;
use std::iter; use std::iter;
use std::ops::ControlFlow; use std::ops::ControlFlow;
use tracing::debug;
declare_lint! { declare_lint! {
/// The `unused_comparisons` lint detects comparisons made useless by /// The `unused_comparisons` lint detects comparisons made useless by

View file

@ -29,7 +29,6 @@ use proc_macro::bridge::client::ProcMacro;
use std::ops::Fn; use std::ops::Fn;
use std::path::Path; use std::path::Path;
use std::{cmp, env}; use std::{cmp, env};
use tracing::{debug, info};
#[derive(Clone)] #[derive(Clone)]
pub struct CStore { pub struct CStore {
@ -263,7 +262,7 @@ impl<'a> CrateLoader<'a> {
fn existing_match(&self, name: Symbol, hash: Option<Svh>, kind: PathKind) -> Option<CrateNum> { fn existing_match(&self, name: Symbol, hash: Option<Svh>, kind: PathKind) -> Option<CrateNum> {
for (cnum, data) in self.cstore.iter_crate_data() { for (cnum, data) in self.cstore.iter_crate_data() {
if data.name() != name { if data.name() != name {
tracing::trace!("{} did not match {}", data.name(), name); trace!("{} did not match {}", data.name(), name);
continue; continue;
} }

View file

@ -158,11 +158,11 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList {
let name = tcx.crate_name(cnum); let name = tcx.crate_name(cnum);
let src = tcx.used_crate_source(cnum); let src = tcx.used_crate_source(cnum);
if src.dylib.is_some() { if src.dylib.is_some() {
tracing::info!("adding dylib: {}", name); info!("adding dylib: {}", name);
add_library(tcx, cnum, RequireDynamic, &mut formats); add_library(tcx, cnum, RequireDynamic, &mut formats);
let deps = tcx.dylib_dependency_formats(cnum); let deps = tcx.dylib_dependency_formats(cnum);
for &(depnum, style) in deps.iter() { for &(depnum, style) in deps.iter() {
tracing::info!("adding {:?}: {}", style, tcx.crate_name(depnum)); info!("adding {:?}: {}", style, tcx.crate_name(depnum));
add_library(tcx, depnum, style, &mut formats); add_library(tcx, depnum, style, &mut formats);
} }
} }
@ -190,7 +190,7 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList {
&& tcx.dep_kind(cnum) == CrateDepKind::Explicit && tcx.dep_kind(cnum) == CrateDepKind::Explicit
{ {
assert!(src.rlib.is_some() || src.rmeta.is_some()); assert!(src.rlib.is_some() || src.rmeta.is_some());
tracing::info!("adding staticlib: {}", tcx.crate_name(cnum)); info!("adding staticlib: {}", tcx.crate_name(cnum));
add_library(tcx, cnum, RequireStatic, &mut formats); add_library(tcx, cnum, RequireStatic, &mut formats);
ret[cnum.as_usize() - 1] = Linkage::Static; ret[cnum.as_usize() - 1] = Linkage::Static;
} }

View file

@ -26,6 +26,9 @@ extern crate rustc_middle;
#[macro_use] #[macro_use]
extern crate rustc_data_structures; extern crate rustc_data_structures;
#[macro_use]
extern crate tracing;
pub use rmeta::{provide, provide_extern}; pub use rmeta::{provide, provide_extern};
mod dependency_format; mod dependency_format;

View file

@ -236,7 +236,6 @@ use std::fmt::Write as _;
use std::io::{Read, Result as IoResult, Write}; use std::io::{Read, Result as IoResult, Write};
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::{cmp, fmt, fs}; use std::{cmp, fmt, fs};
use tracing::{debug, info};
#[derive(Clone)] #[derive(Clone)]
pub(crate) struct CrateLocator<'a> { pub(crate) struct CrateLocator<'a> {

View file

@ -42,7 +42,6 @@ use std::iter::TrustedLen;
use std::mem; use std::mem;
use std::num::NonZeroUsize; use std::num::NonZeroUsize;
use std::path::Path; use std::path::Path;
use tracing::debug;
pub(super) use cstore_impl::provide; pub(super) use cstore_impl::provide;
pub use cstore_impl::provide_extern; pub use cstore_impl::provide_extern;

View file

@ -44,7 +44,6 @@ use std::io::{Read, Seek, Write};
use std::iter; use std::iter;
use std::num::NonZeroUsize; use std::num::NonZeroUsize;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use tracing::{debug, trace};
pub(super) struct EncodeContext<'a, 'tcx> { pub(super) struct EncodeContext<'a, 'tcx> {
opaque: opaque::FileEncoder, opaque: opaque::FileEncoder,

View file

@ -10,7 +10,6 @@ use rustc_span::hygiene::MacroKind;
use std::convert::TryInto; use std::convert::TryInto;
use std::marker::PhantomData; use std::marker::PhantomData;
use std::num::NonZeroUsize; use std::num::NonZeroUsize;
use tracing::debug;
/// Helper trait, for encoding to, and decoding from, a fixed number of bytes. /// Helper trait, for encoding to, and decoding from, a fixed number of bytes.
/// Used mainly for Lazy positions and lengths. /// Used mainly for Lazy positions and lengths.

View file

@ -268,7 +268,7 @@ impl<'tcx> Cx<'tcx> {
// the overall method call for better diagnostics. args[0] // the overall method call for better diagnostics. args[0]
// is guaranteed to exist, since a method call always has a receiver. // is guaranteed to exist, since a method call always has a receiver.
let old_adjustment_span = self.adjustment_span.replace((args[0].hir_id, expr_span)); let old_adjustment_span = self.adjustment_span.replace((args[0].hir_id, expr_span));
tracing::info!("Using method span: {:?}", expr.span); info!("Using method span: {:?}", expr.span);
let args = self.mirror_exprs(args); let args = self.mirror_exprs(args);
self.adjustment_span = old_adjustment_span; self.adjustment_span = old_adjustment_span;
ExprKind::Call { ExprKind::Call {

View file

@ -14,8 +14,6 @@ use rustc_session::parse::ParseSess;
use rustc_span::symbol::{sym, Symbol}; use rustc_span::symbol::{sym, Symbol};
use rustc_span::{edition::Edition, BytePos, Pos, Span}; use rustc_span::{edition::Edition, BytePos, Pos, Span};
use tracing::debug;
mod tokentrees; mod tokentrees;
mod unescape_error_reporting; mod unescape_error_reporting;
mod unicode_chars; mod unicode_chars;

View file

@ -20,13 +20,9 @@ pub(crate) fn emit_unescape_error(
range: Range<usize>, range: Range<usize>,
error: EscapeError, error: EscapeError,
) { ) {
tracing::debug!( debug!(
"emit_unescape_error: {:?}, {:?}, {:?}, {:?}, {:?}", "emit_unescape_error: {:?}, {:?}, {:?}, {:?}, {:?}",
lit, lit, span_with_quotes, mode, range, error
span_with_quotes,
mode,
range,
error
); );
let last_char = || { let last_char = || {
let c = lit[range.clone()].chars().rev().next().unwrap(); let c = lit[range.clone()].chars().rev().next().unwrap();

View file

@ -7,8 +7,6 @@ use rustc_errors::{error_code, Diagnostic, PResult};
use rustc_span::{sym, BytePos, Span}; use rustc_span::{sym, BytePos, Span};
use std::convert::TryInto; use std::convert::TryInto;
use tracing::debug;
// Public for rustfmt usage // Public for rustfmt usage
#[derive(Debug)] #[derive(Debug)]
pub enum InnerAttrPolicy<'a> { pub enum InnerAttrPolicy<'a> {

View file

@ -29,7 +29,6 @@ use std::ops::{Deref, DerefMut};
use std::mem::take; use std::mem::take;
use crate::parser; use crate::parser;
use tracing::{debug, trace};
const TURBOFISH_SUGGESTION_STR: &str = const TURBOFISH_SUGGESTION_STR: &str =
"use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments"; "use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments";

View file

@ -22,7 +22,6 @@ use rustc_span::DUMMY_SP;
use std::convert::TryFrom; use std::convert::TryFrom;
use std::mem; use std::mem;
use tracing::debug;
impl<'a> Parser<'a> { impl<'a> Parser<'a> {
/// Parses a source module as a crate. This is the main entry point for the parser. /// Parses a source module as a crate. This is the main entry point for the parser.

View file

@ -37,7 +37,6 @@ use rustc_errors::{
use rustc_session::parse::ParseSess; use rustc_session::parse::ParseSess;
use rustc_span::source_map::{Span, DUMMY_SP}; use rustc_span::source_map::{Span, DUMMY_SP};
use rustc_span::symbol::{kw, sym, Ident, Symbol}; use rustc_span::symbol::{kw, sym, Ident, Symbol};
use tracing::debug;
use std::ops::Range; use std::ops::Range;
use std::{cmp, mem, slice}; use std::{cmp, mem, slice};

View file

@ -13,7 +13,6 @@ use rustc_span::source_map::{BytePos, Span};
use rustc_span::symbol::{kw, sym, Ident}; use rustc_span::symbol::{kw, sym, Ident};
use std::mem; use std::mem;
use tracing::debug;
/// Specifies how to parse a path. /// Specifies how to parse a path.
#[derive(Copy, Clone, PartialEq)] #[derive(Copy, Clone, PartialEq)]

View file

@ -8,6 +8,9 @@
#![deny(rustc::untranslatable_diagnostic)] #![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)] #![deny(rustc::diagnostic_outside_of_impl)]
#[macro_use]
extern crate tracing;
mod errors; mod errors;
use rustc_ast::MacroDef; use rustc_ast::MacroDef;
@ -1784,7 +1787,7 @@ impl SearchInterfaceForPrivateItemsVisitor<'_> {
fn leaks_private_dep(&self, item_id: DefId) -> bool { fn leaks_private_dep(&self, item_id: DefId) -> bool {
let ret = self.required_visibility.is_public() && self.tcx.is_private_dep(item_id.krate); let ret = self.required_visibility.is_public() && self.tcx.is_private_dep(item_id.krate);
tracing::debug!("leaks_private_dep(item_id={:?})={}", item_id, ret); debug!("leaks_private_dep(item_id={:?})={}", item_id, ret);
ret ret
} }
} }

View file

@ -39,7 +39,7 @@ impl<'r, 'a> AccessLevelsVisitor<'r, 'a> {
visit::walk_crate(&mut visitor, krate); visit::walk_crate(&mut visitor, krate);
} }
tracing::info!("resolve::access_levels: {:#?}", r.access_levels); info!("resolve::access_levels: {:#?}", r.access_levels);
} }
fn reset(&mut self) { fn reset(&mut self) {

View file

@ -36,7 +36,6 @@ use rustc_span::Span;
use std::cell::Cell; use std::cell::Cell;
use std::ptr; use std::ptr;
use tracing::debug;
type Res = def::Res<NodeId>; type Res = def::Res<NodeId>;

View file

@ -8,7 +8,6 @@ use rustc_hir::definitions::*;
use rustc_span::hygiene::LocalExpnId; use rustc_span::hygiene::LocalExpnId;
use rustc_span::symbol::sym; use rustc_span::symbol::sym;
use rustc_span::Span; use rustc_span::Span;
use tracing::debug;
pub(crate) fn collect_definitions( pub(crate) fn collect_definitions(
resolver: &mut Resolver<'_>, resolver: &mut Resolver<'_>,

View file

@ -25,7 +25,6 @@ use rustc_span::lev_distance::find_best_match_for_name;
use rustc_span::source_map::SourceMap; use rustc_span::source_map::SourceMap;
use rustc_span::symbol::{kw, sym, Ident, Symbol}; use rustc_span::symbol::{kw, sym, Ident, Symbol};
use rustc_span::{BytePos, Span}; use rustc_span::{BytePos, Span};
use tracing::debug;
use crate::imports::{Import, ImportKind, ImportResolver}; use crate::imports::{Import, ImportKind, ImportResolver};
use crate::late::{PatternSource, Rib}; use crate::late::{PatternSource, Rib};

View file

@ -23,8 +23,6 @@ use rustc_span::lev_distance::find_best_match_for_name;
use rustc_span::symbol::{kw, Ident, Symbol}; use rustc_span::symbol::{kw, Ident, Symbol};
use rustc_span::Span; use rustc_span::Span;
use tracing::*;
use std::cell::Cell; use std::cell::Cell;
use std::{mem, ptr}; use std::{mem, ptr};

View file

@ -32,7 +32,6 @@ use smallvec::{smallvec, SmallVec};
use rustc_span::source_map::{respan, Spanned}; use rustc_span::source_map::{respan, Spanned};
use std::collections::{hash_map::Entry, BTreeSet}; use std::collections::{hash_map::Entry, BTreeSet};
use std::mem::{replace, take}; use std::mem::{replace, take};
use tracing::debug;
mod diagnostics; mod diagnostics;
pub(crate) mod lifetimes; pub(crate) mod lifetimes;
@ -3268,11 +3267,9 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
source: PathSource<'ast>, source: PathSource<'ast>,
finalize: Finalize, finalize: Finalize,
) -> PartialRes { ) -> PartialRes {
tracing::debug!( debug!(
"smart_resolve_path_fragment(qself={:?}, path={:?}, finalize={:?})", "smart_resolve_path_fragment(qself={:?}, path={:?}, finalize={:?})",
qself, qself, path, finalize,
path,
finalize,
); );
let ns = source.namespace(); let ns = source.namespace();

View file

@ -33,8 +33,6 @@ use rustc_span::{BytePos, Span};
use std::iter; use std::iter;
use std::ops::Deref; use std::ops::Deref;
use tracing::debug;
type Res = def::Res<ast::NodeId>; type Res = def::Res<ast::NodeId>;
/// A field or associated item from self type suggested in case of resolution failure. /// A field or associated item from self type suggested in case of resolution failure.

View file

@ -1212,7 +1212,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
scope: &wrap_scope, scope: &wrap_scope,
trait_definition_only: self.trait_definition_only, trait_definition_only: self.trait_definition_only,
}; };
let span = tracing::debug_span!("scope", scope = ?TruncatedScopeDebug(&this.scope)); let span = debug_span!("scope", scope = ?TruncatedScopeDebug(&this.scope));
{ {
let _enter = span.enter(); let _enter = span.enter();
f(&mut this); f(&mut this);

View file

@ -58,7 +58,6 @@ use smallvec::{smallvec, SmallVec};
use std::cell::{Cell, RefCell}; use std::cell::{Cell, RefCell};
use std::collections::BTreeSet; use std::collections::BTreeSet;
use std::{cmp, fmt, ptr}; use std::{cmp, fmt, ptr};
use tracing::debug;
use diagnostics::{ImportSuggestion, LabelSuggestion, Suggestion}; use diagnostics::{ImportSuggestion, LabelSuggestion, Suggestion};
use imports::{Import, ImportKind, ImportResolver, NameResolution}; use imports::{Import, ImportKind, ImportResolver, NameResolution};

View file

@ -44,8 +44,6 @@ use rls_data::{
RefKind, Relation, RelationKind, SpanData, RefKind, Relation, RelationKind, SpanData,
}; };
use tracing::{debug, error};
#[rustfmt::skip] // https://github.com/rust-lang/rustfmt/issues/5213 #[rustfmt::skip] // https://github.com/rust-lang/rustfmt/issues/5213
macro_rules! down_cast_data { macro_rules! down_cast_data {
($id:ident, $kind:ident, $sp:expr) => { ($id:ident, $kind:ident, $sp:expr) => {

View file

@ -7,6 +7,9 @@
#![deny(rustc::untranslatable_diagnostic)] #![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)] #![deny(rustc::diagnostic_outside_of_impl)]
#[macro_use]
extern crate tracing;
mod dump_visitor; mod dump_visitor;
mod dumper; mod dumper;
#[macro_use] #[macro_use]
@ -49,8 +52,6 @@ use rls_data::{
RefKind, Relation, RelationKind, SpanData, RefKind, Relation, RelationKind, SpanData,
}; };
use tracing::{debug, error, info};
pub struct SaveContext<'tcx> { pub struct SaveContext<'tcx> {
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
maybe_typeck_results: Option<&'tcx ty::TypeckResults<'tcx>>, maybe_typeck_results: Option<&'tcx ty::TypeckResults<'tcx>>,

View file

@ -10,7 +10,6 @@ use rustc_span::{Span, Symbol};
use std::borrow::Cow; use std::borrow::Cow;
use std::fmt::{self}; use std::fmt::{self};
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use tracing::debug;
#[derive(Copy, Clone, Debug, PartialEq, PartialOrd)] #[derive(Copy, Clone, Debug, PartialEq, PartialOrd)]
pub enum CguReuse { pub enum CguReuse {

View file

@ -2530,7 +2530,7 @@ fn parse_pretty(unstable_opts: &UnstableOptions, efmt: ErrorOutputType) -> Optio
), ),
), ),
}; };
tracing::debug!("got unpretty option: {first:?}"); debug!("got unpretty option: {first:?}");
Some(first) Some(first)
} }

View file

@ -7,7 +7,6 @@ use std::path::{Path, PathBuf};
use crate::search_paths::{PathKind, SearchPath}; use crate::search_paths::{PathKind, SearchPath};
use rustc_fs_util::fix_windows_verbatim_for_gcc; use rustc_fs_util::fix_windows_verbatim_for_gcc;
use tracing::debug;
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub enum FileMatch { pub enum FileMatch {

View file

@ -14,6 +14,9 @@
extern crate rustc_macros; extern crate rustc_macros;
pub mod errors; pub mod errors;
#[macro_use]
extern crate tracing;
pub mod cgu_reuse_tracker; pub mod cgu_reuse_tracker;
pub mod utils; pub mod utils;
pub use lint::{declare_lint, declare_lint_pass, declare_tool_lint, impl_lint_pass}; pub use lint::{declare_lint, declare_lint_pass, declare_tool_lint, impl_lint_pass};

View file

@ -41,7 +41,6 @@ use rustc_macros::HashStable_Generic;
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
use std::fmt; use std::fmt;
use std::hash::Hash; use std::hash::Hash;
use tracing::*;
/// A `SyntaxContext` represents a chain of pairs `(ExpnId, Transparency)` named "marks". /// A `SyntaxContext` represents a chain of pairs `(ExpnId, Transparency)` named "marks".
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]

View file

@ -76,8 +76,6 @@ use md5::Md5;
use sha1::Sha1; use sha1::Sha1;
use sha2::Sha256; use sha2::Sha256;
use tracing::debug;
#[cfg(test)] #[cfg(test)]
mod tests; mod tests;

View file

@ -23,7 +23,6 @@ use std::{convert::TryFrom, unreachable};
use std::fs; use std::fs;
use std::io; use std::io;
use tracing::debug;
#[cfg(test)] #[cfg(test)]
mod tests; mod tests;

View file

@ -6,8 +6,6 @@ use rustc_middle::ty::subst::{GenericArg, GenericArgKind};
use rustc_middle::ty::{self, Instance, Ty, TyCtxt, TypeVisitable}; use rustc_middle::ty::{self, Instance, Ty, TyCtxt, TypeVisitable};
use rustc_middle::util::common::record_time; use rustc_middle::util::common::record_time;
use tracing::debug;
use std::fmt::{self, Write}; use std::fmt::{self, Write};
use std::mem::{self, discriminant}; use std::mem::{self, discriminant};

View file

@ -97,6 +97,9 @@
#[macro_use] #[macro_use]
extern crate rustc_middle; extern crate rustc_middle;
#[macro_use]
extern crate tracing;
use rustc_hir::def::DefKind; use rustc_hir::def::DefKind;
use rustc_hir::def_id::{CrateNum, LOCAL_CRATE}; use rustc_hir::def_id::{CrateNum, LOCAL_CRATE};
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags; use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
@ -107,8 +110,6 @@ use rustc_middle::ty::subst::SubstsRef;
use rustc_middle::ty::{self, Instance, TyCtxt}; use rustc_middle::ty::{self, Instance, TyCtxt};
use rustc_session::config::SymbolManglingVersion; use rustc_session::config::SymbolManglingVersion;
use tracing::debug;
mod legacy; mod legacy;
mod v0; mod v0;

View file

@ -2014,7 +2014,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> {
let predicate = self.resolve_vars_if_possible(obligation.predicate); let predicate = self.resolve_vars_if_possible(obligation.predicate);
let span = obligation.cause.span; let span = obligation.cause.span;
debug!(?predicate, obligation.cause.code = tracing::field::debug(&obligation.cause.code())); debug!(?predicate, obligation.cause.code = ?obligation.cause.code());
// Ambiguity errors are often caused as fallout from earlier errors. // Ambiguity errors are often caused as fallout from earlier errors.
// We ignore them if this `infcx` is tainted in some cases below. // We ignore them if this `infcx` is tainted in some cases below.

View file

@ -317,7 +317,7 @@ pub(crate) mod rustc {
tcx, tcx,
)?, )?,
AdtKind::Enum => { AdtKind::Enum => {
tracing::trace!(?adt_def, "treeifying enum"); trace!(?adt_def, "treeifying enum");
let mut tree = Tree::uninhabited(); let mut tree = Tree::uninhabited();
for (idx, discr) in adt_def.discriminants(tcx) { for (idx, discr) in adt_def.discriminants(tcx) {
@ -381,7 +381,7 @@ pub(crate) mod rustc {
let clamp = let clamp =
|align: Align| align.clamp(min_align, max_align).bytes().try_into().unwrap(); |align: Align| align.clamp(min_align, max_align).bytes().try_into().unwrap();
let variant_span = tracing::trace_span!( let variant_span = trace_span!(
"treeifying variant", "treeifying variant",
min_align = ?min_align, min_align = ?min_align,
max_align = ?max_align, max_align = ?max_align,
@ -396,22 +396,22 @@ pub(crate) mod rustc {
// The layout of the variant is prefixed by the discriminant, if any. // The layout of the variant is prefixed by the discriminant, if any.
if let Some(discr) = discr { if let Some(discr) = discr {
tracing::trace!(?discr, "treeifying discriminant"); trace!(?discr, "treeifying discriminant");
let discr_layout = alloc::Layout::from_size_align( let discr_layout = alloc::Layout::from_size_align(
layout_summary.discriminant_size, layout_summary.discriminant_size,
clamp(layout_summary.discriminant_align), clamp(layout_summary.discriminant_align),
) )
.unwrap(); .unwrap();
tracing::trace!(?discr_layout, "computed discriminant layout"); trace!(?discr_layout, "computed discriminant layout");
variant_layout = variant_layout.extend(discr_layout).unwrap().0; variant_layout = variant_layout.extend(discr_layout).unwrap().0;
tree = tree.then(Self::from_disr(discr, tcx, layout_summary.discriminant_size)); tree = tree.then(Self::from_disr(discr, tcx, layout_summary.discriminant_size));
} }
// Next come fields. // Next come fields.
let fields_span = tracing::trace_span!("treeifying fields").entered(); let fields_span = trace_span!("treeifying fields").entered();
for field_def in variant_def.fields.iter() { for field_def in variant_def.fields.iter() {
let field_ty = field_def.ty(tcx, substs_ref); let field_ty = field_def.ty(tcx, substs_ref);
let _span = tracing::trace_span!("treeifying field", field = ?field_ty).entered(); let _span = trace_span!("treeifying field", field = ?field_ty).entered();
// begin with the field's visibility // begin with the field's visibility
tree = tree.then(Self::def(Def::Field(field_def))); tree = tree.then(Self::def(Def::Field(field_def)));
@ -434,7 +434,7 @@ pub(crate) mod rustc {
drop(fields_span); drop(fields_span);
// finally: padding // finally: padding
let padding_span = tracing::trace_span!("adding trailing padding").entered(); let padding_span = trace_span!("adding trailing padding").entered();
let padding_needed = layout_summary.total_size - variant_layout.size(); let padding_needed = layout_summary.total_size - variant_layout.size();
if padding_needed > 0 { if padding_needed > 0 {
tree = tree.then(Self::padding(padding_needed)); tree = tree.then(Self::padding(padding_needed));
@ -467,7 +467,7 @@ pub(crate) mod rustc {
layout.align().abi.bytes().try_into().unwrap(), layout.align().abi.bytes().try_into().unwrap(),
) )
.unwrap(); .unwrap();
tracing::trace!(?ty, ?layout, "computed layout for type"); trace!(?ty, ?layout, "computed layout for type");
Ok(layout) Ok(layout)
} }
} }

View file

@ -110,7 +110,7 @@ where
// Remove all `Def` nodes from `src`, without checking their visibility. // Remove all `Def` nodes from `src`, without checking their visibility.
let src = src.prune(&|def| true); let src = src.prune(&|def| true);
tracing::trace!(?src, "pruned src"); trace!(?src, "pruned src");
// Remove all `Def` nodes from `dst`, additionally... // Remove all `Def` nodes from `dst`, additionally...
let dst = if assume_visibility { let dst = if assume_visibility {
@ -121,7 +121,7 @@ where
dst.prune(&|def| context.is_accessible_from(def, scope)) dst.prune(&|def| context.is_accessible_from(def, scope))
}; };
tracing::trace!(?dst, "pruned dst"); trace!(?dst, "pruned dst");
// Convert `src` from a tree-based representation to an NFA-based representation. // Convert `src` from a tree-based representation to an NFA-based representation.
// If the conversion fails because `src` is uninhabited, conclude that the transmutation // If the conversion fails because `src` is uninhabited, conclude that the transmutation

View file

@ -82,7 +82,7 @@ mod rustc {
false false
}; };
tracing::trace!(?ret, "ret"); trace!(?ret, "ret");
ret ret
} }

View file

@ -15,8 +15,6 @@ use std::collections::btree_map::Entry;
use std::collections::BTreeMap; use std::collections::BTreeMap;
use std::ops::ControlFlow; use std::ops::ControlFlow;
use tracing::debug;
// FIXME(#86795): `BoundVarsCollector` here should **NOT** be used // FIXME(#86795): `BoundVarsCollector` here should **NOT** be used
// outside of `resolve_associated_item`. It's just to address #64494, // outside of `resolve_associated_item`. It's just to address #64494,
// #83765, and #85848 which are creating bound types/regions that lose // #83765, and #85848 which are creating bound types/regions that lose

View file

@ -17,7 +17,6 @@ use rustc_middle::middle::region::{self, Scope, ScopeData, YieldData};
use rustc_middle::ty::{self, RvalueScopes, Ty, TyCtxt, TypeVisitable}; use rustc_middle::ty::{self, RvalueScopes, Ty, TyCtxt, TypeVisitable};
use rustc_span::symbol::sym; use rustc_span::symbol::sym;
use rustc_span::Span; use rustc_span::Span;
use tracing::debug;
mod drop_ranges; mod drop_ranges;