Remove #[macro_use] extern crate tracing from rustc_mir_build.

This commit is contained in:
Nicholas Nethercote 2024-05-22 14:35:22 +10:00
parent d787fb062c
commit 2539364053
25 changed files with 26 additions and 6 deletions

View File

@ -5,6 +5,7 @@ use rustc_middle::span_bug;
use rustc_middle::thir::*;
use rustc_middle::{mir::*, ty};
use rustc_span::Span;
use tracing::debug;
impl<'a, 'tcx> Builder<'a, 'tcx> {
pub(crate) fn ast_block(

View File

@ -3,6 +3,7 @@
use crate::build::CFG;
use rustc_middle::mir::*;
use rustc_middle::ty::TyCtxt;
use tracing::debug;
impl<'tcx> CFG<'tcx> {
pub(crate) fn block_data(&self, blk: BasicBlock) -> &BasicBlockData<'tcx> {

View File

@ -38,7 +38,7 @@ macro_rules! parse_by_kind {
) => {{
let expr_id = $self.preparse($expr_id);
let expr = &$self.thir[expr_id];
debug!("Trying to parse {:?} as {}", expr.kind, $expected);
tracing::debug!("Trying to parse {:?} as {}", expr.kind, $expected);
let $expr_name = expr;
match &expr.kind {
$(

View File

@ -11,6 +11,7 @@ use rustc_middle::ty::{
};
use rustc_middle::{bug, span_bug};
use rustc_target::abi::Size;
use tracing::{instrument, trace};
impl<'a, 'tcx> Builder<'a, 'tcx> {
/// Compile `expr`, yielding a compile-time constant. Assumes that

View File

@ -5,6 +5,7 @@ use crate::build::{BlockAnd, BlockAndExtension, Builder, NeedsTemporary};
use rustc_middle::middle::region;
use rustc_middle::mir::*;
use rustc_middle::thir::*;
use tracing::{debug, instrument};
impl<'a, 'tcx> Builder<'a, 'tcx> {
/// Returns an operand suitable for use until the end of the current

View File

@ -15,6 +15,7 @@ use rustc_middle::ty::AdtDef;
use rustc_middle::ty::{self, CanonicalUserTypeAnnotation, Ty, Variance};
use rustc_span::Span;
use rustc_target::abi::{FieldIdx, VariantIdx, FIRST_VARIANT};
use tracing::{debug, instrument, trace};
use std::assert_matches::assert_matches;
use std::iter;

View File

@ -18,6 +18,7 @@ use rustc_middle::ty::cast::{mir_cast_kind, CastTy};
use rustc_middle::ty::layout::IntegerExt;
use rustc_middle::ty::{self, Ty, UpvarArgs};
use rustc_span::{Span, DUMMY_SP};
use tracing::debug;
impl<'a, 'tcx> Builder<'a, 'tcx> {
/// Returns an rvalue suitable for use until the end of the current

View File

@ -6,6 +6,7 @@ use rustc_data_structures::stack::ensure_sufficient_stack;
use rustc_middle::middle::region;
use rustc_middle::mir::*;
use rustc_middle::thir::*;
use tracing::{debug, instrument};
impl<'a, 'tcx> Builder<'a, 'tcx> {
/// Compile `expr` into a fresh temporary. This is used when building

View File

@ -12,6 +12,7 @@ use rustc_middle::thir::*;
use rustc_middle::ty::CanonicalUserTypeAnnotation;
use rustc_span::source_map::Spanned;
use std::iter;
use tracing::{debug, instrument};
impl<'a, 'tcx> Builder<'a, 'tcx> {
/// Compile `expr`, storing the result into `destination`, which

View File

@ -3,6 +3,7 @@ use crate::build::{BlockAnd, BlockAndExtension, BlockFrame, Builder};
use rustc_middle::middle::region;
use rustc_middle::mir::*;
use rustc_middle::thir::*;
use tracing::debug;
impl<'a, 'tcx> Builder<'a, 'tcx> {
/// Builds a block of MIR statements to evaluate the THIR `expr`.

View File

@ -20,6 +20,8 @@ use rustc_middle::ty::{self, CanonicalUserTypeAnnotation, Ty};
use rustc_span::symbol::Symbol;
use rustc_span::{BytePos, Pos, Span};
use rustc_target::abi::VariantIdx;
use tracing::{debug, instrument};
// helper functions, broken out by category:
mod simplify;
mod test;

View File

@ -14,6 +14,7 @@
use crate::build::matches::{MatchPair, PatternExtraData, TestCase};
use crate::build::Builder;
use tracing::{debug, instrument};
use std::mem;

View File

@ -18,6 +18,7 @@ use rustc_span::def_id::DefId;
use rustc_span::source_map::Spanned;
use rustc_span::symbol::{sym, Symbol};
use rustc_span::{Span, DUMMY_SP};
use tracing::{debug, instrument};
use std::cmp::Ordering;

View File

@ -7,6 +7,7 @@ use rustc_middle::thir::{self, *};
use rustc_middle::ty::TypeVisitableExt;
use rustc_middle::ty::{self, Ty};
use rustc_span::Span;
use tracing::debug;
impl<'a, 'tcx> Builder<'a, 'tcx> {
pub(crate) fn field_match_pairs<'pat>(

View File

@ -7,6 +7,7 @@ use rustc_middle::mir::*;
use rustc_middle::ty::{self, Ty};
use rustc_span::Span;
use rustc_trait_selection::infer::InferCtxtExt;
use tracing::debug;
impl<'a, 'tcx> Builder<'a, 'tcx> {
/// Adds a new temporary value of type `ty` storing the result of

View File

@ -94,6 +94,7 @@ use rustc_middle::{bug, span_bug};
use rustc_session::lint::Level;
use rustc_span::source_map::Spanned;
use rustc_span::{Span, DUMMY_SP};
use tracing::{debug, instrument};
#[derive(Debug)]
pub struct Scopes<'tcx> {

View File

@ -10,9 +10,6 @@
#![feature(let_chains)]
#![feature(try_blocks)]
#[macro_use]
extern crate tracing;
mod build;
mod check_unsafety;
mod errors;

View File

@ -2,6 +2,7 @@ use rustc_ast as ast;
use rustc_middle::bug;
use rustc_middle::mir::interpret::{LitToConstError, LitToConstInput};
use rustc_middle::ty::{self, ParamEnv, ScalarInt, TyCtxt};
use tracing::trace;
use crate::build::parse_float_into_scalar;

View File

@ -1,12 +1,12 @@
use crate::thir::cx::Cx;
use rustc_hir as hir;
use rustc_index::Idx;
use rustc_middle::middle::region;
use rustc_middle::thir::*;
use rustc_middle::ty;
use rustc_index::Idx;
use rustc_middle::ty::CanonicalUserTypeAnnotation;
use tracing::debug;
impl<'tcx> Cx<'tcx> {
pub(crate) fn mirror_block(&mut self, block: &'tcx hir::Block<'tcx>) -> BlockId {

View File

@ -25,6 +25,7 @@ use rustc_middle::{bug, span_bug};
use rustc_span::source_map::Spanned;
use rustc_span::{sym, Span, DUMMY_SP};
use rustc_target::abi::{FieldIdx, FIRST_VARIANT};
use tracing::{debug, info, instrument, trace};
impl<'tcx> Cx<'tcx> {
pub(crate) fn mirror_expr(&mut self, expr: &'tcx hir::Expr<'tcx>) -> ExprId {

View File

@ -17,6 +17,7 @@ use rustc_middle::bug;
use rustc_middle::middle::region;
use rustc_middle::thir::*;
use rustc_middle::ty::{self, RvalueScopes, TyCtxt};
use tracing::instrument;
pub(crate) fn thir_body(
tcx: TyCtxt<'_>,

View File

@ -24,6 +24,7 @@ use rustc_session::lint::builtin::{
};
use rustc_span::hygiene::DesugaringKind;
use rustc_span::{sym, Span};
use tracing::instrument;
pub(crate) fn check_match(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Result<(), ErrorGuaranteed> {
let typeck_results = tcx.typeck(def_id);

View File

@ -12,6 +12,7 @@ use rustc_span::{ErrorGuaranteed, Span};
use rustc_target::abi::{FieldIdx, VariantIdx};
use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt;
use rustc_trait_selection::traits::{self, ObligationCause};
use tracing::{debug, instrument, trace};
use std::cell::Cell;

View File

@ -25,6 +25,7 @@ use rustc_middle::{bug, span_bug};
use rustc_span::def_id::LocalDefId;
use rustc_span::{ErrorGuaranteed, Span};
use rustc_target::abi::{FieldIdx, Integer};
use tracing::{debug, instrument};
use std::cmp::Ordering;

View File

@ -1,6 +1,7 @@
use rustc_hir as hir;
use rustc_middle::bug;
use rustc_middle::ty::{self, CanonicalUserType, TyCtxt, UserType};
use tracing::debug;
pub(crate) trait UserAnnotatedTyHelpers<'tcx> {
fn tcx(&self) -> TyCtxt<'tcx>;