Repository navigation
Fuse impls expose use of specialization (default fn) #70796
Description
Activity
- addedE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-libs-api[DEPRECATED; DO NOT USE][DEPRECATED; DO NOT USE]T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.C-bugCategory: This is a bug.Category: This is a bug.A-iteratorsArea: IteratorsArea: Iterators
on Apr 5, 2020 Supp. Can I take this up?
Oh also, the file is in
src/libcore/iter/adapters/fuse.rsnotsrc/libcore/adapters/fuse.rs. Had me confused for a while, but picked it up from context of the other PR, just saying.@rustbot assign @rakshith-ravi
I fear what the extra indirection will do to #70332, but I guess we'll just have to see...
Alright. I'll go through that as well and suggest changes there, in case I can think of any.
Unlike my last PR, this time, I'd like to give this a shot without any mentoring. However, if I get stuck somewhere, I might request for help. Bear with me please.
Anyways, it's a little too late for me here (IST). Will get on it first thing tomorrow morning. Thanks
It's also possible that could work out better if there's a way for
Chainto directly reach the non-specialized version, rather than shimming its ownDefuseto avoidFusedIteratoreffects.Reacted by Rakshith RaviSo if I understand the situation correctly, we need to have
Iteratorinherit fromIteratorInternalor something like that, which allows for specialization and perform all our specialized work on that, while not exposing thedefault fns to anything outside the crate, yes?This will also mean that
Iteratorwill provide a blanket implementation that uses theIteratorInternal's implementation.It's also possible that could work out better if there's a way for
Chainto directly reach the non-specialized version, rather than shimming its ownDefuseto avoidFusedIteratoreffects.I don't think I entirely understand what you're saying. Could you help me clarify that please?
We definitely don't want to change the
Iteratortrait, if that's what you mean. I would look atZipand itsZipImplto see how that's privately specialized.It's also possible that could work out better if there's a way for
Chainto directly reach the non-specialized version, rather than shimming its ownDefuseto avoidFusedIteratoreffects.I don't think I entirely understand what you're saying. Could you help me clarify that please?
My thought was that we could make #70332 use some internal part of your work, e.g.
FuseImpl, to bypass some of the nested calls. But now I'm also trying anotherChainindependent ofFusein #70896 which I think is promising...Alrighty. Let me know if #70322 requires something specific so that I can implement it accordingly. Would be happy to dive deep into this.
We definitely don't want to change the
Iteratortrait, if that's what you mean. I would look atZipand itsZipImplto see how that's privately specialized.Yup, an implementation similar to
ZipImplis exactly what I meant. I'll get right on it then- added a commit that references this issue
on Apr 17, 2020
Context: #70750 (comment)
We have some uses of
default fninsrc/libcore/adapters/fuse.rswhich allow users to specialize those functions. Instead, thesedefault fns should be moved into internal (private) traits so that the specialization isn't exposed.This issue has been assigned to @rakshith-ravi via this comment.