Commit 040e242
authored
Rollup merge of #72090 - RalfJung:rustc_driver-exit-code, r=oli-obk
rustc_driver: factor out computing the exit code
In a recent Miri PR I [added a convenience wrapper](https://github.com/rust-lang/miri/pull/1405/files#diff-c3d602c5c8035a16699ce9c015bfeceaR125) around `catch_fatal_errors` and `run_compiler` that @oli-obk suggested I could upstream. However, after seeing what could be shared between `rustc_driver::main`, clippy and Miri, really the only thing I found is computing the exit code -- so that's what this PR does.
What prevents using the Miri convenience function in `rustc_driver::main` and clippy is that they do extra work inside `catch_fatal_errors`, and while I could abstract that away, clippy actually *computes the callbacks* inside there, and I fond no good way to abstract that and thus gave up. Maybe the clippy thing could be moved out, I am not sure if it ever can actually raise a `FatalErrorMarker` -- someone more knowledgeable in clippy would have to do that.2 files changed
+15
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1138 | 1138 | | |
1139 | 1139 | | |
1140 | 1140 | | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
1141 | 1151 | | |
1142 | 1152 | | |
1143 | 1153 | | |
| |||
1228 | 1238 | | |
1229 | 1239 | | |
1230 | 1240 | | |
1231 | | - | |
| 1241 | + | |
1232 | 1242 | | |
1233 | 1243 | | |
1234 | 1244 | | |
1235 | 1245 | | |
1236 | | - | |
| 1246 | + | |
1237 | 1247 | | |
1238 | 1248 | | |
1239 | 1249 | | |
| |||
1246 | 1256 | | |
1247 | 1257 | | |
1248 | 1258 | | |
1249 | | - | |
1250 | | - | |
1251 | | - | |
1252 | | - | |
1253 | | - | |
1254 | | - | |
| 1259 | + | |
1255 | 1260 | | |
1256 | 1261 | | |
1257 | | - | |
| 1262 | + | |
1258 | 1263 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | | - | |
| 299 | + | |
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
| |||
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
414 | | - | |
415 | | - | |
416 | 414 | | |
417 | 415 | | |
0 commit comments