|
1 | | -error: a `const` item should never be interior mutable |
| 1 | +error: a `const` item should not be interior mutable |
2 | 2 | --> tests/ui/declare_interior_mutable_const/enums.rs:12:1 |
3 | 3 | | |
4 | 4 | LL | const UNFROZEN_VARIANT: OptionalCell = OptionalCell::Unfrozen(Cell::new(true)); |
5 | | - | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
6 | | - | | |
7 | | - | make this a static item (maybe with lazy_static) |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
8 | 6 | | |
| 7 | + = help: consider making this `Sync` so that it can go in a static item or using a `thread_local` |
9 | 8 | = note: `-D clippy::declare-interior-mutable-const` implied by `-D warnings` |
10 | 9 | = help: to override `-D warnings` add `#[allow(clippy::declare_interior_mutable_const)]` |
11 | 10 |
|
12 | | -error: a `const` item should never be interior mutable |
| 11 | +error: a `const` item should not be interior mutable |
13 | 12 | --> tests/ui/declare_interior_mutable_const/enums.rs:23:1 |
14 | 13 | | |
15 | 14 | LL | const UNFROZEN_VARIANT_FROM_FN: OptionalCell = unfrozen_variant(); |
16 | | - | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
17 | | - | | |
18 | | - | make this a static item (maybe with lazy_static) |
| 15 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 16 | + | |
| 17 | + = help: consider making this `Sync` so that it can go in a static item or using a `thread_local` |
19 | 18 |
|
20 | | -error: a `const` item should never be interior mutable |
| 19 | +error: a `const` item should not be interior mutable |
21 | 20 | --> tests/ui/declare_interior_mutable_const/enums.rs:45:1 |
22 | 21 | | |
23 | | -LL | const NESTED_UNFROZEN_VARIANT: NestedOutermost = NestedOutermost { |
24 | | - | ^---- |
25 | | - | | |
26 | | - | _make this a static item (maybe with lazy_static) |
27 | | - | | |
| 22 | +LL | / const NESTED_UNFROZEN_VARIANT: NestedOutermost = NestedOutermost { |
28 | 23 | LL | | |
29 | 24 | LL | | outer: NestedOuter::NestedInner(NestedInner { |
30 | 25 | LL | | inner: NestedInnermost::Unfrozen(AtomicUsize::new(2)), |
31 | 26 | LL | | }), |
32 | 27 | LL | | }; |
33 | 28 | | |__^ |
| 29 | + | |
| 30 | + = help: consider making this a static item |
34 | 31 |
|
35 | | -error: a `const` item should never be interior mutable |
| 32 | +error: a `const` item should not be interior mutable |
36 | 33 | --> tests/ui/declare_interior_mutable_const/enums.rs:60:5 |
37 | 34 | | |
38 | 35 | LL | const TO_BE_UNFROZEN_VARIANT: OptionalCell; |
39 | 36 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
40 | 37 |
|
41 | | -error: a `const` item should never be interior mutable |
| 38 | +error: a `const` item should not be interior mutable |
42 | 39 | --> tests/ui/declare_interior_mutable_const/enums.rs:61:5 |
43 | 40 | | |
44 | 41 | LL | const TO_BE_FROZEN_VARIANT: OptionalCell; |
45 | 42 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
46 | 43 |
|
47 | | -error: a `const` item should never be interior mutable |
| 44 | +error: a `const` item should not be interior mutable |
48 | 45 | --> tests/ui/declare_interior_mutable_const/enums.rs:64:5 |
49 | 46 | | |
50 | 47 | LL | const DEFAULTED_ON_UNFROZEN_VARIANT: OptionalCell = OptionalCell::Unfrozen(Cell::new(false)); |
51 | 48 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
52 | 49 |
|
53 | | -error: a `const` item should never be interior mutable |
| 50 | +error: a `const` item should not be interior mutable |
54 | 51 | --> tests/ui/declare_interior_mutable_const/enums.rs:90:5 |
55 | 52 | | |
56 | 53 | LL | const TO_BE_UNFROZEN_VARIANT: Option<Self::ToBeUnfrozen> = Some(Self::ToBeUnfrozen::new(4)); |
57 | 54 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
58 | 55 |
|
59 | | -error: a `const` item should never be interior mutable |
| 56 | +error: a `const` item should not be interior mutable |
60 | 57 | --> tests/ui/declare_interior_mutable_const/enums.rs:102:5 |
61 | 58 | | |
62 | 59 | LL | const UNFROZEN_VARIANT: BothOfCellAndGeneric<T> = BothOfCellAndGeneric::Unfrozen(Cell::new(std::ptr::null())); |
63 | 60 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
64 | 61 |
|
65 | | -error: a `const` item should never be interior mutable |
| 62 | +error: a `const` item should not be interior mutable |
66 | 63 | --> tests/ui/declare_interior_mutable_const/enums.rs:105:5 |
67 | 64 | | |
68 | 65 | LL | const GENERIC_VARIANT: BothOfCellAndGeneric<T> = BothOfCellAndGeneric::Generic(std::ptr::null()); |
69 | 66 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
70 | 67 |
|
71 | | -error: a `const` item should never be interior mutable |
| 68 | +error: a `const` item should not be interior mutable |
72 | 69 | --> tests/ui/declare_interior_mutable_const/enums.rs:111:5 |
73 | 70 | | |
74 | 71 | LL | const NO_ENUM: Cell<*const T> = Cell::new(std::ptr::null()); |
75 | 72 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
76 | 73 |
|
77 | | -error: a `const` item should never be interior mutable |
| 74 | +error: a `const` item should not be interior mutable |
78 | 75 | --> tests/ui/declare_interior_mutable_const/enums.rs:118:5 |
79 | 76 | | |
80 | 77 | LL | / const UNFROZEN_VARIANT: BothOfCellAndGeneric<Self::AssocType> = |
81 | 78 | LL | | BothOfCellAndGeneric::Unfrozen(Cell::new(std::ptr::null())); |
82 | 79 | | |____________________________________________________________________^ |
83 | 80 |
|
84 | | -error: a `const` item should never be interior mutable |
| 81 | +error: a `const` item should not be interior mutable |
85 | 82 | --> tests/ui/declare_interior_mutable_const/enums.rs:120:5 |
86 | 83 | | |
87 | 84 | LL | const GENERIC_VARIANT: BothOfCellAndGeneric<Self::AssocType> = BothOfCellAndGeneric::Generic(std::ptr::null()); |
|
0 commit comments