11use super :: { Reset , ReusableAllocations } ;
22use crate :: {
33 core:: FuelCostsProvider ,
4- engine:: translator:: {
5- comparator:: {
6- CmpSelectFusion ,
7- CompareResult as _,
8- TryIntoCmpSelectInstr as _,
9- UpdateBranchOffset as _,
4+ engine:: {
5+ translator:: {
6+ comparator:: {
7+ CmpSelectFusion ,
8+ CompareResult as _,
9+ TryIntoCmpSelectInstr as _,
10+ UpdateBranchOffset as _,
11+ } ,
12+ func:: { Stack , StackLayout , StackSpace } ,
13+ relink_result:: RelinkResult ,
14+ utils:: { BumpFuelConsumption as _, OpPos } ,
1015 } ,
11- func:: { Stack , StackLayout , StackSpace } ,
12- relink_result:: RelinkResult ,
13- utils:: { BumpFuelConsumption as _, OpPos } ,
16+ TranslationError ,
1417 } ,
1518 ir:: { BranchOffset , Op , Slot } ,
1619 Engine ,
@@ -23,9 +26,9 @@ use alloc::vec::{self, Vec};
2326#[ derive( Debug , Default ) ]
2427pub struct OpEncoder {
2528 /// The last pushed [`Op`].
26- ///
29+ ///
2730 /// # Note
28- ///
31+ ///
2932 /// - This allows the last [`Op`] to be peeked and manipulated.
3033 /// - For example, this is useful to perform op-code fusion or adjusting the result slot.
3134 last : Option < OpPos > ,
@@ -41,9 +44,7 @@ impl ReusableAllocations for OpEncoder {
4144 type Allocations = OpEncoderAllocations ;
4245
4346 fn into_allocations ( self ) -> Self :: Allocations {
44- Self :: Allocations {
45- instrs : self . ops ,
46- }
47+ Self :: Allocations { instrs : self . ops }
4748 }
4849}
4950
0 commit comments