Auto merge of #113215 - compiler-errors:rpitit-predicates-tweaks, r=spastorino

Make RPITITs assume/require their parent method's predicates

Removes a FIXME from the `param_env` query where we were manually adding the parent function's predicates to the RPITIT's assumptions.

r? `@spastorino`
This commit is contained in:
bors 2023-07-04 04:24:24 +00:00
commit 0130c3a06e
8 changed files with 76 additions and 41 deletions

View file

@ -574,7 +574,9 @@ fn foo(&self) -> Self::T { String::new() }
let Some(hir_id) = body_owner_def_id.as_local() else {
return false;
};
let hir_id = tcx.hir().local_def_id_to_hir_id(hir_id);
let Some(hir_id) = tcx.opt_local_def_id_to_hir_id(hir_id) else {
return false;
};
// When `body_owner` is an `impl` or `trait` item, look in its associated types for
// `expected` and point at it.
let parent_id = tcx.hir().get_parent_item(hir_id);