rust/tests/ui/suggestions/issue-102892.stderr

75 lines
2.9 KiB
Plaintext

error[E0308]: mismatched types
--> $DIR/issue-102892.rs:16:26
|
LL | let (a, b): (A, B) = &**arc; // suggests putting `&**arc` here too
| ------ ^^^^^^ expected `(A, B)`, found `&(A, B)`
| |
| expected due to this
|
= note: expected tuple `(A, B)`
found reference `&(A, B)`
help: consider removing the borrow
|
LL - let (a, b): (A, B) = &**arc; // suggests putting `&**arc` here too
LL + let (a, b): (A, B) = **arc; // suggests putting `&**arc` here too
|
help: alternatively, consider changing the type annotation
|
LL | let (a, b): &(A, B) = &**arc; // suggests putting `&**arc` here too
| +
error[E0308]: mismatched types
--> $DIR/issue-102892.rs:21:32
|
LL | let (a, b): ((A, B), A) = (&mut *mutation, &(**arc).0); // suggests putting `&**arc` here too
| ^^^^^^^^^^^^^^ expected `(A, B)`, found `&mut (A, B)`
|
= note: expected tuple `(A, B)`
found mutable reference `&mut (A, B)`
help: consider removing the borrow
|
LL - let (a, b): ((A, B), A) = (&mut *mutation, &(**arc).0); // suggests putting `&**arc` here too
LL + let (a, b): ((A, B), A) = (*mutation, &(**arc).0); // suggests putting `&**arc` here too
|
help: alternatively, consider changing the type annotation
|
LL | let (a, b): (&mut (A, B), A) = (&mut *mutation, &(**arc).0); // suggests putting `&**arc` here too
| ++++
error[E0308]: mismatched types
--> $DIR/issue-102892.rs:21:48
|
LL | let (a, b): ((A, B), A) = (&mut *mutation, &(**arc).0); // suggests putting `&**arc` here too
| ^^^^^^^^^^ expected `A`, found `&A`
|
help: consider removing the borrow
|
LL - let (a, b): ((A, B), A) = (&mut *mutation, &(**arc).0); // suggests putting `&**arc` here too
LL + let (a, b): ((A, B), A) = (&mut *mutation, (**arc).0); // suggests putting `&**arc` here too
|
help: alternatively, consider changing the type annotation
|
LL | let (a, b): ((A, B), &A) = (&mut *mutation, &(**arc).0); // suggests putting `&**arc` here too
| +
error[E0507]: cannot move out of an `Arc`
--> $DIR/issue-102892.rs:11:18
|
LL | let (a, b) = **arc; // suggests putting `&**arc` here; with that, fixed!
| - - ^^^^^
| | |
| | ...and here
| data moved here
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
help: consider removing the dereference here
|
LL - let (a, b) = **arc; // suggests putting `&**arc` here; with that, fixed!
LL + let (a, b) = *arc; // suggests putting `&**arc` here; with that, fixed!
|
error: aborting due to 4 previous errors
Some errors have detailed explanations: E0308, E0507.
For more information about an error, try `rustc --explain E0308`.