blob: 18ed08d73dd0db2be69174259d11e6a77a6be7eb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
error[E0369]: cannot multiply `Bar` by `Bar`
--> $DIR/borrow-suggestion-109352-2.rs:19:23
|
LL | let _ = owned_bar * owned_bar;
| --------- ^ --------- Bar
| |
| Bar
|
note: an implementation of `Mul` might be missing for `Bar`
--> $DIR/borrow-suggestion-109352-2.rs:1:1
|
LL | struct Bar;
| ^^^^^^^^^^ must implement `Mul`
note: the trait `Mul` must be implemented
--> $SRC_DIR/core/src/ops/arith.rs:LL:COL
error[E0369]: cannot multiply `&Bar` by `&Bar`
--> $DIR/borrow-suggestion-109352-2.rs:21:21
|
LL | let _ = ref_bar * ref_bar;
| ------- ^ ------- &Bar
| |
| &Bar
|
= note: an implementation for `&mut Bar * &mut Bar` exists
help: consider making this expression a mutable borrow
--> $DIR/borrow-suggestion-109352-2.rs:21:13
|
LL | let _ = ref_bar * ref_bar;
| ^^^^^^^
help: consider making this expression a mutable borrow
--> $DIR/borrow-suggestion-109352-2.rs:21:23
|
LL | let _ = ref_bar * ref_bar;
| ^^^^^^^
error[E0369]: cannot multiply `&Bar` by `&mut Bar`
--> $DIR/borrow-suggestion-109352-2.rs:23:21
|
LL | let _ = ref_bar * ref_mut_bar;
| ------- ^ ----------- &mut Bar
| |
| &Bar
|
= note: an implementation for `&mut Bar * &mut Bar` exists
help: consider making this expression a mutable borrow
--> $DIR/borrow-suggestion-109352-2.rs:23:13
|
LL | let _ = ref_bar * ref_mut_bar;
| ^^^^^^^
error[E0308]: mismatched types
--> $DIR/borrow-suggestion-109352-2.rs:25:27
|
LL | let _ = ref_mut_bar * ref_bar;
| ^^^^^^^ types differ in mutability
|
= note: expected mutable reference `&mut Bar`
found reference `&Bar`
error: aborting due to 4 previous errors
Some errors have detailed explanations: E0308, E0369.
For more information about an error, try `rustc --explain E0308`.
|