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

Replace kernel::str::BStr with core::bstr::ByteStr #1146

Open
tamird opened this issue Mar 6, 2025 · 3 comments
Open

Replace kernel::str::BStr with core::bstr::ByteStr #1146

tamird opened this issue Mar 6, 2025 · 3 comments
Labels
• lib Related to the `rust/` library.

Comments

@tamird
Copy link

tamird commented Mar 6, 2025

This is brand new and still unstable (tracking issue rust-lang/rust#134915) but we should keep an eye on it and proactively request changes if we're going to need them.

This task is similar to (but should be simpler than) #1075.

@ojeda ojeda added the • lib Related to the `rust/` library. label Mar 6, 2025
tamird added a commit to tamird/rust that referenced this issue Mar 14, 2025
This produces a deref chain of `CStr` -> `BStr` -> `[u8]` which is
present in the Rust-for-Linux analogues of these types.

Link: rust-lang#134915
Link: Rust-for-Linux/linux#1075
Link: https://lore.kernel.org/all/20250221142816.0c015e9f@eugeo/
Link: Rust-for-Linux/linux#1146
tamird added a commit to tamird/rust that referenced this issue Mar 14, 2025
This produces a deref chain of `CStr` -> `BStr` -> `[u8]` which is
present in the Rust-for-Linux analogues of these types.

Link: rust-lang#134915
Link: Rust-for-Linux/linux#1075
Link: https://lore.kernel.org/all/20250221142816.0c015e9f@eugeo/
Link: Rust-for-Linux/linux#1146
tamird added a commit to tamird/rust that referenced this issue Mar 14, 2025
This produces a deref chain of `CStr` -> `BStr` -> `[u8]` which is
present in the Rust-for-Linux analogues of these types.

Link: rust-lang#134915
Link: Rust-for-Linux/linux#1075
Link: https://lore.kernel.org/all/20250221142816.0c015e9f@eugeo/
Link: Rust-for-Linux/linux#1146
tamird added a commit to tamird/rust that referenced this issue Mar 16, 2025
This produces a deref chain of `CStr` -> `BStr` -> `[u8]` which is
present in the Rust-for-Linux analogues of these types.

Add `AsRef<ByteStr>` as well.

Link: rust-lang#134915
Link: Rust-for-Linux/linux#1075
Link: https://lore.kernel.org/all/20250221142816.0c015e9f@eugeo/
Link: Rust-for-Linux/linux#1146
@KunWuChan
Copy link

Hi, How shoud we do? Just replace the implement of BStr with ByteStr?
If need, I'll pleasure do it.

@tamird
Copy link
Author

tamird commented Mar 19, 2025

Working on this would be premature as ByteStr is very new. We would need to wait at least until our MSRV

msrv = "1.78.0"

is recent enough to contain the ByteStr APIs we need. That looks like it will be 1.86.0.

@KunWuChan
Copy link

Ok,I'll try to do that when msrv be 1.86.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
• lib Related to the `rust/` library.
Development

No branches or pull requests

3 participants