File tree 2 files changed +16
-1
lines changed
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,11 @@ pub enum InstanceDef<'tcx> {
42
42
/// `DefId` is `FnTrait::call_*`.
43
43
FnPtrShim ( DefId , Ty < ' tcx > ) ,
44
44
45
- /// `<dyn Trait as Trait>::fn`
45
+ /// `<dyn Trait as Trait>::fn`, "direct calls" of which are implicitly
46
+ /// codegen'd as virtual calls.
47
+ ///
48
+ /// NB: if this is reified to a `fn` pointer, a `ReifyShim` is used
49
+ /// (see `ReifyShim` above for more details on that).
46
50
Virtual ( DefId , usize ) ,
47
51
48
52
/// `<[mut closure] as FnOnce>::call_once`
Original file line number Diff line number Diff line change @@ -2417,8 +2417,19 @@ where
2417
2417
+ HasTyCtxt < ' tcx >
2418
2418
+ HasParamEnv < ' tcx > ,
2419
2419
{
2420
+ /// Compute a `FnAbi` suitable for indirect calls, i.e. to `fn` pointers.
2421
+ ///
2422
+ /// NB: this doesn't handle virtual calls - those should use `FnAbi::of_instance`
2423
+ /// instead, where the instance is a `InstanceDef::Virtual`.
2420
2424
fn of_fn_ptr ( cx : & C , sig : ty:: PolyFnSig < ' tcx > , extra_args : & [ Ty < ' tcx > ] ) -> Self ;
2425
+
2426
+ /// Compute a `FnAbi` suitable for declaring/defining an `fn` instance, and for
2427
+ /// direct calls to an `fn`.
2428
+ ///
2429
+ /// NB: that includes virtual calls, which are represented by "direct calls"
2430
+ /// to a `InstanceDef::Virtual` instance (of `<dyn Trait as Trait>::fn`).
2421
2431
fn of_instance ( cx : & C , instance : ty:: Instance < ' tcx > , extra_args : & [ Ty < ' tcx > ] ) -> Self ;
2432
+
2422
2433
fn new_internal (
2423
2434
cx : & C ,
2424
2435
sig : ty:: PolyFnSig < ' tcx > ,
You can’t perform that action at this time.
0 commit comments