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/others.rs:54:5
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | ATOMIC.store(1, 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
|
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/others.rs:1:9
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | #![deny(clippy::borrow_interior_mutable_const)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
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/others.rs:55:16
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | assert_eq!(ATOMIC.load(Ordering::SeqCst), 5);
|
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/others.rs:58:22
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _once_ref = &ONCE_INIT;
|
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/others.rs:59:25
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _once_ref_2 = &&ONCE_INIT;
|
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/others.rs:60:27
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _once_ref_4 = &&&&ONCE_INIT;
|
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/others.rs:61:26
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _once_mut = &mut ONCE_INIT;
|
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/others.rs:72:14
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = &ATOMIC_TUPLE;
|
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/others.rs:73:14
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = &ATOMIC_TUPLE.0;
|
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/others.rs:74:19
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = &(&&&&ATOMIC_TUPLE).0;
|
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/others.rs:75:14
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = &ATOMIC_TUPLE.0[0];
|
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/others.rs:76:13
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = ATOMIC_TUPLE.0[0].load(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-07-11 18:41:48 -05:00
|
|
|
--> tests/ui/borrow_interior_mutable_const/others.rs:81:13
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = ATOMIC_TUPLE.0[0];
|
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-07-11 18:41:48 -05:00
|
|
|
--> tests/ui/borrow_interior_mutable_const/others.rs:86:5
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | CELL.set(2);
|
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-07-11 18:41:48 -05:00
|
|
|
--> tests/ui/borrow_interior_mutable_const/others.rs:87:16
|
2020-01-26 21:14:11 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | assert_eq!(CELL.get(), 6);
|
2020-01-26 21:14:11 -06:00
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
|
= help: assign this const to a local or static variable, and use the variable here
|
|
|
|
|
2020-11-23 06:51:04 -06:00
|
|
|
error: aborting due to 14 previous errors
|
2020-01-26 21:14:11 -06:00
|
|
|
|