1
1
error[E0277]: the trait bound `str: From<_>` is not satisfied
2
- --> $DIR/dont-suggest-borrowing-existing-borrow.rs:10 :14
2
+ --> $DIR/dont-suggest-borrowing-existing-borrow.rs:14 :14
3
3
|
4
4
LL | let _ = &str::from("value");
5
5
| ^^^ the trait `From<_>` is not implemented for `str`
@@ -17,42 +17,78 @@ LL | let _ = <&str>::from("value");
17
17
| + +
18
18
19
19
error[E0277]: the trait bound `S: Trait` is not satisfied
20
- --> $DIR/dont-suggest-borrowing-existing-borrow.rs:13 :18
20
+ --> $DIR/dont-suggest-borrowing-existing-borrow.rs:17 :18
21
21
|
22
22
LL | let _ = &mut S::foo();
23
23
| ^ the trait `Trait` is not implemented for `S`
24
24
|
25
- = help: the following other types implement trait `Trait`:
26
- &S
27
- &mut S
25
+ = help: the trait `Trait` is implemented for `&mut S`
28
26
help: you likely meant to call the associated function `foo` for type `&mut S`, but the code as written calls associated function `foo` on type `S`
29
27
|
30
28
LL | let _ = <&mut S>::foo();
31
29
| + +
32
30
33
31
error[E0277]: the trait bound `S: Trait` is not satisfied
34
- --> $DIR/dont-suggest-borrowing-existing-borrow.rs:15 :14
32
+ --> $DIR/dont-suggest-borrowing-existing-borrow.rs:19 :14
35
33
|
36
34
LL | let _ = &S::foo();
37
35
| ^ the trait `Trait` is not implemented for `S`
38
36
|
39
- = help: the following other types implement trait `Trait`:
37
+ = help: the trait `Trait` is implemented for `&mut S`
38
+ help: you likely meant to call the associated function `foo` for type `&S`, but the code as written calls associated function `foo` on type `S`
39
+ |
40
+ LL - let _ = &S::foo();
41
+ LL + let _ = <&mut S>::foo();
42
+ |
43
+
44
+ error[E0277]: the trait bound `S: Trait` is not satisfied
45
+ --> $DIR/dont-suggest-borrowing-existing-borrow.rs:21:13
46
+ |
47
+ LL | let _ = S::foo();
48
+ | ^ the trait `Trait` is not implemented for `S`
49
+ |
50
+ help: consider mutably borrowing here
51
+ |
52
+ LL | let _ = <&mut S>::foo();
53
+ | +++++ +
54
+
55
+ error[E0277]: the trait bound `S: Trait2` is not satisfied
56
+ --> $DIR/dont-suggest-borrowing-existing-borrow.rs:23:18
57
+ |
58
+ LL | let _ = &mut S::bar();
59
+ | ^ the trait `Trait2` is not implemented for `S`
60
+ |
61
+ = help: the following other types implement trait `Trait2`:
40
62
&S
41
63
&mut S
42
- help: you likely meant to call the associated function `foo` for type `&S`, but the code as written calls associated function `foo` on type `S`
64
+ help: you likely meant to call the associated function `bar` for type `&mut S`, but the code as written calls associated function `bar` on type `S`
65
+ |
66
+ LL | let _ = <&mut S>::bar();
67
+ | + +
68
+
69
+ error[E0277]: the trait bound `S: Trait2` is not satisfied
70
+ --> $DIR/dont-suggest-borrowing-existing-borrow.rs:25:14
71
+ |
72
+ LL | let _ = &S::bar();
73
+ | ^ the trait `Trait2` is not implemented for `S`
74
+ |
75
+ = help: the following other types implement trait `Trait2`:
76
+ &S
77
+ &mut S
78
+ help: you likely meant to call the associated function `bar` for type `&S`, but the code as written calls associated function `bar` on type `S`
43
79
|
44
- LL | let _ = <&S>::foo ();
80
+ LL | let _ = <&S>::bar ();
45
81
| + +
46
82
47
83
error[E0277]: the size for values of type `str` cannot be known at compilation time
48
- --> $DIR/dont-suggest-borrowing-existing-borrow.rs:10 :14
84
+ --> $DIR/dont-suggest-borrowing-existing-borrow.rs:14 :14
49
85
|
50
86
LL | let _ = &str::from("value");
51
87
| ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
52
88
|
53
89
= help: the trait `Sized` is not implemented for `str`
54
90
= note: the return type of a function must have a statically known size
55
91
56
- error: aborting due to 4 previous errors
92
+ error: aborting due to 7 previous errors
57
93
58
94
For more information about this error, try `rustc --explain E0277`.
0 commit comments