Skip to content

Commit

Permalink
Auto merge of #100676 - lcnr:implied-bounds-yay, r=nikomatsakis
Browse files Browse the repository at this point in the history
implied bounds: explicitly state which types are assumed to be wf

Adds a new query which maps each definition to the types which that definition assumes to be well formed. The intent is to make it easier to reason about implied bounds.

This change should not influence the user-facing behavior of rustc. Notably, `borrowck` still only assumes that the function signature of associated functions is well formed while `wfcheck` assumes that the both the function signature and the impl trait ref is well formed. Not sure if that by itself can trigger UB or whether it's just annoying.

As a next step, we can add `WellFormed` predicates to `predicates_of` of these items and can stop adding the wf bounds at each place which uses them. I also intend to move the computation from `assumed_wf_types` to `implied_bounds` into the `param_env` computation. This requires me to take a deeper look at `compare_predicate_entailment` which is currently somewhat weird wrt implied bounds so I am not touching this here.

r? `@nikomatsakis`
  • Loading branch information
bors committed Aug 22, 2022
2 parents 7bac960 + 4b0c969 commit 948e57f
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 948e57f

Please sign in to comment.