11use rustc_attr_parsing:: InstructionSetAttr ;
22use rustc_middle:: mir:: mono:: { Linkage , MonoItem , MonoItemData , Visibility } ;
33use rustc_middle:: mir:: { Body , InlineAsmOperand , START_BLOCK } ;
4- use rustc_middle:: ty:: layout:: { HasTyCtxt , HasTypingEnv , LayoutOf } ;
4+ use rustc_middle:: ty:: layout:: { LayoutOf , TyAndLayout } ;
55use rustc_middle:: ty:: { Instance , TyCtxt } ;
66use rustc_middle:: { bug, ty} ;
77use rustc_span:: sym;
88
99use crate :: common;
10- use crate :: traits:: { AsmCodegenMethods , BuilderMethods , GlobalAsmOperandRef , MiscCodegenMethods } ;
10+ use crate :: mir:: AsmCodegenMethods ;
11+ use crate :: traits:: { GlobalAsmOperandRef , MiscCodegenMethods } ;
1112
12- pub ( crate ) fn codegen_naked_asm < ' a , ' tcx , Bx : BuilderMethods < ' a , ' tcx > > (
13- cx : & ' a Bx :: CodegenCx ,
13+ pub ( crate ) fn codegen_naked_asm <
14+ ' a ,
15+ ' tcx ,
16+ Cx : LayoutOf < ' tcx , LayoutOfResult = TyAndLayout < ' tcx > >
17+ + AsmCodegenMethods < ' tcx >
18+ + MiscCodegenMethods < ' tcx > ,
19+ > (
20+ cx : & ' a Cx ,
1421 mir : & Body < ' tcx > ,
1522 instance : Instance < ' tcx > ,
1623) {
@@ -28,7 +35,7 @@ pub(crate) fn codegen_naked_asm<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
2835 } ;
2936
3037 let operands: Vec < _ > =
31- operands. iter ( ) . map ( |op| inline_to_global_operand :: < Bx > ( cx, instance, op) ) . collect ( ) ;
38+ operands. iter ( ) . map ( |op| inline_to_global_operand :: < Cx > ( cx, instance, op) ) . collect ( ) ;
3239
3340 let item_data = cx. codegen_unit ( ) . items ( ) . get ( & MonoItem :: Fn ( instance) ) . unwrap ( ) ;
3441 let name = cx. mangled_name ( instance) ;
@@ -42,8 +49,8 @@ pub(crate) fn codegen_naked_asm<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
4249 cx. codegen_global_asm ( & template_vec, & operands, options, line_spans) ;
4350}
4451
45- fn inline_to_global_operand < ' a , ' tcx , Bx : BuilderMethods < ' a , ' tcx > > (
46- cx : & ' a Bx :: CodegenCx ,
52+ fn inline_to_global_operand < ' a , ' tcx , Cx : LayoutOf < ' tcx , LayoutOfResult = TyAndLayout < ' tcx > > > (
53+ cx : & ' a Cx ,
4754 instance : Instance < ' tcx > ,
4855 op : & InlineAsmOperand < ' tcx > ,
4956) -> GlobalAsmOperandRef < ' tcx > {
0 commit comments