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`
This commit is contained in:
parent
44fcfb0a96
commit
a17ccfa621
29 changed files with 51 additions and 69 deletions
|
@ -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(..)
|
||||
|
|
|
@ -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 }
|
||||
};
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue