diff options
| author | LeSeulArtichaut <leseulartichaut@gmail.com> | 2020-08-03 00:49:11 +0200 |
|---|---|---|
| committer | LeSeulArtichaut <leseulartichaut@gmail.com> | 2020-09-04 17:47:51 +0200 |
| commit | 3e14b684dd31794e8dbe6acd7a5f132997ee0c47 (patch) | |
| tree | 04430a32c809ca7644bbe9ae281735b4671154b8 /compiler/rustc_ty/src/instance.rs | |
| parent | ef55a0a92f3cb6572ef67d99f4aefbdeb7b6b804 (diff) | |
| download | rust-3e14b684dd31794e8dbe6acd7a5f132997ee0c47.tar.gz rust-3e14b684dd31794e8dbe6acd7a5f132997ee0c47.zip | |
Change ty.kind to a method
Diffstat (limited to 'compiler/rustc_ty/src/instance.rs')
| -rw-r--r-- | compiler/rustc_ty/src/instance.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_ty/src/instance.rs b/compiler/rustc_ty/src/instance.rs index d0bd88af1ff..75bf8ea0bb8 100644 --- a/compiler/rustc_ty/src/instance.rs +++ b/compiler/rustc_ty/src/instance.rs @@ -53,7 +53,7 @@ fn inner_resolve_instance<'tcx>( let ty = tcx.type_of(def.def_id_for_type_of()); let item_type = tcx.subst_and_normalize_erasing_regions(substs, param_env, &ty); - let def = match item_type.kind { + let def = match *item_type.kind() { ty::FnDef(..) if { let f = item_type.fn_sig(tcx); @@ -68,7 +68,7 @@ fn inner_resolve_instance<'tcx>( if ty.needs_drop(tcx, param_env) { debug!(" => nontrivial drop glue"); - match ty.kind { + match *ty.kind() { ty::Closure(..) | ty::Generator(..) | ty::Tuple(..) @@ -231,7 +231,7 @@ fn resolve_associated_item<'tcx>( trait_closure_kind, )) } - traits::ImplSourceFnPointer(ref data) => match data.fn_ty.kind { + traits::ImplSourceFnPointer(ref data) => match data.fn_ty.kind() { ty::FnDef(..) | ty::FnPtr(..) => Some(Instance { def: ty::InstanceDef::FnPtrShim(trait_item.def_id, data.fn_ty), substs: rcvr_substs, @@ -250,7 +250,7 @@ fn resolve_associated_item<'tcx>( let self_ty = trait_ref.self_ty(); let is_copy = self_ty.is_copy_modulo_regions(tcx.at(DUMMY_SP), param_env); - match self_ty.kind { + match self_ty.kind() { _ if is_copy => (), ty::Array(..) | ty::Closure(..) | ty::Tuple(..) => {} _ => return Ok(None), |
