rustix
rustix copied to clipboard
Enable "std" feature on linux-raw-sys when "std" feature is enabled
As "std" changes API details from linux-raw-sys
that is exposed in the public API, this would be a breaking change.
cc https://github.com/bytecodealliance/rustix/issues/753
This currently means that xattr
(1.1.0) and rustix
can't be used in the same crate. xattr
enables the std
feature of linux-raw-sys
, and rustix
then fails compiling if also the net
feature of rustix
is enabled.
error[E0308]: mismatched types
--> src/backend/linux_raw/net/addr.rs:39:32
|
39 | unix.sun_path[i] = *b;
| ---------------- ^^ expected `i8`, found `u8`
| |
| expected due to the type of this binding
error[E0308]: mismatched types
--> src/backend/linux_raw/net/addr.rs:52:32
|
52 | id.copy_from_slice(name);
| --------------- ^^^^ expected `&[i8]`, found `&[u8]`
| |
| arguments to this method are incorrect
|
= note: expected reference `&[i8]`
found reference `&[u8]`
[...]
I'm having this same issue. Our build suddently is broken:
error[E0308]: mismatched types
--> /home/vscode/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustix-0.38.27/src/backend/linux_raw/net/addr.rs:39:32
|
39 | unix.sun_path[i] = *b;
| ---------------- ^^ expected `i8`, found `u8`
| |
| expected due to the type of this binding
error[E0308]: mismatched types
--> /home/vscode/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustix-0.38.27/src/backend/linux_raw/net/addr.rs:52:32
|
52 | id.copy_from_slice(name);
| --------------- ^^^^ expected `&[i8]`, found `&[u8]`
| |
| arguments to this method are incorrect
|
= note: expected reference `&[i8]`
found reference `&[u8]`
note: method defined here
--> /rustc/9d871b0617a4b3d6610b7cee0ab5310dcb542c62/library/core/src/slice/mod.rs:3331:12
BTW Possible temporal quick and dirty fix: depend on rustix = "0.38.26"
and it works. It got broken in a patch release..
xattr 1.1.1 has been released with a fix (reverts the change). I've yanked 1.1.0 now to prevent his from spreading.
(unless your issue is unrelated to xattr)
I've now submitted https://github.com/bytecodealliance/rustix/pull/971 with a fix for this.
#971 is now released in rustix 0.38.28.