Skip to content

Commit 9f8cdb2

Browse files
Remove to_term
1 parent 1ad28a6 commit 9f8cdb2

File tree

4 files changed

+7
-17
lines changed

4 files changed

+7
-17
lines changed

compiler/rustc_middle/src/ty/consts.rs

-4
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,6 @@ impl<'tcx> rustc_type_ir::inherent::Const<TyCtxt<'tcx>> for Const<'tcx> {
195195
fn ty(self) -> Ty<'tcx> {
196196
self.ty()
197197
}
198-
199-
fn into_term(self) -> ty::Term<'tcx> {
200-
self.into()
201-
}
202198
}
203199

204200
impl<'tcx> Const<'tcx> {

compiler/rustc_middle/src/ty/sty.rs

-4
Original file line numberDiff line numberDiff line change
@@ -1660,10 +1660,6 @@ impl<'tcx> rustc_type_ir::inherent::Ty<TyCtxt<'tcx>> for Ty<'tcx> {
16601660
) -> Self {
16611661
Ty::new_alias(interner, kind, alias_ty)
16621662
}
1663-
1664-
fn into_term(self) -> ty::Term<'tcx> {
1665-
self.into()
1666-
}
16671663
}
16681664

16691665
/// Type utilities

compiler/rustc_type_ir/src/inherent.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ pub trait Ty<I: Interner<Ty = Self>>:
1515
+ Hash
1616
+ Eq
1717
+ Into<I::GenericArg>
18+
+ Into<I::Term>
1819
+ IntoKind<Kind = TyKind<I>>
1920
+ TypeSuperVisitable<I>
2021
+ TypeSuperFoldable<I>
@@ -23,8 +24,6 @@ pub trait Ty<I: Interner<Ty = Self>>:
2324
fn new_anon_bound(interner: I, debruijn: DebruijnIndex, var: BoundVar) -> Self;
2425

2526
fn new_alias(interner: I, kind: AliasTyKind, alias_ty: AliasTy<I>) -> Self;
26-
27-
fn into_term(self) -> I::Term;
2827
}
2928

3029
pub trait Region<I: Interner<Region = Self>>:
@@ -41,6 +40,7 @@ pub trait Const<I: Interner<Const = Self>>:
4140
+ Hash
4241
+ Eq
4342
+ Into<I::GenericArg>
43+
+ Into<I::Term>
4444
+ IntoKind<Kind = ConstKind<I>>
4545
+ TypeSuperVisitable<I>
4646
+ TypeSuperFoldable<I>
@@ -51,8 +51,6 @@ pub trait Const<I: Interner<Const = Self>>:
5151
fn new_unevaluated(interner: I, uv: UnevaluatedConst<I>, ty: I::Ty) -> Self;
5252

5353
fn ty(self) -> I::Ty;
54-
55-
fn into_term(self) -> I::Term;
5654
}
5755

5856
pub trait GenericsOf<I: Interner<GenericsOf = Self>> {

compiler/rustc_type_ir/src/predicate.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -437,32 +437,32 @@ impl<I: Interner> AliasTerm<I> {
437437
AliasTyKind::Projection,
438438
AliasTy { def_id: self.def_id, args: self.args, _use_alias_ty_new_instead: () },
439439
)
440-
.into_term(),
440+
.into(),
441441
AliasTermKind::InherentTy => Ty::new_alias(
442442
interner,
443443
AliasTyKind::Inherent,
444444
AliasTy { def_id: self.def_id, args: self.args, _use_alias_ty_new_instead: () },
445445
)
446-
.into_term(),
446+
.into(),
447447
AliasTermKind::OpaqueTy => Ty::new_alias(
448448
interner,
449449
AliasTyKind::Opaque,
450450
AliasTy { def_id: self.def_id, args: self.args, _use_alias_ty_new_instead: () },
451451
)
452-
.into_term(),
452+
.into(),
453453
AliasTermKind::WeakTy => Ty::new_alias(
454454
interner,
455455
AliasTyKind::Weak,
456456
AliasTy { def_id: self.def_id, args: self.args, _use_alias_ty_new_instead: () },
457457
)
458-
.into_term(),
458+
.into(),
459459
AliasTermKind::UnevaluatedConst | AliasTermKind::ProjectionConst => {
460460
I::Const::new_unevaluated(
461461
interner,
462462
UnevaluatedConst::new(self.def_id, self.args),
463463
interner.type_of_instantiated(self.def_id, self.args),
464464
)
465-
.into_term()
465+
.into()
466466
}
467467
}
468468
}

0 commit comments

Comments
 (0)