]> git.lizzy.rs Git - rust.git/blob - tests/ui/sync/suggest-once-cell.stderr
Rollup merge of #106625 - Swatinem:ref/cov6, r=nagisa
[rust.git] / tests / ui / sync / suggest-once-cell.stderr
1 error[E0277]: `OnceCell<()>` cannot be shared between threads safely
2   --> $DIR/suggest-once-cell.rs:8:20
3    |
4 LL |     require_sync::<std::cell::OnceCell<()>>();
5    |                    ^^^^^^^^^^^^^^^^^^^^^^^ `OnceCell<()>` cannot be shared between threads safely
6    |
7    = help: the trait `Sync` is not implemented for `OnceCell<()>`
8    = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::OnceLock` instead
9 note: required by a bound in `require_sync`
10   --> $DIR/suggest-once-cell.rs:3:20
11    |
12 LL | fn require_sync<T: Sync>() {}
13    |                    ^^^^ required by this bound in `require_sync`
14
15 error: aborting due to previous error
16
17 For more information about this error, try `rustc --explain E0277`.