Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for issues #51351 and #52113 #52620

Merged
merged 1 commit into from
Jul 29, 2018
Merged

fix for issues #51351 and #52113 #52620

merged 1 commit into from
Jul 29, 2018

Conversation

mikhail-m1
Copy link
Contributor

@mikhail-m1 mikhail-m1 commented Jul 22, 2018

fix for #51351 and #52113

r? @nikomatsakis

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 22, 2018
//
// An additional regression test for the issue #50716 “NLL ignores lifetimes
// bounds derived from `Sized` requirements” that checks that the fixed compiler
// accepts this code fragment with both AST and MIR borrow checkers.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this referring to the right issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, just copy & paste...

@@ -490,6 +490,29 @@ impl<'cx, 'gcx, 'tcx> UniversalRegionsBuilder<'cx, 'gcx, 'tcx> {
&bound_inputs_and_output,
&mut indices,
);

// Add late-bound regions which are not used in in inputs and outhout
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be nice to put this into a fn, along with a somewhat more extensive comment that (at minimum) cites the issue number.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a comment like this would be good:


Finds late-bound regions that do not appear in the parameter listing and adds them to the indices vector. Typically, we identify late-bound regions as we process the inputs and outputs of the closure/function. However, sometimes there are late-bound regions which do not appear in the fn parameters but which are nonetheless in scope. The simplest case of this are unused functions, like fn foo<'a>() { } (see eg., #51351). Despite not being used, users can still reference these regions (e.g., let x: &'a u32 = &22;), so we need to create entries for them and store them in the indices map. This code iterates over the complete set of late-bound regions and checks for any that we have not yet seen, adding them to the inputs vector.

