diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-09-24 20:34:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-24 20:34:20 +0200 |
| commit | 79bb3c487998988253b34455a9fd4e1c93a3ead1 (patch) | |
| tree | 4ef105f902a5d5f3d33e97e90659b8450ff86777 /compiler | |
| parent | 315053891196d8514c43d62792b2e0bb76ddcbc0 (diff) | |
| parent | 60b35635e8084be2e4f8b55f170e8665edb8e275 (diff) | |
| download | rust-79bb3c487998988253b34455a9fd4e1c93a3ead1.tar.gz rust-79bb3c487998988253b34455a9fd4e1c93a3ead1.zip | |
Rollup merge of #146857 - tnuha:revert_self_has_no_region_infer, r=lcnr
revert change removing `has_infer` check. Commit conservatively patch… …es for now, but more development proceeding. Hotfix for rust-lang/rust#146852.
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_middle/src/ty/util.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/ty/util.rs b/compiler/rustc_middle/src/ty/util.rs index 4f039381e50..a4422abc688 100644 --- a/compiler/rustc_middle/src/ty/util.rs +++ b/compiler/rustc_middle/src/ty/util.rs @@ -1368,7 +1368,6 @@ impl<'tcx> Ty<'tcx> { /// 2229 drop reorder migration analysis. #[inline] pub fn has_significant_drop(self, tcx: TyCtxt<'tcx>, typing_env: ty::TypingEnv<'tcx>) -> bool { - assert!(!self.has_non_region_infer()); // Avoid querying in simple cases. match needs_drop_components(tcx, self) { Err(AlwaysRequiresDrop) => true, @@ -1381,6 +1380,16 @@ impl<'tcx> Ty<'tcx> { _ => self, }; + // FIXME + // We should be canonicalizing, or else moving this to a method of inference + // context, or *something* like that, + // but for now just avoid passing inference variables + // to queries that can't cope with them. + // Instead, conservatively return "true" (may change drop order). + if query_ty.has_infer() { + return true; + } + // This doesn't depend on regions, so try to minimize distinct // query keys used. let erased = tcx.normalize_erasing_regions(typing_env, query_ty); |
