about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/lib.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-12-01 08:15:21 +0100
committerGitHub <noreply@github.com>2024-12-01 08:15:21 +0100
commit20af87858889b55c4533419f6722b630e255054d (patch)
tree6271ed8f9d570ddd9ecd1a920a26c90ca3cb2764 /compiler/rustc_hir_analysis/src/lib.rs
parentfe4c6e8657271b0eeb5ada90e9ab751caab52a22 (diff)
parent0f5759a00536ac7172090226538bd6870df4b07f (diff)
downloadrust-20af87858889b55c4533419f6722b630e255054d.tar.gz
rust-20af87858889b55c4533419f6722b630e255054d.zip
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
Diffstat (limited to 'compiler/rustc_hir_analysis/src/lib.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/lib.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_hir_analysis/src/lib.rs b/compiler/rustc_hir_analysis/src/lib.rs
index b25acfb3007..87fd4de26a5 100644
--- a/compiler/rustc_hir_analysis/src/lib.rs
+++ b/compiler/rustc_hir_analysis/src/lib.rs
@@ -62,7 +62,9 @@ This API is completely unstable and subject to change.
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
 #![doc(rust_logo)]
 #![feature(assert_matches)]
+#![feature(coroutines)]
 #![feature(if_let_guard)]
+#![feature(iter_from_coroutine)]
 #![feature(iter_intersperse)]
 #![feature(let_chains)]
 #![feature(never_type)]