let name = map.name(map.hir_to_node_id(hir_id)).as_interned_str();
let def_id = map.local_def_id(map.hir_to_node_id(hir_id));
let region = ty::BoundRegion::BrNamed(def_id, name);
if added_from_input_and_output.contains(&region) { continue; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I was thinking we could check indices to detect if the region already exists, but I guess in that case we'd have to create the liberated_region first. Still, we are doing that already below...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, thinking a bit more about this, something seems a touch off. In particular, if we are looking at a closure, the added_from_input_and_output is going to contain late-bound regions from the closure's inputs and outputs. But here we are comparing against late-bound regions bound on the closure owner (closure_base_def_id).

I think comparing against entries in indices would be more robust. The diff would basically be to remove added_from_input_and_output and instead do:

let liberated_region = ...;
if !indices.contains_key(&liberated_region) {
    let region_vid = self.infcx.next_nll_region_var(FR);
    indices.insert_late_bound_region(liberated_region, region_vid.to_region_vid());
}

@@ -490,6 +490,9 @@ impl<'cx, 'gcx, 'tcx> UniversalRegionsBuilder<'cx, 'gcx, 'tcx> {
&bound_inputs_and_output,
&mut indices,
);

self.infcx.replace_late_bound_regions_with_nll_infer_vars(self.mir_def_id, &mut indices);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I noted on Zulip, in the case of a closure, this code needs to execute earlier -- that is, the late-bound regions on the closure's creator are not local free regions, so they must be created up above, before the first_local_index variable is assigned.

@@ -479,6 +479,9 @@ impl<'cx, 'gcx, 'tcx> UniversalRegionsBuilder<'cx, 'gcx, 'tcx> {
let mut indices = self.compute_indices(fr_static, defining_ty);
debug!("build: indices={:?}", indices);

let _first_late_bound_index = self.infcx.num_region_vars();
self.infcx.replace_late_bound_regions_with_nll_infer_vars(self.mir_def_id, &mut indices);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we only want to do this here if self.mir_def_id != closure_base_def_id -- i.e., if this is a closure/generator -- otherwise, we want to do it in the location you originally had it.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:47:19] ....................................................................................................
[00:47:22] ....................................................................................................
[00:47:25] ....................................................................................................
[00:47:28] ....................................................................................................
[00:47:31] ....................................................i........................F.FFFF.F...............
[00:47:35] .........F.....................FF.FFFF.FF.....i.....................................................
[00:47:41] ....................................................................................................
[00:47:47] ...................................................i....
[00:47:47] failures:
[00:47:47] 
[00:47:47] 
[00:47:47] ---- [ui] ui/nll/closure-requirements/propagate-approximated-ref.rs stdout ----
[00:47:47] 
[00:47:47] error: Error: expected failure status (Some(1)) but received status Some(101).
[00:47:47] status: exit code: 101
[00:47:47] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-approximated-ref/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Zborrowck=mir" "-Zverbose" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-approximated-ref/auxiliary" "-A" "unused"
[00:47:47] stdout:
[00:47:47] --------------_end":33},{"text":"        demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll","highlight_start":1,"highlight_end":82},{"text":"    });","highlight_start":1,"highlight_end":6}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:18 ~ propagate_approximated_ref[317d]::supply[0]::{{closure}}[0]) with closure substs [\n    i16,\n    for<'r, 's, 't0, 't1, 't2, 't3> extern \"rust-call\" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't1)) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't3)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't1)) u32>))\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"number of external vids: 5","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"where '_#1r: '_#2r","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: External requirements\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs:53:47\n   |\nLL |       establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {\n   |  _______________________________________________^\nLL | |         //~^ ERROR lifetime mismatch\nLL | |\nLL | |         // Only works if 'x: 'y:\nLL | |         demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll\nLL | |     });\n   | |_____^\n   |\n   = note: defining type: DefId(0/1:18 ~ propagate_approximated_ref[317d]::supply[0]::{{closure}}[0]) with closure substs [\n               i16,\n               for<'r, 's, 't0, 't1, 't2, 't3> extern \"rust-call\" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't1)) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't3)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't1)) u32>))\n           ]\n   = note: number of external vids: 5\n   = note: where '_#1r: '_#2r\n\n"}
[00:47:47]   left: `3`,
[00:47:47]   left: `3`,
[00:47:47]  right: `5`: index vec had unexpected number of variables', librustc_mir/borrow_check/nll/universal_regions.rs:280:9
[00:47:47] 
[00:47:47] error: internal compiler error: unexpected panic
[00:47:47] 
[00:47:47] 
[00:47:47] note: the compiler unexpectedly panicked. this is a bug.
[00:47:47] 
[00:47:47] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:47:47] note: rustc 1.29.0-dev running on x86_64-unknown-linux-gnu
[00:47:47] 
[00:47:47] 
[00:47:47] note: compiler flags: -Z ui-testing -Z unstable-options -Z borrowck=mir -Z verbose -C prefer-dynamic -C rpath
[00:47:47] 
[00:47:47] ------------------------------------------
[00:47:47] 
[00:47:47] thread '[ui] ui/nll/closure-requirements/propagate-approximated-ref.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3141:9
[00:47:47] thread '[ui] ui/nll/closure-requirements/propagate-approximated-ref.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3141:9
[00:47:47] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:47:47] 
[00:47:47] ---- [ui] ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs stdout ----
[00:47:47] 
[00:47:47] error: Error: expected failure status (Some(1)) but received status Some(101).
[00:47:47] status: exit code: 101
[00:47:47] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Zborrowck=mir" "-Zverbose" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound/auxiliary" "-A" "unused"
[00:47:47] ------------------------------------------
[00:47:47] 
[00:47:47] ------------------------------------------
[00:47:47] stderr:
[00:47:47] stderr:
[00:47:47] ------------------------------------------
[00:47:47] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs","byte_start":1609,"byte_end":1632,"line_start":49,"line_end":49,"column_start":9,"column_end":32,"is_primary":true,"text":[{"text":"        demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll","highlight_start":9,"highlight_end":32}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"warning: not reporting region error due to nll\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs:49:9\n   |\nLL |         demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll\n   |         ^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[00:47:47] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs","byte_start":1528,"byte_end":1688,"line_start":45,"line_end":50,"column_start":47,"column_end":6,"is_primary":true,"text":[{"text":"    establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {","highlight_start":47,"highlight_end":66},{"text":"        //~^ ERROR","highlight_start":1,"highlight_end":19},{"text":"","highlight_____________^\nLL | |         //~^ ERROR\nLL | |\nLL | |         // Only works if 'x: 'y:\nLL | |         demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll\nLL | |     });\n   | |_____^\n   |\n   = note: defining type: DefId(0/1:18 ~ propagate_approximated_shorter_to_static_no_bound[317d]::supply[0]::{{closure}}[0]) with closure substs [\n               i16,\n               for<'r, 's, 't0, 't1, 't2> extern \"rust-call\" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't1)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't2)) u32>))\n           ]\n   = note: number of external vids: 4\n   = note: where '_#1r: '_#0r\n\n"}
[00:47:47]   left: `2`,
[00:47:47]   left: `2`,
[00:47:47]  right: `4`: index vec had unexpected number of variables', librustc_mir/borrow_check/nll/universal_regions.rs:280:9
[00:47:47] 
[00:47:47] error: internal compiler error: unexpected panic
[00:47:47] 
[00:47:47] 
[00:47:47] note: the compiler unexpectedly panicked. this is a bug.
[00:47:47] 
[00:47:47] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:47:47] 
[00:47:47] note: rustc 1.29.0-dev ru---------
[00:47:47] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs","byte_start":1696,"byte_end":1719,"line_start":51,"line_end":51,"column_start":9,"column_end":32,"is_primary":true,"text":[{"text":"        demand_y(x, y, x.get())","highlight_start":9,"highlight_end":32}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"warning: not reporting region error due to nll\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs:51:9\n   |\nLL |         demand_y(x, y, x.get())\n   |         ^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[00:47:47] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs","byte_start":1603,"byte_end":1784,"line_start":48,"line_end":53,"column_start":47,"column_end":6,"is_primary":true,"text":[{"text":"    establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {","highlight_start":47,"highlight_end":79},{"text":"        //~^ ERROR","highlight_start":1,"highlight_end":19},{"text":"        // Only works if 'x: 'y:","highlight_start":1,"highlight_end":33},{"text":"        demand_y(x, y, x.get())","highlight_start":1,"highlight_end":32},{"text":"        //~^ WARNING not reporting region error due to nll","highlight_start":1,"highlight_end":59},{"text":"    });","highlight_start":1,"highlight_enIBUTING.md#bug-reports
[00:47:47] note: rustc 1.29.0-dev running on x86_64-unknown-linux-gnu
[00:47:47] 
[00:47:47] 
[00:47:47] note: compiler flags: -Z ui-testing -Z unstable-options -Z borrowck=mir -Z verbose -C prefer-dynamic -C rpath
[00:47:47] 
[00:47:47] ------------------------------------------
[00:47:47] 
[00:47:47] thread '[ui] ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3141:9
[00:47:47] thread '[ui] ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3141:9
[00:47:47] 
[00:47:47] ---- [ui] ui/nll/closure-requirements/propagate-approximated-val.rs stdout ----
[00:47:47] 
[00:47:47] error: Error: expected failure status (Some(1)) but received status Some(101).
[00:47:47] status: exit code: 101
[00:47:47] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-val.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-approximated-val/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Zborrowck=mir" "-Zverbose" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-approximated-val/auxiliary" "-A" "unused"
[00:47:47] ------------------------------------------
[00:47:47] 
[00:47:47] ------------------------------------------
[00:47:47] stderr:
[00:47:47] stderr:
[00:47:47] ------------------------------------------
[00:47:47] {"mess\n               for<'r, 's> extern \"rust-call\" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) u32>))\n           ]\n   = note: number of external vids: 5\n   = note: where '_#1r: '_#2r\n\n"}
[00:47:47]   left: `3`,
[00:47:47]   left: `3`,
[00:47:47]  right: `5`: index vec had unexpected number of variables', librustc_mir/borrow_check/nll/universal_regions.rs:280:9
[00:47:47] 
[00:47:47] error: internal compiler error: unexpected panic
[00:47:47] 
[00:47:47] 
[00:47:47] note: the compiler unexpectedly panicked. this is a bug.
[00:47:47] 
[00:47:47] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:47:47] note: rustc 1.29.0-dev running on x86_64-unknown-linux-gnu
[00:47:47] 
[00:47:47] 
[00:47:47] note: compiler flags: -Z ui-testing -Z unstable-options -Z borrowck=mir -Z verbose -C prefer-dynamic -C rpath
[00:47:47] 
[00:47:47] ------------------------------------------
[00:47:47] 
[00:47:47] thread '[ui] ui/nll/closure-requirements/propagate-approximated-val.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3141:9
[00:47:47] thread '[ui] ui/nll/closure-requirements/propagate-approximated-val.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3141:9
[00:47:47] 
[00:47:47] ---- [ui] ui/nll/closure-requirements/propagate-despite-same-frequirements/propagate-despite-same-free-region.rs:54:21\n   |\nLL |             let p = x.get();\n   |                     ^^^^^^^\n\n"}
[00:47:47] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.rs","byte_start":1620,"byte_end":1758,"line_start":52,"line_end":56,"column_start":9,"column_end":10,"is_primary":true,"text":[{"text":"        |_outlives1, _outlives2, x, y| {","highlight_start":9,"highlight_end":41},{"text":"            // Only works if 'x: 'y:","highlight_start":1,"highlight_end":37},{"text":"            let p = x.get();","highlight_start":1,"highlight_end":29},{"text":"            demand_y(x, y, p)","highlight_start":1,"highlight_end":30},{"text":"        },","highlight_start":1,"highlight_end":10}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:16 ~ propagate_despite_same_free_region[317d]::supply[0]::{{closure}}[0]) with closure substs [\n    i16,\n    for<'r, 's> extern \"rust-call\" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) u32>))\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"number of external vids: 4","code":null,"level":"note","spans":[],"ch report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:47:47] note: rustc 1.29.0-dev running on x86_64-unknown-linux-gnu
[00:47:47] 
[00:47:47] 
[00:47:47] note: compiler flags: -Z ui-testing -Z unstable-options -Z borrowck=mir -Z verbose -C prefer-dynamic -C rpath
[00:47:47] 
[00:47:47] ------------------------------------------
[00:47:47] 
[00:47:47] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:498:22
[00:47:47] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:498:22
[00:47:47] thread '[ui] ui/nll/closure-requirements/propagate-despite-same-free-region.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3141:9
[00:47:47] 
[00:47:47] ---- [ui] ui/nll/closure-requirements/propagate-from-trait-match.rs stdout ----
[00:47:47] 
[00:47:47] error: Error: expected failure status (Some(1)) but received status Some(101).
[00:47:47] status: exit code: 101
[00:47:47] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/closure-requirements/propagate-from-trait-match.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-from-trait-match/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Zborrowck=mir" "-Zverbose" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-from-trait-match/auxiliary" "-A" "unused"
[00:47:47] ------------------------------------------
[00:47:47] 
[00:47:47] 
[00:47:47 reporting region error due to nll\nLL | |     });\n   | |_____^\n   |\n   = note: defining type: DefId(0/1:16 ~ propagate_from_trait_match[317d]::supply[0]::{{closure}}[0]) with closure substs [\n               '_#1r,\n               T,\n               i32,\n               extern \"rust-call\" fn((T,))\n           ]\n   = note: number of external vids: 3\n   = note: where T: '_#1r\n\n"}
[00:47:47]   left: `2`,
[00:47:47]   left: `2`,
[00:47:47]  right: `3`: index vec had unexpected number of variables', librustc_mir/borrow_check/nll/universal_regions.rs:280:9
[00:47:47] 
[00:47:47] error: internal compiler error: unexpected panic
[00:47:47] 
[00:47:47] 
[00:47:47] note: the compiler unexpectedly panicked. this is a bug.
[00:47:47] 
[00:47:47] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:47:47] note: rustc 1.29.0-dev running on x86_64-unknown-linux-gnu
[00:47:47] 
[00:47:47] 
[00:47:47] note: compiler flags: -Z ui-testing -Z unstable-options -Z borrowck=mir -Z verbose -C prefer-dynamic -C rpath
[00:47:47] 
[00:47:47] ------------------------------------------
[00:47:47] 
[00:47:47] thread '[ui] ui/nll/closure-requirements/propagate-from-trait-match.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3141:9
[00:47:47] thread '[ui] ui/nll/closure-requirements/propagate-from-trait-match.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3141:9
[00:47:47] 
[00:47:47] ---- [ui] ui/nll/issue-50716.rs stdout ----
[00:47:47] diff of stderr:
[00:47:47] 
[00:47:47] - error: borrowed data escapes outside of closure
[00:47:47] + error: unsatisfied lifror-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/projection-implied-bounds/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Zborrowck=mir" "-Zverbose" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/projection-implied-bounds/auxiliary" "-A" "unused"
[00:47:47] ------------------------------------------
[00:47:47] 
[00:47:47] ------------------------------------------
[00:47:47] stderr:
[00:47:47] stderr:
[00:47:47] ------------------------------------------
[00:47:47] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-implied-bounds.rs","byte_start":1198,"byte_end":1205,"line_start":45,"line_end":45,"column_start":36,"column_end":43,"is_primary":true,"text":[{"text":"    twice(value, |value_ref, item| invoke2(value_ref, item));","highlight_start":36,"highlight_end":43}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"warning: not reporting region error due to nll\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-implied-bounds.rs:45:36\n   |\nLL |     twice(value, |value_ref, item| invoke2(value_ref, item));\n   |                                    ^^^^^^^\n\n"}
[00:47:47]   left: `1`,
[00:47:47]   left: `1`,
[00:47:47]  right: `2`: index vec had unexpected number of variables', librustc_mir/borrow_check/nll/universal_regions.rs:280:9
[00:47:47] 
[00:47:47] error: internal compiler error: unexpected panic
[00:47:47] 
[00:47:47] 
[00:47:47] note: the compiler unexpectedly panicked. this is a bug.
[00:47:47] 
[00:47:47] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:47:47] note: rustc 1.29.0-dev running on x86_64-unknown-linux-gnu
[00:47:47] 
[00:47:47] 
[00:47:47] note: compiler flags: -Z ui-testing -Z unstable-options -Z borrowck=mir -Z verbose -C prefer-dynamic -C rpath
[00:47:47] 
[00:47:47] ------------------------------------------
[00:47:47] 
[00:47:47] thread '[ui] ui/nll/ty-outlives/projection-implied-bounds.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3141:9
[00:47:47] thread '[ui] ui/nll/ty-outlives/projection-implied-bounds.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3141:9
[00:47:47] 
[00:47:47] ---- [ui] ui/nll/ty-outlives/projection-no-regions-closure.rs stdout ----
[00:47:47] 
[00:47:47] error: Error: expected failure status (Some(1)) but received status Some(101).
[00:47:47] status: exit code: 101
[00:47:47] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/projection-no-regions-closure/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Zborrowck=mir" "-Zverbose" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/projection-no-regions-closure/auxiliary" "-A" "unused"
[00:47:47] ------------------------------------------
[00:47:47] 
[00:47:47] ------------------------------------------
[00:47:47] stderr:
[00:47:47] stderr:
[00:47:47] ------------------------------------------
[00:47:47] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs","byte_start":1046,"byte_end":1064,"line_start":35,"line_end":35,"column_start":31,"column_end":49,"is_primary":true,"text":[{"text":"    with_signature(x, |mut y| Box::new(y.next()))","highlight_start":31,"highlight_end":49}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"warning: not reporting region error due to nll\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs:35:31\n   |\nLL |     with_signature(x, |mut y| Box::new(y.next()))\n   |                               ^^^^^^^^^^^^^^^^^^\n\n"}
[00:47:47] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs","byte_start":1522,"byte_end":1540,"line_start":53,"line_end":53,"column_start":31,"column_end":49,"is_primary":true,"text":[{"text":"    with_signature(x, |mut y| Box::new(y.next()))","highlight_start":31,"highlight_end":49}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"warning: not reporting region error due to nll\n  -->heckout/src/test/ui/nll/ty-outlives/projection-one-region-closure.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/projection-one-region-closure/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Zborrowck=mir" "-Zverbose" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/projection-one-region-closure/auxiliary" "-A" "unused"
[00:47:47] ------------------------------------------
[00:47:47] 
[00:47:47] ------------------------------------------
[00:47:47] stderr:
[00:47:47] stderr:
[00:47:47] ------------------------------------------
[00:47:47] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-one-region-closure.rs","byte_start":1582,"byte_end":1589,"line_start":55,"line_end":55,"column_start":39,"column_end":46,"is_primary":true,"text":[{"text":"    with_signature(cell, t, |cell, t| require(cell, t));","highlight_start":39,"highlight_end":46}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"warning: not reporting region error due to nll\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-one-region-closure.rs:55:39\n   |\nLL |     with_signature(cell, t, |cell, t| require(cell, t));\n   |                                       ^^^^^^^\n\n"}
[00:47:47] {"message":"not reporting region error due to nll","code":null,"level":"waon-one-region-closure.rs","byte_start":1572,"byte_end":1598,"line_start":55,"line_end":55,"column_start":29,"column_end":55,"is_primary":true,"text":[{"text":"    with_signature(cell, t, |cell, t| require(cell, t));","highlight_start":29,"highlight_end":55}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:19 ~ projection_one_region_closure[317d]::no_relationships_late[0]::{{closure}}[0]) with closure substs [\n    '_#1r,\n    T,\n    i32,\n    extern \"rust-call\" fn((std::cell::Cell<&'_#2r ()>, T))\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"number of external vids: 5","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"where T: '_#2r","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"where '_#1r: '_#2r","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: External requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-one-region-closure.rs:55:29\n   |\nLL |     with_signature(cell, t, |cell, t| require(cell, t));\n   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = note: defining type: DefId(0/1:19 ~ projection_one_region_closure[317d]::no_relationships_late[0]::{{closure}}[0]) with closure substs [\n               '_#1r,\n               T,\n               i32,\n               extern \"rust-call\" fn((std::cell::Cell<&'_#2r ()>, T))\n           ]\n   = note: number of external vids: 5\n   = note: where T: '_#2r\n   = note: where '_#1r: '_#2r\n\n"}
[00:47:47]   left: `3`,
[00:47:47]   left: `3`,
[00:47:47]  right: `5`: index vec had unexpected number of variables', librustc_mir/borrow_check/nll/universal_regions.rs:280:9
[00:47:47] 
[00:47:47] error: internal compiler error: unexpected panic
[00:47:47] 
[00:47:47] 
[00:47:47] note: the compiler unexpectedly panicked. this is a bug.
[00:47:47] 
[00:47:47] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:47:47] note: rustc 1.29.0-dev running on x86_64-unknown-linux-gnu
[00:47:47] 
[00:47:47] 
[00:47:47] note: compiler flags: -Z ui-testing -Z unstable-options -Z borrowck=mir -Z verbose -C prefer-dynamic -C rpath
[00:47:47] 
[00:47:47] ------------------------------------------
[00:47:47] 
[00:47:47] thread '[ui] ui/nll/ty-outlives/projection-one-region-closure.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3141:9
[00:47:47] thread '[ui] ui/nll/ty-outlives/projection-one-region-closure.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3141:9
[00:47:47] 
[00:47:47] ---- [ui] ui/nll/ty-outlives/projection-one-region-trait-bound-closure.rs stdout ----
[00:47:47] 
[00:47:47] error: Error: expected failure status (Some(1)) but received status Some(101).
[00:47:47] status: exit code: 101
[00:47:47] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Zborrowck=mir" "-Zverbose" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure/auxiliary" "-A" "unused"
[00:47:47] ------------------------------------------
[00:47:47] 
[00:47:47] ------------------------------------------
[00:47:47] stderr:
[00:47:47] stderr:
[00:47:47] ------------------------------------------
[00:47:47] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.rs","byte_start":1321,"byte_end":1328,"line_start":47,"line_end":47,"column_start":39,"column_end":46,"is_primary":true,"text":[{"text":"    with_signature(cell, t, |cell, t| require(cell, t));","highlight_start":39,"highlight_end":46}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"warning: not reporting region error due to nll\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.rs:47:39\n   |\nLL |     with_signature(cell, t, |cell, t| require(cell, t));\n   |                                       ^^^^^^^\n\n"}
[00:47:47] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.rs","byte_start":1572,"byte_end":1579,"line_start":58,"line_end":58,"column_start":39,"column_end":46,"is_primary":true,"text":[{"text":"    with_signature(cell, t, |cell, t| require(cell, t));","highlight_start":39,"highlight_end":46}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"warning: not reporting region error due to nll\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.rs:58:39\n   |\nLL |     with_signature(cell, t, |cell, t| require(cell, t));\n   |                                       ^^^^^^^\n\n"}
[00:47:47] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.rs","byte_start":2424,"byte_end":2431,"line_start":79,"line_end":79,"column_start":39,"column_end":46,"is_primary":true,"text":[{"text":"    with_signature(cell, t, |cell, t| require(cell, t));","highlight_start":39,"highlight_end":46}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"warning: not reporting region error due to nll\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.rs:79:39\n   |\nLL |     with_signature(cell, t, |cell, t| require(cell, t));\n   |                                       ^^^^^^^\n\n"}
[00:47:47] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.rs","byte_start":1311,"byte_end":1337,"line_start":47,"line_end":47,"column_start":29,"column_end":55,"is_primary":true,"text":[{"text":"    with_signature(cell, t, |cell, t| require(cell, t));","highlight_start":29,"highlight_end":55}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:19 ~ projection_one_region_trait_bound_closure[317d]::no_relationships_late[0]::{{closure}}[0]) with closure substs [\n    '_#1r,\n    T,\n    i32,\n    extern \"rust-call\" fn((std::cell::Cell<&'_#2r ()>, T))\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"number of external vids: 5","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"where '_#1r: '_#2r","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: External requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.rs:47:29\n   |\nLL |     with_signature(cell, t, |cell, t| require(cell, t));\n   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = note: defining type: DefId(0/1:19 ~ projection_one_region_trait_bound_closure[317d]::no_relationships_late[0]::{{closure}}[0]) with closure substs [\n               '_#1r,\n               T,\n               i32,\n               extern \"rust-call\" fn((std::cell::Cell<&'_#2r ()>, T))\n           ]\n   = note: number of external vids: 5\n   = note: where '_#1r: '_#2r\n\n"}
[00:47:47]   left: `3`,
[00:47:47]   left: `3`,
[00:47:47]  right: `5`: index vec had unexpected number of variables', librustc_mir/borrow_check/nll/universal_regions.rs:280:9
[00:47:47] note: Run with `RUST_BACKTRAection-two-region-trait-bound-closure/auxiliary" "-A" "unused"
[00:47:47] ------------------------------------------
[00:47:47] 
[00:47:47] ------------------------------------------
[00:47:47] stderr:
[00:47:47] stderr:
[00:47:47] ------------------------------------------
[00:47:47] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs","byte_start":1378,"byte_end":1385,"line_start":48,"line_end":48,"column_start":39,"column_end":46,"is_primary":true,"text":[{"text":"    with_signature(cell, t, |cell, t| require(cell, t));","highlight_start":39,"highlight_end":46}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"warning: not reporting region error due to nll\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs:48:39\n   |\nLL |     with_signature(cell, t, |cell, t| require(cell, t));\n   |                                       ^^^^^^^\n\n"}
[00:47:47] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs","byte_start":1721,"byte_end":1728,"line_start":59,"line_end":59,"column_start":39,"column_end":46,"is_primary":true,"text":[{"text":"    with_signature(cell, t, |cell, t| require(cell, t));","highlight_start":39,"highlight_end":46}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered"ng: not reporting region error due to nll\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs:108:39\n   |\nLL |     with_signature(cell, t, |cell, t| require(cell, t));\n   |                                       ^^^^^^^\n\n"}
[00:47:47] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs","byte_start":1368,"byte_end":1394,"line_start":48,"line_end":48,"column_start":29,"column_end":55,"is_primary":true,"text":[{"text":"    with_signature(cell, t, |cell, t| require(cell, t));","highlight_start":29,"highlight_end":55}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:22 ~ projection_two_region_trait_bound_closure[317d]::no_relationships_late[0]::{{closure}}[0]) with closure substs [\n    '_#1r,\n    '_#2r,\n    T,\n    i32,\n    extern \"rust-call\" fn((std::cell::Cell<&'_#3r ()>, T))\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"number of external vids: 6","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#2r)>>::AssocType: '_#3r","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: External requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs:48:29\n   |\nLL |     with_signature(cell, t, |cell, t| require(cell, t));\n   |                             ^^^^^^^^^^^^^^^^^^^-
[00:47:47] 
[00:47:47] error: Error: expected failure status (Some(1)) but received status Some(101).
[00:47:47] status: exit code: 101
[00:47:47] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Zborrowck=mir" "-Zverbose" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound/auxiliary" "-A" "unused"
[00:47:47] ------------------------------------------
[00:47:47] 
[00:47:47] ------------------------------------------
[00:47:47] stderr:
[00:47:47] stderr:
[00:47:47] ------------------------------------------
[00:47:47] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs","byte_start":972,"byte_end":984,"line_start":34,"line_end":34,"column_start":31,"column_end":43,"is_primary":true,"text":[{"text":"    twice(cell, value, |a, b| invoke(a, b));","highlight_start":31,"highlight_end":43}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"warning: not reporting region error due to nll\n  --> /checkout/src/test/ui/nll/ty-ou               T,\n               i16,\n               for<'r, 's> extern \"rust-call\" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) ()>>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) T))\n           ]\n   = note: number of external vids: 3\n   = note: where T: '_#1r\n\n"}
[00:47:47]   left: `2`,
[00:47:47]   left: `2`,
[00:47:47]  right: `3`: index vec had unexpected number of variables', librustc_mir/borrow_check/nll/universal_regions.rs:280:9
[00:47:47] 
[00:47:47] error: internal compiler error: unexpected panic
[00:47:47] 
[00:47:47] 
[00:47:47] note: the compiler unexpectedly panicked. this is a bug.
[00:47:47] 
[00:47:47] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:47:47] note: rustc 1.29.0-dev running on x86_64-unknown-linux-gnu
[00:47:47] 
[00:47:47] 
[00:47:47] note: compiler flags: -Z ui-testing -Z unstable-options -Z borrowck=mir -Z verbose -C prefer-dynamic -C rpath
[00:47:47] 
[00:47:47] ------------------------------------------
[00:47:47] 
[00:47:47] thread '[ui] ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3141:9
[00:47:47] thread '[ui] ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3141:9
[00:47:47] 
[00:47:47] ---- [ui] ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs stdout ----
[00:47:47] 
[00:47:47] error: Error: expected failure status (Some(1)) but received status Some(101).
[00:47:47] sta     ^\n\n"}
[00:47:47] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs","byte_start":1528,"byte_end":1529,"line_start":52,"line_end":52,"column_start":5,"column_end":6,"is_primary":true,"text":[{"text":"    x","highlight_start":5,"highlight_end":6}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"warning: not reporting region error due to nll\n  --> /checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs:52:5\n   |\nLL |     x\n   |     ^\n\n"}
[00:47:47] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs","byte_start":1221,"byte_end":1226,"line_start":36,"line_end":36,"column_start":23,"column_end":28,"is_primary":true,"text":[{"text":"    with_signature(x, |y| y)","highlight_start":23,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:14 ~ ty_param_closure_outlives_from_return_type[317d]::no_region[0]::{{closure}}[0]) with closure substs [\n    '_#1r,\n    T,\n    i32,\n    extern \"rust-call\" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn std::fmt::Debug + '_#2r)>\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"number of external vids: 4","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"where T: '_#2r","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: External requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs:36:23\n   |\nLL |     with_signature(x, |y| y)\n   |                       ^^^^^\n   |\n   = note: defining type: DefId(0/1:14 ~ ty_param_closure_outlives_from_return_type[317d]::no_region[0]::{{closure}}[0]) with closure substs [\n               '_#1r,\n               T,\n               i32,\n               extern \"rust-call\" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn std::fmt::Debug + '_#2r)>\n           ]\n   = note: number of external vids: 4\n   = note: where T: '_#2r\n\n"}
[00:47:47]   left: `3`,
[00:47:47]   left: `3`,
[00:47:47]  right: `4`: index vec had unexpected number of variables', librustc_mir/borrow_check/nll/universal_regions.rs:280:9
[00:47:47] 
[00:47:47] error: internal compiler error: unexpected panic
[00:47:47] 
[00:47:47] 
[00:47:47] note: the compiler unexpectedly panicked. this is a bug.
[00:47:47] 
[00:47:47] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:47:47] note: rustc 1.29.0-dev running on x86_64-unknown-linux-gnu
[00:47:47] 
[00:47:47] 
[00:47:47] note: compiler flags: -Z ui-testing -Z unstable-options -Z borrowck=mir -Z verbose -C prefer-dynamic -C rpath
[00:47:47] 
[00:47:47] ------------------------------------------
[00:47:47] 
[00:47:47] thread '[ui] ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3141:9
[00:47:47] thread '[ui] ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3141:9
[00:47:47] 
[00:47:47] ---- [ui] ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs stdout ----
[00:47:47] 
[00:47:47] error: Error: expected failure status (Some(1)) but received status Some(101).
[00:47:47] status: exit code: 101
[00:47:47] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Zborrowck=mir" "-Zverbose" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause/auxiliary" "-A" "unused"
[00:47:47] ------------------------------------------
[00:47:47] 
[00:47:47] ------------------------------------------
[00:47:47] stderr:
[00:47:47] stderr:
[00:47:47] ------------------------------------------
[00:47:47] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs","byte_start":1373,"byte_end":1380,"line_start":44,"line_end":44,"column_start":9,"column_end":16,"is_primary":true,"text":[{"text":"        require(&x, &y)","highlight_start":9,"highlight_end":16}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"warning: not reporting region error due to nll\n  --> /checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs:44:9\n   |\nLL |         require(&x, &y)\n   |         ^^^^^^^\n\n"}
[00:47:47] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs","byte_start":2485,"byte_end":2492,"line_start":78,"line_end":78,"column_start":9,"column_end":16,"is_primary":true,"text":[{"text":"        require(&x, &y)","highlight_start":9,"highlight_end":16}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"warning: not reporting region error due to nll\n  --> /checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs:78:9\n   |\nLL |         require(&x, &y)\n   |         ^^^^^^^\n\n"}
[00:47:47] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs","byte_start":1011,"byte_end":1453,"line_start":37,"line_end":46,"column_start":26,"column_end":6,"is_primary":true,"text":[{"text":"    with_signature(a, b, |x, y| {","highlight_start":26,"highlight_end":34},{"text":"        //~^ ERROR the parameter type `T` may not live long enough","highlight_start":1,"highlight_end":67},{"text":"        //","highlight_start":1,"highlight_end":11},{"text":"        // See `correct_region`, which explains the point of this","highlight_start":1,"highlight_end":66},{"text":"        // test.  The only difference is that, in the case of this","highlight_start":1,"highlight_end":67},{"text":"        // function, there is no where clause *anywhere*, and hence we","highlight_start":1,"highlight_end":71},{"text":"        // get an error (but reported by the closure creator).","highlight_start":1,"highlight_end":63},{"text":"        require(&x, &y)","highlight_start":1,"highlight_end":24},{"text":"        //~^ WARNING not reporting region error due to nll","highlight_start":1,"highlight_end":59},{"text":"    })","highlight_start":1,"highlight_end":6}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:16 ~ ty_param_closure_outlives_from_where_clause[317d]::no_region[0]::{{closure}}[0]) with closure substs [\n    T,\n    i32,\n    extern \"rust-call\" fn((std::cell::Cell<&'_#1r ()>, T))\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"number of external vids: 4","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"where T: '_#1r","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: External requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs:37:26\n   |\nLL |       with_signature(a, b, |x, y| {\n   |  __________________________^\nLL | |         //~^ ERROR the parameter type `T` may not live long enough\nLL | |         //\nLL | |         // See `correct_regiopagate-approximated-ref.rs
[00:47:47]     [ui] ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs
[00:47:47]     [ui] ui/nll/closure-requirements/propagate-approximated-val.rs
[00:47:47]     [ui] ui/nll/closure-requirements/propagate-despite-same-free-region.rs
[00:47:47]     [ui] ui/nll/closure-requirements/propagate-from-trait-match.rs
---
[00:47:47] test result: FAILED. 2134 passed; 15 failed; 7 ignored; 0 measured; 0 filtered out
[00:47:47] 
[00:47:47] 
[00:47:47] 
[00:47:47] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-pathcompiler-rt/objects
33908 ./obj/build/x86_64-unknown-linux-gnu/stage1-std/release/build
33908 ./obj/build/x86_64-unknown-linux-gnu/stage0-std/release/build
33884 ./src/llvm-emscripten/lib/Target
33804 ./obj/build/x86_64-unknown-linux-gnu/stage1-rustc/release/build

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@mikhail-m1 mikhail-m1 force-pushed the 51351 branch 2 times, most recently from c668a8b to 2e7a62a Compare July 27, 2018 15:57
@mikhail-m1 mikhail-m1 changed the title [WIP] fix simple case of issue #51351 [WIP] fix simple case of issue #51351 and #52133 Jul 27, 2018
@@ -0,0 +1,29 @@
error[E0597]: `*value` does not live long enough (Ast)
Copy link
Contributor Author

