about summary refs log tree commit diff
path: root/compiler/stable_mir/src/error.rs
AgeCommit message (Collapse)AuthorLines
2025-07-14rename `stable_mir` to `rustc_public`, and `rustc_smir` to `rustc_public_bridge`Makai-91/+0
2025-07-06move `stable_mir` back to its own crate and move `rustc_internal` to ↵Makai-0/+91
the`stable_mir` crate As part of this reorganization, some traits need to be moved from `rustc_smir::context::traits` to `stable_mir::unstable::internal_cx`. These traits are specifically designed for `InternalCx` to clarify the behavior of different functions that share the same name. This move is necessary to avoid orphan rule violations.
2025-04-05let `rustc_smir` host `stable_mir` for refactoringMakai-85/+0
2024-03-01Implement missing ABI structures in StableMIRCelina G. Val-4/+7
2024-02-17Merge `CompilerError::CompilationFailed` and `CompilerError::ICE`.Nicholas Nethercote-8/+4
`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() {{}} ```
2023-12-10remove redundant importssurechen-1/+0
detects redundant imports that can be eliminated. for #117772 : In order to facilitate review and modification, split the checking code and removing redundant imports code into two PR.
2023-12-07Add instance evaluation and methods to read allocCelina G. Val-2/+8
The instance evaluation is needed to handle intrinsics such as `type_id` and `type_name`. Since we now use Allocation to represent all evaluated constants, provide a few methods to help process the data inside an allocation.
2023-12-05Change ty_with_args to return Ty instead of ResultCelina G. Val-1/+1
Although, we would like to avoid crashes whenever possible, and that's why I wanted to make this API fallible. It's looking pretty hard to do proper validation. I think many of our APIs will unfortunately depend on the user doing the correct thing since at the MIR level we are working on, we expect types to have been checked already.
2023-11-20Add place.ty() and Ty build from a kind to smirCelina G. Val-2/+7
2023-10-19Add stable Instance::body() and RustcInternal traitCelina G. Val-0/+7
The `Instance::body()` returns a monomorphized body. For that, we had to implement visitor that monomorphize types and constants. We are also introducing the RustcInternal trait that will allow us to convert back from Stable to Internal. Note that this trait is not yet visible for our users as it depends on Tables. We should probably add a new trait that can be exposed.
2023-10-16Add MonoItems and Instance to stable_mirCelina G. Val-0/+69
Also add a few methods to instantiate instances and get an instance definition. We're still missing support to actually monomorphize the instance body.