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

@ -3,7 +3,10 @@ use crate::ast::ASTNode;
impl super::MirBuilder {
// QMarkPropagate: result?.value (Result-like)
pub(super) fn build_qmark_propagate_expression(&mut self, expression: ASTNode) -> Result<ValueId, String> {
pub(super) fn build_qmark_propagate_expression(
&mut self,
expression: ASTNode,
) -> Result<ValueId, String> {
let res_val = self.build_expression_impl(expression)?;
let ok_id = self.value_gen.next();
self.emit_instruction(super::MirInstruction::BoxCall {
@ -16,9 +19,15 @@ impl super::MirBuilder {
})?;
let then_block = self.block_gen.next();
let else_block = self.block_gen.next();
self.emit_instruction(super::MirInstruction::Branch { condition: ok_id, then_bb: then_block, else_bb: else_block })?;
self.emit_instruction(super::MirInstruction::Branch {
condition: ok_id,
then_bb: then_block,
else_bb: else_block,
})?;
self.start_new_block(then_block)?;
self.emit_instruction(super::MirInstruction::Return { value: Some(res_val) })?;
self.emit_instruction(super::MirInstruction::Return {
value: Some(res_val),
})?;
self.start_new_block(else_block)?;
let val_id = self.value_gen.next();
self.emit_instruction(super::MirInstruction::BoxCall {