@mikhail-m1 mikhail-m1 Jul 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why is this nice error only in compare mode

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:42:11] ....................................................................................................
[00:42:14] ....................................................................................................
[00:42:17] ....................................................................................................
[00:42:20] ...................................................................i................................
[00:42:23] .................................F......................................i...........................
[00:42:30] ....................................................................................................
[00:42:33] ...........................................................................................i........
[00:42:36] ..............................................................................i....
[00:42:36] failures:
[00:42:36] failures:
[00:42:36] 
[00:42:36] ---- [ui] ui/nll/issue-52133.rs#compare stdout ----
[00:42:36] diff of stderr:
[00:42:36] 
[00:42:36] - error[E0597]: `*value` does not live long enough (Ast)
[00:42:36] -    |
[00:42:36] -    |
[00:42:36] - LL |         data.push(value); //[compare]~ ERROR `*value` does not live long enough (Ast)
[00:42:36] -    |                   ^^^^^ borrowed value does not live long enough
[00:42:36] -    |
[00:42:36] - note: borrowed value must be valid for the lifetime 'b as defined on the function body at 45:20...
[00:42:36] -    |
[00:42:36] -    |
[00:42:36] - LL | fn produce_err<'a, 'b: 'a>(data: &'b mut Vec<&'b u32>, value: &'a u32) -> impl Bazinga + 'b {
[00:42:36] -    |                    ^^
[00:42:36] - note: ...but borrowed value is only valid for the lifetime 'a as defined on the function body at 45:16
[00:42:36] -    |
[00:42:36] -    |
[00:42:36] - LL | fn produce_err<'a, 'b: 'a>(data: &'b mut Vec<&'b u32>, value: &'a u32) -> impl Bazinga + 'b {
[00:42:36] - 
[00:42:36] 18 error[E0623]: lifetime mismatch
[00:42:36] 19   --> $DIR/issue-52133.rs:46:9
[00:42:36] 20    |
[00:42:36] 20    |
[00:42:36] 
[00:42:36] 23 LL |     let x = move || { //[compare]~ ERROR lifetime mismatch
[00:42:36] 24    |         ^ ...but data from `value` flows into `data` here
[00:42:36] - error: aborting due to 2 previous errors
[00:42:36] + error: aborting due to previous error
[00:42:36] 27 
[00:42:36] - Some errors occurred: E0597, E0623.
[00:42:36] - Some errors occurred: E0597, E0623.
[00:42:36] - For more information about an error, try `rustc --explain E0597`.
[00:42:36] + For more information about this error, try `rustc --explain E0623`.
[00:42:36] 30 
[00:42:36] 
[00:42:36] 
[00:42:36] The actual stderr differed from the expected stderr.
[00:42:36] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/issue-52133.compare/issue-52133.compare.stderr
[00:42:36] To update references, rerun the tests and pass the `--bless` flag
[00:42:36] To only update this specific test, also pass `--test-args nll/issue-52133.rs`
[00:42:36] 
[00:42:36] error in revision `compare`: 1 errors occurred comparing output.
[00:42:36] status: exit code: 1
[00:42:36] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/issue-52133.rs" "--target=x86_64-unknown-linux-gnu" "--cfg" "compare" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/issue-52133.compare/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Z" "borrowck=compare" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/issue-52133.compare/auxiliary" "-A" "unused"
[00:42:36] ------------------------------------------
[00:42:36] 
[00:42:36] ------------------------------------------
[00:42:36] stderr:
[00:42:36] stderr:
[00:42:36] ------------------------------------------
[00:42:36] {"message":"lifetime mismatch","code":{"code":"E0623","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/issue-52133.rs","byte_start":1231,"byte_end":1238,"line_start":45,"line_end":45,"column_start":63,"column_end":70,"is_primary":false,"text":[{"text":"fn produce_err<'a, 'b: 'a>(data: &'b mut Vec<&'b u32>, value: &'a u32) -> impl Bazinga + 'b {","highlight_start":63,"highlight_end":70}],"label":"these two types are declared with different lifetimes...","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/issue-52133.rs","byte_start":1202,"byte_end":1222,"line_start":45,"line_end":45,"column_start":34,"column_end":54,"is_primary":false,"text":[{"text":"fn produce_err<'a, 'b: 'a>(data: &'b mut Vec<&'b u32>, value: &'a u32) -> impl Bazinga + 'b {","highlight_start":34,"highlight_end":54}],"label":"","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/issue-52133.rs","byte_start":1271,"byte_end":1272,"line_start":46,"line_end":46,"column_start":9,"column_end":10,"is_primary":true,"text":[{"text":"    let x = move || { //[compare]~ ERROR lifetime mismatch","highlight_start":9,"highlight_end":10}],"label":"...but data from `value` flows into `data` here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0623]: lifetime mismatch\n  --> /checkout/src/test/ui/nll/issue-52133.rs:46:9\n   |\nLL | fn produce_err<'a, 'b: 'a>(data: &'b mut Vec<&'b u32>, value: &'a u32) -> impl Bazinga + 'b {\n   |                                  --------------------         ------- these two types are declared with different lifetimes...\nLL |     let x = move || { //[compare]~ ERROR lifetime mismatch\n   |         ^ ...but data from `value` flows into `data` here\n\n"}
[00:42:36] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:42:36] {"message":"For more information about this error, try `rustc --explain E0623`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0623`.\n"}
[00:42:36] ------------------------------------------
[00:42:36] 
[00:42:36] thread '[ui] ui/nll/issue-52133.rs#compare' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3141:9
[00:42:36] note: Run with `RUST_BACKTRACE=1` for a backtrace.
---
[00:42:36] 
[00:42:36] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:498:22
[00:42:36] 
[00:42:36] 
[00:42:36] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-5.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options " "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "5.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[00:42:36] 
[00:42:36] 
[00:42:36] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:42:36] Build completed unsuccessfully in 0:01:36
[00:42:36] Build completed unsuccessfully in 0:01:36
[00:42:36] Makefile:58: recipe for target 'check' failed
[00:42:36] make: *** [check] Error 1

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0fb917b6
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:15775403:start=1532709762345940994,finish=1532709762354889916,duration=8948922
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:03da3761
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:172e4f39
travis_time:start:172e4f39
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:14bde200
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@nikomatsakis nikomatsakis changed the title [WIP] fix simple case of issue #51351 and #52133 fix simple case of issue #51351 and #52133 Jul 28, 2018
Copy link
Contributor

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks awesome! I just had some documentation nits.

