Skip to content

Commit 66b0c23

Browse files
committed
change diag references from once_cell crate to LazyLock
1 parent bf11b8b commit 66b0c23

File tree

2 files changed

+3
-7
lines changed
  • compiler

2 files changed

+3
-7
lines changed

compiler/rustc_const_eval/src/transform/check_consts/ops.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ impl<'tcx> NonConstOp<'tcx> for FnCallNonConst<'tcx> {
303303
}
304304

305305
if let ConstContext::Static(_) = ccx.const_kind() {
306-
err.note("consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell");
306+
err.note("consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`");
307307
}
308308

309309
err

compiler/rustc_lint_defs/src/builtin.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -1265,9 +1265,7 @@ declare_lint! {
12651265
/// * If the value can be computed at compile-time, consider using
12661266
/// const-compatible values (see [Constant Evaluation]).
12671267
/// * For more complex single-initialization cases, consider using a
1268-
/// third-party crate, such as [`lazy_static`] or [`once_cell`].
1269-
/// * If you are using the [nightly channel], consider the new
1270-
/// [`lazy`] module in the standard library.
1268+
/// [`std::sync::LazyLock`].
12711269
/// * If you truly need a mutable global, consider using a [`static`],
12721270
/// which has a variety of options:
12731271
/// * Simple data types can be directly defined and mutated with an
@@ -1282,9 +1280,7 @@ declare_lint! {
12821280
/// [Constant Evaluation]: https://doc.rust-lang.org/reference/const_eval.html
12831281
/// [`static`]: https://doc.rust-lang.org/reference/items/static-items.html
12841282
/// [mutable `static`]: https://doc.rust-lang.org/reference/items/static-items.html#mutable-statics
1285-
/// [`lazy`]: https://doc.rust-lang.org/nightly/std/lazy/index.html
1286-
/// [`lazy_static`]: https://crates.io/crates/lazy_static
1287-
/// [`once_cell`]: https://crates.io/crates/once_cell
1283+
/// [`std::sync::LazyLock`]: https://doc.rust-lang.org/stable/std/sync/struct.LazyLock.html
12881284
/// [`atomic`]: https://doc.rust-lang.org/std/sync/atomic/index.html
12891285
/// [`Mutex`]: https://doc.rust-lang.org/std/sync/struct.Mutex.html
12901286
pub CONST_ITEM_MUTATION,

0 commit comments

Comments
 (0)