Skip to content

Commit 9234dd9

Browse files
committed
Allow interior_mutable_consts in tests
1 parent 56eff43 commit 9234dd9

File tree

5 files changed

+5
-2
lines changed

5 files changed

+5
-2
lines changed

library/coretests/tests/cell.rs

+1
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

+1
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/others.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![deny(clippy::borrow_interior_mutable_const)]
22
#![allow(clippy::declare_interior_mutable_const, clippy::needless_borrow)]
3-
#![allow(const_item_mutation)]
3+
#![allow(const_item_mutation, interior_mutable_consts)]
44

55
use std::borrow::Cow;
66
use std::cell::{Cell, UnsafeCell};

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::declare_interior_mutable_const)]
2-
2+
#![allow(interior_mutable_consts)]
33
use std::borrow::Cow;
44
use std::cell::Cell;
55
use std::fmt::Display;

tests/ui/consts/issue-17718.rs

+1
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)