about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2019-06-12 11:47:48 -0400
committerNiko Matsakis <niko@alum.mit.edu>2019-07-02 12:15:21 -0400
commit2ea6094938a5ba4b0fa0f263bf458f81eaea264b (patch)
tree0934dd87798818af1faa95ff2b01c40b41c65842
parent4de99600b0ca8dafd5310f900def87bbcbf0aae6 (diff)
downloadrust-2ea6094938a5ba4b0fa0f263bf458f81eaea264b.tar.gz
rust-2ea6094938a5ba4b0fa0f263bf458f81eaea264b.zip
explain why pick-constraints can be an empty vector
-rw-r--r--src/librustc_mir/borrow_check/nll/type_check/mod.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/librustc_mir/borrow_check/nll/type_check/mod.rs b/src/librustc_mir/borrow_check/nll/type_check/mod.rs
index ea7db309644..9b7a62ba764 100644
--- a/src/librustc_mir/borrow_check/nll/type_check/mod.rs
+++ b/src/librustc_mir/borrow_check/nll/type_check/mod.rs
@@ -2514,7 +2514,14 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
         if let Some(closure_region_requirements) = tcx.mir_borrowck(def_id).closure_requirements {
             let closure_constraints = QueryRegionConstraints {
                 outlives: closure_region_requirements.apply_requirements(tcx, def_id, substs),
-                pick_constraints: vec![], // TODO
+
+                // Presently, closures never propagate pick
+                // constraints to their parents -- they are enforced
+                // locally.  This is largely a non-issue as pick
+                // constraints only come from `-> impl Trait` and
+                // friends which don't appear (thus far...) in
+                // closures.
+                pick_constraints: vec![],
             };
 
             let bounds_mapping = closure_constraints