Skip to content

kv::std_support may not need value-bag#729

Merged
KodrAus merged 2 commits into
rust-lang:masterfrom
tisonkun:kv-std-support
Jun 3, 2026
Merged

kv::std_support may not need value-bag#729
KodrAus merged 2 commits into
rust-lang:masterfrom
tisonkun:kv-std-support

Conversation

@tisonkun
Copy link
Copy Markdown
Contributor

@tisonkun tisonkun commented Jun 3, 2026

Exclude value-bag from the dependency tree when we don't need it.

The code would still leverage value-bag if it is enabled, thanks to the Value inner design.

cc @KodrAus

Signed-off-by: tison <wander4096@gmail.com>
Comment thread src/kv/value.rs
}
}

#[cfg(feature = "kv_std")]
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We may implement this for the non-value-bag Value. But that can be a follow-up.

@KodrAus
Copy link
Copy Markdown
Contributor

KodrAus commented Jun 3, 2026

We basically shouldn’t depend on kv_std anywhere except where it’s actually needed. It’s just an unfortunate workaround for not being able to activate Cargo features in a dependency based on the presence of multiple other features.

@tisonkun
Copy link
Copy Markdown
Contributor Author

tisonkun commented Jun 3, 2026

@KodrAus I remembered #657 .. Let me see if this makes some different.

@tisonkun
Copy link
Copy Markdown
Contributor Author

tisonkun commented Jun 3, 2026

@KodrAus I believe the issue is std = ["value-bag?/std"] but now we don't have that anymore.

@tisonkun
Copy link
Copy Markdown
Contributor Author

tisonkun commented Jun 3, 2026

That is, I test this PR locally to exclude value-bag from my dependency tree and it works well.

@KodrAus
Copy link
Copy Markdown
Contributor

KodrAus commented Jun 3, 2026

If I remember correctly, part of the issue too was we couldn’t use a combination of dep: and ? in our MSRV. Now that it’s raised we might be able to do that now.

We can continue to follow up with those kinds of improvements though. This specific change is still a step forwards.

Comment thread src/kv/value.rs Outdated
Signed-off-by: tison <wander4096@gmail.com>
@tisonkun tisonkun requested a review from KodrAus June 3, 2026 01:31
Copy link
Copy Markdown
Contributor

@KodrAus KodrAus left a comment

Choose a reason for hiding this comment

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

Thanks @tisonkun

@KodrAus KodrAus merged commit ce6cd9f into rust-lang:master Jun 3, 2026
13 checks passed
@tisonkun tisonkun deleted the kv-std-support branch June 4, 2026 00:09
@tisonkun
Copy link
Copy Markdown
Contributor Author

tisonkun commented Jun 4, 2026

@KodrAus Thanks for your review and merging!

I'd appreciate it if you could test it (locally?) to prevent a regression to #661 and cut a release if it works well :D

I can move to that version downstream then. So far I'm patching in Cargo.toml to use a git dep.

@KodrAus
Copy link
Copy Markdown
Contributor

KodrAus commented Jun 4, 2026

I think we're ok there because we aren't adding any dependencies based on the presence of std here.

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.

2 participants