Skip to content

Commit ba956ef

Browse files
committed
Auto merge of #124914 - nnethercote:rm-extern-crate-rustc_middle, r=saethlin
Remove `#[macro_use] extern crate rustc middle` from numerous crates Because explicit importing of macros via `use` items is nicer (more standard and readable) than implicit importing via `#[macro_use]`. This PR mops up some cases I didn't get to in #124511. r? `@saethlin`
2 parents ecbe3fd + c34ebba commit ba956ef

File tree

211 files changed

+281
-81
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+281
-81
lines changed

compiler/rustc_const_eval/src/const_eval/dummy_machine.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
use crate::interpret::{self, HasStaticRootDefId, ImmTy, Immediate, InterpCx, PointerArithmetic};
1+
use crate::interpret::{
2+
self, throw_machine_stop, HasStaticRootDefId, ImmTy, Immediate, InterpCx, PointerArithmetic,
3+
};
24
use rustc_middle::mir::interpret::{AllocId, ConstAllocation, InterpResult};
35
use rustc_middle::mir::*;
46
use rustc_middle::query::TyCtxtAt;
57
use rustc_middle::ty;
68
use rustc_middle::ty::layout::TyAndLayout;
9+
use rustc_middle::{bug, span_bug};
710
use rustc_span::def_id::DefId;
811

912
/// Macro for machine-specific `InterpError` without allocation.

compiler/rustc_const_eval/src/const_eval/error.rs

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use rustc_span::{Span, Symbol};
1111

1212
use super::CompileTimeInterpreter;
1313
use crate::errors::{self, FrameNote, ReportErrorExt};
14+
use crate::interpret::{err_inval, err_machine_stop};
1415
use crate::interpret::{ErrorHandled, Frame, InterpError, InterpErrorInfo, MachineStopType};
1516

1617
/// The CTFE machine has some custom error kinds.

compiler/rustc_const_eval/src/const_eval/eval_queries.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use std::sync::atomic::Ordering::Relaxed;
33
use either::{Left, Right};
44

55
use rustc_hir::def::DefKind;
6+
use rustc_middle::bug;
67
use rustc_middle::mir::interpret::{AllocId, ErrorHandled, InterpErrorInfo};
78
use rustc_middle::mir::{self, ConstAlloc, ConstValue};
89
use rustc_middle::query::TyCtxtAt;
@@ -24,7 +25,7 @@ use crate::interpret::{
2425
InternKind, InterpCx, InterpError, InterpResult, MPlaceTy, MemoryKind, OpTy, RefTracking,
2526
StackPopCleanup,
2627
};
27-
use crate::interpret::{eval_nullary_intrinsic, InternResult};
28+
use crate::interpret::{eval_nullary_intrinsic, throw_exhaust, InternResult};
2829
use crate::CTRL_C_RECEIVED;
2930

3031
// Returns a pointer to where the result lives

compiler/rustc_const_eval/src/const_eval/machine.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use rustc_hir::def::DefKind;
1010
use rustc_hir::def_id::DefId;
1111
use rustc_hir::def_id::LocalDefId;
1212
use rustc_hir::LangItem;
13+
use rustc_middle::bug;
1314
use rustc_middle::mir;
1415
use rustc_middle::mir::AssertMessage;
1516
use rustc_middle::query::TyCtxtAt;
@@ -24,8 +25,9 @@ use rustc_target::spec::abi::Abi as CallAbi;
2425
use crate::errors::{LongRunning, LongRunningWarn};
2526
use crate::fluent_generated as fluent;
2627
use crate::interpret::{
27-
self, compile_time_machine, AllocId, AllocRange, ConstAllocation, CtfeProvenance, FnArg, FnVal,
28-
Frame, ImmTy, InterpCx, InterpResult, MPlaceTy, OpTy, Pointer, PointerArithmetic, Scalar,
28+
self, compile_time_machine, err_ub, throw_exhaust, throw_inval, throw_ub_custom,
29+
throw_unsup_format, AllocId, AllocRange, ConstAllocation, CtfeProvenance, FnArg, FnVal, Frame,
30+
ImmTy, InterpCx, InterpResult, MPlaceTy, OpTy, Pointer, PointerArithmetic, Scalar,
2931
};
3032

