File tree Expand file tree Collapse file tree 5 files changed +5
-2
lines changed
src/tools/clippy/tests/ui
borrow_interior_mutable_const
declare_interior_mutable_const Expand file tree Collapse file tree 5 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -456,6 +456,7 @@ fn refcell_format() {
456
456
}
457
457
458
458
#[allow(dead_code)]
459
+ #[cfg_attr(not(bootstrap), allow(interior_mutable_consts))]
459
460
fn const_cells() {
460
461
const UNSAFE_CELL: UnsafeCell<i32> = UnsafeCell::new(3);
461
462
const _: i32 = UNSAFE_CELL.into_inner();
Original file line number Diff line number Diff line change @@ -230,6 +230,7 @@ use crate::ops::Index;
230
230
/// Mutex::new(HashMap::with_hasher(BuildHasherDefault::new()));
231
231
///
232
232
/// // HashMaps using LazyLock to retain random seeding
233
+ /// # #[cfg_attr(not(bootstrap), allow(interior_mutable_consts))]
233
234
/// const RANDOM_EMPTY_MAP: LazyLock<HashMap<String, Vec<i32>>> =
234
235
/// LazyLock::new(HashMap::new);
235
236
/// static RANDOM_MAP: LazyLock<Mutex<HashMap<String, Vec<i32>>>> =
Original file line number Diff line number Diff line change 1
1
#![deny(clippy::borrow_interior_mutable_const)]
2
2
#![allow(clippy::declare_interior_mutable_const, clippy::needless_borrow)]
3
- #![allow(const_item_mutation)]
3
+ #![allow(const_item_mutation, interior_mutable_consts )]
4
4
5
5
use std::borrow::Cow;
6
6
use std::cell::{Cell, UnsafeCell};
Original file line number Diff line number Diff line change 1
1
#![warn(clippy::declare_interior_mutable_const)]
2
-
2
+ #![allow(interior_mutable_consts)]
3
3
use std::borrow::Cow;
4
4
use std::cell::Cell;
5
5
use std::fmt::Display;
Original file line number Diff line number Diff line change 1
1
//@ run-pass
2
2
#![allow(dead_code)]
3
+ #![allow(interior_mutable_consts)]
3
4
//@ aux-build:issue-17718-aux.rs
4
5
5
6
extern crate issue_17718_aux as other;
You can’t perform that action at this time.
0 commit comments