Skip to content

Commit 233f0f4

Browse files
Auto-format: cargo fmt --all
1 parent 39c06eb commit 233f0f4

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

crates/vm/src/builtins/frame.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ use crate::{
1111
types::Representable,
1212
};
1313
use num_traits::Zero;
14-
use rustpython_compiler_core::bytecode::{self, Constant, Instruction, InstructionMetadata, StackEffect};
14+
use rustpython_compiler_core::bytecode::{
15+
self, Constant, Instruction, InstructionMetadata, StackEffect,
16+
};
1517

1618
/// Stack state analysis for safe line-number jumps.
1719
///
@@ -249,7 +251,8 @@ pub(crate) mod stack_analysis {
249251
// the stack and POP_ITER removes it.
250252
let mut j = oparg as usize;
251253
if j < instructions.len() {
252-
let target_op = instructions[j].op.to_base().unwrap_or(instructions[j].op);
254+
let target_op =
255+
instructions[j].op.to_base().unwrap_or(instructions[j].op);
253256
if matches!(target_op, Instruction::EndFor) {
254257
j += 1;
255258
}

crates/vm/src/frame.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,8 @@ impl Frame {
292292
pub(crate) fn set_pending_stack_pops(&self, val: u32) {
293293
#[cfg(feature = "threading")]
294294
{
295-
self.pending_stack_pops.store(val, atomic::Ordering::Relaxed);
295+
self.pending_stack_pops
296+
.store(val, atomic::Ordering::Relaxed);
296297
}
297298
#[cfg(not(feature = "threading"))]
298299
{
@@ -303,7 +304,8 @@ impl Frame {
303304
pub(crate) fn pending_unwind_from_stack(&self) -> i64 {
304305
#[cfg(feature = "threading")]
305306
{
306-
self.pending_unwind_from_stack.load(atomic::Ordering::Relaxed)
307+
self.pending_unwind_from_stack
308+
.load(atomic::Ordering::Relaxed)
307309
}
308310
#[cfg(not(feature = "threading"))]
309311
{
@@ -314,7 +316,8 @@ impl Frame {
314316
pub(crate) fn set_pending_unwind_from_stack(&self, val: i64) {
315317
#[cfg(feature = "threading")]
316318
{
317-
self.pending_unwind_from_stack.store(val, atomic::Ordering::Relaxed);
319+
self.pending_unwind_from_stack
320+
.store(val, atomic::Ordering::Relaxed);
318321
}
319322
#[cfg(not(feature = "threading"))]
320323
{
@@ -533,12 +536,7 @@ impl ExecutingFrame<'_> {
533536
/// loop holds the state mutex. Instead it records the work in
534537
/// `pending_stack_pops` / `pending_unwind_from_stack` and we execute it
535538
/// here, inside the execution loop where we already own the state.
536-
fn unwind_stack_for_lineno(
537-
&mut self,
538-
pop_count: usize,
539-
from_stack: i64,
540-
vm: &VirtualMachine,
541-
) {
539+
fn unwind_stack_for_lineno(&mut self, pop_count: usize, from_stack: i64, vm: &VirtualMachine) {
542540
use crate::builtins::frame::stack_analysis::{Kind, pop_value, top_of_stack};
543541

544542
let mut cur_stack = from_stack;
@@ -550,8 +548,7 @@ impl ExecutingFrame<'_> {
550548
if vm.is_none(&exc_obj) {
551549
vm.set_exception(None);
552550
} else {
553-
let exc =
554-
exc_obj.downcast::<crate::builtins::PyBaseException>().ok();
551+
let exc = exc_obj.downcast::<crate::builtins::PyBaseException>().ok();
555552
vm.set_exception(exc);
556553
}
557554
}
@@ -582,7 +579,10 @@ impl ExecutingFrame<'_> {
582579
// Skip RESUME – it should not generate user-visible line events.
583580
if vm.use_tracing.get()
584581
&& !vm.is_none(&self.object.trace.lock())
585-
&& !matches!(instructions.get(idx).map(|u| u.op), Some(Instruction::Resume { .. } | Instruction::InstrumentedResume))
582+
&& !matches!(
583+
instructions.get(idx).map(|u| u.op),
584+
Some(Instruction::Resume { .. } | Instruction::InstrumentedResume)
585+
)
586586
&& let Some((loc, _)) = self.code.locations.get(idx)
587587
&& loc.line.get() as u32 != self.prev_line
588588
{

0 commit comments

Comments
 (0)