ibm-s390-linux / s390-tools

Tools for use with the s390 Linux kernel and device drivers
MIT License
62 stars 58 forks source link

warnings with rust 1.74+ #162

Closed sharkcz closed 5 months ago

sharkcz commented 6 months ago

I am seeing a warnig in the rust code when build with rust 1.74 or newer (1.75)

...
   Compiling pv v0.9.0 (/builddir/build/BUILD/s390-tools-2.30.0/rust/pv)
     Running `/usr/bin/rustc --crate-name pv --edition=2021 pv/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C linker-plugin-lto --cfg 'feature="default"' --cfg 'feature="request"' --cfg 'feature="uvsecret"' -C metadata=35a38c75c9cde075 -C extra-filename=-35a38c75c9cde075 --out-dir /builddir/build/BUILD/s390-tools-2.30.0/rust/target/release/deps -L dependency=/builddir/build/BUILD/s390-tools-2.30.0/rust/target/release/deps --extern byteorder=/builddir/build/BUILD/s390-tools-2.30.0/rust/target/release/deps/libbyteorder-ad2cfee83e136175.rmeta --extern cfg_if=/builddir/build/BUILD/s390-tools-2.30.0/rust/target/release/deps/libcfg_if-13471cd88a311e2f.rmeta --extern clap=/builddir/build/BUILD/s390-tools-2.30.0/rust/target/release/deps/libclap-66bb06e2d53e6023.rmeta --extern curl=/builddir/build/BUILD/s390-tools-2.30.0/rust/target/release/deps/libcurl-228018dd53620a11.rmeta --extern libc=/builddir/build/BUILD/s390-tools-2.30.0/rust/target/release/deps/liblibc-d3df99de539bfe2f.rmeta --extern log=/builddir/build/BUILD/s390-tools-2.30.0/rust/target/release/deps/liblog-918eee9aec1ac4fc.rmeta --extern openssl=/builddir/build/BUILD/s390-tools-2.30.0/rust/target/release/deps/libopenssl-1b5d43345480177f.rmeta --extern openssl_extensions=/builddir/build/BUILD/s390-tools-2.30.0/rust/target/release/deps/libopenssl_extensions-066c23ac8e47ccde.rmeta --extern serde=/builddir/build/BUILD/s390-tools-2.30.0/rust/target/release/deps/libserde-bce325e4421b8e5c.rmeta --extern thiserror=/builddir/build/BUILD/s390-tools-2.30.0/rust/target/release/deps/libthiserror-5c0a5cd94050c451.rmeta --extern zerocopy=/builddir/build/BUILD/s390-tools-2.30.0/rust/target/release/deps/libzerocopy-bf9689a4eb01d1e4.rmeta -Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Clink-arg=-Wl,-z,relro -Clink-arg=-Wl,-z,now -Clink-arg=-specs=/usr/lib/rpm/redhat/redhat-package-notes --cap-lints=warn -L native=/usr/lib64`
warning: `&` without an explicit lifetime name cannot be used here
   --> pv/src/error.rs:101:20
    |
101 |     pub const CRL: &str = "CRL";
    |                    ^
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #115010 <https://github.com/rust-lang/rust/issues/115010>
    = note: `#[warn(elided_lifetimes_in_associated_constant)]` on by default
help: use the `'static` lifetime
    |
101 |     pub const CRL: &'static str = "CRL";
    |                     +++++++
warning: `&` without an explicit lifetime name cannot be used here
   --> pv/src/error.rs:102:21
    |
102 |     pub const CERT: &str = "certificate";
    |                     ^
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #115010 <https://github.com/rust-lang/rust/issues/115010>
help: use the `'static` lifetime
    |
102 |     pub const CERT: &'static str = "certificate";
    |                      +++++++
warning: `pv` (lib) generated 2 warnings (run `cargo fix --lib -p pv` to apply 2 suggestions)
...
steffen-eiden commented 6 months ago

Thanks for the report. I am already aware of it and will provide a fix soon.