# WithOptConstParam removal and cleanup 1. [remove `WithOptConstParam`, but add hack for non-owned feeding](https://github.com/rust-lang/rust/pull/96840) 2. Eliminate `par_body_owners` and `body_owners` functions * [prefer queries calling other queries](https://github.com/rust-lang/rust/pull/108118) * rename `mir_drops_elaborated_and_const_checked` to `mir_analysis` * at the end of compilation, iterate over all `DefId`s, calling `mir_analysis` on all body owners. * since this may create more `DefIds`, we need to iterate by even beyond the initially "last" `DefId`. * after this iteration, no more `DefIds` may be created (as we could then forget to call the analysis queries), so we need to freeze the `definitions` table. * need an `is_body_owner` query to differentiate `DefId`s with bodies from those without. This should be fed inside `create_def` just like `def_span`. 3. remove the `feed_type_of_anon_const` hack * create the `DefId` for the `AnonConst` during `typeck` of its parent * keep things simple by also feeding the `def_id_to_hir_id` query for the `AnonConst`? # Future things to do once that works 1. in release-builds, don't iterate over `mir_analysis` until after monomorphization to ensure that `DefId`s can be created during the mir opt pipeline * allows outlining generic function bodies that only do a generic op right at the start but have a lot of complex monomorphic logic right after. 2. remove `Promoted` by creating new `DefId`s per promoted and feeding the mir body queries for those.