3

Eagerly instantiate closure/coroutine-like bounds with placeholders to deal with...

 1 month ago
source link: https://github.com/rust-lang/rust/pull/122267
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Conversation

Member

A follow-up to #119849, however it aims to fix a different set of issues. Currently, we have trouble confirming goals where built-in closure/fnptr/coroutine signatures are compared against higher-ranked goals.

Currently, we don't support goals like for<'a> fn(&'a ()): Fn(&'a ()) because we don't expect the self type of goal to reference any bound regions from the goal, because we don't really know how to deal with the double binder of predicate + self type. However, this definitely can be reached (#121653) -- and in fact, it results in post-mono errors in the case of #112347 where the builtin type (e.g. a coroutine) is hidden behind a TAIT.

The proper fix here is to instantiate the goal before trying to extract the signature from the self type. See final two commits.

r? lcnr

lcnr reacted with thumbs up emojifmease and fee1-dead reacted with eyes emoji

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK