[Solved] Cannot find function utf8_char_width when building with xargo/steed


Trying to compile a program (that worked last week), it looks like a dependency is broken (fails to compile).

If the current tools are broken, can I roll back a version? If they’re not broken, what have I missed/done wrong? (followed from On Other Systems section from https://github.com/japaric/steed)

Many thanks,

Socrates:hello bRad$ xargo build --target armv7-unknown-linux-steedeabihf
   Compiling core v0.0.0 (file:///Users/bRad/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore)
   Compiling alloc v0.0.0 (file:///Users/bRad/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc)
   Compiling std_unicode v0.0.0 (file:///Users/bRad/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd_unicode)
   Compiling collections v0.0.0 (file:///Users/bRad/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcollections)
    Finished release [optimized] target(s) in 21.72 secs
   Compiling rand v0.0.0 (file:///Users/bRad/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/librand)
    Finished release [optimized] target(s) in 1.70 secs
    Updating git repository `https://github.com/japaric/steed`
    Updating git repository `https://github.com/rust-lang-nursery/compiler-builtins`
    Updating registry `https://github.com/rust-lang/crates.io-index`
    Updating git repository `https://github.com/redox-os/ralloc`
   Compiling sc v0.1.5
   Compiling rustc-cfg v0.3.0
   Compiling unborrow v0.3.1
   Compiling ralloc_shim v0.1.1 (https://github.com/redox-os/ralloc#e31a743e)
   Compiling ralloc v1.0.0 (https://github.com/redox-os/ralloc#e31a743e)
   Compiling compiler_builtins v0.1.0 (https://github.com/rust-lang-nursery/compiler-builtins#9681358d)
   Compiling std v0.1.0 (https://github.com/japaric/steed#d2ace31d)
error[E0425]: cannot find function `utf8_char_width` in module `core_str`
    --> /Users/bRad/.cargo/git/checkouts/steed-63ab0a422b3ba8a3/d2ace31/src/io/mod.rs:1666:21
1666 |         let width = core_str::utf8_char_width(first_byte);
     |                     ^^^^^^^^^^^^^^^^^^^^^^^^^ not found in `core_str`
     = help: possible candidate is found in another module, you can import it into scope:
               `use core::str::utf8_char_width;`

error: aborting due to previous error

error: Could not compile `std`.

To learn more, run the command again with --verbose.
error: `"cargo" "build" "--release" "--manifest-path" "/var/folders/4f/s_wvdrd15ljdywkl0tcp25r00000gp/T/xargo.nn3zhWmN4Wo3/Cargo.toml" "--target" "armv7-unknown-linux-steedeabihf" "-p" "std"` failed with exit code: Some(101)
note: run with `RUST_BACKTRACE=1` for a backtrace


steed/src/io/mod.rs hasn’t changed in the last month, so I suspect the breakage happened when you updated your nightly rustc. You can install old nightlies using rustup, see rustup help toolchain.


thank you–I’ll try rolling back.


https://github.com/japaric/steed/pull/119 should fix the issue once merged


@FenrirWolf I applied the changes from your PR to my local copy and all is well again. Thank you!