Remove #[macro_use] extern crate tracing from rustc_const_eval.

This commit is contained in:
Nicholas Nethercote 2024-05-22 14:20:23 +10:00
parent c7da1a5bb8
commit 7a5d814a04
27 changed files with 29 additions and 3 deletions

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::*;