Remove extern crate rustc_middle from rustc_mir_build.

This commit is contained in:
Nicholas Nethercote 2024-05-08 19:31:05 +10:00
parent 00cfb45b54
commit 900bcacf3a
20 changed files with 24 additions and 8 deletions

View File

@ -1,6 +1,7 @@
use crate::build::ForGuard::OutsideGuard; use crate::build::ForGuard::OutsideGuard;
use crate::build::{BlockAnd, BlockAndExtension, BlockFrame, Builder}; use crate::build::{BlockAnd, BlockAndExtension, BlockFrame, Builder};
use rustc_middle::middle::region::Scope; use rustc_middle::middle::region::Scope;
use rustc_middle::span_bug;
use rustc_middle::thir::*; use rustc_middle::thir::*;
use rustc_middle::{mir::*, ty}; use rustc_middle::{mir::*, ty};
use rustc_span::Span; use rustc_span::Span;

View File

@ -1,5 +1,6 @@
use std::collections::VecDeque; use std::collections::VecDeque;
use rustc_middle::bug;
use rustc_middle::mir::coverage::{ use rustc_middle::mir::coverage::{
BlockMarkerId, ConditionId, ConditionInfo, MCDCBranchSpan, MCDCDecisionSpan, BlockMarkerId, ConditionId, ConditionInfo, MCDCBranchSpan, MCDCDecisionSpan,
}; };

View File

@ -24,6 +24,7 @@ use rustc_hir::HirId;
use rustc_index::{IndexSlice, IndexVec}; use rustc_index::{IndexSlice, IndexVec};
use rustc_middle::{ use rustc_middle::{
mir::*, mir::*,
span_bug,
thir::*, thir::*,
ty::{ParamEnv, Ty, TyCtxt}, ty::{ParamEnv, Ty, TyCtxt},
}; };

View File

@ -9,6 +9,7 @@ use rustc_middle::thir::*;
use rustc_middle::ty::{ use rustc_middle::ty::{
self, CanonicalUserType, CanonicalUserTypeAnnotation, TyCtxt, UserTypeAnnotationIndex, self, CanonicalUserType, CanonicalUserTypeAnnotation, TyCtxt, UserTypeAnnotationIndex,
}; };
use rustc_middle::{bug, span_bug};
use rustc_target::abi::Size; use rustc_target::abi::Size;
impl<'a, 'tcx> Builder<'a, 'tcx> { impl<'a, 'tcx> Builder<'a, 'tcx> {

View File

@ -4,6 +4,7 @@ use crate::build::expr::category::Category;
use crate::build::ForGuard::{OutsideGuard, RefWithinGuard}; use crate::build::ForGuard::{OutsideGuard, RefWithinGuard};
use crate::build::{BlockAnd, BlockAndExtension, Builder, Capture, CaptureMap}; use crate::build::{BlockAnd, BlockAndExtension, Builder, Capture, CaptureMap};
use rustc_hir::def_id::LocalDefId; use rustc_hir::def_id::LocalDefId;
use rustc_middle::bug;
use rustc_middle::hir::place::Projection as HirProjection; use rustc_middle::hir::place::Projection as HirProjection;
use rustc_middle::hir::place::ProjectionKind as HirProjectionKind; use rustc_middle::hir::place::ProjectionKind as HirProjectionKind;
use rustc_middle::middle::region; use rustc_middle::middle::region;

View File

@ -9,6 +9,7 @@ use crate::build::expr::as_place::PlaceBase;
use crate::build::expr::category::{Category, RvalueFunc}; use crate::build::expr::category::{Category, RvalueFunc};
use crate::build::{BlockAnd, BlockAndExtension, Builder, NeedsTemporary}; use crate::build::{BlockAnd, BlockAndExtension, Builder, NeedsTemporary};
use rustc_hir::lang_items::LangItem; use rustc_hir::lang_items::LangItem;
use rustc_middle::bug;
use rustc_middle::middle::region; use rustc_middle::middle::region;
use rustc_middle::mir::interpret::Scalar; use rustc_middle::mir::interpret::Scalar;
use rustc_middle::mir::*; use rustc_middle::mir::*;

View File

@ -7,6 +7,7 @@ use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::stack::ensure_sufficient_stack; use rustc_data_structures::stack::ensure_sufficient_stack;
use rustc_hir as hir; use rustc_hir as hir;
use rustc_middle::mir::*; use rustc_middle::mir::*;
use rustc_middle::span_bug;
use rustc_middle::thir::*; use rustc_middle::thir::*;
use rustc_middle::ty::CanonicalUserTypeAnnotation; use rustc_middle::ty::CanonicalUserTypeAnnotation;
use rustc_span::source_map::Spanned; use rustc_span::source_map::Spanned;

View File

@ -12,6 +12,7 @@ use crate::build::{BlockAnd, BlockAndExtension, Builder};
use crate::build::{GuardFrame, GuardFrameLocal, LocalsForNode}; use crate::build::{GuardFrame, GuardFrameLocal, LocalsForNode};
use rustc_data_structures::{fx::FxIndexMap, stack::ensure_sufficient_stack}; use rustc_data_structures::{fx::FxIndexMap, stack::ensure_sufficient_stack};
use rustc_hir::{BindingMode, ByRef}; use rustc_hir::{BindingMode, ByRef};
use rustc_middle::bug;
use rustc_middle::middle::region; use rustc_middle::middle::region;
use rustc_middle::mir::{self, *}; use rustc_middle::mir::{self, *};
use rustc_middle::thir::{self, *}; use rustc_middle::thir::{self, *};

View File

@ -13,6 +13,7 @@ use rustc_middle::mir::*;
use rustc_middle::ty::util::IntTypeExt; use rustc_middle::ty::util::IntTypeExt;
use rustc_middle::ty::GenericArg; use rustc_middle::ty::GenericArg;
use rustc_middle::ty::{self, adjustment::PointerCoercion, Ty, TyCtxt}; use rustc_middle::ty::{self, adjustment::PointerCoercion, Ty, TyCtxt};
use rustc_middle::{bug, span_bug};
use rustc_span::def_id::DefId; use rustc_span::def_id::DefId;
use rustc_span::source_map::Spanned; use rustc_span::source_map::Spanned;
use rustc_span::symbol::{sym, Symbol}; use rustc_span::symbol::{sym, Symbol};

View File

@ -20,6 +20,7 @@ use rustc_middle::mir::*;
use rustc_middle::query::TyCtxtAt; use rustc_middle::query::TyCtxtAt;
use rustc_middle::thir::{self, ExprId, LintLevel, LocalVarId, Param, ParamId, PatKind, Thir}; use rustc_middle::thir::{self, ExprId, LintLevel, LocalVarId, Param, ParamId, PatKind, Thir};
use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt}; use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt};
use rustc_middle::{bug, span_bug};
use rustc_span::symbol::sym; use rustc_span::symbol::sym;
use rustc_span::Span; use rustc_span::Span;
use rustc_span::Symbol; use rustc_span::Symbol;

