Skip to content

Commit ad5742e

Browse files
committed
Allow interior_mutable_consts in tests
1 parent 77a4c14 commit ad5742e

File tree

5 files changed

+5
-2
lines changed

5 files changed

+5
-2
lines changed

library/coretests/tests/cell.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ fn refcell_format() {
456456
}
457457

458458
#[allow(dead_code)]
459+
#[cfg_attr(not(bootstrap), allow(interior_mutable_consts))]
459460
fn const_cells() {
460461
const UNSAFE_CELL: UnsafeCell<i32> = UnsafeCell::new(3);
461462
const _: i32 = UNSAFE_CELL.into_inner();

library/std/src/collections/hash/map.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ use crate::ops::Index;
230230
/// Mutex::new(HashMap::with_hasher(BuildHasherDefault::new()));
231231
///
232232
/// // HashMaps using LazyLock to retain random seeding
233+
/// # #[cfg_attr(not(bootstrap), allow(interior_mutable_consts))]
233234
/// const RANDOM_EMPTY_MAP: LazyLock<HashMap<String, Vec<i32>>> =
234235
/// LazyLock::new(HashMap::new);
235236
/// static RANDOM_MAP: LazyLock<Mutex<HashMap<String, Vec<i32>>>> =

src/tools/clippy/tests/ui/borrow_interior_mutable_const.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
const_item_mutation,
88
unconditional_panic
99
)]
10-
10+
#![allow(interior_mutable_consts)]
1111
use core::cell::{Cell, UnsafeCell};
1212
use core::ops::{Deref, Index};
1313

src/tools/clippy/tests/ui/declare_interior_mutable_const.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![deny(clippy::declare_interior_mutable_const)]
22
#![allow(clippy::missing_const_for_thread_local)]
3-
3+
#![allow(interior_mutable_consts)]
44
use core::cell::{Cell, RefCell, UnsafeCell};
55
use core::mem::{ManuallyDrop, MaybeUninit};
66
use core::ptr;

tests/ui/consts/issue-17718.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@ run-pass
22
#![allow(dead_code)]
3+
#![allow(interior_mutable_consts)]
34
//@ aux-build:issue-17718-aux.rs
45

56
extern crate issue_17718_aux as other;

0 commit comments

Comments
 (0)