refactor: move convert module to stable_mir

note that this commit delete `convert/error.rs`, we would use `SmirError::from_internal` instead.

**Unresolved questions:**
- There are still a few direct calls to rustc's internals scattered across `impl Stable`s, but most of them appear to be relatively stable, e.g., `mir::interpret::ConstAllocation::inner(self)` and `mir::syntax::SwitchTargets::otherwise(self)`.
This commit is contained in:
Makai
2025-05-05 15:35:54 +08:00
parent 0f6f68313d
commit 663e2b7e29
11 changed files with 1225 additions and 668 deletions

View File

@@ -8,6 +8,7 @@ use std::cell::Cell;
use rustc_hir::def::DefKind;
use rustc_smir::{Bridge, SmirContainer, Tables};
use stable_mir::abi::{FnAbi, Layout, LayoutShape, ReprOptions};
use stable_mir::convert::{RustcInternal, Stable};
use stable_mir::crate_def::Attribute;
use stable_mir::mir::alloc::{AllocId, GlobalAlloc};
use stable_mir::mir::mono::{Instance, InstanceDef, StaticDef};