3133
use super::error::*;

compiler/rustc_const_eval/src/const_eval/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Not in interpret to make sure we do not use private implementation details
22

3+
use rustc_middle::bug;
34
use rustc_middle::mir;
45
use rustc_middle::mir::interpret::InterpErrorInfo;
56
use rustc_middle::query::{Key, TyCtxtAt};

compiler/rustc_const_eval/src/const_eval/valtrees.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use rustc_data_structures::stack::ensure_sufficient_stack;
2+
use rustc_middle::bug;
23
use rustc_middle::mir;
34
use rustc_middle::mir::interpret::{EvalToValTreeResult, GlobalId};
45
use rustc_middle::ty::layout::{LayoutCx, LayoutOf, TyAndLayout};

compiler/rustc_const_eval/src/interpret/cast.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ use rustc_middle::mir::CastKind;
77
use rustc_middle::ty::adjustment::PointerCoercion;
88
use rustc_middle::ty::layout::{IntegerExt, LayoutOf, TyAndLayout};
99
use rustc_middle::ty::{self, FloatTy, Ty};
10+
use rustc_middle::{bug, span_bug};
1011
use rustc_target::abi::Integer;
1112
use rustc_type_ir::TyKind::*;
1213

1314
use super::{
14-
util::ensure_monomorphic_enough, FnVal, ImmTy, Immediate, InterpCx, Machine, OpTy, PlaceTy,
15+
err_inval, throw_ub, throw_ub_custom, util::ensure_monomorphic_enough, FnVal, ImmTy, Immediate,
16+
InterpCx, Machine, OpTy, PlaceTy,
1517
};
1618

1719
use crate::fluent_generated as fluent;

compiler/rustc_const_eval/src/interpret/discriminant.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
//! Functions for reading and writing discriminants of multi-variant layouts (enums and coroutines).
22
33
use rustc_middle::mir;
4+
use rustc_middle::span_bug;
45
use rustc_middle::ty::layout::{LayoutOf, PrimitiveExt};
56
use rustc_middle::ty::{self, ScalarInt, Ty};
67
use rustc_target::abi::{self, TagEncoding};
78
use rustc_target::abi::{VariantIdx, Variants};
89

9-
use super::{ImmTy, InterpCx, InterpResult, Machine, Readable, Scalar, Writeable};
10+
use super::{
11+
err_ub, throw_ub, ImmTy, InterpCx, InterpResult, Machine, Readable, Scalar, Writeable,
12+
};
1013

1114
impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
1215
/// Writes the discriminant of the given variant.

compiler/rustc_const_eval/src/interpret/eval_context.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,17 @@ use rustc_middle::ty::layout::{
1717
TyAndLayout,
1818
};
1919
use rustc_middle::ty::{self, GenericArgsRef, ParamEnv, Ty, TyCtxt, TypeFoldable, Variance};
20+
use rustc_middle::{bug, span_bug};
2021
use rustc_mir_dataflow::storage::always_storage_live_locals;
2122
use rustc_session::Limit;
2223
use rustc_span::Span;
2324
use rustc_target::abi::{call::FnAbi, Align, HasDataLayout, Size, TargetDataLayout};
2425

2526
use super::{
26-
GlobalId, Immediate, InterpErrorInfo, InterpResult, MPlaceTy, Machine, MemPlace, MemPlaceMeta,
27-
Memory, MemoryKind, OpTy, Operand, Place, PlaceTy, Pointer, PointerArithmetic, Projectable,
28-
Provenance, Scalar, StackPopJump,
27+
err_inval, throw_inval, throw_ub, throw_ub_custom, throw_unsup, GlobalId, Immediate,
28+
InterpErrorInfo, InterpResult, MPlaceTy, Machine, MemPlace, MemPlaceMeta, Memory, MemoryKind,
29+
OpTy, Operand, Place, PlaceTy, Pointer, PointerArithmetic, Projectable, Provenance, Scalar,
30+
StackPopJump,
2931
};
3032
use crate::errors;
3133
use crate::util;

compiler/rustc_const_eval/src/interpret/intern.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use rustc_middle::ty::layout::TyAndLayout;
2424
use rustc_span::def_id::LocalDefId;
2525
use rustc_span::sym;
2626

