Skip to content
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

[u8]::utf8_chunks in std will conflict with the definition in bstr #181

Open
BurntSushi opened this issue Apr 15, 2024 · 0 comments
Open

Comments

@BurntSushi
Copy link
Owner

Note that it looks like [u8]::utf8_chunks will be getting stabilized in std soon (which is great): rust-lang/rust#99543

This will wind up conflicting with bstr's definition of the same routine. This is similar to the itertools situations where it's tricky to bring new iterator adapters into std from itertools because of the same style of conflict.

Code can be fixed I think by disambiguating via universal functional call syntax, but this can often lead to a lot of noise.

@dtolnay outlined a couple of concrete issues that might arise here: rust-lang/rust#99543 (comment)

The first issue is that std doesn't have an incomplete method. It seems reasonable to add one, so I think someone just needs to open an ACP for that.

The second issue occurs when someone is specifically using, e.g., bstr::Utf8Chunks somewhere and relying on [u8]::utf8_chunks to return that. I expect this to be a somewhat rare issue, and I'm not sure it warrants doing version sniffing to re-export core types. (And even if we did that, we would need Utf8Chunk::incomplete to exist.)

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

No branches or pull requests

1 participant