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
+3
View File
@@ -26,6 +26,9 @@
#[macro_use]
extern crate rustc_macros;
#[macro_use]
extern crate tracing;
pub mod util {
pub mod classify;
pub mod comments;
-1
View File
@@ -9,7 +9,6 @@
use rustc_span::Span;
use std::ascii;
use tracing::debug;
pub enum LitError {
NotLiteral,
-2
View File
@@ -11,8 +11,6 @@
use rustc_span::source_map::SourceMap;
use rustc_span::{Span, DUMMY_SP};
use tracing::debug;
/// A visitor that walks over the HIR and collects `Node`s into a HIR map.
pub(super) struct NodeCollector<'a, 'hir> {
/// Source map
-1
View File
@@ -13,7 +13,6 @@
use rustc_span::{BytePos, Span, DUMMY_SP};
use smallvec::smallvec;
use tracing::debug;
impl<'a, 'hir> LoweringContext<'a, 'hir> {
#[instrument(level = "trace", skip(self))]
@@ -11,8 +11,6 @@
use rustc_span::symbol::sym;
use rustc_span::Span;
use tracing::debug;
macro_rules! gate_feature_fn {
($visitor: expr, $has_feature: expr, $span: expr, $name: expr, $explain: expr, $help: expr) => {{
let (visitor, has_feature, span, name, explain, help) =
+3
View File
@@ -12,6 +12,9 @@
#![feature(let_else)]
#![recursion_limit = "256"]
#[macro_use]
extern crate tracing;
pub mod ast_validation;
mod errors;
pub mod feature_gate;
@@ -6,7 +6,6 @@
use rustc_middle::ty::RegionVid;
use smallvec::SmallVec;
use std::collections::BTreeMap;
use tracing::debug;
use crate::MirBorrowckCtxt;
+3
View File
@@ -16,6 +16,9 @@
extern crate proc_macro;
#[macro_use]
extern crate tracing;
use crate::deriving::*;
use rustc_expand::base::{MacroExpanderFn, ResolverExpand, SyntaxExtensionKind};
+1 -1
View File
@@ -335,7 +335,7 @@ pub fn expand_test_or_bench(
// extern crate test
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 {
vec![
@@ -15,7 +15,6 @@
use rustc_target::spec::PanicStrategy;
use smallvec::{smallvec, SmallVec};
use thin_vec::thin_vec;
use tracing::debug;
use std::{iter, mem};
-1
View File
@@ -19,7 +19,6 @@
use libc::{c_char, c_uint};
use smallvec::SmallVec;
use tracing::debug;
impl<'ll, 'tcx> AsmBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> {
fn codegen_inline_asm(
@@ -190,10 +190,10 @@ fn create_dll_import_lib(
let output_path_z = rustc_fs_util::path_to_c_string(&output_path);
tracing::trace!("invoking LLVMRustWriteImportLibrary");
tracing::trace!(" dll_name {:#?}", dll_name_z);
tracing::trace!(" output_path {}", output_path.display());
tracing::trace!(
trace!("invoking LLVMRustWriteImportLibrary");
trace!(" dll_name {:#?}", dll_name_z);
trace!(" output_path {}", output_path.display());
trace!(
" import names: {}",
dll_imports
.iter()
@@ -18,7 +18,6 @@
use rustc_middle::middle::exported_symbols::{SymbolExportInfo, SymbolExportLevel};
use rustc_session::cgu_reuse_tracker::CguReuse;
use rustc_session::config::{self, CrateType, Lto};
use tracing::{debug, info};
use std::ffi::{CStr, CString};
use std::fs::File;
@@ -28,7 +28,6 @@
use rustc_span::symbol::sym;
use rustc_span::InnerSpan;
use rustc_target::spec::{CodeModel, RelocModel, SanitizerSet, SplitDebuginfo};
use tracing::debug;
use libc::{c_char, c_int, c_uint, c_void, size_t};
use std::ffi::CString;
@@ -27,7 +27,6 @@
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]
@@ -11,7 +11,6 @@
use crate::llvm;
use crate::value::Value;
use rustc_codegen_ssa::traits::*;
use tracing::debug;
use rustc_middle::ty::layout::{FnAbiOf, HasTyCtxt};
use rustc_middle::ty::{self, Instance, TypeVisitable};
@@ -21,7 +21,6 @@
use libc::{c_char, c_uint};
use std::fmt::Write;
use tracing::debug;
/*
* A note on nomenclature of linking: "extern", "foreign", and "upcall".
@@ -23,7 +23,6 @@
AddressSpace, Align, HasDataLayout, Primitive, Scalar, Size, WrappingRange,
};
use std::ops::Range;
use tracing::debug;
pub fn const_alloc_to_llvm<'ll>(cx: &CodegenCx<'ll, '_>, alloc: ConstAllocation<'_>) -> &'ll Value {
let alloc = alloc.inner();
@@ -16,8 +16,6 @@
use std::ffi::CString;
use tracing::debug;
/// Generates and exports the Coverage Map.
///
/// Rust Coverage Map generation supports LLVM Coverage Mapping Format versions
@@ -28,7 +28,6 @@
use std::ffi::CString;
use std::iter;
use tracing::debug;
pub mod mapgen;
@@ -39,7 +39,6 @@
use std::cell::OnceCell;
use std::cell::RefCell;
use std::iter;
use tracing::debug;
mod create_scope_map;
pub mod gdb;
@@ -6,7 +6,7 @@
use rustc_hir::def_id::DefId;
use rustc_middle::ty::layout::{HasParamEnv, LayoutOf};
use rustc_middle::ty::{self, DefIdTree, Ty};
use tracing::trace;
use trace;
use crate::common::CodegenCx;
use crate::llvm;
@@ -22,7 +22,6 @@
use rustc_middle::ty::Ty;
use rustc_symbol_mangling::typeid::typeid_for_fnabi;
use smallvec::SmallVec;
use tracing::debug;
/// Declare a function.
///
@@ -15,7 +15,6 @@
use rustc_target::spec::{MergeFunctions, PanicStrategy};
use smallvec::{smallvec, SmallVec};
use std::ffi::{CStr, CString};
use tracing::debug;
use std::mem;
use std::path::Path;
@@ -11,7 +11,6 @@
use rustc_middle::ty::{self, Instance, TypeVisitable};
use rustc_session::config::CrateType;
use rustc_target::spec::RelocModel;
use tracing::debug;
impl<'tcx> PreDefineMethods<'tcx> for CodegenCx<'_, 'tcx> {
fn predefine_static(
@@ -11,7 +11,6 @@
use rustc_target::abi::{Int, Pointer, F32, F64};
use rustc_target::abi::{PointeeInfo, Scalar, Size, TyAbiInterface, Variants};
use smallvec::{smallvec, SmallVec};
use tracing::debug;
use std::fmt::Write;
+3 -1
View File
@@ -5,6 +5,9 @@
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
#[macro_use]
extern crate tracing;
use fluent_bundle::FluentResource;
use fluent_syntax::parser::ParserError;
use rustc_data_structures::sync::Lrc;
@@ -16,7 +19,6 @@
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;
@@ -12,7 +12,6 @@
use std::marker::PhantomData;
use std::ops::{Deref, DerefMut};
use std::thread::panicking;
use tracing::debug;
/// Used for emitting structured error messages and other diagnostic information.
///
-1
View File
@@ -34,7 +34,6 @@
use std::path::Path;
use termcolor::{Ansi, BufferWriter, ColorChoice, ColorSpec, StandardStream};
use termcolor::{Buffer, Color, WriteColor};
use tracing::*;
/// Default column width, used in tests and when terminal dimensions cannot be determined.
const DEFAULT_COLUMN_WIDTH: usize = 140;
+3
View File
@@ -15,6 +15,9 @@
#[macro_use]
extern crate rustc_macros;
#[macro_use]
extern crate tracing;
extern crate proc_macro as pm;
mod placeholders;
@@ -32,7 +32,6 @@
use std::borrow::Cow;
use std::collections::hash_map::Entry;
use std::{mem, slice};
use tracing::debug;
pub(crate) struct ParserAnyMacro<'a> {
parser: Parser<'a>,
-1
View File
@@ -15,7 +15,6 @@
use std::fmt::{self, Write};
use std::hash::Hash;
use tracing::debug;
/// The `DefPathTable` maps `DefIndex`es to `DefKey`s and vice versa.
/// Internally the `DefPathTable` holds a tree of `DefKey`s, where each `DefKey`
+3
View File
@@ -17,6 +17,9 @@
#[macro_use]
extern crate rustc_macros;
#[macro_use]
extern crate tracing;
#[macro_use]
extern crate rustc_data_structures;
+1 -1
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
#[allow(rustc::bad_opt_access)]
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(
config.opts.edition,
config.opts.unstable_opts.threads,
+3
View File
@@ -8,6 +8,9 @@
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
#[macro_use]
extern crate tracing;
mod callbacks;
mod errors;
pub mod interface;
+2 -3
View File
@@ -38,7 +38,6 @@
use rustc_span::FileName;
use rustc_trait_selection::traits;
use rustc_typeck as typeck;
use tracing::{info, warn};
use std::any::Any;
use std::cell::RefCell;
@@ -165,7 +164,7 @@ pub fn create_resolver(
krate: &ast::Crate,
crate_name: &str,
) -> BoxedResolver {
tracing::trace!("create_resolver");
trace!("create_resolver");
BoxedResolver::new(sess, move |sess, resolver_arenas| {
Resolver::new(sess, krate, crate_name, metadata_loader, resolver_arenas)
})
@@ -279,7 +278,7 @@ pub fn configure_and_expand(
crate_name: &str,
resolver: &mut Resolver<'_>,
) -> Result<ast::Crate> {
tracing::trace!("configure_and_expand");
trace!("configure_and_expand");
pre_expansion_lint(sess, lint_store, resolver.registered_tools(), &krate, crate_name);
rustc_builtin_macros::register_builtin_macros(resolver);
+1 -1
View File
@@ -166,7 +166,7 @@ pub fn crate_name(&self) -> Result<&Query<String>> {
pub fn expansion(
&self,
) -> Result<&Query<(Lrc<ast::Crate>, Rc<RefCell<BoxedResolver>>, Lrc<LintStore>)>> {
tracing::trace!("expansion");
trace!("expansion");
self.expansion.compute(|| {
let crate_name = self.crate_name()?.peek().clone();
let (krate, lint_store) = self.register_plugins()?.take();
+1 -1
View File
@@ -1,3 +1,4 @@
use info;
use libloading::Library;
use rustc_ast as ast;
use rustc_codegen_ssa::traits::CodegenBackend;
@@ -31,7 +32,6 @@
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::OnceLock;
use std::thread;
use tracing::info;
/// Function pointer type that constructs a new CodegenBackend.
pub type MakeBackendFn = fn() -> Box<dyn CodegenBackend>;
-1
View File
@@ -59,7 +59,6 @@
use crate::nonstandard_style::{method_context, MethodLateContext};
use std::fmt::Write;
use tracing::{debug, trace};
// hardwired lints from librustc_middle
pub use rustc_session::lint::builtin::*;
+2 -3
View File
@@ -45,7 +45,6 @@
use rustc_span::symbol::{sym, Ident, Symbol};
use rustc_span::{BytePos, Span};
use rustc_target::abi;
use tracing::debug;
use std::cell::Cell;
use std::iter;
@@ -417,7 +416,7 @@ pub fn check_lint_name(
None => {
// 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?
tracing::debug!("lints={:?}", self.by_name.keys().collect::<Vec<_>>());
debug!("lints={:?}", self.by_name.keys().collect::<Vec<_>>());
let tool_prefix = format!("{}::", tool_name);
return if self.by_name.keys().any(|lint| lint.starts_with(&tool_prefix)) {
self.no_lint_suggestion(&complete_name)
@@ -510,7 +509,7 @@ fn check_tool_name_for_backwards_compat(
CheckLintNameResult::Tool(Err((Some(slice::from_ref(id)), complete_name)))
}
Some(other) => {
tracing::debug!("got renamed lint {:?}", other);
debug!("got renamed lint {:?}", other);
CheckLintNameResult::NoLint(None)
}
}
-1
View File
@@ -26,7 +26,6 @@
use rustc_span::Span;
use std::slice;
use tracing::debug;
macro_rules! run_early_pass { ($cx:expr, $f:ident, $($args:expr),*) => ({
$cx.pass.$f(&$cx.context, $($args),*);
-1
View File
@@ -12,7 +12,6 @@
use rustc_span::hygiene::{ExpnKind, MacroKind};
use rustc_span::symbol::{kw, sym, Symbol};
use rustc_span::Span;
use tracing::debug;
declare_tool_lint! {
pub rustc::DEFAULT_HASH_TYPES,
-1
View File
@@ -29,7 +29,6 @@
use std::any::Any;
use std::cell::Cell;
use std::slice;
use tracing::debug;
/// Extract the `LintStore` from the query context.
/// This function exists because we've erased `LintStore` as `dyn Any` in the context.
-1
View File
@@ -21,7 +21,6 @@
use rustc_session::Session;
use rustc_span::symbol::{sym, Symbol};
use rustc_span::{Span, DUMMY_SP};
use tracing::debug;
use crate::errors::{
MalformedAttribute, MalformedAttributeSub, OverruledAttribute, OverruledAttributeSub,
+2
View File
@@ -42,6 +42,8 @@
extern crate rustc_middle;
#[macro_use]
extern crate rustc_session;
#[macro_use]
extern crate tracing;
mod array_into_iter;
pub mod builtin;
-1
View File
@@ -19,7 +19,6 @@
use std::cmp;
use std::iter;
use std::ops::ControlFlow;
use tracing::debug;
declare_lint! {
/// The `unused_comparisons` lint detects comparisons made useless by
+1 -2
View File
@@ -29,7 +29,6 @@
use std::ops::Fn;
use std::path::Path;
use std::{cmp, env};
use tracing::{debug, info};
#[derive(Clone)]
pub struct CStore {
@@ -263,7 +262,7 @@ pub fn into_cstore(self) -> CStore {
fn existing_match(&self, name: Symbol, hash: Option<Svh>, kind: PathKind) -> Option<CrateNum> {
for (cnum, data) in self.cstore.iter_crate_data() {
if data.name() != name {
tracing::trace!("{} did not match {}", data.name(), name);
trace!("{} did not match {}", data.name(), name);
continue;
}
@@ -158,11 +158,11 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList {
let name = tcx.crate_name(cnum);
let src = tcx.used_crate_source(cnum);
if src.dylib.is_some() {
tracing::info!("adding dylib: {}", name);
info!("adding dylib: {}", name);
add_library(tcx, cnum, RequireDynamic, &mut formats);
let deps = tcx.dylib_dependency_formats(cnum);
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);
}
}
@@ -190,7 +190,7 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList {
&& tcx.dep_kind(cnum) == CrateDepKind::Explicit
{
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);
ret[cnum.as_usize() - 1] = Linkage::Static;
}
+3
View File
@@ -26,6 +26,9 @@
#[macro_use]
extern crate rustc_data_structures;
#[macro_use]
extern crate tracing;
pub use rmeta::{provide, provide_extern};
mod dependency_format;
-1
View File
@@ -236,7 +236,6 @@
use std::io::{Read, Result as IoResult, Write};
use std::path::{Path, PathBuf};
use std::{cmp, fmt, fs};
use tracing::{debug, info};
#[derive(Clone)]
pub(crate) struct CrateLocator<'a> {
@@ -42,7 +42,6 @@
use std::mem;
use std::num::NonZeroUsize;
use std::path::Path;
use tracing::debug;
pub(super) use cstore_impl::provide;
pub use cstore_impl::provide_extern;
@@ -44,7 +44,6 @@
use std::iter;
use std::num::NonZeroUsize;
use std::path::{Path, PathBuf};
use tracing::{debug, trace};
pub(super) struct EncodeContext<'a, 'tcx> {
opaque: opaque::FileEncoder,
@@ -10,7 +10,6 @@
use std::convert::TryInto;
use std::marker::PhantomData;
use std::num::NonZeroUsize;
use tracing::debug;
/// Helper trait, for encoding to, and decoding from, a fixed number of bytes.
/// Used mainly for Lazy positions and lengths.
+1 -1
View File
@@ -268,7 +268,7 @@ fn make_mirror_unadjusted(&mut self, expr: &'tcx hir::Expr<'tcx>) -> Expr<'tcx>
// the overall method call for better diagnostics. args[0]
// 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));
tracing::info!("Using method span: {:?}", expr.span);
info!("Using method span: {:?}", expr.span);
let args = self.mirror_exprs(args);
self.adjustment_span = old_adjustment_span;
ExprKind::Call {
-2
View File
@@ -14,8 +14,6 @@
use rustc_span::symbol::{sym, Symbol};
use rustc_span::{edition::Edition, BytePos, Pos, Span};
use tracing::debug;
mod tokentrees;
mod unescape_error_reporting;
mod unicode_chars;
@@ -20,13 +20,9 @@ pub(crate) fn emit_unescape_error(
range: Range<usize>,
error: EscapeError,
) {
tracing::debug!(
debug!(
"emit_unescape_error: {:?}, {:?}, {:?}, {:?}, {:?}",
lit,
span_with_quotes,
mode,
range,
error
lit, span_with_quotes, mode, range, error
);
let last_char = || {
let c = lit[range.clone()].chars().rev().next().unwrap();
-2
View File
@@ -7,8 +7,6 @@
use rustc_span::{sym, BytePos, Span};
use std::convert::TryInto;
use tracing::debug;
// Public for rustfmt usage
#[derive(Debug)]
pub enum InnerAttrPolicy<'a> {
@@ -29,7 +29,6 @@
use std::mem::take;
use crate::parser;
use tracing::{debug, trace};
const TURBOFISH_SUGGESTION_STR: &str =
"use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments";
-1
View File
@@ -22,7 +22,6 @@
use std::convert::TryFrom;
use std::mem;
use tracing::debug;
impl<'a> Parser<'a> {
/// Parses a source module as a crate. This is the main entry point for the parser.
-1
View File
@@ -37,7 +37,6 @@
use rustc_session::parse::ParseSess;
use rustc_span::source_map::{Span, DUMMY_SP};
use rustc_span::symbol::{kw, sym, Ident, Symbol};
use tracing::debug;
use std::ops::Range;
use std::{cmp, mem, slice};
-1
View File
@@ -13,7 +13,6 @@
use rustc_span::symbol::{kw, sym, Ident};
use std::mem;
use tracing::debug;
/// Specifies how to parse a path.
#[derive(Copy, Clone, PartialEq)]
+4 -1
View File
@@ -8,6 +8,9 @@
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
#[macro_use]
extern crate tracing;
mod errors;
use rustc_ast::MacroDef;
@@ -1784,7 +1787,7 @@ fn check_def_id(&mut self, def_id: DefId, kind: &str, descr: &dyn fmt::Display)
fn leaks_private_dep(&self, item_id: DefId) -> bool {
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
}
}
+1 -1
View File
@@ -39,7 +39,7 @@ pub fn compute_access_levels<'c>(r: &'r mut Resolver<'a>, krate: &'c Crate) {
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) {
@@ -36,7 +36,6 @@
use std::cell::Cell;
use std::ptr;
use tracing::debug;
type Res = def::Res<NodeId>;
@@ -8,7 +8,6 @@
use rustc_span::hygiene::LocalExpnId;
use rustc_span::symbol::sym;
use rustc_span::Span;
use tracing::debug;
pub(crate) fn collect_definitions(
resolver: &mut Resolver<'_>,
@@ -25,7 +25,6 @@
use rustc_span::source_map::SourceMap;
use rustc_span::symbol::{kw, sym, Ident, Symbol};
use rustc_span::{BytePos, Span};
use tracing::debug;
use crate::imports::{Import, ImportKind, ImportResolver};
use crate::late::{PatternSource, Rib};
-2
View File
@@ -23,8 +23,6 @@
use rustc_span::symbol::{kw, Ident, Symbol};
use rustc_span::Span;
use tracing::*;
use std::cell::Cell;
use std::{mem, ptr};
+2 -5
View File
@@ -32,7 +32,6 @@
use rustc_span::source_map::{respan, Spanned};
use std::collections::{hash_map::Entry, BTreeSet};
use std::mem::{replace, take};
use tracing::debug;
mod diagnostics;
pub(crate) mod lifetimes;
@@ -3268,11 +3267,9 @@ fn smart_resolve_path_fragment(
source: PathSource<'ast>,
finalize: Finalize,
) -> PartialRes {
tracing::debug!(
debug!(
"smart_resolve_path_fragment(qself={:?}, path={:?}, finalize={:?})",
qself,
path,
finalize,
qself, path, finalize,
);
let ns = source.namespace();
@@ -33,8 +33,6 @@
use std::iter;
use std::ops::Deref;
use tracing::debug;
type Res = def::Res<ast::NodeId>;
/// A field or associated item from self type suggested in case of resolution failure.
+1 -1
View File
@@ -1212,7 +1212,7 @@ fn with<F>(&mut self, wrap_scope: Scope<'_>, f: F)
scope: &wrap_scope,
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();
f(&mut this);
-1
View File
@@ -58,7 +58,6 @@
use std::cell::{Cell, RefCell};
use std::collections::BTreeSet;
use std::{cmp, fmt, ptr};
use tracing::debug;
use diagnostics::{ImportSuggestion, LabelSuggestion, Suggestion};
use imports::{Import, ImportKind, ImportResolver, NameResolution};
@@ -44,8 +44,6 @@
RefKind, Relation, RelationKind, SpanData,
};
use tracing::{debug, error};
#[rustfmt::skip] // https://github.com/rust-lang/rustfmt/issues/5213
macro_rules! down_cast_data {
($id:ident, $kind:ident, $sp:expr) => {
+3 -2
View File
@@ -7,6 +7,9 @@
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
#[macro_use]
extern crate tracing;
mod dump_visitor;
mod dumper;
#[macro_use]
@@ -49,8 +52,6 @@
RefKind, Relation, RelationKind, SpanData,
};
use tracing::{debug, error, info};
pub struct SaveContext<'tcx> {
tcx: TyCtxt<'tcx>,
maybe_typeck_results: Option<&'tcx ty::TypeckResults<'tcx>>,
@@ -10,7 +10,6 @@
use std::borrow::Cow;
use std::fmt::{self};
use std::sync::{Arc, Mutex};
use tracing::debug;
#[derive(Copy, Clone, Debug, PartialEq, PartialOrd)]
pub enum CguReuse {
+1 -1
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)
}
-1
View File
@@ -7,7 +7,6 @@
use crate::search_paths::{PathKind, SearchPath};
use rustc_fs_util::fix_windows_verbatim_for_gcc;
use tracing::debug;
#[derive(Copy, Clone)]
pub enum FileMatch {
+3
View File
@@ -14,6 +14,9 @@
extern crate rustc_macros;
pub mod errors;
#[macro_use]
extern crate tracing;
pub mod cgu_reuse_tracker;
pub mod utils;
pub use lint::{declare_lint, declare_lint_pass, declare_tool_lint, impl_lint_pass};
-1
View File
@@ -41,7 +41,6 @@
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
use std::fmt;
use std::hash::Hash;
use tracing::*;
/// A `SyntaxContext` represents a chain of pairs `(ExpnId, Transparency)` named "marks".
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
-2
View File
@@ -76,8 +76,6 @@
use sha1::Sha1;
use sha2::Sha256;
use tracing::debug;
#[cfg(test)]
mod tests;
-1
View File
@@ -23,7 +23,6 @@
use std::fs;
use std::io;
use tracing::debug;
#[cfg(test)]
mod tests;
@@ -6,8 +6,6 @@
use rustc_middle::ty::{self, Instance, Ty, TyCtxt, TypeVisitable};
use rustc_middle::util::common::record_time;
use tracing::debug;
use std::fmt::{self, Write};
use std::mem::{self, discriminant};
+3 -2
View File
@@ -97,6 +97,9 @@
#[macro_use]
extern crate rustc_middle;
#[macro_use]
extern crate tracing;
use rustc_hir::def::DefKind;
use rustc_hir::def_id::{CrateNum, LOCAL_CRATE};
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
@@ -107,8 +110,6 @@
use rustc_middle::ty::{self, Instance, TyCtxt};
use rustc_session::config::SymbolManglingVersion;
use tracing::debug;
mod legacy;
mod v0;
@@ -2014,7 +2014,7 @@ fn maybe_report_ambiguity(
let predicate = self.resolve_vars_if_possible(obligation.predicate);
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.
// We ignore them if this `infcx` is tainted in some cases below.
+8 -8
View File
@@ -317,7 +317,7 @@ pub fn from_ty(ty: Ty<'tcx>, tcx: TyCtxt<'tcx>) -> Result<Self, Err> {
tcx,
)?,
AdtKind::Enum => {
tracing::trace!(?adt_def, "treeifying enum");
trace!(?adt_def, "treeifying enum");
let mut tree = Tree::uninhabited();
for (idx, discr) in adt_def.discriminants(tcx) {
@@ -381,7 +381,7 @@ fn from_repr_c_variant(
let clamp =
|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",
min_align = ?min_align,
max_align = ?max_align,
@@ -396,22 +396,22 @@ fn from_repr_c_variant(
// The layout of the variant is prefixed by the discriminant, if any.
if let Some(discr) = discr {
tracing::trace!(?discr, "treeifying discriminant");
trace!(?discr, "treeifying discriminant");
let discr_layout = alloc::Layout::from_size_align(
layout_summary.discriminant_size,
clamp(layout_summary.discriminant_align),
)
.unwrap();
tracing::trace!(?discr_layout, "computed discriminant layout");
trace!(?discr_layout, "computed discriminant layout");
variant_layout = variant_layout.extend(discr_layout).unwrap().0;
tree = tree.then(Self::from_disr(discr, tcx, layout_summary.discriminant_size));
}
// 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() {
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
tree = tree.then(Self::def(Def::Field(field_def)));
@@ -434,7 +434,7 @@ fn from_repr_c_variant(
drop(fields_span);
// 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();
if padding_needed > 0 {
tree = tree.then(Self::padding(padding_needed));
@@ -467,7 +467,7 @@ fn layout_of<'tcx>(
layout.align().abi.bytes().try_into().unwrap(),
)
.unwrap();
tracing::trace!(?ty, ?layout, "computed layout for type");
trace!(?ty, ?layout, "computed layout for type");
Ok(layout)
}
}
@@ -110,7 +110,7 @@ pub(crate) fn answer(self) -> Answer<<C as QueryContext>::Ref> {
// Remove all `Def` nodes from `src`, without checking their visibility.
let src = src.prune(&|def| true);
tracing::trace!(?src, "pruned src");
trace!(?src, "pruned src");
// Remove all `Def` nodes from `dst`, additionally...
let dst = if assume_visibility {
@@ -121,7 +121,7 @@ pub(crate) fn answer(self) -> Answer<<C as QueryContext>::Ref> {
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.
// If the conversion fails because `src` is uninhabited, conclude that the transmutation
@@ -82,7 +82,7 @@ fn is_accessible_from(&self, def: Self::Def, scope: Self::Scope) -> bool {
false
};
tracing::trace!(?ret, "ret");
trace!(?ret, "ret");
ret
}
-2
View File
@@ -15,8 +15,6 @@
use std::collections::BTreeMap;
use std::ops::ControlFlow;
use tracing::debug;
// FIXME(#86795): `BoundVarsCollector` here should **NOT** be used
// outside of `resolve_associated_item`. It's just to address #64494,
// #83765, and #85848 which are creating bound types/regions that lose
@@ -17,7 +17,6 @@
use rustc_middle::ty::{self, RvalueScopes, Ty, TyCtxt, TypeVisitable};
use rustc_span::symbol::sym;
use rustc_span::Span;
use tracing::debug;
mod drop_ranges;