diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-10-27 14:45:02 +0400 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-10-27 15:06:08 +0400 |
| commit | a17ccfa6211b978c502cdd6739bb1b58db0dbb03 (patch) | |
| tree | b7f4c86ce1613f93b41c716fcb6b86ec20c3e161 /compiler/rustc_ty_utils/src | |
| parent | 44fcfb0a9606fa08ea293a71f2e6d470227ef9df (diff) | |
| download | rust-a17ccfa6211b978c502cdd6739bb1b58db0dbb03.tar.gz rust-a17ccfa6211b978c502cdd6739bb1b58db0dbb03.zip | |
Accept `TyCtxt` instead of `TyCtxtAt` in `Ty::is_*` functions
Functions in answer: - `Ty::is_freeze` - `Ty::is_sized` - `Ty::is_unpin` - `Ty::is_copy_modulo_regions`
Diffstat (limited to 'compiler/rustc_ty_utils/src')
| -rw-r--r-- | compiler/rustc_ty_utils/src/instance.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_ty_utils/src/layout.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_ty_utils/src/needs_drop.rs | 2 |
3 files changed, 5 insertions, 6 deletions
diff --git a/compiler/rustc_ty_utils/src/instance.rs b/compiler/rustc_ty_utils/src/instance.rs index 416c1ec510b..6436713b388 100644 --- a/compiler/rustc_ty_utils/src/instance.rs +++ b/compiler/rustc_ty_utils/src/instance.rs @@ -4,7 +4,7 @@ use rustc_infer::infer::TyCtxtInferExt; use rustc_middle::traits::CodegenObligationError; use rustc_middle::ty::subst::SubstsRef; use rustc_middle::ty::{self, Instance, TyCtxt, TypeVisitable}; -use rustc_span::{sym, DUMMY_SP}; +use rustc_span::sym; use rustc_trait_selection::traits; use traits::{translate_substs, Reveal}; @@ -236,7 +236,7 @@ fn resolve_associated_item<'tcx>( if name == sym::clone { let self_ty = trait_ref.self_ty(); - let is_copy = self_ty.is_copy_modulo_regions(tcx.at(DUMMY_SP), param_env); + let is_copy = self_ty.is_copy_modulo_regions(tcx, param_env); match self_ty.kind() { _ if is_copy => (), ty::Generator(..) diff --git a/compiler/rustc_ty_utils/src/layout.rs b/compiler/rustc_ty_utils/src/layout.rs index 345911f4309..52ba0eee97c 100644 --- a/compiler/rustc_ty_utils/src/layout.rs +++ b/compiler/rustc_ty_utils/src/layout.rs @@ -399,7 +399,7 @@ fn layout_of_uncached<'tcx>( } let pointee = tcx.normalize_erasing_regions(param_env, pointee); - if pointee.is_sized(tcx.at(DUMMY_SP), param_env) { + if pointee.is_sized(tcx, param_env) { return Ok(tcx.intern_layout(LayoutS::scalar(cx, data_ptr))); } @@ -755,8 +755,7 @@ fn layout_of_uncached<'tcx>( } else { let param_env = tcx.param_env(def.did()); let last_field = def.variant(v).fields.last().unwrap(); - let always_sized = - tcx.type_of(last_field.did).is_sized(tcx.at(DUMMY_SP), param_env); + let always_sized = tcx.type_of(last_field.did).is_sized(tcx, param_env); if !always_sized { StructKind::MaybeUnsized } else { StructKind::AlwaysSized } }; diff --git a/compiler/rustc_ty_utils/src/needs_drop.rs b/compiler/rustc_ty_utils/src/needs_drop.rs index d390a308153..024dcd591bd 100644 --- a/compiler/rustc_ty_utils/src/needs_drop.rs +++ b/compiler/rustc_ty_utils/src/needs_drop.rs @@ -109,7 +109,7 @@ where for component in components { match *component.kind() { - _ if component.is_copy_modulo_regions(tcx.at(DUMMY_SP), self.param_env) => (), + _ if component.is_copy_modulo_regions(tcx, self.param_env) => (), ty::Closure(_, substs) => { queue_type(self, substs.as_closure().tupled_upvars_ty()); |
