This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit c4effdb
authored
Rollup merge of rust-lang#136958 - compiler-errors:additive-replacmeent, r=estebank
Fix presentation of purely "additive" replacement suggestion parts
rust-lang#127541 changes replacement suggestions to use the "diff" view always, which I think is really verbose in cases where a replacement snippet is a "superset" of the snippet that is being replaced.
Consider:
```
LL - Self::Baz: Clone,
LL + Self::Baz: Clone, T: std::clone::Clone
```
In this code, we suggest replacing `", "` with `", T: std::clone::Clone"`. This is a consequence of how the snippet is constructed. I believe that since the string that is being replaced is a subset of the replacement string, it's not providing much value to present this as a diff. Users should be able to clearly understand what's being suggested here using the `~` underline view we've been suggesting for some time now.
Given that this affects ~100 tests out of the ~1000 UI tests affected, I expect this to be a pretty meaningful improvement of the fallout of rust-lang#127541.
---
In the last commit, this PR also "trims" replacement parts so that they are turned into their purely additive subset, if possible. See the diff for what this means.
---
r? estebankFile tree
153 files changed
+640
-897
lines changed- compiler/rustc_errors/src
- src/tools/clippy/tests/ui
- tests/ui
- associated-types
- attributes
- borrowck
- c-variadic
- cfg
- check-cfg
- closures
- 2229_closure_analysis
- compare-method
- const-generics
- generic_const_exprs
- assoc_const_unification
- const_kind_expr
- consts
- did_you_mean
- dropck
- dst
- empty
- env-macro
- error-codes
- extern
- feature-gates
- fmt
- impl-trait
- imports
- issue-45829
- issues
- issue-41652
- issue-57741-dereference-boxed-value
- let-else
- lexer
- lifetimes
- lint
- let_underscore
- unused
- macros
- match
- methods
- issues
- mir
- mismatched_types
- moves
- namespace
- nll/ty-outlives
- parser
- char
- issues
- misspelled-keywords
- recover
- pattern
- usefulness
- privacy
- pub
- resolve
- rfcs
- rfc-2008-non-exhaustive
- rfc-2126-extern-absolute-paths
- rust-2018
- stability-attribute
- statics
- structs
- suggestions
- test-attrs
- traits
- associated_type_bound
- non_lifetime_binders
- transmutability
- typeck
- type
- pattern_types
- unresolved
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
153 files changed
+640
-897
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1976 | 1976 | | |
1977 | 1977 | | |
1978 | 1978 | | |
| 1979 | + | |
| 1980 | + | |
1979 | 1981 | | |
1980 | 1982 | | |
1981 | | - | |
| 1983 | + | |
1982 | 1984 | | |
1983 | 1985 | | |
1984 | 1986 | | |
1985 | | - | |
| 1987 | + | |
| 1988 | + | |
1986 | 1989 | | |
1987 | 1990 | | |
1988 | 1991 | | |
| |||
2167 | 2170 | | |
2168 | 2171 | | |
2169 | 2172 | | |
2170 | | - | |
| 2173 | + | |
2171 | 2174 | | |
2172 | 2175 | | |
2173 | 2176 | | |
| |||
2213 | 2216 | | |
2214 | 2217 | | |
2215 | 2218 | | |
2216 | | - | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
| 2224 | + | |
2217 | 2225 | | |
2218 | 2226 | | |
2219 | 2227 | | |
| |||
2376 | 2384 | | |
2377 | 2385 | | |
2378 | 2386 | | |
2379 | | - | |
2380 | | - | |
2381 | | - | |
| 2387 | + | |
| 2388 | + | |
| 2389 | + | |
| 2390 | + | |
| 2391 | + | |
| 2392 | + | |
2382 | 2393 | | |
2383 | 2394 | | |
2384 | 2395 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
233 | 245 | | |
234 | 246 | | |
235 | 247 | | |
236 | 248 | | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
237 | 267 | | |
238 | 268 | | |
239 | 269 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
| 11 | + | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| |||
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | | - | |
24 | | - | |
25 | | - | |
| 22 | + | |
| 23 | + | |
26 | 24 | | |
27 | 25 | | |
28 | 26 | | |
| |||
32 | 30 | | |
33 | 31 | | |
34 | 32 | | |
35 | | - | |
36 | | - | |
37 | | - | |
| 33 | + | |
| 34 | + | |
38 | 35 | | |
39 | 36 | | |
40 | 37 | | |
| |||
44 | 41 | | |
45 | 42 | | |
46 | 43 | | |
47 | | - | |
48 | | - | |
49 | | - | |
| 44 | + | |
| 45 | + | |
50 | 46 | | |
51 | 47 | | |
52 | 48 | | |
| |||
56 | 52 | | |
57 | 53 | | |
58 | 54 | | |
59 | | - | |
60 | | - | |
61 | | - | |
| 55 | + | |
| 56 | + | |
62 | 57 | | |
63 | 58 | | |
64 | 59 | | |
| |||
104 | 99 | | |
105 | 100 | | |
106 | 101 | | |
107 | | - | |
108 | | - | |
109 | | - | |
| 102 | + | |
| 103 | + | |
110 | 104 | | |
111 | 105 | | |
112 | 106 | | |
| |||
116 | 110 | | |
117 | 111 | | |
118 | 112 | | |
119 | | - | |
120 | | - | |
121 | | - | |
| 113 | + | |
| 114 | + | |
122 | 115 | | |
123 | 116 | | |
124 | 117 | | |
| |||
128 | 121 | | |
129 | 122 | | |
130 | 123 | | |
131 | | - | |
132 | | - | |
| 124 | + | |
133 | 125 | | |
134 | 126 | | |
135 | 127 | | |
| |||
140 | 132 | | |
141 | 133 | | |
142 | 134 | | |
143 | | - | |
144 | | - | |
| 135 | + | |
145 | 136 | | |
146 | 137 | | |
147 | 138 | | |
| |||
191 | 182 | | |
192 | 183 | | |
193 | 184 | | |
194 | | - | |
195 | | - | |
| 185 | + | |
196 | 186 | | |
197 | 187 | | |
198 | 188 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | | - | |
73 | | - | |
| 71 | + | |
| 72 | + | |
74 | 73 | | |
75 | 74 | | |
76 | 75 | | |
| |||
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
138 | | - | |
139 | | - | |
| 137 | + | |
| 138 | + | |
140 | 139 | | |
141 | 140 | | |
142 | 141 | | |
| |||
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
138 | | - | |
139 | | - | |
| 137 | + | |
| 138 | + | |
140 | 139 | | |
141 | 140 | | |
142 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | | - | |
| 16 | + | |
| 17 | + | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| |||
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
41 | | - | |
42 | | - | |
43 | | - | |
| 40 | + | |
| 41 | + | |
44 | 42 | | |
45 | 43 | | |
46 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
| 15 | + | |
| 16 | + | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
| 15 | + | |
| 16 | + | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
| 38 | + | |
| 39 | + | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
| |||
0 commit comments