Skip to content

Add minimal support for rustc-rayon - #212

Merged
cuviper merged 1 commit into
indexmap-rs:masterfrom
cuviper:rustc-rayon
Jan 6, 2022
Merged

Add minimal support for rustc-rayon#212
cuviper merged 1 commit into
indexmap-rs:masterfrom
cuviper:rustc-rayon

Conversation

@cuviper

@cuviper cuviper commented Dec 9, 2021

Copy link
Copy Markdown
Member

This adds basic IntoParallelIterator support for the rustc-rayon fork of rayon, as needed by rust-lang/rust#90842 (cc @pierwill). The optional dependency is commented as "internal" for rustc's use alone, and we should feel free to make breaking changes like semver-bumps in coordination with compiler updates.

@cuviper
cuviper requested a review from bluss December 9, 2021 20:02

@bluss bluss left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, seems sensible.

@bluss

bluss commented Dec 9, 2021

Copy link
Copy Markdown
Member

This makes me wonder about more hacky ideas, could rustc just patch in an alternative fork of rayon from the top of its cargo projects? I don't think the cargo patch feature can do exactly that, at least not without requiring version/crate name to stay identical.

@cuviper

cuviper commented Dec 9, 2021

Copy link
Copy Markdown
Member Author

Cargo patches affect the whole workspace, and I'm not sure we would want to force that fork everywhere since it lags behind. Really, we should do away with that fork, but that requires more work and nobody is really using the parallel rustc anyway...

@bluss

bluss commented Dec 9, 2021

Copy link
Copy Markdown
Member

Yes I guess the fork would have to be a lot more careful about exactly what it's changing if it should work, it would need to be designed for being used that way.

@pierwill

pierwill commented Dec 9, 2021

Copy link
Copy Markdown

This is amazing! Thank you @cuviper. :)

@cuviper

cuviper commented Jan 6, 2022

Copy link
Copy Markdown
Member Author

Yes, this has IntoParallelIterator for IndexMap, &IndexMap, &mut IndexMap, IndexSet, and &IndexSet.

@cuviper

cuviper commented Jan 6, 2022

Copy link
Copy Markdown
Member Author

Confirmed on zulip that it is working with the "rustc-rayon" feature properly enabled. :)

I'm merging this, then I'll check other pending PRs and see about publishing a release.

@cuviper
cuviper merged commit 921df7b into indexmap-rs:master Jan 6, 2022
@cuviper
cuviper deleted the rustc-rayon branch July 18, 2023 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants