Skip to content

Conversation

conradludgate
Copy link
Contributor

Motivation

The other day I saw someone asking for JoinMap to be stabalised. I happened to notice just now that the task ID system is now stable in tokio.

Solution

Removes the unstable config requirement for tokio_util::JoinMap.

@conradludgate conradludgate force-pushed the conrad/stabalise-joinmap branch 2 times, most recently from eb9f646 to 5155239 Compare January 6, 2025 15:35
@conradludgate conradludgate changed the title feat: Stabalise JoinMap feat(tokio_util): Stabalise JoinMap Jan 6, 2025
@Darksonn Darksonn added A-tokio-util Area: The tokio-util crate M-task Module: tokio/task labels Jan 6, 2025
@conradludgate conradludgate force-pushed the conrad/stabalise-joinmap branch from 5155239 to 91695b2 Compare January 6, 2025 15:45
@Darksonn Darksonn changed the title feat(tokio_util): Stabalise JoinMap feat(tokio_util): Stabilise JoinMap Jan 8, 2025
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

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

Overall LGTM.

@baxterjo
Copy link

Looks like just merge conflicts at this point?

@conradludgate
Copy link
Contributor Author

Seems I forgot about this. Will check today

@baxterjo
Copy link

Would the change in #7252 preclude a non breaking change in this API? Can we merge this without 7252 then merge in 7252 as an optimization later?

@conradludgate
Copy link
Contributor Author

Would the change in #7252 preclude a non breaking change in this API? Can we merge this without 7252 then merge in 7252 as an optimization later?

Yes, that's my understanding. The only public API change noticeable is removing the S: Clone bound, which is non-breaking

@Darksonn
Copy link
Contributor

I'd like to get #7257 fixed before we stabilize it.

@Darksonn
Copy link
Contributor

Awesome, thanks. I'm going to make a release #7283 containing just the bugfix, and then we can merge this and #7252 and make another release. I'm doing this so that people who want the fix can upgrade to 0.7.15 without being affected by the breaking changes contained in this PR (mainly the addition of a feature flag).

@baxterjo
Copy link

baxterjo commented Jul 7, 2025

Anything else blocking this merge?

@Darksonn
Copy link
Contributor

Darksonn commented Jul 8, 2025

I was waiting for conrad to reply on #7252.

@conradludgate conradludgate force-pushed the conrad/stabalise-joinmap branch from f645277 to 0182f8c Compare July 22, 2025 14:31
@Darksonn
Copy link
Contributor

There seems to be a clippy failure.

@conradludgate
Copy link
Contributor Author

There seems to be a clippy failure.

CI is passing now

Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

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

LGTM, but an additional comment on the feature requirements.

Comment on lines -103 to 98
/// [contains]: fn@Self::contains_key
#[cfg_attr(docsrs, doc(cfg(all(feature = "rt", tokio_unstable))))]
pub struct JoinMap<K, V, S = RandomState> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add back the doc attribute? Right now it is rendered like this:

Available on crate feature join-map and (crate features rt or join-map) only.

I believe we can improve this with an explicit attribute.

#[cfg_attr(docsrs, doc(cfg(feature = "join-map")))]

Comment on lines 32 to 33
rt = ["tokio/rt", "tokio/sync", "futures-util"]
join-map = ["tokio/rt", "hashbrown"]
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should just have join-map also enable the rt feature. After all, the join map does require a runtime.

Suggested change
rt = ["tokio/rt", "tokio/sync", "futures-util"]
join-map = ["tokio/rt", "hashbrown"]
rt = ["tokio/rt", "tokio/sync", "futures-util"]
join-map = ["rt", "hashbrown"]

This way, we can simplify the task module to only exist when rt is enabled instead of the rt or join-map requirement it has today.

@Darksonn Darksonn enabled auto-merge (squash) August 3, 2025 07:40
@Darksonn Darksonn merged commit 416e36b into tokio-rs:master Aug 3, 2025
90 checks passed
@baxterjo
Copy link

baxterjo commented Aug 4, 2025

Wohoo! Thanks folks! 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio-util Area: The tokio-util crate M-task Module: tokio/task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants