Commit d2a66d6
authored
feat: Don't stop at first error when emitting lints and warnings (#15889)
While emitting warnings, if `cargo` encounters a critical warning or an
error while linting, it returns early, potentially before all packages
could emit their warnings or be linted. This could make it so users have
to run a `cargo` command more than once before seeing all of the
relevant output. Beyond this, having an error caused by a lint be a
"stop the world" event seems wrong, as it (currently) doesn't inhibit
outputting other warnings or linting other packages.
To address this, I made it so that `cargo` waits until the end of
`emit_warnings` to return an error if one was encountered. To keep the
cause of the error the same as before, `cargo` saves off the first error
it encounters, and returns it at the end.1 file changed
+15
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1205 | 1205 | | |
1206 | 1206 | | |
1207 | 1207 | | |
| 1208 | + | |
1208 | 1209 | | |
1209 | 1210 | | |
1210 | 1211 | | |
1211 | | - | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
1212 | 1217 | | |
1213 | 1218 | | |
1214 | 1219 | | |
| |||
1220 | 1225 | | |
1221 | 1226 | | |
1222 | 1227 | | |
1223 | | - | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
1224 | 1231 | | |
1225 | 1232 | | |
1226 | 1233 | | |
| |||
1233 | 1240 | | |
1234 | 1241 | | |
1235 | 1242 | | |
1236 | | - | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
1237 | 1249 | | |
1238 | 1250 | | |
1239 | 1251 | | |
| |||
0 commit comments