@@ -2633,34 +2633,6 @@ impl<'tcx> ty::Instance<'tcx> {
2633
2633
}
2634
2634
}
2635
2635
2636
- pub trait FnAbiExt < ' tcx , C >
2637
- where
2638
- C : LayoutOf < ' tcx , LayoutOfResult = TyAndLayout < ' tcx > > + HasTargetSpec ,
2639
- {
2640
- /// Compute a `FnAbi` suitable for indirect calls, i.e. to `fn` pointers.
2641
- ///
2642
- /// NB: this doesn't handle virtual calls - those should use `FnAbi::of_instance`
2643
- /// instead, where the instance is an `InstanceDef::Virtual`.
2644
- fn of_fn_ptr ( cx : & C , sig : ty:: PolyFnSig < ' tcx > , extra_args : & [ Ty < ' tcx > ] ) -> Self ;
2645
-
2646
- /// Compute a `FnAbi` suitable for declaring/defining an `fn` instance, and for
2647
- /// direct calls to an `fn`.
2648
- ///
2649
- /// NB: that includes virtual calls, which are represented by "direct calls"
2650
- /// to an `InstanceDef::Virtual` instance (of `<dyn Trait as Trait>::fn`).
2651
- fn of_instance ( cx : & C , instance : ty:: Instance < ' tcx > , extra_args : & [ Ty < ' tcx > ] ) -> Self ;
2652
-
2653
- fn new_internal (
2654
- cx : & C ,
2655
- sig : ty:: PolyFnSig < ' tcx > ,
2656
- extra_args : & [ Ty < ' tcx > ] ,
2657
- caller_location : Option < Ty < ' tcx > > ,
2658
- codegen_fn_attr_flags : CodegenFnAttrFlags ,
2659
- make_self_ptr_thin : bool ,
2660
- ) -> Self ;
2661
- fn adjust_for_abi ( & mut self , cx : & C , abi : SpecAbi ) ;
2662
- }
2663
-
2664
2636
/// Calculates whether a function's ABI can unwind or not.
2665
2637
///
2666
2638
/// This takes two primary parameters:
@@ -2816,6 +2788,34 @@ pub fn conv_from_spec_abi(tcx: TyCtxt<'_>, abi: SpecAbi) -> Conv {
2816
2788
}
2817
2789
}
2818
2790
2791
+ pub trait FnAbiExt < ' tcx , C >
2792
+ where
2793
+ C : LayoutOf < ' tcx , LayoutOfResult = TyAndLayout < ' tcx > > + HasTargetSpec ,
2794
+ {
2795
+ /// Compute a `FnAbi` suitable for indirect calls, i.e. to `fn` pointers.
2796
+ ///
2797
+ /// NB: this doesn't handle virtual calls - those should use `FnAbi::of_instance`
2798
+ /// instead, where the instance is an `InstanceDef::Virtual`.
2799
+ fn of_fn_ptr ( cx : & C , sig : ty:: PolyFnSig < ' tcx > , extra_args : & [ Ty < ' tcx > ] ) -> Self ;
2800
+
2801
+ /// Compute a `FnAbi` suitable for declaring/defining an `fn` instance, and for
2802
+ /// direct calls to an `fn`.
2803
+ ///
2804
+ /// NB: that includes virtual calls, which are represented by "direct calls"
2805
+ /// to an `InstanceDef::Virtual` instance (of `<dyn Trait as Trait>::fn`).
2806
+ fn of_instance ( cx : & C , instance : ty:: Instance < ' tcx > , extra_args : & [ Ty < ' tcx > ] ) -> Self ;
2807
+
2808
+ fn new_internal (
2809
+ cx : & C ,
2810
+ sig : ty:: PolyFnSig < ' tcx > ,
2811
+ extra_args : & [ Ty < ' tcx > ] ,
2812
+ caller_location : Option < Ty < ' tcx > > ,
2813
+ codegen_fn_attr_flags : CodegenFnAttrFlags ,
2814
+ make_self_ptr_thin : bool ,
2815
+ ) -> Self ;
2816
+ fn adjust_for_abi ( & mut self , cx : & C , abi : SpecAbi ) ;
2817
+ }
2818
+
2819
2819
impl < ' tcx , C > FnAbiExt < ' tcx , C > for call:: FnAbi < ' tcx , Ty < ' tcx > >
2820
2820
where
2821
2821
C : LayoutOf < ' tcx , LayoutOfResult = TyAndLayout < ' tcx > > + HasTargetSpec ,
0 commit comments