about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/collect.rs
diff options
context:
space:
mode:
authorBoxy <rust@boxyuwu.dev>2024-11-30 19:31:06 +0000
committerBoxy <rust@boxyuwu.dev>2024-12-03 23:39:51 +0000
commitec036cda3fee341d938336b64bc38cd11df7231d (patch)
tree2397765ef5e6e6afa1fcfbebc1eb3cd8cf7764a2 /compiler/rustc_hir_analysis/src/collect.rs
parentc44b3d50fea96a3e0417e8264c16ea21a0a3fca2 (diff)
downloadrust-ec036cda3fee341d938336b64bc38cd11df7231d.tar.gz
rust-ec036cda3fee341d938336b64bc38cd11df7231d.zip
Don't try and handle unfed `type_of` on anon consts
Diffstat (limited to 'compiler/rustc_hir_analysis/src/collect.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/collect.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_hir_analysis/src/collect.rs b/compiler/rustc_hir_analysis/src/collect.rs
index 8d5824130d8..a4636da3f62 100644
--- a/compiler/rustc_hir_analysis/src/collect.rs
+++ b/compiler/rustc_hir_analysis/src/collect.rs
@@ -309,10 +309,10 @@ impl<'tcx> Visitor<'tcx> for CollectItemTypesVisitor<'tcx> {
                     self.tcx.ensure().type_of(param.def_id);
                     if let Some(default) = default {
                         // need to store default and type of default
+                        self.tcx.ensure().const_param_default(param.def_id);
                         if let hir::ConstArgKind::Anon(ac) = default.kind {
                             self.tcx.ensure().type_of(ac.def_id);
                         }
-                        self.tcx.ensure().const_param_default(param.def_id);
                     }
                 }
             }
@@ -1817,7 +1817,6 @@ fn const_param_default<'tcx>(
         ),
     };
     let icx = ItemCtxt::new(tcx, def_id);
-    // FIXME(const_generics): investigate which places do and don't need const ty feeding
-    let ct = icx.lowerer().lower_const_arg(default_ct, FeedConstTy::No);
+    let ct = icx.lowerer().lower_const_arg(default_ct, FeedConstTy::Param(def_id.to_def_id()));
     ty::EarlyBinder::bind(ct)
 }