@@ -223,19 +223,19 @@ impl InlineAsmReg {
223223 name : Symbol ,
224224 ) -> Result < Self , & ' static str > {
225225 // FIXME: use direct symbol comparison for register names
226- name . with ( |name| {
227- Ok ( match arch {
228- InlineAsmArch :: X86 | InlineAsmArch :: X86_64 => {
229- Self :: X86 ( X86InlineAsmReg :: parse ( arch , has_feature , name ) ? )
230- }
231- InlineAsmArch :: Arm => Self :: Arm ( ArmInlineAsmReg :: parse ( arch , has_feature , name ) ? ) ,
232- InlineAsmArch :: AArch64 => {
233- Self :: AArch64 ( AArch64InlineAsmReg :: parse ( arch , has_feature , name ) ? )
234- }
235- InlineAsmArch :: RiscV32 | InlineAsmArch :: RiscV64 => {
236- Self :: RiscV ( RiscVInlineAsmReg :: parse ( arch , has_feature , name ) ? )
237- }
238- } )
226+ // Use `Symbol::as_str` instead of `Symbol:: with` here because `has_feature` may access `Symbol`.
227+ let name = name . as_str ( ) ;
228+ Ok ( match arch {
229+ InlineAsmArch :: X86 | InlineAsmArch :: X86_64 => {
230+ Self :: X86 ( X86InlineAsmReg :: parse ( arch , has_feature , & name ) ? )
231+ }
232+ InlineAsmArch :: Arm => Self :: Arm ( ArmInlineAsmReg :: parse ( arch , has_feature , & name ) ? ) ,
233+ InlineAsmArch :: AArch64 => {
234+ Self :: AArch64 ( AArch64InlineAsmReg :: parse ( arch , has_feature , & name ) ? )
235+ }
236+ InlineAsmArch :: RiscV32 | InlineAsmArch :: RiscV64 => {
237+ Self :: RiscV ( RiscVInlineAsmReg :: parse ( arch , has_feature , & name ) ? )
238+ }
239239 } )
240240 }
241241
0 commit comments