about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2024-12-02 17:36:11 +0100
committerGitHub <noreply@github.com>2024-12-02 17:36:11 +0100
commit4c68112df14dca6186be968a0c063f7573ff3666 (patch)
tree8f2915b4daf698505b284b44c18e0ae9d4c3ca66 /compiler/rustc_mir_transform
parent7c92266fdee746d56e1cfaacebd068acf9fd975f (diff)
parente089bead327795727e1a72fd276776f12f186cea (diff)
Rollup merge of #133751 - lcnr:no-trait-solving-on-type, r=compiler-errors
remove `Ty::is_copy_modulo_regions`

Using these functions is likely incorrect if an `InferCtxt` is available, I moved this function to `TyCtxt` (and added it to `LateContext`) and added a note to the documentation that one should prefer `Infer::type_is_copy_modulo_regions` instead.

I didn't yet move `is_sized` and `is_freeze`, though I think we should move these as well.

r? `@compiler-errors` cc #132279
Diffstat (limited to 'compiler/rustc_mir_transform')
-rw-r--r--compiler/rustc_mir_transform/src/validate.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_mir_transform/src/validate.rs b/compiler/rustc_mir_transform/src/validate.rs
index 936d88e9ac0..404fbb6b839 100644
--- a/compiler/rustc_mir_transform/src/validate.rs
+++ b/compiler/rustc_mir_transform/src/validate.rs
@@ -609,7 +609,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
             if let Operand::Copy(place) = operand {
                 let ty = place.ty(&self.body.local_decls, self.tcx).ty;
 
-                if !ty.is_copy_modulo_regions(self.tcx, self.typing_env) {
+                if !self.tcx.type_is_copy_modulo_regions(self.typing_env, ty) {
                     self.fail(location, format!("`Operand::Copy` with non-`Copy` type {ty}"));
                 }
             }