Skip to content

Commit

Permalink
fix(frontend): use predicates_defined_on instead of predicate_of
Browse files Browse the repository at this point in the history
  • Loading branch information
W95Psp committed Nov 2, 2023
1 parent 2ee26c3 commit 2f367b8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion frontend/exporter/src/rustc_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl<'tcx> ty::TyCtxt<'tcx> {
let mut next_did = Some(did);
let mut predicates = vec![];
while let Some(did) = next_did {
let gen_preds = self.predicates_of(did);
let gen_preds = self.predicates_defined_on(did);
next_did = gen_preds.parent;
predicates.extend(gen_preds.predicates.into_iter())
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/exporter/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ impl ImplInfos {
let s = &with_owner_id(base, (), (), did);

let predicates = tcx
.predicates_of(did)
.predicates_defined_on(did)
.predicates
.iter()
.map(|(x, _)| x.sinto(s))
Expand Down
4 changes: 2 additions & 2 deletions frontend/exporter/src/types/copied.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2975,7 +2975,7 @@ fn region_bounds_at_current_owner<'tcx, S: UnderOwnerState<'tcx>>(s: &S) -> Gene
let tcx = s.base().tcx;

// According to what kind of node we are looking at, we should
// either call `predicates_of` or `item_bounds`
// either call `predicates_defined_on` or `item_bounds`
let use_item_bounds = {
if let Some(oid) = s.owner_id().as_local() {
let hir_id = tcx.hir().local_def_id_to_hir_id(oid);
Expand All @@ -3001,7 +3001,7 @@ fn region_bounds_at_current_owner<'tcx, S: UnderOwnerState<'tcx>>(s: &S) -> Gene
let span = list.default_span(tcx);
list.into_iter().map(|x| (x, span)).collect()
} else {
tcx.predicates_of(s.owner_id())
tcx.predicates_defined_on(s.owner_id())
.predicates
.into_iter()
.cloned()
Expand Down

0 comments on commit 2f367b8

Please sign in to comment.