]> git.lizzy.rs Git - rust.git/blob - tests/ui/declare_interior_mutable_const/enums.stderr
Auto merge of #6304 - matthiaskrgr:crash_6302, r=llogiq
[rust.git] / tests / ui / declare_interior_mutable_const / enums.stderr
1 error: a `const` item should never be interior mutable
2   --> $DIR/enums.rs:12:1
3    |
4 LL | const UNFROZEN_VARIANT: OptionalCell = OptionalCell::Unfrozen(Cell::new(true)); //~ ERROR interior mutable
5    | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6    | |
7    | make this a static item (maybe with lazy_static)
8    |
9    = note: `-D clippy::declare-interior-mutable-const` implied by `-D warnings`
10
11 error: a `const` item should never be interior mutable
12   --> $DIR/enums.rs:23:1
13    |
14 LL | const UNFROZEN_VARIANT_FROM_FN: OptionalCell = unfrozen_variant(); //~ ERROR interior mutable
15    | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16    | |
17    | make this a static item (maybe with lazy_static)
18
19 error: a `const` item should never be interior mutable
20   --> $DIR/enums.rs:45:1
21    |
22 LL |   const NESTED_UNFROZEN_VARIANT: NestedOutermost = NestedOutermost {
23    |   ^----
24    |   |
25    |  _make this a static item (maybe with lazy_static)
26    | |
27 LL | |     outer: NestedOuter::NestedInner(NestedInner {
28 LL | |         inner: NestedInnermost::Unfrozen(AtomicUsize::new(2)),
29 LL | |     }),
30 LL | | }; //~ ERROR interior mutable
31    | |__^
32
33 error: a `const` item should never be interior mutable
34   --> $DIR/enums.rs:59:5
35    |
36 LL |     const TO_BE_UNFROZEN_VARIANT: OptionalCell; //~ ERROR interior mutable
37    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38
39 error: a `const` item should never be interior mutable
40   --> $DIR/enums.rs:60:5
41    |
42 LL |     const TO_BE_FROZEN_VARIANT: OptionalCell; //~ ERROR interior mutable
43    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44
45 error: a `const` item should never be interior mutable
46   --> $DIR/enums.rs:63:5
47    |
48 LL |     const DEFAULTED_ON_UNFROZEN_VARIANT: OptionalCell = OptionalCell::Unfrozen(Cell::new(false)); //~ ERROR interior mutable
49    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
50
51 error: a `const` item should never be interior mutable
52   --> $DIR/enums.rs:89:5
53    |
54 LL |     const TO_BE_UNFROZEN_VARIANT: Option<Self::ToBeUnfrozen> = Some(Self::ToBeUnfrozen::new(4)); //~ ERROR interior mutable
55    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
56
57 error: a `const` item should never be interior mutable
58   --> $DIR/enums.rs:101:5
59    |
60 LL |     const UNFROZEN_VARIANT: BothOfCellAndGeneric<T> = BothOfCellAndGeneric::Unfrozen(Cell::new(std::ptr::null())); //~ ERROR interior mut...
61    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
62
63 error: a `const` item should never be interior mutable
64   --> $DIR/enums.rs:104:5
65    |
66 LL |     const GENERIC_VARIANT: BothOfCellAndGeneric<T> = BothOfCellAndGeneric::Generic(std::ptr::null()); //~ ERROR interior mutable
67    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
68
69 error: a `const` item should never be interior mutable
70   --> $DIR/enums.rs:110:5
71    |
72 LL |     const NO_ENUM: Cell<*const T> = Cell::new(std::ptr::null()); //~ ERROR interior mutable
73    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
74
75 error: a `const` item should never be interior mutable
76   --> $DIR/enums.rs:117:5
77    |
78 LL | /     const UNFROZEN_VARIANT: BothOfCellAndGeneric<Self::AssocType> =
79 LL | |         BothOfCellAndGeneric::Unfrozen(Cell::new(std::ptr::null())); //~ ERROR interior mutable
80    | |____________________________________________________________________^
81
82 error: a `const` item should never be interior mutable
83   --> $DIR/enums.rs:119:5
84    |
85 LL |     const GENERIC_VARIANT: BothOfCellAndGeneric<Self::AssocType> = BothOfCellAndGeneric::Generic(std::ptr::null()); //~ ERROR interior mu...
86    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
87
88 error: aborting due to 12 previous errors
89