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:
Romain Perier
2025-04-30 16:20:32 +02:00
parent 427288b3ce
commit ea7af1803f
17 changed files with 21 additions and 27 deletions

View File

@@ -15,10 +15,9 @@ use rustc_middle::ty::adjustment::{Adjust, Adjustment, AutoBorrow};
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;

View File

@@ -11,9 +11,10 @@ use rustc_hir::{self as hir, ParamName};
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;

View File

@@ -5,10 +5,9 @@ use rustc_hir::def::Namespace;
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;