From 9f8cdb286ec2660c7abe65f687bb29cb0b207fa5 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Mon, 13 May 2024 15:22:47 -0400 Subject: [PATCH] Remove to_term --- compiler/rustc_middle/src/ty/consts.rs | 4 ---- compiler/rustc_middle/src/ty/sty.rs | 4 ---- compiler/rustc_type_ir/src/inherent.rs | 6 ++---- compiler/rustc_type_ir/src/predicate.rs | 10 +++++----- 4 files changed, 7 insertions(+), 17 deletions(-) diff --git a/compiler/rustc_middle/src/ty/consts.rs b/compiler/rustc_middle/src/ty/consts.rs index 27a4abaa0b695..9dc30447f0e57 100644 --- a/compiler/rustc_middle/src/ty/consts.rs +++ b/compiler/rustc_middle/src/ty/consts.rs @@ -195,10 +195,6 @@ impl<'tcx> rustc_type_ir::inherent::Const> for Const<'tcx> { fn ty(self) -> Ty<'tcx> { self.ty() } - - fn into_term(self) -> ty::Term<'tcx> { - self.into() - } } impl<'tcx> Const<'tcx> { diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index e4396c6f20ba2..74b03d6db66db 100644 --- a/compiler/rustc_middle/src/ty/sty.rs +++ b/compiler/rustc_middle/src/ty/sty.rs @@ -1660,10 +1660,6 @@ impl<'tcx> rustc_type_ir::inherent::Ty> for Ty<'tcx> { ) -> Self { Ty::new_alias(interner, kind, alias_ty) } - - fn into_term(self) -> ty::Term<'tcx> { - self.into() - } } /// Type utilities diff --git a/compiler/rustc_type_ir/src/inherent.rs b/compiler/rustc_type_ir/src/inherent.rs index 0a964801ce7f2..92b1e08ab0a36 100644 --- a/compiler/rustc_type_ir/src/inherent.rs +++ b/compiler/rustc_type_ir/src/inherent.rs @@ -15,6 +15,7 @@ pub trait Ty>: + Hash + Eq + Into + + Into + IntoKind> + TypeSuperVisitable + TypeSuperFoldable @@ -23,8 +24,6 @@ pub trait Ty>: fn new_anon_bound(interner: I, debruijn: DebruijnIndex, var: BoundVar) -> Self; fn new_alias(interner: I, kind: AliasTyKind, alias_ty: AliasTy) -> Self; - - fn into_term(self) -> I::Term; } pub trait Region>: @@ -41,6 +40,7 @@ pub trait Const>: + Hash + Eq + Into + + Into + IntoKind> + TypeSuperVisitable + TypeSuperFoldable @@ -51,8 +51,6 @@ pub trait Const>: fn new_unevaluated(interner: I, uv: UnevaluatedConst, ty: I::Ty) -> Self; fn ty(self) -> I::Ty; - - fn into_term(self) -> I::Term; } pub trait GenericsOf> { diff --git a/compiler/rustc_type_ir/src/predicate.rs b/compiler/rustc_type_ir/src/predicate.rs index 1ec237d7cd555..b6c7c2c348cca 100644 --- a/compiler/rustc_type_ir/src/predicate.rs +++ b/compiler/rustc_type_ir/src/predicate.rs @@ -437,32 +437,32 @@ impl AliasTerm { AliasTyKind::Projection, AliasTy { def_id: self.def_id, args: self.args, _use_alias_ty_new_instead: () }, ) - .into_term(), + .into(), AliasTermKind::InherentTy => Ty::new_alias( interner, AliasTyKind::Inherent, AliasTy { def_id: self.def_id, args: self.args, _use_alias_ty_new_instead: () }, ) - .into_term(), + .into(), AliasTermKind::OpaqueTy => Ty::new_alias( interner, AliasTyKind::Opaque, AliasTy { def_id: self.def_id, args: self.args, _use_alias_ty_new_instead: () }, ) - .into_term(), + .into(), AliasTermKind::WeakTy => Ty::new_alias( interner, AliasTyKind::Weak, AliasTy { def_id: self.def_id, args: self.args, _use_alias_ty_new_instead: () }, ) - .into_term(), + .into(), AliasTermKind::UnevaluatedConst | AliasTermKind::ProjectionConst => { I::Const::new_unevaluated( interner, UnevaluatedConst::new(self.def_id, self.args), interner.type_of_instantiated(self.def_id, self.args), ) - .into_term() + .into() } } }