mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-05 02:50:32 +00:00
131 lines
5.1 KiB
Text
131 lines
5.1 KiB
Text
error: a `const` item with interior mutability should not be borrowed
|
|
--> $DIR/borrow_interior_mutable_const.rs:34:5
|
|
|
|
|
LL | ATOMIC.store(1, Ordering::SeqCst); //~ ERROR interior mutability
|
|
| ^^^^^^
|
|
|
|
|
= note: `-D clippy::borrow-interior-mutable-const` implied by `-D warnings`
|
|
= 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
|
|
--> $DIR/borrow_interior_mutable_const.rs:35:16
|
|
|
|
|
LL | assert_eq!(ATOMIC.load(Ordering::SeqCst), 5); //~ ERROR interior mutability
|
|
| ^^^^^^
|
|
|
|
|
= 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
|
|
--> $DIR/borrow_interior_mutable_const.rs:38:22
|
|
|
|
|
LL | let _once_ref = &ONCE_INIT; //~ ERROR interior mutability
|
|
| ^^^^^^^^^
|
|
|
|
|
= 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
|
|
--> $DIR/borrow_interior_mutable_const.rs:39:25
|
|
|
|
|
LL | let _once_ref_2 = &&ONCE_INIT; //~ ERROR interior mutability
|
|
| ^^^^^^^^^
|
|
|
|
|
= 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
|
|
--> $DIR/borrow_interior_mutable_const.rs:40:27
|
|
|
|
|
LL | let _once_ref_4 = &&&&ONCE_INIT; //~ ERROR interior mutability
|
|
| ^^^^^^^^^
|
|
|
|
|
= 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
|
|
--> $DIR/borrow_interior_mutable_const.rs:41:26
|
|
|
|
|
LL | let _once_mut = &mut ONCE_INIT; //~ ERROR interior mutability
|
|
| ^^^^^^^^^
|
|
|
|
|
= 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
|
|
--> $DIR/borrow_interior_mutable_const.rs:52:14
|
|
|
|
|
LL | let _ = &ATOMIC_TUPLE; //~ ERROR interior mutability
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= 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
|
|
--> $DIR/borrow_interior_mutable_const.rs:53:14
|
|
|
|
|
LL | let _ = &ATOMIC_TUPLE.0; //~ ERROR interior mutability
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= 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
|
|
--> $DIR/borrow_interior_mutable_const.rs:54:19
|
|
|
|
|
LL | let _ = &(&&&&ATOMIC_TUPLE).0; //~ ERROR interior mutability
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= 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
|
|
--> $DIR/borrow_interior_mutable_const.rs:55:14
|
|
|
|
|
LL | let _ = &ATOMIC_TUPLE.0[0]; //~ ERROR interior mutability
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= 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
|
|
--> $DIR/borrow_interior_mutable_const.rs:56:13
|
|
|
|
|
LL | let _ = ATOMIC_TUPLE.0[0].load(Ordering::SeqCst); //~ ERROR interior mutability
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= 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
|
|
--> $DIR/borrow_interior_mutable_const.rs:62:13
|
|
|
|
|
LL | let _ = ATOMIC_TUPLE.0[0]; //~ ERROR interior mutability
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= 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
|
|
--> $DIR/borrow_interior_mutable_const.rs:67:5
|
|
|
|
|
LL | CELL.set(2); //~ ERROR interior mutability
|
|
| ^^^^
|
|
|
|
|
= 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
|
|
--> $DIR/borrow_interior_mutable_const.rs:68:16
|
|
|
|
|
LL | assert_eq!(CELL.get(), 6); //~ ERROR interior mutability
|
|
| ^^^^
|
|
|
|
|
= 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
|
|
--> $DIR/borrow_interior_mutable_const.rs:81:5
|
|
|
|
|
LL | u64::ATOMIC.store(5, Ordering::SeqCst); //~ ERROR interior mutability
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= 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
|
|
--> $DIR/borrow_interior_mutable_const.rs:82:16
|
|
|
|
|
LL | assert_eq!(u64::ATOMIC.load(Ordering::SeqCst), 9); //~ ERROR interior mutability
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= help: assign this const to a local or static variable, and use the variable here
|
|
|
|
error: aborting due to 16 previous errors
|
|
|