27-
use super::{AllocId, Allocation, InterpCx, MPlaceTy, Machine, MemoryKind, PlaceTy};
27+
use super::{err_ub, AllocId, Allocation, InterpCx, MPlaceTy, Machine, MemoryKind, PlaceTy};
2828
use crate::const_eval;
2929
use crate::errors::NestedStaticInThreadLocal;
3030

compiler/rustc_const_eval/src/interpret/intrinsics.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,18 @@ use rustc_middle::ty::layout::{LayoutOf as _, ValidityRequirement};
88
use rustc_middle::ty::GenericArgsRef;
99
use rustc_middle::ty::{Ty, TyCtxt};
1010
use rustc_middle::{
11+
bug,
1112
mir::{self, BinOp, ConstValue, NonDivergingIntrinsic},
1213
ty::layout::TyAndLayout,
1314
};
1415
use rustc_span::symbol::{sym, Symbol};
1516
use rustc_target::abi::Size;
1617

1718
use super::{
18-
memory::MemoryKind, util::ensure_monomorphic_enough, Allocation, CheckInAllocMsg,
19-
ConstAllocation, GlobalId, ImmTy, InterpCx, InterpResult, MPlaceTy, Machine, OpTy, Pointer,
20-
PointerArithmetic, Scalar,
19+
err_inval, err_ub_custom, err_unsup_format, memory::MemoryKind, throw_inval, throw_ub_custom,
20+
throw_ub_format, util::ensure_monomorphic_enough, Allocation, CheckInAllocMsg, ConstAllocation,
21+
GlobalId, ImmTy, InterpCx, InterpResult, MPlaceTy, Machine, OpTy, Pointer, PointerArithmetic,
22+
Scalar,
2123
};
2224

2325
use crate::fluent_generated as fluent;

compiler/rustc_const_eval/src/interpret/machine.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ use rustc_target::abi::{Align, Size};
1818
use rustc_target::spec::abi::Abi as CallAbi;
1919

2020
use super::{
21-
AllocBytes, AllocId, AllocKind, AllocRange, Allocation, ConstAllocation, CtfeProvenance, FnArg,
22-
Frame, ImmTy, InterpCx, InterpResult, MPlaceTy, MemoryKind, Misalignment, OpTy, PlaceTy,
23-
Pointer, Provenance,
21+
throw_unsup, throw_unsup_format, AllocBytes, AllocId, AllocKind, AllocRange, Allocation,
22+
ConstAllocation, CtfeProvenance, FnArg, Frame, ImmTy, InterpCx, InterpResult, MPlaceTy,
23+
MemoryKind, Misalignment, OpTy, PlaceTy, Pointer, Provenance,
2424
};
2525

2626
/// Data returned by Machine::stack_pop,

compiler/rustc_const_eval/src/interpret/memory.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,18 @@ use std::ptr;
1616
use rustc_ast::Mutability;
1717
use rustc_data_structures::fx::{FxHashSet, FxIndexMap};
1818
use rustc_hir::def::DefKind;
19+
use rustc_middle::bug;
1920
use rustc_middle::mir::display_allocation;
2021
use rustc_middle::ty::{self, Instance, ParamEnv, Ty, TyCtxt};
2122
use rustc_target::abi::{Align, HasDataLayout, Size};
2223

2324
use crate::fluent_generated as fluent;
2425

2526
use super::{
26-
alloc_range, AllocBytes, AllocId, AllocMap, AllocRange, Allocation, CheckAlignMsg,
27-
CheckInAllocMsg, CtfeProvenance, GlobalAlloc, InterpCx, InterpResult, Machine, MayLeak,
28-
Misalignment, Pointer, PointerArithmetic, Provenance, Scalar,
27+
alloc_range, err_ub, err_ub_custom, throw_ub, throw_ub_custom, throw_unsup, throw_unsup_format,
28+
AllocBytes, AllocId, AllocMap, AllocRange, Allocation, CheckAlignMsg, CheckInAllocMsg,
29+
CtfeProvenance, GlobalAlloc, InterpCx, InterpResult, Machine, MayLeak, Misalignment, Pointer,
30+
PointerArithmetic, Provenance, Scalar,
2931
};
3032