let closure_mapping =
&UniversalRegions::closure_mapping(tcx, user_closure_ty, self.num_external_vids);
let closure_base_def_id = tcx.closure_base_def_id(closure_def_id);
/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be reverted?

@@ -882,3 +929,23 @@ impl<'tcx> FreeRegionRelations<'tcx> for UniversalRegions<'tcx> {
self.outlives(longer, shorter)
}
}

fn fold_late_bound_regions<'tcx>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I would call this for_each_late_bound_region -- fold suggests to me that we are propagating a result back. I'd probably even call it for_each_late_bound_region_defined_on but I sort of have a penchant for long names. ;)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also a comment is a good idea, something like:


Iterates over the late-bound regions defined on fn_def_id and invokes `` with the liberated form of each one.

@@ -479,6 +482,14 @@ impl<'cx, 'gcx, 'tcx> UniversalRegionsBuilder<'cx, 'gcx, 'tcx> {
let mut indices = self.compute_indices(fr_static, defining_ty);
debug!("build: indices={:?}", indices);

let closure_base_def_id = self.infcx.tcx.closure_base_def_id(self.mir_def_id);

if self.mir_def_id != closure_base_def_id {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This merits a comment. Something like


If this is a closure or generator, then the late-bound regions from the enclosing function are actually external regions to us. For example, here, 'a is not local to the closure c (although it is local to the fn foo):

fn foo<'a>() {
    let c = || {
        let x: &'a u32 = ...;
    }
}

@@ -490,6 +501,13 @@ impl<'cx, 'gcx, 'tcx> UniversalRegionsBuilder<'cx, 'gcx, 'tcx> {
&bound_inputs_and_output,
&mut indices,
);

if self.mir_def_id == closure_base_def_id {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, I would put a comment here like


Converse of above, if this is a function then the late-bound regions declared on its signature are local to the fn.

// option. This file may not be copied, modified, or distributed
// except according to those terms.
//
// revisions: ast mir
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Short comment documenting the purpose of the test would be nice:


Regression test for #51351 and #52133: In the case of #51351, late-bound regions (like 'a) that were unused within the arguments of a function were overlooked and could case an ICE. In the case of #52133, LBR defined on the creator function needed to be added to the free regions of the closure, as they were not present in the closure's generic declarations otherwise.

@nikomatsakis
Copy link
Contributor

@bors delegate=mikhail-m1

@mikhail-m1 -- I delegated to you, so once the nits are fixed, you can feel free to write "r=nikomatsakis" to bors =)

@bors
Copy link
Contributor

bors commented Jul 28, 2018

✌️ @mikhail-m1 can now approve this pull request

@mikhail-m1
Copy link
Contributor Author

@bors r=nikomatsakis

@bors
Copy link
Contributor

bors commented Jul 29, 2018

📌 Commit bb66d70 has been approved by nikomatsakis

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 29, 2018
@bors
Copy link
Contributor

bors commented Jul 29, 2018

⌛ Testing commit bb66d70 with merge 75af9df...

bors added a commit that referenced this pull request Jul 29, 2018
@bors
Copy link
Contributor

bors commented Jul 29, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: nikomatsakis
Pushing 75af9df to master...

@bors bors merged commit bb66d70 into rust-lang:master Jul 29, 2018
@mikhail-m1 mikhail-m1 changed the title fix simple case of issue #51351 and #52133 fix for issues #51351 and #52113 Jul 30, 2018
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Jul 30, 2018
Fix wrong issue number in the test name

I made a mistake in previous PR rust-lang#52620, second issue number was wrong, changing from rust-lang#52133 to rust-lang#52113

r? @kennytm
@lqd lqd mentioned this pull request Jul 31, 2018
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jul 31, 2018
Fix wrong issue number in the test name

I made a mistake in previous PR rust-lang#52620, second issue number was wrong, changing from rust-lang#52133 to rust-lang#52113

r? @kennytm
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Aug 1, 2018
Fix wrong issue number in the test name

I made a mistake in previous PR rust-lang#52620, second issue number was wrong, changing from rust-lang#52133 to rust-lang#52113

r? @kennytm
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Aug 1, 2018
Fix wrong issue number in the test name

I made a mistake in previous PR rust-lang#52620, second issue number was wrong, changing from rust-lang#52133 to rust-lang#52113

r? @kennytm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants