2020-11-23 06:51:04 -06:00
|
|
|
error: a `const` item with interior mutability should not be borrowed
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/borrow_interior_mutable_const/enums.rs:22:14
|
2020-11-23 06:51:04 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = &UNFROZEN_VARIANT;
|
2020-11-23 06:51:04 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: assign this const to a local or static variable, and use the variable here
|
2023-07-02 07:35:19 -05:00
|
|
|
note: the lint level is defined here
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/borrow_interior_mutable_const/enums.rs:3:9
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | #![deny(clippy::borrow_interior_mutable_const)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-11-23 06:51:04 -06:00
|
|
|
|
|
|
|
error: a `const` item with interior mutability should not be borrowed
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/borrow_interior_mutable_const/enums.rs:37:18
|
2020-11-23 06:51:04 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = &Self::TO_BE_FROZEN_VARIANT;
|
2020-11-23 06:51:04 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: assign this const to a local or static variable, and use the variable here
|
|
|
|
|
|
|
|
error: a `const` item with interior mutability should not be borrowed
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/borrow_interior_mutable_const/enums.rs:41:18
|
2020-11-23 06:51:04 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = &Self::DEFAULTED_ON_FROZEN_VARIANT;
|
2020-11-23 06:51:04 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: assign this const to a local or static variable, and use the variable here
|
|
|
|
|
|
|
|
error: a `const` item with interior mutability should not be borrowed
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/borrow_interior_mutable_const/enums.rs:50:18
|
2020-11-23 06:51:04 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = &<Self as AssocConsts>::TO_BE_UNFROZEN_VARIANT;
|
2020-11-23 06:51:04 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: assign this const to a local or static variable, and use the variable here
|
|
|
|
|
|
|
|
error: a `const` item with interior mutability should not be borrowed
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/borrow_interior_mutable_const/enums.rs:52:18
|
2020-11-23 06:51:04 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = &Self::DEFAULTED_ON_UNFROZEN_VARIANT;
|
2020-11-23 06:51:04 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: assign this const to a local or static variable, and use the variable here
|
|
|
|
|
|
|
|
error: a `const` item with interior mutability should not be borrowed
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/borrow_interior_mutable_const/enums.rs:74:18
|
2020-11-23 06:51:04 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = &<Self as AssocTypes>::TO_BE_UNFROZEN_VARIANT;
|
2020-11-23 06:51:04 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: assign this const to a local or static variable, and use the variable here
|
|
|
|
|
|
|
|
error: a `const` item with interior mutability should not be borrowed
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/borrow_interior_mutable_const/enums.rs:91:18
|
2020-11-23 06:51:04 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = &Self::UNFROZEN_VARIANT;
|
2020-11-23 06:51:04 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: assign this const to a local or static variable, and use the variable here
|
|
|
|
|
|
|
|
error: a `const` item with interior mutability should not be borrowed
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/borrow_interior_mutable_const/enums.rs:92:18
|
2020-11-23 06:51:04 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = &Self::GENERIC_VARIANT;
|
2020-11-23 06:51:04 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: assign this const to a local or static variable, and use the variable here
|
|
|
|
|
|
|
|
error: a `const` item with interior mutability should not be borrowed
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/borrow_interior_mutable_const/enums.rs:99:14
|
2020-11-23 06:51:04 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = &helper::WRAPPED_PRIVATE_UNFROZEN_VARIANT;
|
2020-11-23 06:51:04 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: assign this const to a local or static variable, and use the variable here
|
|
|
|
|
|
|
|
error: aborting due to 9 previous errors
|
|
|
|
|