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() {
456456}
457457
458458#[ allow( dead_code) ]
459+ #[ cfg_attr( not( bootstrap) , allow( interior_mutable_consts) ) ]
459460fn const_cells ( ) {
460461 const UNSAFE_CELL : UnsafeCell < i32 > = UnsafeCell :: new ( 3 ) ;
461462 const _: i32 = UNSAFE_CELL . into_inner ( ) ;
Original file line number Diff line number Diff 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>>>> =
Original file line number Diff line number Diff line change 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
55use std:: borrow:: Cow ;
66use std:: cell:: { Cell , UnsafeCell } ;
Original file line number Diff line number Diff line change 11#![ warn( clippy:: declare_interior_mutable_const) ]
2-
2+ #! [ allow ( interior_mutable_consts ) ]
33use std:: borrow:: Cow ;
44use std:: cell:: Cell ;
55use std:: fmt:: Display ;
Original file line number Diff line number Diff line change 11//@ run-pass
22#![ allow( dead_code) ]
3+ #![ allow( interior_mutable_consts) ]
34//@ aux-build:issue-17718-aux.rs
45
56extern crate issue_17718_aux as other;
You can’t perform that action at this time.
0 commit comments