2020-01-26 21:14:11 -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/traits.rs:15:18
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = &Self::ATOMIC;
|
2020-11-23 06:51:04 -06:00
|
|
|
| ^^^^^^^^^^^^
|
2020-09-24 07:49:22 -05: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/traits.rs:1:9
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | #![deny(clippy::borrow_interior_mutable_const)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-09-24 07:49:22 -05: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/traits.rs:26:18
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = &Self::ATOMIC;
|
2020-11-23 06:51:04 -06:00
|
|
|
| ^^^^^^^^^^^^
|
2020-01-26 21:14:11 -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/traits.rs:51:18
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = &Self::TO_BE_CONCRETE;
|
2020-11-23 06:51:04 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
2020-01-26 21:14:11 -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/traits.rs:86:18
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = &Self::TO_BE_UNFROZEN;
|
2020-11-23 06:51:04 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
2020-01-26 21:14:11 -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/traits.rs:87:18
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = &Self::WRAPPED_TO_BE_UNFROZEN;
|
2020-11-23 06:51:04 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-01-26 21:14:11 -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/traits.rs:109:18
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = &Self::BOUNDED;
|
2020-11-23 06:51:04 -06:00
|
|
|
| ^^^^^^^^^^^^^
|
2020-01-26 21:14:11 -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/traits.rs:122:18
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = &Self::BOUNDED;
|
2020-11-23 06:51:04 -06:00
|
|
|
| ^^^^^^^^^^^^^
|
2020-01-26 21:14:11 -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/traits.rs:151:18
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = &Self::SELF;
|
2020-11-23 06:51:04 -06:00
|
|
|
| ^^^^^^^^^^
|
2020-01-26 21:14:11 -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/traits.rs:152:18
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = &Self::WRAPPED_SELF;
|
2020-11-23 06:51:04 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
|
|
|
= help: assign this const to a local or static variable, and use the variable here
|
|
|
|
|
2024-05-02 10:26:44 -05:00
|
|
|
error: a `const` item with interior mutability should not be borrowed
|
|
|
|
--> tests/ui/borrow_interior_mutable_const/traits.rs:161:18
|
|
|
|
|
|
|
|
|
LL | let _ = &Self::DIRECT;
|
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: assign this const to a local or static variable, and use the variable here
|
|
|
|
|
2020-01-26 21:14:11 -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/traits.rs:162:18
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = &Self::INDIRECT;
|
2020-11-23 06:51:04 -06:00
|
|
|
| ^^^^^^^^^^^^^^
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
|
|
|
= help: assign this const to a local or static variable, and use the variable here
|
|
|
|
|
2024-05-02 10:26:44 -05:00
|
|
|
error: a `const` item with interior mutability should not be borrowed
|
|
|
|
--> tests/ui/borrow_interior_mutable_const/traits.rs:171:18
|
|
|
|
|
|
|
|
|
LL | let _ = &Self::DIRECT;
|
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: assign this const to a local or static variable, and use the variable here
|
|
|
|
|
2020-01-26 21:14:11 -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/traits.rs:172:18
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = &Self::INDIRECT;
|
2020-11-23 06:51:04 -06:00
|
|
|
| ^^^^^^^^^^^^^^
|
2020-01-26 21:14:11 -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/traits.rs:191:18
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = &Self::ATOMIC;
|
2020-11-23 06:51:04 -06:00
|
|
|
| ^^^^^^^^^^^^
|
2020-01-26 21:14:11 -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/traits.rs:195:18
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = &Self::BOUNDED_ASSOC_TYPE;
|
2020-11-23 06:51:04 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-01-26 21:14:11 -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/traits.rs:200:5
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | u64::ATOMIC.store(5, Ordering::SeqCst);
|
2020-01-26 21:14:11 -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/traits.rs:201:16
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | assert_eq!(u64::ATOMIC.load(Ordering::SeqCst), 9);
|
2020-01-26 21:14:11 -06:00
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: assign this const to a local or static variable, and use the variable here
|
|
|
|
|
2024-05-02 10:26:44 -05:00
|
|
|
error: aborting due to 17 previous errors
|
2020-01-26 21:14:11 -06:00
|
|
|
|