3133
#[derive(Debug, PartialEq, Copy, Clone)]

compiler/rustc_const_eval/src/interpret/operand.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ use rustc_middle::mir::interpret::ScalarSizeMismatch;
1010
use rustc_middle::ty::layout::{LayoutOf, TyAndLayout};
1111
use rustc_middle::ty::print::{FmtPrinter, PrettyPrinter};
1212
use rustc_middle::ty::{ConstInt, ScalarInt, Ty, TyCtxt};
13+
use rustc_middle::{bug, span_bug};
1314
use rustc_middle::{mir, ty};
1415
use rustc_target::abi::{self, Abi, HasDataLayout, Size};
1516

1617
use super::{
17-
alloc_range, from_known_layout, mir_assign_valid_types, CtfeProvenance, InterpCx, InterpResult,
18-
MPlaceTy, Machine, MemPlace, MemPlaceMeta, OffsetMode, PlaceTy, Pointer, Projectable,
19-
Provenance, Scalar,
18+
alloc_range, err_ub, from_known_layout, mir_assign_valid_types, throw_ub, CtfeProvenance,
19+
InterpCx, InterpResult, MPlaceTy, Machine, MemPlace, MemPlaceMeta, OffsetMode, PlaceTy,
20+
Pointer, Projectable, Provenance, Scalar,
2021
};
2122

2223
/// An `Immediate` represents a single immediate self-contained Rust value.

compiler/rustc_const_eval/src/interpret/operator.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ use rustc_middle::mir;
33
use rustc_middle::mir::interpret::{InterpResult, Scalar};
44
use rustc_middle::ty::layout::{LayoutOf, TyAndLayout};
55
use rustc_middle::ty::{self, FloatTy, ScalarInt, Ty};
6+
use rustc_middle::{bug, span_bug};
67
use rustc_span::symbol::sym;
78
use rustc_target::abi::Abi;
89

9-
use super::{ImmTy, Immediate, InterpCx, Machine, PlaceTy};
10+
use super::{err_ub, throw_ub, throw_ub_custom, ImmTy, Immediate, InterpCx, Machine, PlaceTy};
1011

1112
use crate::fluent_generated as fluent;
1213

compiler/rustc_const_eval/src/interpret/place.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ use rustc_middle::mir;
1111
use rustc_middle::ty;
1212
use rustc_middle::ty::layout::{LayoutOf, TyAndLayout};
1313
use rustc_middle::ty::Ty;
14+
use rustc_middle::{bug, span_bug};
1415
use rustc_target::abi::{Abi, Align, HasDataLayout, Size};
1516

1617
use super::{
17-
alloc_range, mir_assign_valid_types, AllocRef, AllocRefMut, CheckAlignMsg, CtfeProvenance,
18-
ImmTy, Immediate, InterpCx, InterpResult, Machine, MemoryKind, Misalignment, OffsetMode, OpTy,
19-
Operand, Pointer, PointerArithmetic, Projectable, Provenance, Readable, Scalar,
18+
alloc_range, mir_assign_valid_types, throw_ub, AllocRef, AllocRefMut, CheckAlignMsg,
19+
CtfeProvenance, ImmTy, Immediate, InterpCx, InterpResult, Machine, MemoryKind, Misalignment,
20+
OffsetMode, OpTy, Operand, Pointer, PointerArithmetic, Projectable, Provenance, Readable,
21+
Scalar,
2022
};
2123

2224
#[derive(Copy, Clone, Hash, PartialEq, Eq, Debug)]

compiler/rustc_const_eval/src/interpret/projection.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@ use rustc_middle::mir;
1414
use rustc_middle::ty;
1515
use rustc_middle::ty::layout::{LayoutOf, TyAndLayout};
1616
use rustc_middle::ty::Ty;
17+
use rustc_middle::{bug, span_bug};
1718
use rustc_target::abi::Size;
1819
use rustc_target::abi::{self, VariantIdx};
1920

