1
Fork 0
rust/compiler/rustc_middle/src
bors a9bb589cd6 Auto merge of #100676 - lcnr:implied-bounds-yay, r=nikomatsakis
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`
2022-08-22 06:10:26 +00:00
..
dep_graph Use a dedicated DepKind for the forever-red node. 2022-07-06 23:20:12 +02:00
hir Check attributes on struct expression fields. 2022-08-11 21:48:39 -07:00
infer make PlaceholderConst not store the type of the const 2022-08-01 15:42:38 +01:00
middle Rollup merge of #96478 - WaffleLapkin:rustc_default_body_unstable, r=Aaron1011 2022-08-09 17:34:50 +05:30
mir Rollup merge of #100081 - RalfJung:unused-unsafe-in-unsafe-fn, r=jackh726 2022-08-19 12:26:40 +05:30
query Auto merge of #100676 - lcnr:implied-bounds-yay, r=nikomatsakis 2022-08-22 06:10:26 +00:00
thir Rollup merge of #99000 - JulianKnodt:allow_resolve_no_substs, r=lcnr 2022-07-14 19:24:04 +05:30
traits More docs 2022-08-21 02:35:11 +00:00
ty Auto merge of #100676 - lcnr:implied-bounds-yay, r=nikomatsakis 2022-08-22 06:10:26 +00:00
util span: move MultiSpan 2022-04-05 07:01:00 +01:00
arena.rs arena > Rc for query results 2022-07-12 15:27:24 +02:00
lib.rs Adjust cfgs 2022-08-12 16:28:15 -04:00
lint.rs Rename debugging_opts to unstable_opts 2022-07-13 17:47:06 -05:00
macros.rs impl TypeVisitable in type traversal macros 2022-07-05 22:25:33 +01:00
metadata.rs resolve/metadata: Stop encoding macros as reexports 2022-02-24 22:55:40 +03:00
tests.rs
thir.rs Avoid repeating qualifiers on static_assert_size calls. 2022-08-10 11:51:21 +10:00