]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrow_interior_mutable_const/enums.stderr
Auto merge of #6304 - matthiaskrgr:crash_6302, r=llogiq
[rust.git] / tests / ui / borrow_interior_mutable_const / enums.stderr
1 error: a `const` item with interior mutability should not be borrowed
2   --> $DIR/enums.rs:22:14
3    |
4 LL |     let _ = &UNFROZEN_VARIANT; //~ ERROR interior mutability
5    |              ^^^^^^^^^^^^^^^^
6    |
7    = note: `-D clippy::borrow-interior-mutable-const` implied by `-D warnings`
8    = help: assign this const to a local or static variable, and use the variable here
9
10 error: a `const` item with interior mutability should not be borrowed
11   --> $DIR/enums.rs:37:18
12    |
13 LL |         let _ = &Self::TO_BE_FROZEN_VARIANT; //~ ERROR interior mutable
14    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
15    |
16    = help: assign this const to a local or static variable, and use the variable here
17
18 error: a `const` item with interior mutability should not be borrowed
19   --> $DIR/enums.rs:41:18
20    |
21 LL |         let _ = &Self::DEFAULTED_ON_FROZEN_VARIANT; //~ ERROR interior mutable
22    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23    |
24    = help: assign this const to a local or static variable, and use the variable here
25
26 error: a `const` item with interior mutability should not be borrowed
27   --> $DIR/enums.rs:50:18
28    |
29 LL |         let _ = &<Self as AssocConsts>::TO_BE_UNFROZEN_VARIANT; //~ ERROR interior mutable
30    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
31    |
32    = help: assign this const to a local or static variable, and use the variable here
33
34 error: a `const` item with interior mutability should not be borrowed
35   --> $DIR/enums.rs:52:18
36    |
37 LL |         let _ = &Self::DEFAULTED_ON_UNFROZEN_VARIANT; //~ ERROR interior mutable
38    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39    |
40    = help: assign this const to a local or static variable, and use the variable here
41
42 error: a `const` item with interior mutability should not be borrowed
43   --> $DIR/enums.rs:74:18
44    |
45 LL |         let _ = &<Self as AssocTypes>::TO_BE_UNFROZEN_VARIANT; //~ ERROR interior mutable
46    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
47    |
48    = help: assign this const to a local or static variable, and use the variable here
49
50 error: a `const` item with interior mutability should not be borrowed
51   --> $DIR/enums.rs:91:18
52    |
53 LL |         let _ = &Self::UNFROZEN_VARIANT; //~ ERROR interior mutability
54    |                  ^^^^^^^^^^^^^^^^^^^^^^
55    |
56    = help: assign this const to a local or static variable, and use the variable here
57
58 error: a `const` item with interior mutability should not be borrowed
59   --> $DIR/enums.rs:92:18
60    |
61 LL |         let _ = &Self::GENERIC_VARIANT; //~ ERROR interior mutability
62    |                  ^^^^^^^^^^^^^^^^^^^^^
63    |
64    = help: assign this const to a local or static variable, and use the variable here
65
66 error: a `const` item with interior mutability should not be borrowed
67   --> $DIR/enums.rs:99:14
68    |
69 LL |     let _ = &helper::WRAPPED_PRIVATE_UNFROZEN_VARIANT; //~ ERROR interior mutability
70    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
71    |
72    = help: assign this const to a local or static variable, and use the variable here
73
74 error: aborting due to 9 previous errors
75