View File

@ -90,6 +90,7 @@ use rustc_index::{IndexSlice, IndexVec};
use rustc_middle::middle::region; use rustc_middle::middle::region;
use rustc_middle::mir::*; use rustc_middle::mir::*;
use rustc_middle::thir::{ExprId, LintLevel}; use rustc_middle::thir::{ExprId, LintLevel};
use rustc_middle::{bug, span_bug};
use rustc_session::lint::Level; use rustc_session::lint::Level;
use rustc_span::source_map::Spanned; use rustc_span::source_map::Spanned;
use rustc_span::{Span, DUMMY_SP}; use rustc_span::{Span, DUMMY_SP};

View File

@ -4,6 +4,7 @@ use crate::errors::*;
use rustc_errors::DiagArgValue; use rustc_errors::DiagArgValue;
use rustc_hir::{self as hir, BindingMode, ByRef, HirId, Mutability}; use rustc_hir::{self as hir, BindingMode, ByRef, HirId, Mutability};
use rustc_middle::mir::BorrowKind; use rustc_middle::mir::BorrowKind;
use rustc_middle::span_bug;
use rustc_middle::thir::visit::Visitor; use rustc_middle::thir::visit::Visitor;
use rustc_middle::thir::*; use rustc_middle::thir::*;
use rustc_middle::ty::print::with_no_trimmed_paths; use rustc_middle::ty::print::with_no_trimmed_paths;

View File

@ -12,8 +12,6 @@
#[macro_use] #[macro_use]
extern crate tracing; extern crate tracing;
#[macro_use]
extern crate rustc_middle;
mod build; mod build;
mod check_unsafety; mod check_unsafety;

View File

@ -1,4 +1,5 @@
use rustc_ast as ast; use rustc_ast as ast;
use rustc_middle::bug;
use rustc_middle::mir::interpret::{LitToConstError, LitToConstInput}; use rustc_middle::mir::interpret::{LitToConstError, LitToConstInput};
use rustc_middle::ty::{self, ParamEnv, ScalarInt, TyCtxt}; use rustc_middle::ty::{self, ParamEnv, ScalarInt, TyCtxt};

View File

@ -21,6 +21,7 @@ use rustc_middle::ty::GenericArgs;
use rustc_middle::ty::{ use rustc_middle::ty::{
self, AdtKind, InlineConstArgs, InlineConstArgsParts, ScalarInt, Ty, UpvarArgs, UserType, self, AdtKind, InlineConstArgs, InlineConstArgsParts, ScalarInt, Ty, UpvarArgs, UserType,
}; };
use rustc_middle::{bug, span_bug};
use rustc_span::source_map::Spanned; use rustc_span::source_map::Spanned;
use rustc_span::{sym, Span, DUMMY_SP}; use rustc_span::{sym, Span, DUMMY_SP};
use rustc_target::abi::{FieldIdx, FIRST_VARIANT}; use rustc_target::abi::{FieldIdx, FIRST_VARIANT};

