@@ -21,7 +21,9 @@ use crate::{
21
21
pub struct ArchArm64 { }
22
22
23
23
impl ArchArm64 {
24
- pub fn new ( _file : & object:: File ) -> Result < Self > { Ok ( Self { } ) }
24
+ pub fn new ( _file : & object:: File ) -> Result < Self > {
25
+ Ok ( Self { } )
26
+ }
25
27
}
26
28
27
29
impl Arch for ArchArm64 {
@@ -186,7 +188,9 @@ struct DisplayCtx<'a> {
186
188
// Reworked for more structured output. The library only gives us a Display impl, and no way to
187
189
// capture any of this information, so it needs to be reimplemented here.
188
190
fn display_instruction < Cb > ( args : & mut Cb , ins : & Instruction , ctx : & mut DisplayCtx ) -> & ' static str
189
- where Cb : FnMut ( InstructionPart < ' static > ) {
191
+ where
192
+ Cb : FnMut ( InstructionPart < ' static > ) ,
193
+ {
190
194
let mnemonic = match ins. opcode {
191
195
Opcode :: Invalid => return "<invalid>" ,
192
196
Opcode :: UDF => "udf" ,
@@ -2001,13 +2005,17 @@ fn condition_code(cond: u8) -> &'static str {
2001
2005
2002
2006
#[ inline]
2003
2007
fn push_register < Cb > ( args : & mut Cb , size : SizeCode , reg : u16 , sp : bool )
2004
- where Cb : FnMut ( InstructionPart < ' static > ) {
2008
+ where
2009
+ Cb : FnMut ( InstructionPart < ' static > ) ,
2010
+ {
2005
2011
push_opaque ( args, reg_name ( size, reg, sp) ) ;
2006
2012
}
2007
2013
2008
2014
#[ inline]
2009
2015
fn push_shift < Cb > ( args : & mut Cb , style : ShiftStyle , amount : u8 )
2010
- where Cb : FnMut ( InstructionPart < ' static > ) {
2016
+ where
2017
+ Cb : FnMut ( InstructionPart < ' static > ) ,
2018
+ {
2011
2019
push_opaque ( args, shift_style ( style) ) ;
2012
2020
if amount != 0 {
2013
2021
push_plain ( args, " " ) ;
@@ -2017,12 +2025,16 @@ where Cb: FnMut(InstructionPart<'static>) {
2017
2025
2018
2026
#[ inline]
2019
2027
fn push_condition_code < Cb > ( args : & mut Cb , cond : u8 )
2020
- where Cb : FnMut ( InstructionPart < ' static > ) {
2028
+ where
2029
+ Cb : FnMut ( InstructionPart < ' static > ) ,
2030
+ {
2021
2031
push_opaque ( args, condition_code ( cond) ) ;
2022
2032
}
2023
2033
2024
2034
fn push_barrier < Cb > ( args : & mut Cb , option : u8 )
2025
- where Cb : FnMut ( InstructionPart < ' static > ) {
2035
+ where
2036
+ Cb : FnMut ( InstructionPart < ' static > ) ,
2037
+ {
2026
2038
match option {
2027
2039
0b0001 => push_opaque ( args, "oshld" ) ,
2028
2040
0b0010 => push_opaque ( args, "oshst" ) ,
@@ -2042,32 +2054,42 @@ where Cb: FnMut(InstructionPart<'static>) {
2042
2054
2043
2055
#[ inline]
2044
2056
fn push_opaque < ' a , Cb > ( args : & mut Cb , text : & ' a str )
2045
- where Cb : FnMut ( InstructionPart < ' a > ) {
2057
+ where
2058
+ Cb : FnMut ( InstructionPart < ' a > ) ,
2059
+ {
2046
2060
args ( InstructionPart :: opaque ( text) ) ;
2047
2061
}
2048
2062
2049
2063
#[ inline]
2050
2064
fn push_plain < Cb > ( args : & mut Cb , text : & ' static str )
2051
- where Cb : FnMut ( InstructionPart < ' static > ) {
2065
+ where
2066
+ Cb : FnMut ( InstructionPart < ' static > ) ,
2067
+ {
2052
2068
args ( InstructionPart :: basic ( text) ) ;
2053
2069
}
2054
2070
2055
2071
#[ inline]
2056
2072
fn push_separator < Cb > ( args : & mut Cb )
2057
- where Cb : FnMut ( InstructionPart < ' static > ) {
2073
+ where
2074
+ Cb : FnMut ( InstructionPart < ' static > ) ,
2075
+ {
2058
2076
args ( InstructionPart :: separator ( ) ) ;
2059
2077
}
2060
2078
2061
2079
#[ inline]
2062
2080
fn push_unsigned < Cb > ( args : & mut Cb , v : u64 )
2063
- where Cb : FnMut ( InstructionPart < ' static > ) {
2081
+ where
2082
+ Cb : FnMut ( InstructionPart < ' static > ) ,
2083
+ {
2064
2084
push_plain ( args, "#" ) ;
2065
2085
args ( InstructionPart :: unsigned ( v) ) ;
2066
2086
}
2067
2087
2068
2088
#[ inline]
2069
2089
fn push_signed < Cb > ( args : & mut Cb , v : i64 )
2070
- where Cb : FnMut ( InstructionPart < ' static > ) {
2090
+ where
2091
+ Cb : FnMut ( InstructionPart < ' static > ) ,
2092
+ {
2071
2093
push_plain ( args, "#" ) ;
2072
2094
args ( InstructionPart :: signed ( v) ) ;
2073
2095
}
@@ -2107,7 +2129,9 @@ fn is_reg_index_reloc(resolved: Option<ResolvedRelocation>) -> bool {
2107
2129
}
2108
2130
2109
2131
fn push_operand < Cb > ( args : & mut Cb , o : & Operand , ctx : & mut DisplayCtx )
2110
- where Cb : FnMut ( InstructionPart < ' static > ) {
2132
+ where
2133
+ Cb : FnMut ( InstructionPart < ' static > ) ,
2134
+ {
2111
2135
match o {
2112
2136
Operand :: Nothing => unreachable ! ( ) ,
2113
2137
Operand :: PCOffset ( off) => {
0 commit comments