dalance / procs

A modern replacement for ps written in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error[E0412]: cannot find type `FromBytesUntilNulError` in module `std::ffi`

yurivict opened this issue · comments

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

std::ffi::FromBytesUntilNulError seems to be missing at Rust 1.72.0.
rust-lang/rust#113701

Could you update to Rust 1.73.0?

It builds with Rust 1.73.0, thanks!

Maybe rust-version in Cargo.toml should be updated?

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.