ping-exporter icon indicating copy to clipboard operation
ping-exporter copied to clipboard

Build fails : use of unstable library feature 'ptr_cast'

Open arcenik opened this issue 4 years ago • 0 comments

Hi,

When building the current version using Docker it fails due to this error:

Step 1/9 : FROM ekidd/rust-musl-builder:1.36.0 as builder
 ---> 199e6dcf7c1c
...
Step 4/9 : RUN make
 ---> Running in 6c5eeea56895
cargo build -vv --release
...
   Compiling itoa v0.4.5
     Running `CARGO_PKG_VERSION_MINOR=4 CARGO_MANIFEST_DIR=/home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/itoa-0.4.5 CARGO_PKG_VERSION_PATCH=5 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_PRE= CARGO_PKG_VERSION=0.4.5 LD_LIBRARY_PATH
='/home/rust/src/target/release/deps:/home/rust/.rustup/toolchains/1.36.0-x86_64-unknown-linux-gnu/lib:/home/rust/.rustup/toolchains/1.36.0-x86_64-unknown-linux-gnu/lib' CARGO_PKG_DESCRIPTION='Fast functions for printing integer primitives to 
an io::Write' CARGO_PKG_HOMEPAGE= CARGO_PKG_NAME=itoa CARGO_PKG_AUTHORS='David Tolnay <[email protected]>' CARGO_PKG_REPOSITORY='https://github.com/dtolnay/itoa' CARGO=/home/rust/.rustup/toolchains/1.36.0-x86_64-unknown-linux-gnu/bin/cargo rus
tc --crate-name itoa /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/itoa-0.4.5/src/lib.rs --color never --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=89ec0
5bcb7a58bf5 -C extra-filename=-89ec05bcb7a58bf5 --out-dir /home/rust/src/target/x86_64-unknown-linux-musl/release/deps --target x86_64-unknown-linux-musl -L dependency=/home/rust/src/target/x86_64-unknown-linux-musl/release/deps -L dependency=
/home/rust/src/target/release/deps --cap-lints warn`
error[E0658]: use of unstable library feature 'ptr_cast'
  --> /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/object-0.19.0/src/pod.rs:35:30
   |
35 |     let val = unsafe { &*ptr.cast() };
   |                              ^^^^
   |
   = note: for more information, see https://github.com/rust-lang/rust/issues/60602

error[E0658]: use of unstable library feature 'ptr_cast'
  --> /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/object-0.19.0/src/pod.rs:53:52
   |
53 |     let slice = unsafe { slice::from_raw_parts(ptr.cast(), count) };
   |                                                    ^^^^
   |
   = note: for more information, see https://github.com/rust-lang/rust/issues/60602

error[E0658]: use of unstable library feature 'ptr_cast'
  --> /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/object-0.19.0/src/pod.rs:65:66
   |
65 |     unsafe { slice::from_raw_parts(slice::from_ref(val).as_ptr().cast(), size) }
   |                                                                  ^^^^
   |
   = note: for more information, see https://github.com/rust-lang/rust/issues/60602

Using the latest version of ekidd/rust-musl-builder (1.43.1) fixes the issue.

The complete build log for both versions: build-1.36.0.log build-1.43.1.log

arcenik avatar May 23 '20 12:05 arcenik