mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Use less rustc_type_ir in the compiler codebase
This commit does the following: - Replaces use of rustc_type_ir by rustc_middle - Removes the rustc_type_ir dependency - The DelayedSet type is exposed by rustc_middle so everything can be accessed through rustc_middle in a coherent manner.
This commit is contained in:
@@ -4494,7 +4494,6 @@ dependencies = [
|
||||
"rustc_session",
|
||||
"rustc_span",
|
||||
"rustc_transmute",
|
||||
"rustc_type_ir",
|
||||
"smallvec",
|
||||
"thin-vec",
|
||||
"tracing",
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
pub use rustc_session::lint::RegisteredTools;
|
||||
use rustc_span::hygiene::MacroKind;
|
||||
use rustc_span::{DUMMY_SP, ExpnId, ExpnKind, Ident, Span, Symbol, kw, sym};
|
||||
pub use rustc_type_ir::data_structures::DelayedSet;
|
||||
pub use rustc_type_ir::relate::VarianceDiagInfo;
|
||||
pub use rustc_type_ir::*;
|
||||
use tracing::{debug, instrument};
|
||||
|
||||
@@ -21,7 +21,6 @@ rustc_parse_format = { path = "../rustc_parse_format" }
|
||||
rustc_session = { path = "../rustc_session" }
|
||||
rustc_span = { path = "../rustc_span" }
|
||||
rustc_transmute = { path = "../rustc_transmute", features = ["rustc"] }
|
||||
rustc_type_ir = { path = "../rustc_type_ir" }
|
||||
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
|
||||
thin-vec = "0.2"
|
||||
tracing = "0.1"
|
||||
|
||||
@@ -15,10 +15,9 @@
|
||||
use rustc_middle::ty::print::{FmtPrinter, PrettyPrinter, Print, Printer};
|
||||
use rustc_middle::ty::{
|
||||
self, GenericArg, GenericArgKind, GenericArgsRef, InferConst, IsSuggestable, Term, TermKind,
|
||||
Ty, TyCtxt, TypeFoldable, TypeFolder, TypeSuperFoldable, TypeckResults,
|
||||
Ty, TyCtxt, TypeFoldable, TypeFolder, TypeSuperFoldable, TypeVisitableExt, TypeckResults,
|
||||
};
|
||||
use rustc_span::{BytePos, DUMMY_SP, FileName, Ident, Span, sym};
|
||||
use rustc_type_ir::TypeVisitableExt;
|
||||
use tracing::{debug, instrument, warn};
|
||||
|
||||
use super::nice_region_error::placeholder_error::Highlighted;
|
||||
|
||||
@@ -11,9 +11,10 @@
|
||||
use rustc_middle::bug;
|
||||
use rustc_middle::traits::ObligationCauseCode;
|
||||
use rustc_middle::ty::error::TypeError;
|
||||
use rustc_middle::ty::{self, IsSuggestable, Region, Ty, TyCtxt, TypeVisitableExt as _};
|
||||
use rustc_middle::ty::{
|
||||
self, IsSuggestable, Region, Ty, TyCtxt, TypeVisitableExt as _, Upcast as _,
|
||||
};
|
||||
use rustc_span::{BytePos, ErrorGuaranteed, Span, Symbol, kw};
|
||||
use rustc_type_ir::Upcast as _;
|
||||
use tracing::{debug, instrument};
|
||||
|
||||
use super::ObligationCauseAsDiagArg;
|
||||
|
||||
@@ -5,10 +5,9 @@
|
||||
use rustc_hir::def_id::LOCAL_CRATE;
|
||||
use rustc_infer::traits::{Obligation, PredicateObligation};
|
||||
use rustc_middle::ty::print::{FmtPrinter, Print};
|
||||
use rustc_middle::ty::{self, TyCtxt};
|
||||
use rustc_middle::ty::{self, TyCtxt, Upcast};
|
||||
use rustc_session::Limit;
|
||||
use rustc_span::Span;
|
||||
use rustc_type_ir::Upcast;
|
||||
use tracing::debug;
|
||||
|
||||
use crate::error_reporting::TypeErrCtxt;
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
};
|
||||
use rustc_infer::infer::{InferCtxt, RegionVariableOrigin, TyCtxtInferExt};
|
||||
use rustc_infer::traits::solve::Goal;
|
||||
use rustc_middle::ty::{self, Ty, TyCtxt, TypeFoldable, TypeVisitableExt as _};
|
||||
use rustc_middle::traits::query::NoSolution;
|
||||
use rustc_middle::traits::solve::Certainty;
|
||||
use rustc_middle::ty::{self, Ty, TyCtxt, TypeFoldable, TypeVisitableExt as _, TypingMode};
|
||||
use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span};
|
||||
use rustc_type_ir::TypingMode;
|
||||
use rustc_type_ir::solve::{Certainty, NoSolution};
|
||||
|
||||
use crate::traits::{EvaluateConstErr, specialization_graph};
|
||||
|
||||
@@ -155,7 +155,7 @@ fn instantiate_canonical_var_with_infer(
|
||||
|
||||
fn register_hidden_type_in_storage(
|
||||
&self,
|
||||
opaque_type_key: rustc_type_ir::OpaqueTypeKey<Self::Interner>,
|
||||
opaque_type_key: ty::OpaqueTypeKey<'tcx>,
|
||||
hidden_ty: <Self::Interner as ty::Interner>::Ty,
|
||||
span: <Self::Interner as ty::Interner>::Span,
|
||||
) -> Option<<Self::Interner as ty::Interner>::Ty> {
|
||||
|
||||
@@ -10,11 +10,10 @@
|
||||
FromSolverError, PredicateObligation, PredicateObligations, TraitEngine,
|
||||
};
|
||||
use rustc_middle::ty::{
|
||||
self, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, TypeVisitor, TypingMode,
|
||||
self, DelayedSet, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, TypeVisitor, TypingMode,
|
||||
};
|
||||
use rustc_next_trait_solver::solve::{GenerateProofTree, HasChanged, SolverDelegateEvalExt as _};
|
||||
use rustc_span::Span;
|
||||
use rustc_type_ir::data_structures::DelayedSet;
|
||||
use tracing::instrument;
|
||||
|
||||
use self::derive_errors::*;
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
self, MismatchedProjectionTypes, Obligation, ObligationCause, ObligationCauseCode,
|
||||
PredicateObligation, SelectionError,
|
||||
};
|
||||
use rustc_middle::traits::query::NoSolution;
|
||||
use rustc_middle::ty::error::{ExpectedFound, TypeError};
|
||||
use rustc_middle::ty::{self, Ty, TyCtxt};
|
||||
use rustc_middle::{bug, span_bug};
|
||||
use rustc_next_trait_solver::solve::{GenerateProofTree, SolverDelegateEvalExt as _};
|
||||
use rustc_type_ir::solve::NoSolution;
|
||||
use tracing::{instrument, trace};
|
||||
|
||||
use crate::solve::delegate::SolverDelegate;
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
use rustc_middle::ty::{
|
||||
self, EarlyBinder, GenericArgs, Ty, TyCtxt, TypeFoldable, TypeFolder, TypeSuperFoldable,
|
||||
TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor, TypingMode, Upcast,
|
||||
elaborate,
|
||||
};
|
||||
use rustc_span::Span;
|
||||
use rustc_type_ir::elaborate;
|
||||
use smallvec::SmallVec;
|
||||
use tracing::{debug, instrument};
|
||||
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
ImplDerivedHostCause, ImplSource, Obligation, ObligationCauseCode, PredicateObligation,
|
||||
};
|
||||
use rustc_middle::span_bug;
|
||||
use rustc_middle::traits::query::NoSolution;
|
||||
use rustc_middle::ty::elaborate::elaborate;
|
||||
use rustc_middle::ty::fast_reject::DeepRejectCtxt;
|
||||
use rustc_middle::ty::{self, TypingMode};
|
||||
use rustc_type_ir::elaborate::elaborate;
|
||||
use rustc_type_ir::solve::NoSolution;
|
||||
use thin_vec::{ThinVec, thin_vec};
|
||||
|
||||
use super::SelectionContext;
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
use rustc_middle::arena::ArenaAllocatable;
|
||||
use rustc_middle::traits::query::NoSolution;
|
||||
use rustc_middle::ty::error::TypeError;
|
||||
use rustc_middle::ty::relate::Relate;
|
||||
use rustc_middle::ty::{self, Ty, TyCtxt, TypeFoldable, Upcast, Variance};
|
||||
use rustc_type_ir::relate::Relate;
|
||||
|
||||
use super::{FromSolverError, FulfillmentContext, ScrubbedTraitError, TraitEngine};
|
||||
use crate::error_reporting::InferCtxtErrorExt;
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
use rustc_infer::traits::query::type_op::ImpliedOutlivesBounds;
|
||||
use rustc_middle::infer::canonical::CanonicalQueryResponse;
|
||||
use rustc_middle::traits::ObligationCause;
|
||||
use rustc_middle::ty::outlives::{Component, push_outlives_components};
|
||||
use rustc_middle::ty::{self, ParamEnvAnd, Ty, TyCtxt, TypeVisitable, TypeVisitor};
|
||||
use rustc_span::def_id::CRATE_DEF_ID;
|
||||
use rustc_span::{DUMMY_SP, Span, sym};
|
||||
use rustc_type_ir::outlives::{Component, push_outlives_components};
|
||||
use smallvec::{SmallVec, smallvec};
|
||||
|
||||
use crate::traits::query::NoSolution;
|
||||
|
||||
@@ -14,9 +14,8 @@
|
||||
use rustc_hir as hir;
|
||||
use rustc_infer::traits::{Obligation, PolyTraitObligation, SelectionError};
|
||||
use rustc_middle::ty::fast_reject::DeepRejectCtxt;
|
||||
use rustc_middle::ty::{self, Ty, TypeVisitableExt, TypingMode};
|
||||
use rustc_middle::ty::{self, Ty, TypeVisitableExt, TypingMode, elaborate};
|
||||
use rustc_middle::{bug, span_bug};
|
||||
use rustc_type_ir::elaborate;
|
||||
use tracing::{debug, instrument, trace};
|
||||
|
||||
use super::SelectionCandidate::*;
|
||||
|
||||
@@ -15,10 +15,9 @@
|
||||
use rustc_infer::infer::{DefineOpaqueTypes, HigherRankedType, InferOk};
|
||||
use rustc_infer::traits::ObligationCauseCode;
|
||||
use rustc_middle::traits::{BuiltinImplSource, SignatureMismatchData};
|
||||
use rustc_middle::ty::{self, GenericArgsRef, Ty, TyCtxt, Upcast};
|
||||
use rustc_middle::ty::{self, GenericArgsRef, Ty, TyCtxt, Upcast, elaborate};
|
||||
use rustc_middle::{bug, span_bug};
|
||||
use rustc_span::def_id::DefId;
|
||||
use rustc_type_ir::elaborate;
|
||||
use thin_vec::thin_vec;
|
||||
use tracing::{debug, instrument};
|
||||
|
||||
|
||||
@@ -28,10 +28,9 @@
|
||||
use rustc_middle::ty::print::{PrintTraitRefExt as _, with_no_trimmed_paths};
|
||||
use rustc_middle::ty::{
|
||||
self, GenericArgsRef, PolyProjectionPredicate, Ty, TyCtxt, TypeFoldable, TypeVisitableExt,
|
||||
TypingMode, Upcast,
|
||||
TypingMode, Upcast, elaborate,
|
||||
};
|
||||
use rustc_span::{Symbol, sym};
|
||||
use rustc_type_ir::elaborate;
|
||||
use tracing::{debug, instrument, trace};
|
||||
|
||||
use self::EvaluationResult::*;
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
use rustc_infer::traits::Obligation;
|
||||
use rustc_middle::bug;
|
||||
use rustc_middle::query::LocalCrate;
|
||||
use rustc_middle::traits::query::NoSolution;
|
||||
use rustc_middle::ty::print::PrintTraitRefExt as _;
|
||||
use rustc_middle::ty::{self, GenericArgsRef, Ty, TyCtxt, TypeVisitableExt, TypingMode};
|
||||
use rustc_session::lint::builtin::COHERENCE_LEAK_CHECK;
|
||||
use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span, sym};
|
||||
use rustc_type_ir::solve::NoSolution;
|
||||
use specialization_graph::GraphExt;
|
||||
use tracing::{debug, instrument};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user