View File

@ -13,6 +13,7 @@ use rustc_hir::def_id::{DefId, LocalDefId};
use rustc_hir::lang_items::LangItem; use rustc_hir::lang_items::LangItem;
use rustc_hir::HirId; use rustc_hir::HirId;
use rustc_hir::Node; use rustc_hir::Node;
use rustc_middle::bug;
use rustc_middle::middle::region; use rustc_middle::middle::region;
use rustc_middle::thir::*; use rustc_middle::thir::*;
use rustc_middle::ty::{self, RvalueScopes, TyCtxt}; use rustc_middle::ty::{self, RvalueScopes, TyCtxt};

View File

@ -1,9 +1,3 @@
use rustc_pattern_analysis::errors::Uncovered;
use rustc_pattern_analysis::rustc::{
Constructor, DeconstructedPat, MatchArm, RustcPatCtxt as PatCtxt, Usefulness, UsefulnessReport,
WitnessPat,
};
use crate::errors::*; use crate::errors::*;
use rustc_arena::{DroplessArena, TypedArena}; use rustc_arena::{DroplessArena, TypedArena};
@ -14,11 +8,17 @@ use rustc_errors::{codes::*, struct_span_code_err, Applicability, ErrorGuarantee
use rustc_hir::def::*; use rustc_hir::def::*;
use rustc_hir::def_id::LocalDefId; use rustc_hir::def_id::LocalDefId;
use rustc_hir::{self as hir, BindingMode, ByRef, HirId}; use rustc_hir::{self as hir, BindingMode, ByRef, HirId};
use rustc_middle::bug;
use rustc_middle::middle::limits::get_limit_size; use rustc_middle::middle::limits::get_limit_size;
use rustc_middle::thir::visit::Visitor; use rustc_middle::thir::visit::Visitor;
use rustc_middle::thir::*; use rustc_middle::thir::*;
use rustc_middle::ty::print::with_no_trimmed_paths; use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_middle::ty::{self, AdtDef, Ty, TyCtxt}; use rustc_middle::ty::{self, AdtDef, Ty, TyCtxt};
use rustc_pattern_analysis::errors::Uncovered;
use rustc_pattern_analysis::rustc::{
Constructor, DeconstructedPat, MatchArm, RustcPatCtxt as PatCtxt, Usefulness, UsefulnessReport,
WitnessPat,
};
use rustc_session::lint::builtin::{ use rustc_session::lint::builtin::{
BINDINGS_WITH_VARIANT_NAME, IRREFUTABLE_LET_PATTERNS, UNREACHABLE_PATTERNS, BINDINGS_WITH_VARIANT_NAME, IRREFUTABLE_LET_PATTERNS, UNREACHABLE_PATTERNS,
}; };

View File

@ -4,6 +4,7 @@ use rustc_index::Idx;
use rustc_infer::infer::{InferCtxt, TyCtxtInferExt}; use rustc_infer::infer::{InferCtxt, TyCtxtInferExt};
use rustc_infer::traits::Obligation; use rustc_infer::traits::Obligation;
use rustc_middle::mir; use rustc_middle::mir;
use rustc_middle::span_bug;
use rustc_middle::thir::{FieldPat, Pat, PatKind}; use rustc_middle::thir::{FieldPat, Pat, PatKind};
use rustc_middle::ty::{self, Ty, TyCtxt, ValTree}; use rustc_middle::ty::{self, Ty, TyCtxt, ValTree};
use rustc_session::lint; use rustc_session::lint;

View File

@ -20,6 +20,7 @@ use rustc_middle::thir::{
}; };
use rustc_middle::ty::layout::IntegerExt; use rustc_middle::ty::layout::IntegerExt;
use rustc_middle::ty::{self, CanonicalUserTypeAnnotation, Ty, TyCtxt, TypeVisitableExt}; use rustc_middle::ty::{self, CanonicalUserTypeAnnotation, Ty, TyCtxt, TypeVisitableExt};
use rustc_middle::{bug, span_bug};
use rustc_span::def_id::LocalDefId; use rustc_span::def_id::LocalDefId;
use rustc_span::{ErrorGuaranteed, Span}; use rustc_span::{ErrorGuaranteed, Span};
use rustc_target::abi::{FieldIdx, Integer}; use rustc_target::abi::{FieldIdx, Integer};

View File

@ -1,4 +1,5 @@
use rustc_hir as hir; use rustc_hir as hir;
use rustc_middle::bug;
use rustc_middle::ty::{self, CanonicalUserType, TyCtxt, UserType}; use rustc_middle::ty::{self, CanonicalUserType, TyCtxt, UserType};
pub(crate) trait UserAnnotatedTyHelpers<'tcx> { pub(crate) trait UserAnnotatedTyHelpers<'tcx> {