Commit 4d26177
authored
Rollup merge of rust-lang#127301 - estebank:fix-suggestions, r=Urgau
Tweak some structured suggestions to be more verbose and accurate
Addressing some issues I found while working on rust-lang#127282.
```
error: this URL is not a hyperlink
--> $DIR/auxiliary/include-str-bare-urls.md:1:11
|
LL | HEADS UP! https://example.com MUST SHOW UP IN THE STDERR FILE!
| ^^^^^^^^^^^^^^^^^^^
|
= note: bare URLs are not automatically turned into clickable links
note: the lint level is defined here
--> $DIR/include-str-bare-urls.rs:14:9
|
LL | #![deny(rustdoc::bare_urls)]
| ^^^^^^^^^^^^^^^^^^
help: use an automatic link instead
|
LL | HEADS UP! <https://example.com> MUST SHOW UP IN THE STDERR FILE!
| + +
```
```
error[E0384]: cannot assign twice to immutable variable `v`
--> $DIR/assign-imm-local-twice.rs:7:5
|
LL | v = 1;
| ----- first assignment to `v`
LL | println!("v={}", v);
LL | v = 2;
| ^^^^^ cannot assign twice to immutable variable
|
help: consider making this binding mutable
|
LL | let mut v: isize;
| +++
```
```
error[E0393]: the type parameter `Rhs` must be explicitly specified
--> $DIR/issue-22560.rs:9:23
|
LL | trait Sub<Rhs=Self> {
| ------------------- type parameter `Rhs` must be specified for this
...
LL | type Test = dyn Add + Sub;
| ^^^
|
= note: because of the default `Self` reference, type parameters must be specified on object types
help: set the type parameter to the desired type
|
LL | type Test = dyn Add + Sub<Rhs>;
| +++++
```
```
error[E0596]: cannot borrow `v` as mutable, as it is not declared as mutable
--> $DIR/issue-33819.rs:4:34
|
LL | Some(ref v) => { let a = &mut v; },
| ^^^^^^ cannot borrow as mutable
|
help: try removing `&mut` here
|
LL - Some(ref v) => { let a = &mut v; },
LL + Some(ref v) => { let a = v; },
|
```
```
help: remove the invocation before committing it to a version control system
|
LL - dbg!();
|
```
```
error[E0308]: mismatched types
--> $DIR/issue-39974.rs:1:21
|
LL | const LENGTH: f64 = 2;
| ^ expected `f64`, found integer
|
help: use a float literal
|
LL | const LENGTH: f64 = 2.0;
| ++
```
```
error[E0529]: expected an array or slice, found `Vec<i32>`
--> $DIR/match-ergonomics.rs:8:9
|
LL | [&v] => {},
| ^^^^ pattern cannot match with input type `Vec<i32>`
|
help: consider slicing here
|
LL | match x[..] {
| ++++
```
```
error[E0609]: no field `0` on type `[u32; 1]`
--> $DIR/parenthesized-deref-suggestion.rs:10:21
|
LL | (x as [u32; 1]).0;
| ^ unknown field
|
help: instead of using tuple indexing, use array indexing
|
LL | (x as [u32; 1])[0];
| ~ +
```File tree
4 files changed
+0
-15
lines changed- tests/ui
- dbg_macro
4 files changed
+0
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
90 | 89 | | |
91 | 90 | | |
92 | 91 | | |
| |||
146 | 145 | | |
147 | 146 | | |
148 | 147 | | |
149 | | - | |
150 | 148 | | |
151 | 149 | | |
152 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | 99 | | |
101 | 100 | | |
102 | 101 | | |
103 | 102 | | |
104 | | - | |
105 | 103 | | |
106 | 104 | | |
107 | 105 | | |
| |||
121 | 119 | | |
122 | 120 | | |
123 | 121 | | |
124 | | - | |
125 | 122 | | |
126 | 123 | | |
127 | 124 | | |
128 | 125 | | |
129 | | - | |
130 | 126 | | |
131 | 127 | | |
132 | 128 | | |
| |||
146 | 142 | | |
147 | 143 | | |
148 | 144 | | |
149 | | - | |
150 | 145 | | |
151 | 146 | | |
152 | 147 | | |
153 | 148 | | |
154 | | - | |
155 | 149 | | |
156 | 150 | | |
157 | 151 | | |
| |||
171 | 165 | | |
172 | 166 | | |
173 | 167 | | |
174 | | - | |
175 | 168 | | |
176 | 169 | | |
177 | 170 | | |
178 | 171 | | |
179 | | - | |
180 | 172 | | |
181 | 173 | | |
182 | 174 | | |
| |||
202 | 194 | | |
203 | 195 | | |
204 | 196 | | |
205 | | - | |
206 | 197 | | |
207 | 198 | | |
208 | 199 | | |
209 | 200 | | |
210 | | - | |
211 | 201 | | |
212 | 202 | | |
213 | 203 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | 67 | | |
69 | 68 | | |
70 | 69 | | |
| |||
88 | 87 | | |
89 | 88 | | |
90 | 89 | | |
91 | | - | |
92 | 90 | | |
93 | 91 | | |
94 | 92 | | |
| |||
0 commit comments