|
| 1 | +error[E0433]: failed to resolve: use of undeclared type `AtomicUsize` |
| 2 | + --> $DIR/const_refs_to_static-ice-121413.rs:8:24 |
| 3 | + | |
| 4 | +LL | static FOO: Sync = AtomicUsize::new(0); |
| 5 | + | ^^^^^^^^^^^ use of undeclared type `AtomicUsize` |
| 6 | + | |
| 7 | +help: consider importing this struct |
| 8 | + | |
| 9 | +LL + use std::sync::atomic::AtomicUsize; |
| 10 | + | |
| 11 | + |
| 12 | +warning: trait objects without an explicit `dyn` are deprecated |
| 13 | + --> $DIR/const_refs_to_static-ice-121413.rs:8:17 |
| 14 | + | |
| 15 | +LL | static FOO: Sync = AtomicUsize::new(0); |
| 16 | + | ^^^^ |
| 17 | + | |
| 18 | + = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! |
| 19 | + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> |
| 20 | + = note: `#[warn(bare_trait_objects)]` on by default |
| 21 | +help: if this is an object-safe trait, use `dyn` |
| 22 | + | |
| 23 | +LL | static FOO: dyn Sync = AtomicUsize::new(0); |
| 24 | + | +++ |
| 25 | + |
| 26 | +error[E0277]: the size for values of type `(dyn Sync + 'static)` cannot be known at compilation time |
| 27 | + --> $DIR/const_refs_to_static-ice-121413.rs:8:17 |
| 28 | + | |
| 29 | +LL | static FOO: Sync = AtomicUsize::new(0); |
| 30 | + | ^^^^ doesn't have a size known at compile-time |
| 31 | + | |
| 32 | + = help: the trait `Sized` is not implemented for `(dyn Sync + 'static)` |
| 33 | + |
| 34 | +error[E0277]: the size for values of type `(dyn Sync + 'static)` cannot be known at compilation time |
| 35 | + --> $DIR/const_refs_to_static-ice-121413.rs:8:24 |
| 36 | + | |
| 37 | +LL | static FOO: Sync = AtomicUsize::new(0); |
| 38 | + | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time |
| 39 | + | |
| 40 | + = help: the trait `Sized` is not implemented for `(dyn Sync + 'static)` |
| 41 | + = note: constant expressions must have a statically known size |
| 42 | + |
| 43 | +error: aborting due to 3 previous errors; 1 warning emitted |
| 44 | + |
| 45 | +Some errors have detailed explanations: E0277, E0433. |
| 46 | +For more information about an error, try `rustc --explain E0277`. |
0 commit comments