rust/tests/ui/borrow_interior_mutable_const/others.stderr

141 lines
5.0 KiB
Plaintext
Raw Normal View History

2020-01-26 21:14:11 -06:00
error: a `const` item with interior mutability should not be borrowed
--> $DIR/others.rs:54:5
2020-01-26 21:14:11 -06:00
|
LL | ATOMIC.store(1, Ordering::SeqCst); //~ ERROR interior mutability
| ^^^^^^
|
= note: `-D clippy::borrow-interior-mutable-const` implied by `-D warnings`
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
--> $DIR/others.rs:55:16
2020-01-26 21:14:11 -06:00
|
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/others.rs:58:22
2020-01-26 21:14:11 -06:00
|
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/others.rs:59:25
2020-01-26 21:14:11 -06:00
|
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/others.rs:60:27
2020-01-26 21:14:11 -06:00
|
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/others.rs:61:26
2020-01-26 21:14:11 -06:00
|
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
2020-11-08 06:07:49 -06:00
error: non-binding let on a type that implements `Drop`
--> $DIR/others.rs:72:5
|
LL | let _ = &ATOMIC_TUPLE; //~ ERROR interior mutability
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[deny(clippy::let_underscore_drop)]` on by default
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
2020-01-26 21:14:11 -06:00
error: a `const` item with interior mutability should not be borrowed
--> $DIR/others.rs:72:14
2020-01-26 21:14:11 -06:00
|
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/others.rs:73:14
2020-01-26 21:14:11 -06:00
|
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/others.rs:74:19
2020-01-26 21:14:11 -06:00
|
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/others.rs:75:14
2020-01-26 21:14:11 -06:00
|
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/others.rs:76:13
2020-01-26 21:14:11 -06:00
|
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/others.rs:82:13
2020-01-26 21:14:11 -06:00
|
LL | let _ = ATOMIC_TUPLE.0[0]; //~ ERROR interior mutability
| ^^^^^^^^^^^^
|
= help: assign this const to a local or static variable, and use the variable here
2020-11-08 06:07:49 -06:00
error: non-binding let on a type that implements `Drop`
--> $DIR/others.rs:83:5
|
LL | let _ = ATOMIC_TUPLE.1.into_iter();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
error: non-binding let on a type that implements `Drop`
--> $DIR/others.rs:85:5
|
LL | let _ = &{ ATOMIC_TUPLE };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
2020-01-26 21:14:11 -06:00
error: a `const` item with interior mutability should not be borrowed
--> $DIR/others.rs:87:5
2020-01-26 21:14:11 -06:00
|
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/others.rs:88:16
2020-01-26 21:14:11 -06:00
|
LL | assert_eq!(CELL.get(), 6); //~ ERROR interior mutability
| ^^^^
|
= help: assign this const to a local or static variable, and use the variable here
2020-11-08 06:07:49 -06:00
error: aborting due to 17 previous errors
2020-01-26 21:14:11 -06:00