New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specialize ProcessResults::fold #563
Conversation
Thanks a lot for this - looks very good to me (as always with your contributions). And even if I think this is correct, I think we do ourselves a favor if we have tests for this specialization. Could you add some? (I think we already have quicktests for specializations.) |
If you mean Looks like there's also a |
d991949
to
bc5ab46
Compare
574: Fix and refactor specializations tests r=phimuemue a=SkiFire13 As found in #563 specializations tests don't actually test the specialize tests due to the use of `Box<dyn Iterator>`. This PR fix this problem by having `check_specialized` be a macro so that the code inside (what used to be the) closure directly calls methods on the iterator types. This also does a tiny refactor, moving the single test in `tests/fold_specialization.rs` together with the others in `tests/specializations.rs`. Note that this may conflict with #563 (but I hope it doesn't since they touch different parts of the file) Co-authored-by: Giacomo Stevanato <giaco.stevanato@gmail.com>
Thank you. bors r+ |
Build succeeded: |
https://github.com/rust-lang/rust/blob/914a1e2c517dfbaa23a4ec4a3eebefb3e2c253c2/library/alloc/src/boxed.rs#L1566-L1581 Looks like we should replace the iterator dynamic dispatch in check_specialized with a macro (like the one you created), as it does not fulfill its purpose. |
Because all the generic methods on |
Had finally figured out the issues with
Actually already done in bf4ca16 |
Partially fixes #562.
try_fold
can't be added right now because it requires the unstableTry
trait.