Normalize passes keep spans and clean warnings

This commit is contained in:
nyash-codex
2025-11-24 15:02:51 +09:00
parent 466e636af6
commit da1a5558e5
40 changed files with 547 additions and 362 deletions

View File

@ -56,7 +56,7 @@ pub use instruction::MirInstruction;
pub use join_ir_runner::{run_joinir_function, JoinRuntimeError, JoinValue};
pub use optimizer::MirOptimizer;
pub use printer::MirPrinter;
pub use spanned_instruction::SpannedInstruction;
pub use spanned_instruction::{SpannedInstRef, SpannedInstruction};
pub use query::{MirQuery, MirQueryBox};
pub use slot_registry::{BoxTypeId, MethodSlot};
pub use types::{
@ -229,8 +229,8 @@ mod tests {
// Ensure TypeOp exists in the resulting MIR
let has_typeop = result.module.functions.values().any(|f| {
f.blocks.values().any(|b| {
b.all_instructions()
.any(|i| matches!(i, MirInstruction::TypeOp { .. }))
b.all_spanned_instructions()
.any(|sp| matches!(sp.inst, MirInstruction::TypeOp { .. }))
})
});
assert!(
@ -264,8 +264,8 @@ mod tests {
// Ensure TypeOp exists in the resulting MIR
let has_typeop = result.module.functions.values().any(|f| {
f.blocks.values().any(|b| {
b.all_instructions()
.any(|i| matches!(i, MirInstruction::TypeOp { .. }))
b.all_spanned_instructions()
.any(|sp| matches!(sp.inst, MirInstruction::TypeOp { .. }))
})
});
assert!(