Open
Description
Once upon a time, both operator dispatch and method lookup went through the same tangled, twisty paths. It was a mess. But lo, they were severed and made two. Each could follow its own path. Overall, this is progress. But there is still room for improvement:
- The second half of "operator dispatch" is basically the same as
confirm::confirm
, but with some slight differences. - The autoderef loop for
[]
is basically the same asprobe
, but with some slight differences (e.g., at each step it consists builtin[]
as well). - The
probe
loop, which usescheck::autoderef
, isn't able to be part of an inference transaction betweencheck::autoderef
uses operator dispatch which adds things into the main fulfillment context, thus leaking inference types etc outside the transaction.
It feels like things could still be cleaned up a bit further, allowing for more code reuse and happiness all around.
Some FIXMEs are scattered about at relevant points of the code.
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
nikomatsakis commentedon Nov 7, 2014
I am happy to mentor.
Tag some code duplication with FIXME for #18741.
Tag some code duplication with FIXME for rust-lang#18741.
steveklabnik commentedon Dec 31, 2015
@nikomatsakis is this ticket still valid?
nikomatsakis commentedon Jan 4, 2016
On Thu, Dec 31, 2015 at 10:26:12AM -0800, Steve Klabnik wrote:
yes
Phyllostachys commentedon Jan 13, 2016
Inspired by this and having been a long time fan of Rust and wanting to contribute, I'm interested in solving this issue. With that said, is there anything I need to know to get started? Also, where can I start looking?
nikomatsakis commentedon Jan 13, 2016
@Phyllostachys to be honest it's a bit out of cache for me. I'd have to go read into the code some to see where things stand. Anyway, usually a good place to start is to try and touch base at some point on IRC or over e-mail.
Phyllostachys commentedon Jan 13, 2016
I'll have to jump on IRC tonight. Who would I email if I emailed someone?
nikomatsakis commentedon Jan 14, 2016
@Phyllostachys me, my e-mail is on my github page
ahmedcharles commentedon Aug 27, 2016
@nikomatsakis Are you still willing to mentor this?
Mark-Simulacrum commentedon May 13, 2017
@ahmedcharles Are you still interested? We can try to connect you with niko if so
nikomatsakis commentedon May 25, 2017
Well, it's quite out of cache, but let me start by giving a few very basic pointers. The relevant code is now found at
src/librustc_typeck/check/method/mod.rs
-- the fns in question arelookup_method()
andlookup_method_in_trait_adjusted()
. You may find theREADME.md
in that same directory useful.14 remaining items