Remove region variable leaks from higher_ranked_sub().#28369
Conversation
6cd3183 to
8122df9
Compare
|
This could be better with tests to make sure that the tainted region checks are sound, but I can't come up with any. |
|
Actually, the return value from |
8122df9 to
01872f7
Compare
|
Nice, that makes much more sense. I've rebased with a much more conservative fix that covers most of the bases. If you think I should go through and return |
|
@ebfull it seems like the policy is a bit unclear; I think at least a comment on Sub and Equate indicating that they are supposed to:
would make the policy clear. |
|
I've started a crater run. |
|
@bors r+ |
|
📌 Commit e567cb5 has been approved by |
Fixes #28279. Currently `common_supertype(*mut for<'a> Fn(&'a usize), *mut for<'a> Fn(&'a usize) + 'static)` equals `*mut Fn(&usize)` which seems to be caused by `higher_ranked_sub()` allowing region variables to escape the comparison. This prevents inference from working properly with stuff like `Rc<Fn(&T)>`. r? @nikomatsakis
|
@nikomatsakis I asked @brson if it would be a good idea, in case it fixes soundness holes we weren't aware of. I apologize if this was an unnecessary use of crater resources. |
|
@ebfull oh not to worry, I just wondered if there was some known interaction |
|
Oh, shoot, sorry I let this crater run slip. It's still in progress. |
|
I've been running into problems with crater. Still trying to get this through. |
Fixes #28279.
Currently
common_supertype(*mut for<'a> Fn(&'a usize), *mut for<'a> Fn(&'a usize) + 'static)equals
*mut Fn(&usize)which seems to be caused byhigher_ranked_sub()allowing region variables to escape the comparison. This prevents inference from working properly with stuff likeRc<Fn(&T)>.r? @nikomatsakis