about summary refs log tree commit diff
path: root/tests/ui/suggestions/dont-suggest-borrowing-existing-borrow.stderr
blob: 86d9a745b87bea3f4fdf64494eaf62b0aefe890f (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
error[E0277]: the trait bound `str: From<_>` is not satisfied
  --> $DIR/dont-suggest-borrowing-existing-borrow.rs:14:14
   |
LL |     let _ = &str::from("value");
   |              ^^^ the trait `From<_>` is not implemented for `str`
   |
   = help: the following other types implement trait `From<T>`:
             `String` implements `From<&String>`
             `String` implements `From<&mut str>`
             `String` implements `From<&str>`
             `String` implements `From<Box<str>>`
             `String` implements `From<Cow<'_, str>>`
             `String` implements `From<char>`
help: you likely meant to call the associated function `from` for type `&str`, but the code as written calls associated function `from` on type `str`
   |
LL |     let _ = <&str>::from("value");
   |             +    +

error[E0277]: the trait bound `S: Trait` is not satisfied
  --> $DIR/dont-suggest-borrowing-existing-borrow.rs:17:18
   |
LL |     let _ = &mut S::foo();
   |                  ^ unsatisfied trait bound
   |
help: the trait `Trait` is not implemented for `S`
  --> $DIR/dont-suggest-borrowing-existing-borrow.rs:3:1
   |
LL | struct S;
   | ^^^^^^^^
   = help: the trait `Trait` is implemented for `&mut S`
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`
   |
LL |     let _ = <&mut S>::foo();
   |             +      +

error[E0277]: the trait bound `S: Trait` is not satisfied
  --> $DIR/dont-suggest-borrowing-existing-borrow.rs:19:14
   |
LL |     let _ = &S::foo();
   |              ^ unsatisfied trait bound
   |
help: the trait `Trait` is not implemented for `S`
  --> $DIR/dont-suggest-borrowing-existing-borrow.rs:3:1
   |
LL | struct S;
   | ^^^^^^^^
   = help: the trait `Trait` is implemented for `&mut S`
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`
   |
LL -     let _ = &S::foo();
LL +     let _ = <&mut S>::foo();
   |

error[E0277]: the trait bound `S: Trait` is not satisfied
  --> $DIR/dont-suggest-borrowing-existing-borrow.rs:21:13
   |
LL |     let _ = S::foo();
   |             ^ the trait `Trait` is not implemented for `S`
   |
help: consider mutably borrowing here
   |
LL |     let _ = <&mut S>::foo();
   |             +++++  +

error[E0277]: the trait bound `S: Trait2` is not satisfied
  --> $DIR/dont-suggest-borrowing-existing-borrow.rs:23:18
   |
LL |     let _ = &mut S::bar();
   |                  ^ unsatisfied trait bound
   |
help: the trait `Trait2` is not implemented for `S`
  --> $DIR/dont-suggest-borrowing-existing-borrow.rs:3:1
   |
LL | struct S;
   | ^^^^^^^^
   = help: the following other types implement trait `Trait2`:
             &S
             &mut S
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`
   |
LL |     let _ = <&mut S>::bar();
   |             +      +

error[E0277]: the trait bound `S: Trait2` is not satisfied
  --> $DIR/dont-suggest-borrowing-existing-borrow.rs:25:14
   |
LL |     let _ = &S::bar();
   |              ^ unsatisfied trait bound
   |
help: the trait `Trait2` is not implemented for `S`
  --> $DIR/dont-suggest-borrowing-existing-borrow.rs:3:1
   |
LL | struct S;
   | ^^^^^^^^
   = help: the following other types implement trait `Trait2`:
             &S
             &mut S
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`
   |
LL |     let _ = <&S>::bar();
   |             +  +

error[E0277]: the size for values of type `str` cannot be known at compilation time
  --> $DIR/dont-suggest-borrowing-existing-borrow.rs:14:14
   |
LL |     let _ = &str::from("value");
   |              ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
   |
   = help: the trait `Sized` is not implemented for `str`
   = note: the return type of a function must have a statically known size

error: aborting due to 7 previous errors

For more information about this error, try `rustc --explain E0277`.