20-
use super::{InterpCx, InterpResult, MPlaceTy, Machine, MemPlaceMeta, OpTy, Provenance, Scalar};
21+
use super::{
22+
throw_ub, throw_unsup_format, InterpCx, InterpResult, MPlaceTy, Machine, MemPlaceMeta, OpTy,
23+
Provenance, Scalar,
24+
};
2125

2226
/// Describes the constraints placed on offset-projections.
2327
#[derive(Copy, Clone, Debug)]

compiler/rustc_const_eval/src/interpret/step.rs

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use either::Either;
77
use rustc_index::IndexSlice;
88
use rustc_middle::mir;
99
use rustc_middle::ty::layout::LayoutOf;
10+
use rustc_middle::{bug, span_bug};
1011
use rustc_target::abi::{FieldIdx, FIRST_VARIANT};
1112

1213
use super::{

compiler/rustc_const_eval/src/interpret/terminator.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use std::borrow::Cow;
22

33
use either::Either;
44

5+
use rustc_middle::span_bug;
56
use rustc_middle::{
67
mir,
78
ty::{
@@ -19,8 +20,9 @@ use rustc_target::abi::{
1920
use rustc_target::spec::abi::Abi;
2021

2122
use super::{
22-
CtfeProvenance, FnVal, ImmTy, InterpCx, InterpResult, MPlaceTy, Machine, OpTy, PlaceTy,
23-
Projectable, Provenance, Scalar, StackPopCleanup,
23+
throw_ub, throw_ub_custom, throw_unsup_format, CtfeProvenance, FnVal, ImmTy, InterpCx,
24+
InterpResult, MPlaceTy, Machine, OpTy, PlaceTy, Projectable, Provenance, Scalar,
25+
StackPopCleanup,
2426
};
2527
use crate::fluent_generated as fluent;
2628

compiler/rustc_const_eval/src/interpret/util.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use crate::const_eval::{CompileTimeEvalContext, CompileTimeInterpreter, InterpretationResult};
2-
use crate::interpret::{MemPlaceMeta, MemoryKind};
32
use rustc_hir::def_id::LocalDefId;
43
use rustc_middle::mir;
54
use rustc_middle::mir::interpret::{Allocation, InterpResult, Pointer};
@@ -9,7 +8,7 @@ use rustc_middle::ty::{
98
};
109
use std::ops::ControlFlow;
1110

12-
use super::{InterpCx, MPlaceTy};
11+
use super::{throw_inval, InterpCx, MPlaceTy, MemPlaceMeta, MemoryKind};
1312

1413
/// Checks whether a type contains generic parameters which must be instantiated.
1514
///

compiler/rustc_const_eval/src/interpret/validity.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use hir::def::DefKind;
1313
use rustc_ast::Mutability;
1414
use rustc_data_structures::fx::FxHashSet;
1515
use rustc_hir as hir;
16+
use rustc_middle::bug;
1617
use rustc_middle::mir::interpret::{
1718
ExpectedKind, InterpError, InvalidMetaKind, Misalignment, PointerKind, Provenance,
1819
ValidationErrorInfo, ValidationErrorKind, ValidationErrorKind::*,
@@ -27,9 +28,9 @@ use rustc_target::abi::{
2728
use std::hash::Hash;
2829

2930
use super::{
30-
format_interp_error, machine::AllocMap, AllocId, CheckInAllocMsg, GlobalAlloc, ImmTy,
31-
Immediate, InterpCx, InterpResult, MPlaceTy, Machine, MemPlaceMeta, OpTy, Pointer, Projectable,
32-
Scalar, ValueVisitor,
31+
err_ub, format_interp_error, machine::AllocMap, throw_ub, AllocId, CheckInAllocMsg,
32+
GlobalAlloc, ImmTy, Immediate, InterpCx, InterpResult, MPlaceTy, Machine, MemPlaceMeta, OpTy,
33+
Pointer, Projectable, Scalar, ValueVisitor,
3334
};
3435

3536
// for the validation errors

compiler/rustc_const_eval/src/interpret/visitor.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_target::abi::{FieldsShape, VariantIdx, Variants};
99

1010
use std::num::NonZero;
1111

12-
use super::{InterpCx, MPlaceTy, Machine, Projectable};
12+
use super::{throw_inval, InterpCx, MPlaceTy, Machine, Projectable};
1313

1414
/// How to traverse a value and what to do when we are at the leaves.
1515
pub trait ValueVisitor<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>>: Sized {

compiler/rustc_const_eval/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ Rust MIR: a lowered representation of Rust.
2222

2323
#[macro_use]
2424
extern crate tracing;
25-
#[macro_use]
26-
extern crate rustc_middle;
2725

2826
pub mod const_eval;
2927
mod errors;

compiler/rustc_const_eval/src/transform/check_consts/check.rs

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use rustc_infer::infer::TyCtxtInferExt;
88
use rustc_infer::traits::ObligationCause;
99
use rustc_middle::mir::visit::{MutatingUseContext, NonMutatingUseContext, PlaceContext, Visitor};
1010
use rustc_middle::mir::*;
11+
use rustc_middle::span_bug;
1112
use rustc_middle::ty::{self, adjustment::PointerCoercion, Ty, TyCtxt};
1213
use rustc_middle::ty::{Instance, InstanceDef, TypeVisitableExt};
1314
use rustc_mir_dataflow::Analysis;

compiler/rustc_const_eval/src/transform/check_consts/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use rustc_attr as attr;
88
use rustc_errors::DiagCtxt;
99
use rustc_hir as hir;
1010
use rustc_hir::def_id::{DefId, LocalDefId};
11+
use rustc_middle::bug;
1112
use rustc_middle::mir;
1213
use rustc_middle::ty::{self, PolyFnSig, TyCtxt};
1314
use rustc_span::Symbol;

compiler/rustc_const_eval/src/transform/check_consts/ops.rs

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use rustc_hir::def_id::DefId;
88
use rustc_infer::infer::TyCtxtInferExt;
99
use rustc_infer::traits::{ImplSource, Obligation, ObligationCause};
1010
use rustc_middle::mir::{self, CallSource};
11+
use rustc_middle::span_bug;
1112
use rustc_middle::ty::print::{with_no_trimmed_paths, PrintTraitRefExt as _};
1213
use rustc_middle::ty::{
1314
self, suggest_constraining_type_param, Closure, FnDef, FnPtr, GenericArgKind, GenericArgsRef,

compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use rustc_errors::ErrorGuaranteed;
66
use rustc_hir::LangItem;
77
use rustc_infer::infer::TyCtxtInferExt;
8+
use rustc_middle::bug;
89
use rustc_middle::mir;
910
use rustc_middle::mir::*;
1011
use rustc_middle::traits::BuiltinImplSource;

compiler/rustc_const_eval/src/transform/validate.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use rustc_middle::mir::interpret::Scalar;
99
use rustc_middle::mir::visit::{NonUseContext, PlaceContext, Visitor};
1010
use rustc_middle::mir::*;
1111
use rustc_middle::ty::{self, InstanceDef, ParamEnv, Ty, TyCtxt, TypeVisitableExt, Variance};
12+
use rustc_middle::{bug, span_bug};
1213
use rustc_target::abi::{Size, FIRST_VARIANT};
1314
use rustc_target::spec::abi::Abi;
1415

compiler/rustc_const_eval/src/util/caller_location.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use rustc_hir::LangItem;
2+
use rustc_middle::bug;
23
use rustc_middle::mir;
34
use rustc_middle::query::TyCtxtAt;
45
use rustc_middle::ty::layout::LayoutOf;

compiler/rustc_const_eval/src/util/check_validity_requirement.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use rustc_middle::bug;
12
use rustc_middle::ty::layout::{LayoutCx, LayoutError, LayoutOf, TyAndLayout, ValidityRequirement};
23
use rustc_middle::ty::{ParamEnv, ParamEnvAnd, Ty, TyCtxt};
34
use rustc_target::abi::{Abi, FieldsShape, Scalar, Variants};

compiler/rustc_const_eval/src/util/type_name.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use rustc_data_structures::intern::Interned;
22
use rustc_hir::def_id::CrateNum;
33
use rustc_hir::definitions::DisambiguatedDefPathData;
4+
use rustc_middle::bug;
45
use rustc_middle::ty::{
56
self,
67
print::{PrettyPrinter, Print, PrintError, Printer},

0 commit comments

Comments
 (0)