fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
2.3 KiB57 linesraw
1error[E0308]: mismatched types
2  --> $DIR/issue-102892.rs:15:26
3   |
4LL |     let (a, b): (A, B) = &**arc; // suggests putting `&**arc` here too
5   |                 ------   ^^^^^^ expected `(A, B)`, found `&(A, B)`
6   |                 |
7   |                 expected due to this
8   |
9   = note:  expected tuple `(A, B)`
10           found reference `&(A, B)`
11help: consider removing the borrow
12   |
13LL -     let (a, b): (A, B) = &**arc; // suggests putting `&**arc` here too
14LL +     let (a, b): (A, B) = **arc; // suggests putting `&**arc` here too
15   |
16help: alternatively, consider changing the type annotation
17   |
18LL |     let (a, b): &(A, B) = &**arc; // suggests putting `&**arc` here too
19   |                 +
20
21error[E0308]: mismatched types
22  --> $DIR/issue-102892.rs:20:32
23   |
24LL |     let (a, b): ((A, B), A) = (&mut *mutation, &(**arc).0); // suggests putting `&**arc` here too
25   |                                ^^^^^^^^^^^^^^ expected `(A, B)`, found `&mut (A, B)`
26   |
27   = note:          expected tuple `(A, B)`
28           found mutable reference `&mut (A, B)`
29help: consider removing the borrow
30   |
31LL -     let (a, b): ((A, B), A) = (&mut *mutation, &(**arc).0); // suggests putting `&**arc` here too
32LL +     let (a, b): ((A, B), A) = (*mutation, &(**arc).0); // suggests putting `&**arc` here too
33   |
34help: alternatively, consider changing the type annotation
35   |
36LL |     let (a, b): (&mut (A, B), A) = (&mut *mutation, &(**arc).0); // suggests putting `&**arc` here too
37   |                  ++++
38
39error[E0308]: mismatched types
40  --> $DIR/issue-102892.rs:20:48
41   |
42LL |     let (a, b): ((A, B), A) = (&mut *mutation, &(**arc).0); // suggests putting `&**arc` here too
43   |                                                ^^^^^^^^^^ expected `A`, found `&A`
44   |
45help: consider removing the borrow
46   |
47LL -     let (a, b): ((A, B), A) = (&mut *mutation, &(**arc).0); // suggests putting `&**arc` here too
48LL +     let (a, b): ((A, B), A) = (&mut *mutation, (**arc).0); // suggests putting `&**arc` here too
49   |
50help: alternatively, consider changing the type annotation
51   |
52LL |     let (a, b): ((A, B), &A) = (&mut *mutation, &(**arc).0); // suggests putting `&**arc` here too
53   |                          +
54
55error: aborting due to 3 previous errors
56
57For more information about this error, try `rustc --explain E0308`.