rust/compiler/rustc_hir_analysis
Matthias Krüger 20af878588
Rollup merge of #132047 - compiler-errors:rbv-rtn-cleanup, r=cjgillot
Robustify and genericize return-type-notation resolution in `resolve_bound_vars`

#129629 implemented return-type-notation (RTN) in its path form, like `where T::method(..): Bound`. As part of lowering, we must record the late-bound vars for the where clause introduced by the method (namely, its early- and late-bound lifetime arguments, since `where T::method(..)` turns into a higher-ranked where clause over all of the lifetimes according to [RFC 3654](https://rust-lang.github.io/rfcs/3654-return-type-notation.html#converting-to-higher-ranked-trait-bounds)).

However, this logic was only looking at the where clauses of the parent item that the `T::method(..)` bound was written on, and not any parent items. This PR generalizes that logic to look at the parent item (i.e. the outer impl or trait) instead and fixes a (debug only) assertion as an effect.

This logic is also more general and likely easier to adapt to more interesting (though likely very far off) cases like non-lifetime binder `for<T: Trait> T::method(..): Send` bounds.

Tracking:

- https://github.com/rust-lang/rust/issues/109417
2024-12-01 08:15:21 +01:00
..
src Rollup merge of #132047 - compiler-errors:rbv-rtn-cleanup, r=cjgillot 2024-12-01 08:15:21 +01:00
Cargo.toml Remove unused intercrate dependencies 2024-11-07 14:17:16 +00:00
messages.ftl Rollup merge of #116161 - Soveu:varargs2, r=cjgillot 2024-11-30 12:56:50 +08:00
README.md

For high-level intro to how type checking works in rustc, see the type checking chapter of the rustc dev guide.