Change ty.kind to a method
This commit is contained in:
parent
ef55a0a92f
commit
3e14b684dd
189 changed files with 947 additions and 899 deletions
|
@ -345,7 +345,7 @@ impl<'a, 'b, 'tcx> TypeFolder<'tcx> for AssocTypeNormalizer<'a, 'b, 'tcx> {
|
|||
// should occur eventually).
|
||||
|
||||
let ty = ty.super_fold_with(self);
|
||||
match ty.kind {
|
||||
match *ty.kind() {
|
||||
ty::Opaque(def_id, substs) => {
|
||||
// Only normalize `impl Trait` after type-checking, usually in codegen.
|
||||
match self.param_env.reveal() {
|
||||
|
@ -908,7 +908,7 @@ fn assemble_candidates_from_trait_def<'cx, 'tcx>(
|
|||
let tcx = selcx.tcx();
|
||||
// Check whether the self-type is itself a projection.
|
||||
// If so, extract what we know from the trait and try to come up with a good answer.
|
||||
let bounds = match obligation_trait_ref.self_ty().kind {
|
||||
let bounds = match *obligation_trait_ref.self_ty().kind() {
|
||||
ty::Projection(ref data) => {
|
||||
tcx.projection_predicates(data.item_def_id).subst(tcx, data.substs)
|
||||
}
|
||||
|
@ -1067,7 +1067,7 @@ fn assemble_candidates_from_impls<'cx, 'tcx>(
|
|||
// Any type with multiple potential discriminant types is therefore not eligible.
|
||||
let self_ty = selcx.infcx().shallow_resolve(obligation.predicate.self_ty());
|
||||
|
||||
match self_ty.kind {
|
||||
match self_ty.kind() {
|
||||
ty::Bool
|
||||
| ty::Char
|
||||
| ty::Int(_)
|
||||
|
@ -1219,8 +1219,8 @@ fn confirm_object_candidate<'cx, 'tcx>(
|
|||
let self_ty = obligation_trait_ref.self_ty();
|
||||
let object_ty = selcx.infcx().shallow_resolve(self_ty);
|
||||
debug!("confirm_object_candidate(object_ty={:?})", object_ty);
|
||||
let data = match object_ty.kind {
|
||||
ty::Dynamic(ref data, ..) => data,
|
||||
let data = match object_ty.kind() {
|
||||
ty::Dynamic(data, ..) => data,
|
||||
_ => span_bug!(
|
||||
obligation.cause.span,
|
||||
"confirm_object_candidate called with non-object: {:?}",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue