chore(fmt): add legacy stubs and strip trailing whitespace to unblock cargo fmt

This commit is contained in:
Selfhosting Dev
2025-09-17 07:43:07 +09:00
parent fcf8ce1f3c
commit adbb0201a9
385 changed files with 35622 additions and 15004 deletions

View File

@ -9,7 +9,7 @@
#![allow(dead_code)]
use crate::mir::{ValueId, BasicBlockId};
use crate::mir::{BasicBlockId, ValueId};
/// The unified semantics interface for MIR evaluation/lowering.
pub trait Semantics {
@ -55,21 +55,34 @@ pub trait Semantics {
// Host/Box calls
fn new_box(&mut self, type_id: i64, args: &[Self::Val]) -> Self::Val;
fn box_call_tagged(&mut self, type_id: i64, method_id: i64, recv: Self::Val, argv: &[Self::Val], tags: &[i64]) -> Self::Val;
fn box_call_tagged(
&mut self,
type_id: i64,
method_id: i64,
recv: Self::Val,
argv: &[Self::Val],
tags: &[i64],
) -> Self::Val;
fn extern_call(&mut self, iface: &str, method: &str, args: &[Self::Val]) -> Self::Val;
// GC hooks
fn barrier_read(&mut self, v: Self::Val) -> Self::Val { v }
fn barrier_write(&mut self, _ptr: &Self::Ptr, v: Self::Val) -> Self::Val { v }
fn barrier_read(&mut self, v: Self::Val) -> Self::Val {
v
}
fn barrier_write(&mut self, _ptr: &Self::Ptr, v: Self::Val) -> Self::Val {
v
}
fn safepoint(&mut self) {}
}
/// Optional helpers extension — default blanket impl with conveniences.
pub trait SemanticsExt: Semantics {
fn to_bool_hint(&mut self, v: Self::Val) -> Self::Val { v }
fn to_bool_hint(&mut self, v: Self::Val) -> Self::Val {
v
}
}
impl<T: Semantics> SemanticsExt for T {}
pub mod vm_impl;
pub mod clif_adapter;
pub mod vm_impl;