rust/compiler/stable_mir/src
Nicholas Nethercote e72e7e9ae3 Merge CompilerError::CompilationFailed and CompilerError::ICE.
`CompilerError` has `CompilationFailed` and `ICE` variants, which seems
reasonable at first. But the way it identifies them is flawed:
- If compilation errors out, i.e. `RunCompiler::run` returns an `Err`,
  it uses `CompilationFailed`, which is reasonable.
- If compilation panics with `FatalError`, it catches the panic and uses
  `ICE`. This is sometimes right, because ICEs do cause `FatalError`
  panics, but sometimes wrong, because certain compiler errors also
  cause `FatalError` panics. (The compiler/rustdoc/clippy/whatever just
  catches the `FatalError` with `catch_with_exit_code` in `main`.)

In other words, certain non-ICE compilation failures get miscategorized
as ICEs. It's not possible to reliably distinguish the two cases, so
this commit merges them. It also renames the combined variant as just
`Failed`, to better match the existing `Interrupted` and `Skipped`
variants.

Here is an example of a non-ICE failure that causes a `FatalError`
panic, from `tests/ui/recursion_limit/issue-105700.rs`:
```
 #![recursion_limit="4"]
 #![invalid_attribute]
 #![invalid_attribute]
 #![invalid_attribute]
 #![invalid_attribute]
 #![invalid_attribute]
 //~^ERROR recursion limit reached while expanding

 fn main() {{}}
```
2024-02-17 09:40:44 +11:00
..
mir Dejargnonize subst 2024-02-12 15:46:35 +09:00
abi.rs Remove the abi_amdgpu_kernel feature 2024-01-30 15:46:40 +00:00
compiler_interface.rs Rollup merge of #120982 - momvart:smir-61-foreign_kind, r=oli-obk 2024-02-15 09:20:18 +01:00
crate_def.rs Improve documentation and fix the fixme comment 2023-11-23 12:29:20 -08:00
error.rs Merge CompilerError::CompilationFailed and CompilerError::ICE. 2024-02-17 09:40:44 +11:00
lib.rs Add APIs for fetching foreign items including foreign modules, their ABIs, and their items 2024-02-12 19:44:35 +00:00
mir.rs Add support to global allocation to stable-mir 2023-11-21 19:16:53 -08:00
target.rs remove some redundant clones 2023-12-11 21:54:36 +01:00
ty.rs Rewrite foreign item kind query using DefKind 2024-02-14 17:38:36 +00:00
visitor.rs Restore movability to SMIR 2023-12-28 16:35:01 +00:00