Skip to content

Commit 05977fe

Browse files
committed
rewrite comment on how to get closure sig, per arielb1's suggestion
1 parent 47b8ef5 commit 05977fe

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/librustc_typeck/collect.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,14 +1269,14 @@ fn fn_sig<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
12691269
}
12701270

12711271
NodeExpr(&hir::Expr { node: hir::ExprClosure(..), .. }) => {
1272-
// In order to property accommodate regions during NLL
1273-
// inference, `fn_sig` query only works for top-level
1274-
// functions. This is because closures often contain erased regions
1275-
// in their signatures that are understood by NLL inference but not other
1276-
// parts of the system -- these do not appear in the generics and hence
1277-
// are not properly substituted away without some care.
1272+
// Closure signatures are not like other function
1273+
// signatures and cannot be accessed through `fn_sig`. For
1274+
// example, a closure signature excludes the `self`
1275+
// argument. In any case they are embedded within the
1276+
// closure type as part of the `ClosureSubsts`.
12781277
//
1279-
// To get the signature of a closure, you should use the
1278+
// To get
1279+
// the signature of a closure, you should use the
12801280
// `closure_sig` method on the `ClosureSubsts`:
12811281
//
12821282
// closure_substs.closure_sig(def_id, tcx)

0 commit comments

Comments
 (0)