1
Fork 0

Represent the raw pointer for a array length check as a new kind of fake borrow

This commit is contained in:
Michael Goulet 2025-01-19 22:45:03 +00:00
parent 057313b7a6
commit eeecb56b73
26 changed files with 199 additions and 89 deletions

View file

@ -232,6 +232,18 @@ impl<'tcx> Stable<'tcx> for mir::Mutability {
}
}
impl<'tcx> Stable<'tcx> for mir::RawPtrKind {
type T = stable_mir::mir::RawPtrKind;
fn stable(&self, _: &mut Tables<'_>) -> Self::T {
use mir::RawPtrKind::*;
match *self {
Const => stable_mir::mir::RawPtrKind::Const,
Mut => stable_mir::mir::RawPtrKind::Mut,
FakeForPtrMetadata => stable_mir::mir::RawPtrKind::FakeForPtrMetadata,
}
}
}
impl<'tcx> Stable<'tcx> for mir::BorrowKind {
type T = stable_mir::mir::BorrowKind;
fn stable(&self, tables: &mut Tables<'_>) -> Self::T {