rust/compiler/rustc_borrowck/src
Yuki Okushi 3b780fc279
Rollup merge of #99079 - compiler-errors:issue-99073, r=oli-obk
Check that RPITs constrained by a recursive call in a closure are compatible

Fixes #99073

Adapts a similar visitor pattern to `find_opaque_ty_constraints` (that we use to check TAITs), but with some changes:
0. Only walk the "OnlyBody" children, instead of all items in the RPIT's defining scope
1. Only walk through the body's children if we found a constraining usage
2. Don't actually do any inference, just do a comparison and error if they're mismatched

----

r? `@oli-obk` -- you know all this impl-trait stuff best... is this the right approach? I can explain the underlying issue better if you'd like, in case that might reveal a better solution. Not sure if it's possible to gather up the closure's defining usages of the RPIT while borrowck'ing the outer function, that might be a better place to put this check...
2022-07-27 19:05:32 +09:00
..
constraints add def_id and substs to ConstraintCategory::CallArgument 2022-05-25 18:13:03 +02:00
diagnostics Rollup merge of #99748 - compiler-errors:better-impl-trait-printing, r=fee1-dead 2022-07-26 14:27:00 +05:30
region_infer Use real opaque type instead of just saying impl Trait 2022-07-26 06:19:58 +00:00
type_check Revert "Do not allow typeck children items to constrain outer RPITs" 2022-07-26 07:46:30 +00:00
borrow_set.rs cleanup mir visitor for rustc::pass_by_value 2022-07-01 16:21:21 +02:00
borrowck_errors.rs On partial uninit error point at where we need init 2022-07-07 12:25:55 -07:00
constraint_generation.rs Update TypeVisitor paths 2022-07-06 06:41:53 +01:00
consumers.rs take opaq types 2022-07-20 12:43:10 +03:00
dataflow.rs Remove crate visibility usage in compiler 2022-05-20 20:04:54 -04:00
def_use.rs Add new MutatatingUseContexts for deinit and SetDiscriminant 2022-04-11 09:26:26 -04:00
facts.rs Rename debugging_opts to unstable_opts 2022-07-13 17:47:06 -05:00
invalidation.rs add new rval, pull deref early 2022-07-12 14:26:41 +03:00
lib.rs Auto merge of #99506 - Dylan-DPC:rollup-q3msucx, r=Dylan-DPC 2022-07-20 13:36:59 +00:00
location.rs Remove crate visibility usage in compiler 2022-05-20 20:04:54 -04:00
member_constraints.rs Use real opaque type instead of just saying impl Trait 2022-07-26 06:19:58 +00:00
nll.rs Use LocalDefId in OpaqueTypeKey 2022-07-19 02:08:49 +00:00
path_utils.rs Remove in_band_lifetimes from borrowck 2021-12-15 08:39:21 +01:00
place_ext.rs Remove crate visibility usage in compiler 2022-05-20 20:04:54 -04:00
places_conflict.rs Revert "Rollup merge of #98582 - oli-obk:unconstrained_opaque_type, r=estebank" 2022-07-20 07:55:58 +00:00
prefixes.rs Revert "Rollup merge of #98582 - oli-obk:unconstrained_opaque_type, r=estebank" 2022-07-20 07:55:58 +00:00
renumber.rs fold_region: remove unused parameter 2022-06-27 15:55:03 +02:00
session_diagnostics.rs Migrate some rustc_borrowck diagnostics to SessionDiagnostic 2022-06-28 22:41:56 +00:00
universal_regions.rs Move is_free and is_free_or_static to Region, change resolve_var to resolve_region, and remove RootEmptyRegion 2022-07-07 20:48:51 -04:00
used_muts.rs cleanup mir visitor for rustc::pass_by_value 2022-07-01 16:21:21 +02:00