Implement PartialEq for all function pointers via a shim#108074
Implement PartialEq for all function pointers via a shim#108074oli-obk wants to merge 4 commits intorust-lang:masterfrom
PartialEq for all function pointers via a shim#108074Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @compiler-errors (or someone else) soon. Please see the contribution instructions for more information. |
|
Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
|
|
||
| let x: fn(&'static ()) = foo; | ||
| let y: for<'a> fn(&'a ()) = foo; | ||
| x == y; |
There was a problem hiding this comment.
So it works if the RHS is higher-ranked, but not if the LHS is higher-ranked? That is odd...
There was a problem hiding this comment.
that seems definitely fixable, but I think it's a preexisting issue of binary ops.
There was a problem hiding this comment.
I assume this is related to this remark?
== has too much magic to work with this.
I don't think I understand what the magic is, I thought a == b was just PartialEq::eq(&a, &b)...
| @@ -837,15 +837,9 @@ fn trait_method<'tcx>( | |||
| method_name: Symbol, | |||
| substs: impl IntoIterator<Item = impl Into<GenericArg<'tcx>>>, | |||
| ) -> ConstantKind<'tcx> { | |||
There was a problem hiding this comment.
why does this not use lang_items?
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
@rustbot author |
|
closing in favor of #108080 |
This allows comparing higher kinded function pointers, at least directly via
PartialEq.==has too much magic to work with this.We can implement this in libstd without needing a shim once #99531 lands
this unblocks #105750
r? types