about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2025-09-17 14:56:43 +1000
committerGitHub <noreply@github.com>2025-09-17 14:56:43 +1000
commitf21a9c94cf39cdb26a15ea0967501629f3156958 (patch)
tree70f71a1c021921d703cb35ef23466b421c891938 /compiler
parentf104ecfba6f56d84c6f48fa328ce20ef48efa796 (diff)
parentfa7e474f9ca755ac102debcf6cd0ce77313ee0bf (diff)
downloadrust-f21a9c94cf39cdb26a15ea0967501629f3156958.tar.gz
rust-f21a9c94cf39cdb26a15ea0967501629f3156958.zip
Rollup merge of #145181 - Borgerr:remove-fixme-from-has-sigdrop, r=lcnr
remove FIXME block from `has_significant_drop`, it never encounters inference variables

The `FIXME` block in `Ty::has_significant_drop` is outdated as related queries can now handle type inference.

https://github.com/rust-lang/rust/blob/321a89bec57b8ca723d1af8f784490b950458c6a/compiler/rustc_middle/src/ty/util.rs#L1378-L1389

Closes rust-lang/rust#86868 (other places mentioned in the issue have been resolved, or moved to other issues)

r? types
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_middle/src/ty/util.rs9
1 files changed, 1 insertions, 8 deletions
diff --git a/compiler/rustc_middle/src/ty/util.rs b/compiler/rustc_middle/src/ty/util.rs
index 029586a9c55..b79b67c5927 100644
--- a/compiler/rustc_middle/src/ty/util.rs
+++ b/compiler/rustc_middle/src/ty/util.rs
@@ -1359,6 +1359,7 @@ 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,
@@ -1371,14 +1372,6 @@ impl<'tcx> Ty<'tcx> {
                     _ => self,
                 };
 
-                // FIXME(#86868): 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);