Auto merge of #110031 - compiler-errors:generic-elaboration, r=b-naber

Make elaboration generic over input

Combines all the `elaborate_*` family of functions into just one, which is an iterator over the same type that you pass in (e.g. elaborating `Predicate` gives `Predicate`s, elaborating `Obligation`s gives `Obligation`s, etc.)
This commit is contained in:
bors 2023-04-09 00:18:10 +00:00
commit d048c1130f
2 changed files with 2 additions and 2 deletions

View File

@ -122,7 +122,7 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessPassByValue {
let sized_trait = need!(cx.tcx.lang_items().sized_trait());
let preds = traits::elaborate_predicates(cx.tcx, cx.param_env.caller_bounds().iter())
let preds = traits::elaborate(cx.tcx, cx.param_env.caller_bounds().iter())
.filter(|p| !p.is_global())
.filter_map(|pred| {
// Note that we do not want to deal with qualified predicates here.

View File

@ -2104,7 +2104,7 @@ pub fn fn_has_unsatisfiable_preds(cx: &LateContext<'_>, did: DefId) -> bool {
.filter_map(|(p, _)| if p.is_global() { Some(*p) } else { None });
traits::impossible_predicates(
cx.tcx,
traits::elaborate_predicates(cx.tcx, predicates)
traits::elaborate(cx.tcx, predicates)
.collect::<Vec<_>>(),
)
}