Change ty.kind to a method

This commit is contained in:
LeSeulArtichaut
2020-08-03 00:49:11 +02:00
parent ef55a0a92f
commit 3e14b684dd
189 changed files with 947 additions and 899 deletions

View File

@@ -471,7 +471,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for BoundVarReplacer<'a, 'tcx> {
}
fn fold_ty(&mut self, t: Ty<'tcx>) -> Ty<'tcx> {
match t.kind {
match *t.kind() {
ty::Bound(debruijn, bound_ty) => {
if debruijn == self.current_index {
let fld_t = &mut self.fld_t;
@@ -771,7 +771,7 @@ impl TypeFolder<'tcx> for Shifter<'tcx> {
}
fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
match ty.kind {
match *ty.kind() {
ty::Bound(debruijn, bound_ty) => {
if self.amount == 0 || debruijn < self.current_index {
ty
@@ -987,7 +987,7 @@ impl<'tcx> TypeVisitor<'tcx> for LateBoundRegionsCollector {
// ignore the inputs to a projection, as they may not appear
// in the normalized form
if self.just_constrained {
if let ty::Projection(..) | ty::Opaque(..) = t.kind {
if let ty::Projection(..) | ty::Opaque(..) = t.kind() {
return false;
}
}