m-c fails to build with nightly Rust: "error: use of deprecated item 'std::sync::atomic::ATOMIC_USIZE_INIT': the `new` function is now preferred"
Categories
(Testing :: geckodriver, defect, P1)
Tracking
(firefox67 fixed)
Tracking | Status | |
---|---|---|
firefox67 | --- | fixed |
People
(Reporter: botond, Assigned: ato)
References
Details
Attachments
(2 files)
I'm trying to build mozilla-central with nightly Rust, and I'm getting the following errors:
3:45.60 error: use of deprecated item 'std::sync::atomic::ATOMIC_USIZE_INIT': the `new` function is now preferred
3:45.60 --> testing/geckodriver/src/logging.rs:34:48
3:45.60 |
3:45.60 34 | use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
3:45.60 | ^^^^^^^^^^^^^^^^^
3:45.60 |
3:45.60 = note: `-D deprecated` implied by `-D warnings`
3:45.60 error: use of deprecated item 'std::sync::atomic::ATOMIC_USIZE_INIT': the `new` function is now preferred
3:45.60 --> testing/geckodriver/src/logging.rs:40:37
3:45.60 |
3:45.60 40 | static MAX_LOG_LEVEL: AtomicUsize = ATOMIC_USIZE_INIT;
3:45.60 | ^^^^^^^^^^^^^^^^^
3:45.60 error: aborting due to 2 previous errors
3:45.64 error: Could not compile `geckodriver`.
Later there is also:
4:15.72 error: use of deprecated item 'std::error::Error::cause': replaced by Error::source, which can support downcasting
4:15.72 --> media/audioipc/audioipc/src/errors.rs:10:1
4:15.72 |
4:15.72 10 | / error_chain! {
4:15.72 11 | | // Maybe replace with chain_err to improve the error info.
4:15.72 12 | | foreign_links {
4:15.72 13 | | Bincode(bincode::Error);
4:15.72 ... |
4:15.72 21 | | }
4:15.72 22 | | }
4:15.72 | |_^
4:15.72 |
4:15.72 = note: `-D deprecated` implied by `-D warnings`
4:15.72 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
4:15.72 error: use of deprecated item 'std::error::Error::cause': replaced by Error::source, which can support downcasting
4:15.72 --> media/audioipc/audioipc/src/errors.rs:10:1
4:15.72 |
4:15.72 10 | / error_chain! {
4:15.72 11 | | // Maybe replace with chain_err to improve the error info.
4:15.72 12 | | foreign_links {
4:15.72 13 | | Bincode(bincode::Error);
4:15.72 ... |
4:15.72 21 | | }
4:15.72 22 | | }
4:15.72 | |_^
4:15.72 |
4:15.72 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
4:15.72 error: aborting due to 2 previous errors
Comment 1•6 years ago
|
||
(In reply to Botond Ballo [:botond] from comment #0)
Later there is also:
4:15.72 error: use of deprecated item 'std::error::Error::cause': replaced by Error::source, which can support downcasting 4:15.72 --> media/audioipc/audioipc/src/errors.rs:10:1
This is unrelated to geckodriver and should be filed under the media component.
In regards of the geckodriver problem it would be nice to see when this will reach Rust stable, but I think it would be good to have it fixed for the 0.25.0 release.
Reporter | ||
Comment 2•6 years ago
|
||
(In reply to Henrik Skupin (:whimboo) [⌚️UTC+1] from comment #1)
This is unrelated to geckodriver and should be filed under the media component.
Good point, filed bug 1524818.
Assignee | ||
Comment 3•6 years ago
|
||
Thanks for reporting this! It’s an easy fix.
Assignee | ||
Comment 4•6 years ago
|
||
Explicit const static lifetime definitions are not required and
makes for complicated types. This patch simplifies the const assignemnt.
Depends on D18680
Assignee | ||
Comment 5•6 years ago
|
||
ATOMIC_USIZE_INIT is deprecated and removed in Rust nightly (1.34.0).
The replacement is AtomicUsize::new(), which takes a usize argument.
The default argument of ATOMIC_USIZE_INIT was 0, so we'll use that.
Setting MAX_LOG_LEVEL to 0 effectively disables all logging
until logging::init() or ::init_with_level() is called, setting
MAX_LOG_LEVEL to the appropriate logging::Level value.
Comment 7•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/ceb9fac8ba25
https://hg.mozilla.org/mozilla-central/rev/9dc660f5c8b7
Description
•