error[E0412]: cannot find type `FromBytesUntilNulError` in module `std::ffi`
yurivict opened this issue · comments
yuri@FreeBSD commented
error[E0412]: cannot find type `FromBytesUntilNulError` in module `std::ffi`
--> src/util.rs:358:66
|
358 | pub fn i8_to_cstr(x: &[i8]) -> Result<&std::ffi::CStr, std::ffi::FromBytesUntilNulError> {
| ^^^^^^^^^^^^^^^^^^^^^^
--> /wrkdirs/usr/ports/lang/rust/work/rustc-1.72.0-src/library/core/src/ffi/c_str.rs:116:1
|
= note: similarly named struct `FromBytesWithNulError` defined here
|
help: a struct with a similar name exists
|
358 | pub fn i8_to_cstr(x: &[i8]) -> Result<&std::ffi::CStr, std::ffi::FromBytesWithNulError> {
| ~~~~~~~~~~~~~~~~~~~~~
help: consider importing this struct
|
1 + use core::ffi::FromBytesUntilNulError;
|
help: if you import `FromBytesUntilNulError`, refer to it directly
|
358 - pub fn i8_to_cstr(x: &[i8]) -> Result<&std::ffi::CStr, std::ffi::FromBytesUntilNulError> {
358 + pub fn i8_to_cstr(x: &[i8]) -> Result<&std::ffi::CStr, FromBytesUntilNulError> {
|
For more information about this error, try `rustc --explain E0412`.
error: could not compile `procs` (bin "procs") due to previous error
Version: 0.14.3
rust-1.72.0
FreeBSD 13.2
Naoya Hatta commented
std::ffi::FromBytesUntilNulError
seems to be missing at Rust 1.72.0.
rust-lang/rust#113701
Could you update to Rust 1.73.0?
yuri@FreeBSD commented
It builds with Rust 1.73.0, thanks!
Trevor Gross commented
Maybe rust-version
in Cargo.toml should be updated?
Naoya Hatta commented
If rust-version
is updated, all platforms are affected.
I think this is too much restriction.
I changed std::ffi::FromBytesUntilNulError
to core::ffi::FromBytesUntilNulError
.
By this changing, Rust 1.69.0 can be used.