Skip to content

Commit d64ae55

Browse files
author
DigitalCodeCrafter
committed
fixed a mir test
1 parent ed1cacb commit d64ae55

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/mir/lowerer.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ impl MirBuilder<'_> {
136136

137137
#[cfg(test)]
138138
mod tests {
139-
use crate::{common::diagnostics::sinks::AssertErrors, mir::pretty, semantics, syntax};
139+
use crate::{common::{Span, diagnostics::sinks::AssertErrors}, mir::pretty, semantics, syntax};
140140
use super::*;
141141

142142
#[test]
@@ -168,12 +168,14 @@ let y = x - 3
168168
Operand::Move(Place { local: LocalId(1), projection: vec![] }),
169169
Operand::Move(Place { local: LocalId(2), projection: vec![] })
170170
)),
171+
Instr::Debug(DebugInfo { span: Span::new(1, 15), kind: DebugKind::DeclareLocal { local: LocalId(0), name: "x".to_string() } }),
171172
Instr::Assign(Place { local: LocalId(4), projection: vec![] }, RValue::Use(Operand::Copy(Place { local: LocalId(0), projection: vec![] }))),
172173
Instr::Assign(Place { local: LocalId(5), projection: vec![] }, RValue::Use(Operand::Const(Const::Number(3.0)))),
173174
Instr::Assign(Place { local: LocalId(3), projection: vec![] }, RValue::Binary(BinaryOp::Sub,
174175
Operand::Move(Place { local: LocalId(4), projection: vec![] }),
175176
Operand::Move(Place { local: LocalId(5), projection: vec![] })
176177
)),
178+
Instr::Debug(DebugInfo { span: Span::new(15, 29), kind: DebugKind::DeclareLocal { local: LocalId(3), name: "y".to_string() } }),
177179
],
178180
terminator: Terminator::Return(Operand::Const(Const::Unit)),
179181
}]

0 commit comments

Comments
 (0)