Skip to content

Commit 2ea6094

Browse files
committed
explain why pick-constraints can be an empty vector
1 parent 4de9960 commit 2ea6094

File tree

1 file changed

+8
-1
lines changed
  • src/librustc_mir/borrow_check/nll/type_check

1 file changed

+8
-1
lines changed

src/librustc_mir/borrow_check/nll/type_check/mod.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2514,7 +2514,14 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
25142514
if let Some(closure_region_requirements) = tcx.mir_borrowck(def_id).closure_requirements {
25152515
let closure_constraints = QueryRegionConstraints {
25162516
outlives: closure_region_requirements.apply_requirements(tcx, def_id, substs),
2517-
pick_constraints: vec![], // TODO
2517+
2518+
// Presently, closures never propagate pick
2519+
// constraints to their parents -- they are enforced
2520+
// locally. This is largely a non-issue as pick
2521+
// constraints only come from `-> impl Trait` and
2522+
// friends which don't appear (thus far...) in
2523+
// closures.
2524+
pick_constraints: vec![],
25182525
};
25192526

25202527
let bounds_mapping = closure_constraints

0 commit comments

Comments
 (0)