1
Fork 0

remove Ty::is_copy_modulo_regions

This commit is contained in:
lcnr 2024-12-02 13:57:56 +01:00
parent cfee10ce89
commit e089bead32
15 changed files with 36 additions and 29 deletions

View file

@ -586,7 +586,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingCopyImplementations {
return;
}
}
if ty.is_copy_modulo_regions(cx.tcx, cx.typing_env()) {
if cx.type_is_copy_modulo_regions(ty) {
return;
}
if type_implements_negative_copy_modulo_regions(cx.tcx, ty, cx.typing_env()) {

View file

@ -710,6 +710,10 @@ impl<'tcx> LateContext<'tcx> {
TypingEnv { typing_mode: self.typing_mode(), param_env: self.param_env }
}
pub fn type_is_copy_modulo_regions(&self, ty: Ty<'tcx>) -> bool {
self.tcx.type_is_copy_modulo_regions(self.typing_env(), ty)
}
/// Gets the type-checking results for the current body,
/// or `None` if outside a body.
pub fn maybe_typeck_results(&self) -> Option<&'tcx ty::TypeckResults<'tcx>> {

View file

@ -144,7 +144,7 @@ impl<'tcx> LateLintPass<'tcx> for DropForgetUseless {
&& let Some(fn_name) = cx.tcx.get_diagnostic_name(def_id)
{
let arg_ty = cx.typeck_results().expr_ty(arg);
let is_copy = arg_ty.is_copy_modulo_regions(cx.tcx, cx.typing_env());
let is_copy = cx.type_is_copy_modulo_regions(arg_ty);
let drop_is_single_call_in_arm = is_single_call_in_arm(cx, arg, expr);
let let_underscore_ignore_sugg = || {
if let Some((_, node)) = cx.tcx.hir().parent_iter(expr.hir_id).nth(0)