Skip to content

refactor and cleanup region errors for NLL #52021

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

Merged
merged 10 commits into from
Jul 7, 2018

Conversation

nikomatsakis
Copy link
Contributor

This is a WIP commit. It simplifies some of the code from #51536 and extends a few more steps towards the errors that @davidtwco and I were shooting for. These are intended as a replacement for the general "unable to infer lifetime" messages -- one that is actually actionable. We're certainly not there yet, but the overall shape hopefully gets a bit clearer.

I'm thinking about trying to open up an internals thread to sketch out the overall plan and perhaps discuss how to get the wording right, which special cases to handle, etc.

r? @estebank
cc @davidtwco

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 3, 2018
@nikomatsakis
Copy link
Contributor Author

That said, I might like to land this PR anyway, just to give us more to build from.

@nikomatsakis
Copy link
Contributor Author

I haven't updated the stderr files yet, but the general output we are creating looks like this:

error: unsatisfied lifetime constraints
  --> borrowck/issue-45983.rs:17:18
   |
16 |     let x = None;
   |         - region `'2` appears in the type of `x`
17 |     give_any(|y| x = Some(y));
   |               -  ^^^^^^^^^^^ free region requires that `'1` must outlive `'2`
   |               |
   |               region `'1` appears in this argument

There are a bunch of "to do" items here:

  • In this particular case, I think we should add some special wording about closures:
    • something to indicate that the reference y cannot escape the closure body
  • The "region '2 appears in the type of x" messages are meant to display a "fully elaborated" type, like "the fully elaborated type of x is Option<&'2 usize>", which should help users to pinpoint otherwise anonymous regions (same for the one about '1)

@nikomatsakis
Copy link
Contributor Author

nikomatsakis commented Jul 3, 2018

Another example:

error: unsatisfied lifetime constraints
  --> underscore-lifetime/dyn-trait-underscore.rs:18:5
   |
16 | fn a<T>(items: &[T]) -> Box<dyn Iterator<Item=&T>> {
   |         ----- region `'1` appears in this argument
17 |     Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
   |     ^^^^^^^^^^^^^^^^^^^^^^ cast requires that `'1` must outlive `'static`

In this case, my final goal might look like this:

error: unsatisfied lifetime constraints
  --> underscore-lifetime/dyn-trait-underscore.rs:18:5
   |
16 | fn a<T>(items: &[T]) -> Box<dyn Iterator<Item=&T>> {
   |         -----           -------------------------- lifetime bound defaults to `'static`
   |         |
   |         the fully elaborated type of `items` is `&'1 [T]`
17 |     Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
   |     ^^^^^^^^^^^^^^^^^^^^^^ cast requires that `'1` must outlive `'static`

This could be done with:

  • the same 'fully elaborated types' fixme
  • a special case that looks for the case where the 'static arises from an object type in the return type
    • I think we have all the info we need to see that...

@rust-highfive
Copy link
Contributor

The job x86_64-gnu-llvm-3.9 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:40:32] ....................................................................................................
[00:40:37] ....................................................................................................
[00:40:43] ....................................................................................................
[00:40:48] ....................................................................................................
[00:40:54] ............................i.................F...F.FFF.F..F.F.F..............F..F..................
[00:40:59] ..FF.F........i.....................................................................................
[00:41:11] ....................................................................................................
[00:41:18] ........................................................i...........................................
[00:41:20] .........................................
[00:41:20] failures:
[00:41:20] failures:
[00:41:20] 
[00:41:20] ---- [ui] ui/nll/closure-requirements/escape-argument-callee.rs stdout ----
[00:41:20] diff of stderr:
[00:41:20] 
[00:41:20] 4 LL |         let mut closure = expect_sig(|p, y| *p = y);
[00:41:20] 6 
[00:41:20] 6 
[00:41:20] - error: free region `ReFree(DefId(0/1:9 ~ escape_argument_callee[317d]::test[0]::{{closure}}[0]), BrAnon(3))` does not outlive free region `ReFree(DefId(0/1:9 ~ escape_argument_callee[317d]::test[0]::{{closure}}[0]), BrAnon(2))`
[00:41:20] + error: unsatisfied lifetime constraints
[00:41:20] 9    |
[00:41:20] 9    |
[00:41:20] 10 LL |         let mut closure = expect_sig(|p, y| *p = y);
[00:41:20] -    |                                             ^^^^^^
[00:41:20] -    |                                             ^^^^^^
[00:41:20] +    |                                       -  -  ^^^^^^ free region requires that `'1` must outlive `'2`
[00:41:20] +    |                                       |  |
[00:41:20] +    |                                       |  region `'1` appears in this argument
[00:41:20] +    |                                       region `'2` appears in this argument
[00:41:20] 13 note: No external requirements
[00:41:20] 14   --> $DIR/escape-argument-callee.rs:36:38
[00:41:20] 
[00:41:20] 
[00:41:20] 
[00:41:20] The actual stderr differed from the expected stderr.
[00:41:20] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/escape-argument-callee/escape-argument-callee.stderr
[00:41:20] To update references, rerun the tests and pass the `--bless` flag
[00:41:20] To only update this specific test, also pass `--test-args nll/closure-requirements/escape-argument-callee.rs`
[00:41:20] error: 1 errors occurred comparing output.
[00:41:20] status: exit code: 101
[00:41:20] status: exit code: 101
[00:41:20] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/closure-requirements/escape-argument-callee.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/escape-argument-callee/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/escape-argument-callee/auxiliary" "-A" "unused"
[00:41:20] ------------------------------------------
[00:41:20] 
[00:41:20] ------------------------------------------
[00:41:20] stderr:
[00:41:20] stderr:
[00:41:20] ------------------------------------------
[00:41:20] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/escape-argument-callee.rs","byte_start":1365,"byte_end":1366,"line_start":36,"line_end":36,"column_start":50,"column_end":51,"is_primary":true,"text":[{"text":"        let mut closure = expect_sig(|p, y| *p = y);","highlight_start":50,"highlight_end":51}],"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/escape-argument-callee.rs:36:50\n   |\nLL |         let mut closure = expect_sig(|p, y| *p = y);\n   |                                                  ^\n\n"}
[00:41:20] {"message":"unsatisfied lifetime constraints","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/escape-argument-callee.rs","byte_start":1357,"byte_end":1358,"line_start":36,"line_end":36,"column_start":42,"column_end":43,"is_primary":false,"text":[{"text":"        let mut closure = expect_sig(|p, y| *p = y);","highlight_start":42,"highlight_end":43}],"label":"region `'1` appears in this argument","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/closure-requirements/escape-argument-callee.rs","byte_start":1354,"byte_end":1355,"line_start":36,"line_end":36,"column_start":39,"column_end":40,"is_primary":false,"text":[{"text":"        let mut closure = expect_sig(|p, y| *p = y);","highlight_start":39,"highlight_end":40}],"label":"region `'2` appears in this argument","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/closure-requirements/escape-argument-callee.rs","byte_start":1360,"byte_end":1366,"line_start":36,"line_end":36,"column_start":45,"column_end":51,"is_primary":true,"text":[{"text":"        let mut closure = expect_sig(|p, y| *p = y);","highlight_start":45,"highlight_end":51}],"label":"free region requires that `'1` must outlive `'2`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: unsatisfied lifetime constraints\n  --> /checkout/src/test/ui/nll/closure-requirements/escape-argument-callee.rs:36:45\n   |\nLL |         let mut closure = expect_sig(|p, y| *p = y);\n   |                                       -  -  ^^^^^^ free region requires that `'1` must outlive `'2`\n   |                                       |  |\n   |                                       |  region `'1` appears in this argument\n   |                                       region `'2` appears in this argument\n\n"}
[00:41:20] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/escape-argument-callee.rs","byte_start":1353,"byte_end":1366,"line_start":36,"line_end":36,"column_start":38,"column_end":51,"is_primary":true,"text":[{"text":"        let mut closure = expect_sig(|p, y| *p = y);","highlight_start":38,"highlight_end":51}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:9 ~ escape_argument_callee[317d]::test[0]::{{closure}}[0]) with closure substs [\n    i16,\n    for<'r, 's, 't0> extern \"rust-call\" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) mut &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) i32, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't0)) i32))\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/closure-requirements/escape-argument-callee.rs:36:38\n   |\nLL |         let mut closure = expect_sig(|p, y| *p = y);\n   |                                      ^^^^^^^^^^^^^\n   |\n   = note: defining type: DefId(0/1:9 ~ escape_argument_callee[317d]::test[0]::{{closure}}[0]) with closure substs [\n               i16,\n               for<'r, 's, 't0> extern \"rust-call\" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) mut &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) i32, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't0)) i32))\n           ]\n\n"}
[00:41:20] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/escape-argument-callee.rs","byte_start":1241,"byte_end":1527,"line_start":30,"line_end":43,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn test() {","highlight_start":1,"highlight_end":12},{"text":"    let x = 44;","highlight_start":1,"highlight_end":16},{"text":"    let mut p = &x;","highlight_start":1,"highlight_end":20},{"text":"","highlight_start":1,"highlight_end":1},{"text":"    {","highlight_start":1,"highlight_end":6},{"text":"        let y = 22;","highlight_start":1,"highlight_end":20},{"text":"        let mut closure = expect_sig(|p, y| *p = y);","highlight_start":1,"highlight_end":53},{"text":"        //~^ ERROR does not outlive free region","highlight_start":1,"highlight_end":48},{"text":"        //~| WARNING not reporting region error due to nll","highlight_start":1,"highlight_end":59},{"text":"        closure(&mut p, &y);","highlight_start":1,"highlight_end":29},{"text":"    }","highlight_start":1,"highlight_end":6},{"text":"","highlight_start":1,"highlight_end":1},{"text":"    deref(p);","highlight_start":1,"highlight_end":14},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/0:3 ~ escape_argument_callee[317d]::test[0]) with substs []","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/closure-requirements/escape-argument-callee.rs:30:1\n   |\nLL | / fn test() {\nLL | |     let x = 44;\nLL | |     let mut p = &x;\nLL | |\n...  |\nLL | |     deref(p);\nLL | | }\n   | |_^\n   |\n   = note: defining type: DefId(0/0:3 ~ escape_argument_callee[317d]::test[0]) with substs []\n\n"}
[00:41:20] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:41:20] ------------------------------------------
[00:41:20] 
[00:41:20] thread '[ui] ui/nll/closure-requirements/escape-argument-callee.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3140:9
[00:41:20] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:41:20] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:41:20] 
[00:41:20] ---- [ui] ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs stdout ----
[00:41:20] diff of stderr:
[00:41:20] 
[00:41:20] 4 LL |             let p = x.get();
[00:41:20] 6 
[00:41:20] 6 
[00:41:20] - error: free region `ReFree(DefId(0/1:20 ~ propagate_approximated_fail_no_postdom[317d]::supply[0]::{{closure}}[0]), BrAnon(1))` does not outlive free region `ReFree(DefId(0/1:20 ~ propagate_approximated_fail_no_postdom[317d]::supply[0]::{{closure}}[0]), BrAnon(2))`
[00:41:20] -   --> $DIR/propagate-approximated-fail-no-postdom.rs:55:17
[00:41:20] + error: unsatisfied lifetime constraints
[00:41:20] +   --> $DIR/propagate-approximated-fail-no-postdom.rs:58:13
[00:41:20] 9    |
[00:41:20] - LL |             let p = x.get();
[00:41:20] -    |                 ^
[00:41:20] + LL |         |_outlives1, _outlives2, _outlives3, x, y| {
[00:41:20] +    |          ----------              ---------- region `'2` appears in this argument
[00:41:20] +    |          |
[00:41:20] +    |          region `'1` appears in this argument
[00:41:20] + ...
[00:41:20] + LL |             demand_y(x, y, p)
[00:41:20] +    |             ^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
[00:41:20] 13 note: No external requirements
[00:41:20] 14   --> $DIR/propagate-approximated-fail-no-postdom.rs:53:9
[00:41:20] 
[00:41:20] 
[00:41:20] 
[00:41:20] The actual stderr differed from the expected stderr.
[00:41:20] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom/propagate-approximated-fail-no-postdom.stderr
[00:41:20] To update references, rerun the tests and pass the `--bless` flag
[00:41:20] To only update this specific test, also pass `--test-args nll/closure-requirements/propagate-approximated-fail-no-postdom.rs`
[00:41:20] error: 1 errors occurred comparing output.
[00:41:20] status: exit code: 101
[00:41:20] status: exit code: 101
[00:41:20] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.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-fail-no-postdom/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-fail-no-postdom/auxiliary" "-A" "unused"
[00:41:20] ------------------------------------------
[00:41:20] 
[00:41:20] ------------------------------------------
[00:41:20] stderr:
[00:41:20] stderr:
[00:41:20] ------------------------------------------
[00:41:20] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs","byte_start":1671,"byte_end":1678,"line_start":55,"line_end":55,"column_start":21,"column_end":28,"is_primary":true,"text":[{"text":"            let p = x.get();","highlight_start":21,"highlight_end":28}],"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-fail-no-postdom.rs:55:21\n   |\nLL |             let p = x.get();\n   |                     ^^^^^^^\n\n"}
[00:41:20] {"message":"unsatisfied lifetime constraints","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs","byte_start":1570,"byte_end":1580,"line_start":53,"line_end":53,"column_start":10,"column_end":20,"is_primary":false,"text":[{"text":"        |_outlives1, _outlives2, _outlives3, x, y| {","highlight_start":10,"highlight_end":20}],"label":"region `'1` appears in this argument","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs","byte_start":1594,"byte_end":1604,"line_start":53,"line_end":53,"column_start":34,"column_end":44,"is_primary":false,"text":[{"text":"        |_outlives1, _outlives2, _outlives3, x, y| {","highlight_start":34,"highlight_end":44}],"label":"region `'2` appears in this argument","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs","byte_start":1804,"byte_end":1821,"line_start":58,"line_end":58,"column_start":13,"column_end":30,"is_primary":true,"text":[{"text":"            demand_y(x, y, p)","highlight_start":13,"highlight_end":30}],"label":"argument requires that `'1` must outlive `'2`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: unsatisfied lifetime constraints\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs:58:13\n   |\nLL |         |_outlives1, _outlives2, _outlives3, x, y| {\n   |          ----------              ---------- region `'2` appears in this argument\n   |          |\n   |          region `'1` appears in this argument\n...\nLL |             demand_y(x, y, p)\n   |             ^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`\n\n"}
[00:41:20] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs","byte_start":1569,"byte_end":1831,"line_start":53,"line_end":59,"column_start":9,"column_end":10,"is_primary":true,"text":[{"text":"        |_outlives1, _outlives2, _outlives3, x, y| {","highlight_start":9,"highlight_end":53},{"text":"            // Only works if 'x: 'y:","highlight_start":1,"highlight_end":37},{"text":"            let p = x.get();","highlight_start":1,"highlight_end":29},{"text":"            //~^ WARN not reporting region error due to nll","highlight_start":1,"highlight_end":60},{"text":"            //~| ERROR does not outlive free region","highlight_start":1,"highlight_end":52},{"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:20 ~ propagate_approximated_fail_no_postdom[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<&'_#2r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) &'_#3r 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}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs:53:9\n   |\nLL | /         |_outlives1, _outlives2, _outlives3, x, y| {\nLL | |             // Only works if 'x: 'y:\nLL | |             let p = x.get();\nLL | |             //~^ WARN not reporting region error due to nll\nLL | |             //~| ERROR does not outlive free region\nLL | |             demand_y(x, y, p)\nLL | |         },\n   | |_________^\n   |\n   = note: defining type: DefId(0/1:20 ~ propagate_approximated_fail_no_postdom[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<&'_#2r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) &'_#3r 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\n"}
[00:41:20] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs","byte_start":1391,"byte_end":1841,"line_start":48,"line_end":61,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn supply<'a, 'b, 'c>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>, cell_c: Cell<&'c u32>) {","highlight_start":1,"highlight_end":93},{"text":"    establish_relationships(","highlight_start":1,"highlight_end":29},{"text":"        cell_a,","highlight_start":1,"highlight_end":16},{"text":"        cell_b,","highlight_start":1,"highlight_end":16},{"text":"        cell_c,","highlight_start":1,"highlight_end":16},{"text":"        |_outlives1, _outlives2, _outlives3, x, y| {","highlight_start":1,"highlight_end":53},{"text":"            // Only works if 'x: 'y:","highlight_start":1,"highlight_end":37},{"text":"            let p = x.get();","highlight_start":1,"highlight_end":29},{"text":"            //~^ WARN not reporting region error due to nll","highlight_start":1,"highlight_end":60},{"text":"            //~| ERROR does not outlive free region","highlight_start":1,"highlight_end":52},{"text":"            demand_y(x, y, p)","highlight_start":1,"highlight_end":30},{"text":"        },","highlight_start":1,"highlight_end":11},{"text":"    );","highlight_start":1,"highlight_end":7},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/0:6 ~ propagate_approximated_fail_no_postdom[317d]::supply[0]) with substs []","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs:48:1\n   |\nLL | / fn supply<'a, 'b, 'c>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>, cell_c: Cell<&'c u32>) {\nLL | |     establish_relationships(\nLL | |         cell_a,\nLL | |         cell_b,\n...  |\nLL | |     );\nLL | | }\n   | |_^\n   |\n   = note: defining type: DefId(0/0:6 ~ propagate_approximated_fail_no_postdom[317d]::supply[0]) with substs []\n\n"}
[00:41:20] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:41:20] ------------------------------------------
[00:41:20] 
[00:41:20] thread '[ui] ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3140:9
[00:41:20] 
[00:41:20] 
[00:41:20] ---- [ui] ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs stdout ----
[00:41:20] diff of stderr:
[00:41:20] 
[00:41:20] 23    = note: number of external vids: 2
[00:41:20] 24    = note: where '_#1r: '_#0r
[00:41:20] 25 
[00:41:20] - error: argument requires that data must outlive free region `ReStatic`
[00:41:20] + error: unsatisfied lifetime constraints
[00:41:20] 28    |
[00:41:20] 28    |
[00:41:20] 29 LL | /     establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
[00:41:20] 
[00:41:20] 32 LL | |         // Only works if 'x: 'y:
[00:41:20] 33 LL | |         demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll
[00:41:20] 34 LL | |     });
[00:41:20] -    | |______^
[00:41:20] +    | |______^ argument requires that `'a` must outlive `'static`
[00:41:20] 37 note: No external requirements
[00:41:20] 38   --> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:44:1
[00:41:20] 
[00:41:20] 
[00:41:20] 
[00:41:20] The actual stderr differed from the expected stderr.
[00:41:20] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound/propagate-approximated-shorter-to-static-no-bound.stderr
[00:41:20] To update references, rerun the tests and pass the `--bless` flag
[00:41:20] To only update this specific test, also pass `--test-args nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs`
[00:41:20] error: 1 errors occurred comparing output.
[00:41:20] status: exit code: 101
[00:41:20] status: exit code: 101
[00:41:20] 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:41:20] ------------------------------------------
[00:41:20] 
[00:41:20] ------------------------------------------
[00:41:20] stderr:
[00:41:20] stderr:
[00:41:20] ------------------------------------------
[00:41:20] {"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":1662,"byte_end":1685,"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:41:20] {"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":1741,"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 argument requires that data must outlive free region","highlight_start":1,"highlight_end":72},{"text":"","highlight_start":1,"highlight_end":1},{"text":"        // Only works if 'x: 'y:","highlight_start":1,"highlight_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_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]","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"number of external vids: 2","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"where '_#1r: '_#0r","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: External requirements\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs:45:47\n   |\nLL |       establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {\n   |  _______________________________________________^\nLL | |         //~^ ERROR argument requires that data must outlive free region\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: 2\n   = note: where '_#1r: '_#0r\n\n"}
[00:41:20] {"message":"unsatisfied lifetime constraints","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs","byte_start":1486,"byte_end":1742,"line_start":45,"line_end":50,"column_start":5,"column_end":7,"is_primary":true,"text":[{"text":"    establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {","highlight_start":5,"highlight_end":66},{"text":"        //~^ ERROR argument requires that data must outlive free region","highlight_start":1,"highlight_end":72},{"text":"","highlight_start":1,"highlight_end":1},{"text":"        // Only works if 'x: 'y:","highlight_start":1,"highlight_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":7}],"label":"argument requires that `'a` must outlive `'static`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: unsatisfied lifetime constraints\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs:45:5\n   |\nLL | /     establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {\nLL | |         //~^ ERROR argument requires that data must outlive free region\nLL | |\nLL | |         // Only works if 'x: 'y:\nLL | |         demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll\nLL | |     });\n   | |______^ argument requires that `'a` must outlive `'static`\n\n"}
[00:41:20] {"message":"No 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":1416,"byte_end":1745,"line_start":44,"line_end":51,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {","highlight_start":1,"highlight_end":66},{"text":"    establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {","highlight_start":1,"highlight_end":66},{"text":"        //~^ ERROR argument requires that data must outlive free region","highlight_start":1,"highlight_end":72},{"text":"","highlight_start":1,"highlight_end":1},{"text":"        // Only works if 'x: 'y:","highlight_start":1,"highlight_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":8},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/0:6 ~ propagate_approximated_shorter_to_static_no_bound[317d]::supply[0]) with substs []","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs:44:1\n   |\nLL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {\nLL | |     establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {\nLL | |         //~^ ERROR argument requires that data must outlive free region\nLL | |\n...  |\nLL | |     });\nLL | | }\n   | |_^\n   |\n   = note: defining type: DefId(0/0:6 ~ propagate_approximated_shorter_to_static_no_bound[317d]::supply[0]) with substs []\n\n"}
[00:41:20] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:41:20] ------------------------------------------
[00:41:20] 
[00:41:20] thread '[ui] ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3140:9
[00:41:20] 
[00:41:20] 
[00:41:20] ---- [ui] ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs stdout ----
[00:41:20] diff of stderr:
[00:41:20] 
[00:41:20] 4 LL |     foo(cell, |cell_a, cell_x| {
[00:41:20] 6 
[00:41:20] 6 
[00:41:20] - error: argument requires that data must outlive free region `'_#1r`
[00:41:20] -   --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:33:20
[00:41:20] + error: unsatisfied lifetime constraints
[00:41:20] +   --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:33:9
[00:41:20] 9    |
[00:41:20] + LL |     foo(cell, |cell_a, cell_x| {
[00:41:20] +    |                ------  ------ region `'1` appears in this argument
[00:41:20] +    |                |
[00:41:20] +    |                region `'2` appears in this argument
[00:41:20] + LL |         //~^ WARNING not reporting region error due to nll
[00:41:20] 10 LL |         cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure
[00:41:20] -    |                    ^^^^^^^^^^^^
[00:41:20] +    |         ^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
[00:41:20] 13 note: No external requirements
[00:41:20] 14   --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:31:15
[00:41:20] 
[00:41:20] 
[00:41:20] 
[00:41:20] The actual stderr differed from the expected stderr.
[00:41:20] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free/propagate-approximated-shorter-to-static-comparing-against-free.stderr
[00:41:20] To update references, rerun the tests and pass the `--bless` flag
[00:41:20] To only update this specific test, also pass `--test-args nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs`
[00:41:20] error: 1 errors occurred comparing output.
[00:41:20] status: exit code: 101
[00:41:20] status: exit code: 101
[00:41:20] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.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-comparing-against-free/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-comparing-against-free/auxiliary" "-A" "unused"
[00:41:20] ------------------------------------------
[00:41:20] 
[00:41:20] ------------------------------------------
[00:41:20] stderr:
[00:41:20] stderr:
[00:41:20] ------------------------------------------
[00:41:20] {"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-comparing-against-free.rs","byte_start":933,"byte_end":936,"line_start":31,"line_end":31,"column_start":5,"column_end":8,"is_primary":true,"text":[{"text":"    foo(cell, |cell_a, cell_x| {","highlight_start":5,"highlight_end":8}],"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-comparing-against-free.rs:31:5\n   |\nLL |     foo(cell, |cell_a, cell_x| {\n   |     ^^^\n\n"}
[00:41:20] {"message":"unsatisfied lifetime constraints","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs","byte_start":952,"byte_end":958,"line_start":31,"line_end":31,"column_start":24,"column_end":30,"is_primary":false,"text":[{"text":"    foo(cell, |cell_a, cell_x| {","highlight_start":24,"highlight_end":30}],"label":"region `'1` appears in this argument","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs","byte_start":944,"byte_end":950,"line_start":31,"line_end":31,"column_start":16,"column_end":22,"is_primary":false,"text":[{"text":"    foo(cell, |cell_a, cell_x| {","highlight_start":16,"highlight_end":22}],"label":"region `'2` appears in this argument","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs","byte_start":1029,"byte_end":1053,"line_start":33,"line_end":33,"column_start":9,"column_end":33,"is_primary":true,"text":[{"text":"        cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure","highlight_start":9,"highlight_end":33}],"label":"argument requires that `'1` must outlive `'2`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: unsatisfied lifetime constraints\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs:33:9\n   |\nLL |     foo(cell, |cell_a, cell_x| {\n   |                ------  ------ region `'1` appears in this argument\n   |                |\n   |                region `'2` appears in this argument\nLL |         //~^ WARNING not reporting region error due to nll\nLL |         cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure\n   |         ^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`\n\n"}
[00:41:20] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs","byte_start":943,"byte_end":1167,"line_start":31,"line_end":35,"column_start":15,"column_end":6,"is_primary":true,"text":[{"text":"    foo(cell, |cell_a, cell_x| {","highlight_start":15,"highlight_end":33},{"text":"        //~^ WARNING not reporting region error due to nll","highlight_start":1,"highlight_end":59},{"text":"        cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure","highlight_start":1,"highlight_end":69},{"text":"        //~^ ERROR argument requires that data must outlive free region","highlight_start":1,"highlight_end":72},{"text":"    })","highlight_start":1,"highlight_end":6}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:12 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case1[0]::{{closure}}[0]) with closure substs [\n    i32,\n    for<'r> extern \"rust-call\" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>))\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs:31:15\n   |\nLL |       foo(cell, |cell_a, cell_x| {\n   |  _______________^\nLL | |         //~^ WARNING not reporting region error due to nll\nLL | |         cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure\nLL | |         //~^ ERROR argument requires that data must outlive free region\nLL | |     })\n   | |_____^\n   |\n   = note: defining type: DefId(0/1:12 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case1[0]::{{closure}}[0]) with closure substs [\n               i32,\n               for<'r> extern \"rust-call\" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>))\n           ]\n\n"}
[00:41:20] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs","byte_start":871,"byte_end":1170,"line_start":28,"line_end":36,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn case1() {","highlight_start":1,"highlight_end":13},{"text":"    let a = 0;","highlight_start":1,"highlight_end":15},{"text":"    let cell = Cell::new(&a);","highlight_start":1,"highlight_end":30},{"text":"    foo(cell, |cell_a, cell_x| {","highlight_start":1,"highlight_end":33},{"text":"        //~^ WARNING not reporting region error due to nll","highlight_start":1,"highlight_end":59},{"text":"        cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure","highlight_start":1,"highlight_end":69},{"text":"        //~^ ERROR argument requires that data must outlive free region","highlight_start":1,"highlight_end":72},{"text":"    })","highlight_start":1,"highlight_end":7},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/0:5 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case1[0]) with substs []","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs:28:1\n   |\nLL | / fn case1() {\nLL | |     let a = 0;\nLL | |     let cell = Cell::new(&a);\nLL | |     foo(cell, |cell_a, cell_x| {\n...  |\nLL | |     })\nLL | | }\n   | |_^\n   |\n   = note: defining type: DefId(0/0:5 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case1[0]) with substs []\n\n"}
[00:41:20] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs","byte_start":1417,"byte_end":1530,"line_start":46,"line_end":48,"column_start":15,"column_end":6,"is_primary":true,"text":[{"text":"    foo(cell, |cell_a, cell_x| {","highlight_start":15,"highlight_end":33},{"text":"        cell_x.set(cell_a.get()); // forces 'a: 'x, implies 'a = 'static -> borrow error","highlight_start":1,"highlight_end":89},{"text":"    })","highlight_start":1,"highlight_end":6}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:13 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case2[0]::{{closure}}[0]) with closure substs [\n    i32,\n    for<'r> extern \"rust-call\" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>))\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"number of external vids: 2","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"where '_#1r: '_#0r","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: External requirements\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs:46:15\n   |\nLL |       foo(cell, |cell_a, cell_x| {\n   |  _______________^\nLL | |         cell_x.set(cell_a.get()); // forces 'a: 'x, implies 'a = 'static -> borrow error\nLL | |     })\n   | |_____^\n   |\n   = note: defining type: DefId(0/1:13 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case2[0]::{{closure}}[0]) with closure substs [\n               i32,\n               for<'r> extern \"rust-call\" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>))\n           ]\n   = note: number of external vids: 2\n   = note: where '_#1r: '_#0r\n\n"}
[00:41:20] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs","byte_start":1189,"byte_end":1533,"line_start":39,"line_end":49,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn case2() {","highlight_start":1,"highlight_end":13},{"text":"    let a = 0;","highlight_start":1,"highlight_end":15},{"text":"    let cell = Cell::new(&a);","highlight_start":1,"highlight_end":30},{"text":"    //~^ ERROR `a` does not live long enough","highlight_start":1,"highlight_end":45},{"text":"","highlight_start":1,"highlight_end":1},{"text":"    // As you can see in the stderr output, this closure propoagates a","highlight_start":1,"highlight_end":71},{"text":"    // requirement that `'a: 'static'.","highlight_start":1,"highlight_end":39},{"text":"    foo(cell, |cell_a, cell_x| {","highlight_start":1,"highlight_end":33},{"text":"        cell_x.set(cell_a.get()); // forces 'a: 'x, implies 'a = 'static -> borrow error","highlight_start":1,"highlight_end":89},{"text":"    })","highlight_start":1,"highlight_end":7},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/0:6 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case2[0]) with substs []","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs:39:1\n   |\nLL | / fn case2() {\nLL | |     let a = 0;\nLL | |     let cell = Cell::new(&a);\nLL | |     //~^ ERROR `a` does not live long enough\n...  |\nLL | |     })\nLL | | }\n   | |_^\n   |\n   = note: defining type: DefId(0/0:6 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case2[0]) with substs []\n\n"}
[00:41:20] {"message":"`a` does not live long enough","code":{"code":"E0597","explanation":"\nThis error occurs because a borrow was made inside a variable which has a\ngreater lifetime than the borrowed one.\n\nExample of erroneous code:\n\n```compile_fail,E0597\nstruct Foo<'a> {\n    x: Option<&'a u32>,\n}\n\nlet mut x = Foo { x: None };\nlet y = 0;\nx.x = Some(&y); // error: `y` does not live long enough\n```\n\nIn here, `x` is created before `y` and therefore has a greater lifetime. Always\nkeep in mind that values in a scope are dropped in the opposite order they are\ncreated. So to fix the previous example, just make the `y` lifetime greater than\nthe `x`'s one:\n\n```\nstruct Foo<'a> {\n    x: Option<&'a u32>,\n}\n\nlet y = 0;\nlet mut x = Foo { x: None };\nx.x = Some(&y);\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs","byte_start":1242,"byte_end":1244,"line_start":41,"line_end":41,"column_start":26,"column_end":28,"is_primary":true,"text":[{"text":"    let cell = Cell::new(&a);","highlight_start":26,"highlight_end":28}],"label":"borrowed value does not live long enough","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs","byte_start":1532,"byte_end":1533,"line_start":49,"line_end":49,"column_start":1,"column_end":2,"is_primary":false,"text":[{"text":"}","highlight_start":1,"highlight_end":2}],"label":"borrowed value only lives until here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"borrowed value must be valid for the static lifetime...","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0597]: `a` does not live long enough\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs:41:26\n   |\nLL |     let cell = Cell::new(&a);\n   |                          ^^ borrowed value does not live long enough\n...\nLL | }\n   | - borrowed value only lives until here\n   |\n   = note: borrowed value must be valid for the static lifetime...\n\n"}
[00:41:20] {"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 2 previous errors\n\n"}
[00:41:20] {"message":"For more information about this error, try `rustc --explain E0597`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0597`.\n"}
[00:41:20] ------------------------------------------
[00:41:20] 
[00:41:20] thread '[ui] ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3140:9
[00:41:20] 
[00:41:20] 
[00:41:20] ---- [ui] ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs stdout ----
[00:41:20] diff of stderr:
[00:41:20] 
[00:41:20] 23    = note: number of external vids: 3
[00:41:20] 24    = note: where '_#1r: '_#0r
[00:41:20] 25 
[00:41:20] - error: argument requires that data must outlive free region `ReStatic`
[00:41:20] + error: unsatisfied lifetime constraints
[00:41:20] 28    |
[00:41:20] 28    |
[00:41:20] 29 LL | /     establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
[00:41:20] 
[00:41:20] 32 LL | |         demand_y(x, y, x.get())
[00:41:20] 33 LL | |         //~^ WARNING not reporting region error due to nll
[00:41:20] 34 LL | |     });
[00:41:20] -    | |______^
[00:41:20] +    | |______^ argument requires that `'a` must outlive `'static`
[00:41:20] 37 note: No external requirements
[00:41:20] 38   --> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:47:1
[00:41:20] 
[00:41:20] 
[00:41:20] 
[00:41:20] The actual stderr differed from the expected stderr.
[00:41:20] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound/propagate-approximated-shorter-to-static-wrong-bound.stderr
[00:41:20] To update references, rerun the tests and pass the `--bless` flag
[00:41:20] To only update this specific test, also pass `--test-args nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs`
[00:41:20] error: 1 errors occurred comparing output.
[00:41:20] status: exit code: 101
[00:41:20] status: exit code: 101
[00:41:20] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-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-wrong-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-wrong-bound/auxiliary" "-A" "unused"
[00:41:20] ------------------------------------------
[00:41:20] 
[00:41:20] ------------------------------------------
[00:41:20] stderr:
[00:41:20] stderr:
[00:41:20] ------------------------------------------
[00:41:20] {"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":1749,"byte_end":1772,"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:41:20] {"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":1837,"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 argument requires that data must outlive free region","highlight_start":1,"highlight_end":72},{"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_end":6}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:18 ~ propagate_approximated_shorter_to_static_wrong_bound[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<&'_#2r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't1)) 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: 3","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"where '_#1r: '_#0r","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: External requirements\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs:48:47\n   |\nLL |       establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {\n   |  _______________________________________________^\nLL | |         //~^ ERROR argument requires that data must outlive free region\nLL | |         // Only works if 'x: 'y:\nLL | |         demand_y(x, y, x.get())\nLL | |         //~^ WARNING not reporting region error due to nll\nLL | |     });\n   | |_____^\n   |\n   = note: defining type: DefId(0/1:18 ~ propagate_approximated_shorter_to_static_wrong_bound[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<&'_#2r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't1)) 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: 3\n   = note: where '_#1r: '_#0r\n\n"}
[00:41:20] {"message":"unsatisfied lifetime constraints","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs","byte_start":1561,"byte_end":1838,"line_start":48,"line_end":53,"column_start":5,"column_end":7,"is_primary":true,"text":[{"text":"    establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {","highlight_start":5,"highlight_end":79},{"text":"        //~^ ERROR argument requires that data must outlive free region","highlight_start":1,"highlight_end":72},{"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_end":7}],"label":"argument requires that `'a` must outlive `'static`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: unsatisfied lifetime constraints\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs:48:5\n   |\nLL | /     establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {\nLL | |         //~^ ERROR argument requires that data must outlive free region\nLL | |         // Only works if 'x: 'y:\nLL | |         demand_y(x, y, x.get())\nLL | |         //~^ WARNING not reporting region error due to nll\nLL | |     });\n   | |______^ argument requires that `'a` must outlive `'static`\n\n"}
[00:41:20] {"message":"No 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":1491,"byte_end":1841,"line_start":47,"line_end":54,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {","highlight_start":1,"highlight_end":66},{"text":"    establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {","highlight_start":1,"highlight_end":79},{"text":"        //~^ ERROR argument requires that data must outlive free region","highlight_start":1,"highlight_end":72},{"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_end":8},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/0:6 ~ propagate_approximated_shorter_to_static_wrong_bound[317d]::supply[0]) with substs []","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs:47:1\n   |\nLL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {\nLL | |     establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {\nLL | |         //~^ ERROR argument requires that data must outlive free region\nLL | |         // Only works if 'x: 'y:\n...  |\nLL | |     });\nLL | | }\n   | |_^\n   |\n   = note: defining type: DefId(0/0:6 ~ propagate_approximated_shorter_to_static_wrong_bound[317d]::supply[0]) with substs []\n\n"}
[00:41:20] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:41:20] ------------------------------------------
[00:41:20] 
[00:41:20] thread '[ui] ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3140:9
[00:41:20] 
[00:41:20] 
[00:41:20] ---- [ui] ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs stdout ----
[00:41:20] diff of stderr:
[00:41:20] 
[00:41:20] 4 LL |         demand_y(x, y, x.get())
[00:41:20] 6 
[00:41:20] 6 
[00:41:20] - error: argument requires that data must outlive free region `ReFree(DefId(0/1:18 ~ propagate_fail_to_approximate_longer_no_bounds[317d]::supply[0]::{{closure}}[0]), BrAnon(2))`
[00:41:20] + error: unsatisfied lifetime constraints
[00:41:20] 9    |
[00:41:20] 9    |
[00:41:20] + LL |     establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
[00:41:20] +    |                                                ---------  - region `'1` appears in this argument
[00:41:20] +    |                                                |
[00:41:20] +    |                                                region `'2` appears in this argument
[00:41:20] + LL |         // Only works if 'x: 'y:
[00:41:20] 10 LL |         demand_y(x, y, x.get())
[00:41:20] -    |         ^^^^^^^^^^^^^^^^^^^^^^^
[00:41:20] +    |         ^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
[00:41:20] 13 note: No external requirements
[00:41:20] 14   --> $DIR/propagate-fail-to-approximate-longer-no-bounds.rs:45:47
[00:41:20] 
[00:41:20] 
[00:41:20] 
[00:41:20] The actual stderr differed from the expected stderr.
[00:41:20] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds/propagate-fail-to-approximate-longer-no-bounds.stderr
[00:41:20] To update references, rerun the tests and pass the `--bless` flag
[00:41:20] To only update this specific test, also pass `--test-args nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs`
[00:41:20] error: 1 errors occurred comparing output.
[00:41:20] status: exit code: 101
[00:41:20] status: exit code: 101
[00:41:20] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.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-fail-to-approximate-longer-no-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/closure-requirements/propagate-fail-to-approximate-longer-no-bounds/auxiliary" "-A" "unused"
[00:41:20] ------------------------------------------
[00:41:20] 
[00:41:20] ------------------------------------------
[00:41:20] stderr:
[00:41:20] stderr:
[00:41:20] ------------------------------------------
[00:41:20] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs","byte_start":1636,"byte_end":1659,"line_start":47,"line_end":47,"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-fail-to-approximate-longer-no-bounds.rs:47:9\n   |\nLL |         demand_y(x, y, x.get())\n   |         ^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[00:41:20] {"message":"unsatisfied lifetime constraints","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs","byte_start":1587,"byte_end":1588,"line_start":45,"line_end":45,"column_start":59,"column_end":60,"is_primary":false,"text":[{"text":"    establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {","highlight_start":59,"highlight_end":60}],"label":"region `'1` appears in this argument","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs","byte_start":1576,"byte_end":1585,"line_start":45,"line_end":45,"column_start":48,"column_end":57,"is_primary":false,"text":[{"text":"    establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {","highlight_start":48,"highlight_end":57}],"label":"region `'2` appears in this argument","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs","byte_start":1636,"byte_end":1659,"line_start":47,"line_end":47,"column_start":9,"column_end":32,"is_primary":true,"text":[{"text":"        demand_y(x, y, x.get())","highlight_start":9,"highlight_end":32}],"label":"argument requires that `'1` must outlive `'2`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: unsatisfied lifetime constraints\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs:47:9\n   |\nLL |     establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {\n   |                                                ---------  - region `'1` appears in this argument\n   |                                                |\n   |                                                region `'2` appears in this argument\nLL |         // Only works if 'x: 'y:\nLL |         demand_y(x, y, x.get())\n   |         ^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`\n\n"}
[00:41:20] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs","byte_start":1575,"byte_end":1793,"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":"        // 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":"        //~^ WARN not reporting region error due to nll","highlight_start":1,"highlight_end":56},{"text":"        //~| ERROR argument requires that data must outlive free region","highlight_start":1,"highlight_end":72},{"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_fail_to_approximate_longer_no_bounds[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<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't1)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) u32>))\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs:45:47\n   |\nLL |       establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {\n   |  _______________________________________________^\nLL | |         // Only works if 'x: 'y:\nLL | |         demand_y(x, y, x.get())\nLL | |         //~^ WARN not reporting region error due to nll\nLL | |         //~| ERROR argument requires that data must outlive free region\nLL | |     });\n   | |_____^\n   |\n   = note: defining type: DefId(0/1:18 ~ propagate_fail_to_approximate_longer_no_bounds[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<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't1)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) u32>))\n           ]\n\n"}
[00:41:20] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs","byte_start":1463,"byte_end":1797,"line_start":44,"line_end":51,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {","highlight_start":1,"highlight_end":66},{"text":"    establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {","highlight_start":1,"highlight_end":66},{"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":"        //~^ WARN not reporting region error due to nll","highlight_start":1,"highlight_end":56},{"text":"        //~| ERROR argument requires that data must outlive free region","highlight_start":1,"highlight_end":72},{"text":"    });","highlight_start":1,"highlight_end":8},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/0:6 ~ propagate_fail_to_approximate_longer_no_bounds[317d]::supply[0]) with substs []","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs:44:1\n   |\nLL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {\nLL | |     establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {\nLL | |         // Only works if 'x: 'y:\nLL | |         demand_y(x, y, x.get())\n...  |\nLL | |     });\nLL | | }\n   | |_^\n   |\n   = note: defining type: DefId(0/0:6 ~ propagate_fail_to_approximate_longer_no_bounds[317d]::supply[0]) with substs []\n\n"}
[00:41:20] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:41:20] ------------------------------------------
[00:41:20] 
[00:41:20] thread '[ui] ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3140:9
[00:41:20] 
[00:41:20] 
[00:41:20] ---- [ui] ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs stdout ----
[00:41:20] diff of stderr:
[00:41:20] 
[00:41:20] 4 LL |         demand_y(x, y, x.get())
[00:41:20] 6 
[00:41:20] 6 
[00:41:20] - error: free region `ReFree(DefId(0/1:18 ~ propagate_fail_to_approximate_longer_wrong_bounds[317d]::supply[0]::{{closure}}[0]), BrAnon(2))` does not outlive free region `ReFree(DefId(0/1:18 ~ propagate_fail_to_approximate_longer_wrong_bounds[317d]::supply[0]::{{closure}}[0]), BrAnon(4))`
[00:41:20] -   --> $DIR/propagate-fail-to-approximate-longer-wrong-bounds.rs:51:18
[00:41:20] + error: unsatisfied lifetime constraints
[00:41:20] +   --> $DIR/propagate-fail-to-approximate-longer-wrong-bounds.rs:51:9
[00:41:20] 9    |
[00:41:20] + LL |     establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
[00:41:20] +    |                                                ----------  ---------- region `'2` appears in this argument
[00:41:20] +    |                                                |
[00:41:20] +    |                                                region `'1` appears in this argument
[00:41:20] + LL |         // Only works if 'x: 'y:
[00:41:20] 10 LL |         demand_y(x, y, x.get())
[00:41:20] -    |                  ^
[00:41:20] +    |         ^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
[00:41:20] 13 note: No external requirements
[00:41:20] 14   --> $DIR/propagate-fail-to-approximate-longer-wrong-bounds.rs:49:47
[00:41:20] 
[00:41:20] 
[00:41:20] 
[00:41:20] The actual stderr differed from the expected stderr.
[00:41:20] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds/propagate-fail-to-approximate-longer-wrong-bounds.stderr
[00:41:20] To update references, rerun the tests and pass the `--bless` flag
[00:41:20] To only update this specific test, also pass `--test-args nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs`
[00:41:20] error: 1 errors occurred comparing output.
[00:41:20] status: exit code: 101
[00:41:20] status: exit code: 101
[00:41:20] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.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-fail-to-approximate-longer-wrong-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/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds/auxiliary" "-A" "unused"
[00:41:20] ------------------------------------------
[00:41:20] 
[00:41:20] ------------------------------------------
[00:41:20] stderr:
[00:41:20] stderr:
[00:41:20] ------------------------------------------
[00:41:20] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs","byte_start":1825,"byte_end":1848,"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-fail-to-approximate-longer-wrong-bounds.rs:51:9\n   |\nLL |         demand_y(x, y, x.get())\n   |         ^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[00:41:20] {"message":"unsatisfied lifetime constraints","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs","byte_start":1752,"byte_end":1762,"line_start":49,"line_end":49,"column_start":48,"column_end":58,"is_primary":false,"text":[{"text":"    establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {","highlight_start":48,"highlight_end":58}],"label":"region `'1` appears in this argument","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs","byte_start":1764,"byte_end":1774,"line_start":49,"line_end":49,"column_start":60,"column_end":70,"is_primary":false,"text":[{"text":"    establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {","highlight_start":60,"highlight_end":70}],"label":"region `'2` appears in this argument","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs","byte_start":1825,"byte_end":1848,"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":"argument requires that `'1` must outlive `'2`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: unsatisfied lifetime constraints\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs:51:9\n   |\nLL |     establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {\n   |                                                ----------  ---------- region `'2` appears in this argument\n   |                                                |\n   |                                                region `'1` appears in this argument\nLL |         // Only works if 'x: 'y:\nLL |         demand_y(x, y, x.get())\n   |         ^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`\n\n"}
[00:41:20] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs","byte_start":1751,"byte_end":1958,"line_start":49,"line_end":54,"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":"        // 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":"        //~^ WARN not reporting region error due to nll","highlight_start":1,"highlight_end":56},{"text":"        //~| ERROR does not outlive free region","highlight_start":1,"highlight_end":48},{"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_fail_to_approximate_longer_wrong_bounds[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<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) &'_#1r 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}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs:49:47\n   |\nLL |       establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {\n   |  _______________________________________________^\nLL | |         // Only works if 'x: 'y:\nLL | |         demand_y(x, y, x.get())\nLL | |         //~^ WARN not reporting region error due to nll\nLL | |         //~| ERROR does not outlive free region\nLL | |     });\n   | |_____^\n   |\n   = note: defining type: DefId(0/1:18 ~ propagate_fail_to_approximate_longer_wrong_bounds[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<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) &'_#1r 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\n"}
[00:41:20] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs","byte_start":1639,"byte_end":1962,"line_start":48,"line_end":55,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {","highlight_start":1,"highlight_end":66},{"text":"    establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {","highlight_start":1,"highlight_end":79},{"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":"        //~^ WARN not reporting region error due to nll","highlight_start":1,"highlight_end":56},{"text":"        //~| ERROR does not outlive free region","highlight_start":1,"highlight_end":48},{"text":"    });","highlight_start":1,"highlight_end":8},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/0:6 ~ propagate_fail_to_approximate_longer_wrong_bounds[317d]::supply[0]) with substs []","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs:48:1\n   |\nLL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {\nLL | |     establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {\nLL | |         // Only works if 'x: 'y:\nLL | |         demand_y(x, y, x.get())\n...  |\nLL | |     });\nLL | | }\n   | |_^\n   |\n   = note: defining type: DefId(0/0:6 ~ propagate_fail_to_approximate_longer_wrong_bounds[317d]::supply[0]) with substs []\n\n"}
[00:41:20] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:41:20] ------------------------------------------
[00:41:20] 
[00:41:20] thread '[ui] ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3140:9
[00:41:20] 
[00:41:20] 
[00:41:20] ---- [ui] ui/nll/closure-requirements/region-lbr-named-does-not-outlive-static.rs stdout ----
[00:41:20] diff of stderr:
[00:41:20] 
[00:41:20] 4 LL |     &*x
[00:41:20] 6 
[00:41:20] 6 
[00:41:20] - error: free region `ReFree(DefId(0/0:3 ~ region_lbr_named_does_not_outlive_static[317d]::foo[0]), BrNamed(crate0:DefIndex(1:9), 'a))` does not outlive free region `ReStatic`
[00:41:20] + error: unsatisfied lifetime constraints
[00:41:20] 9    |
[00:41:20] 9    |
[00:41:20] 10 LL |     &*x
[00:41:20] -    |     ^^^
[00:41:20] -    |     ^^^
[00:41:20] +    |     ^^^ free region requires that `'a` must outlive `'static`
[00:41:20] 13 error: aborting due to previous error
[00:41:20] 14 
[00:41:20] 
[00:41:20] 
[00:41:20] 
[00:41:20] The actual stderr differed from the expected stderr.
[00:41:20] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/region-lbr-named-does-not-outlive-static/region-lbr-named-does-not-outlive-static.stderr
[00:41:20] To update references, rerun the tests and pass the `--bless` flag
[00:41:20] To only update this specific test, also pass `--test-args nll/closure-requirements/region-lbr-named-does-not-outlive-static.rs`
[00:41:20] error: 1 errors occurred comparing output.
[00:41:20] status: exit code: 101
[00:41:20] status: exit code: 101
[00:41:20] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/closure-requirements/region-lbr-named-does-not-outlive-static.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/region-lbr-named-does-not-outlive-static/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/region-lbr-named-does-not-outlive-static/auxiliary" "-A" "unused"
[00:41:20] ------------------------------------------
[00:41:20] 
[00:41:20] ------------------------------------------
[00:41:20] stderr:
[00:41:20] stderr:
[00:41:20] ------------------------------------------
[00:41:20] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/region-lbr-named-does-not-outlive-static.rs","byte_start":817,"byte_end":820,"line_start":19,"line_end":19,"column_start":5,"column_end":8,"is_primary":true,"text":[{"text":"    &*x","highlight_start":5,"highlight_end":8}],"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/region-lbr-named-does-not-outlive-static.rs:19:5\n   |\nLL |     &*x\n   |     ^^^\n\n"}
[00:41:20] {"message":"unsatisfied lifetime constraints","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/region-lbr-named-does-not-outlive-static.rs","byte_start":817,"byte_end":820,"line_start":19,"line_end":19,"column_start":5,"column_end":8,"is_primary":true,"text":[{"text":"    &*x","highlight_start":5,"highlight_end":8}],"label":"free region requires that `'a` must outlive `'static`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: unsatisfied lifetime constraints\n  --> /checkout/src/test/ui/nll/closure-requirements/region-lbr-named-does-not-outlive-static.rs:19:5\n   |\nLL |     &*x\n   |     ^^^ free region requires that `'a` must outlive `'static`\n\n"}
[00:41:20] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:41:20] ------------------------------------------
[00:41:20] 
[00:41:20] thread '[ui] ui/nll/closure-requirements/region-lbr-named-does-not-outlive-static.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3140:9
[00:41:20] 
[00:41:20] 
[00:41:20] ---- [ui] ui/nll/closure-requirements/return-wrong-bound-region.rs stdout ----
[00:41:20] diff of stderr:
[00:41:20] 
[00:41:20] 4 LL |     expect_sig(|a, b| b); // ought to return `a`
[00:41:20] 6 
[00:41:20] 6 
[00:41:20] - error: free region `ReFree(DefId(0/1:9 ~ return_wrong_bound_region[317d]::test[0]::{{closure}}[0]), BrAnon(2))` does not outlive free region `ReFree(DefId(0/1:9 ~ return_wrong_bound_region[317d]::test[0]::{{closure}}[0]), BrAnon(1))`
[00:41:20] + error: unsatisfied lifetime constraints
[00:41:20] 8   --> $DIR/return-wrong-bound-region.rs:21:23
[00:41:20] 9    |
[00:41:20] 10 LL |     expect_sig(|a, b| b); // ought to return `a`
[00:41:20] -    |                       ^
[00:41:20] -    |                       ^
[00:41:20] +    |                 -  -  ^ free region requires that `'1` must outlive `'2`
[00:41:20] +    |                 |  |
[00:41:20] +    |                 |  region `'1` appears in this argument
[00:41:20] +    |                 region `'2` appears in this argument
[00:41:20] 13 note: No external requirements
[00:41:20] 14   --> $DIR/return-wrong-bound-region.rs:21:16
[00:41:20] 
[00:41:20] 
[00:41:20] 
[00:41:20] The actual stderr differed from the expected stderr.
[00:41:20] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/return-wrong-bound-region/return-wrong-bound-region.stderr
[00:41:20] To update references, rerun the tests and pass the `--bless` flag
[00:41:20] To only update this specific test, also pass `--test-args nll/closure-requirements/return-wrong-bound-region.rs`
[00:41:20] error: 1 errors occurred comparing output.
[00:41:20] status: exit code: 101
[00:41:20] status: exit code: 101
[00:41:20] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/closure-requirements/return-wrong-bound-region.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/return-wrong-bound-region/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/return-wrong-bound-region/auxiliary" "-A" "unused"
[00:41:20] ------------------------------------------
[00:41:20] 
[00:41:20] ------------------------------------------
[00:41:20] stderr:
[00:41:20] stderr:
[00:41:20] ------------------------------------------
[00:41:20] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/return-wrong-bound-region.rs","byte_start":743,"byte_end":744,"line_start":21,"line_end":21,"column_start":23,"column_end":24,"is_primary":true,"text":[{"text":"    expect_sig(|a, b| b); // ought to return `a`","highlight_start":23,"highlight_end":24}],"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/return-wrong-bound-region.rs:21:23\n   |\nLL |     expect_sig(|a, b| b); // ought to return `a`\n   |                       ^\n\n"}
[00:41:20] {"message":"unsatisfied lifetime constraints","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/return-wrong-bound-region.rs","byte_start":740,"byte_end":741,"line_start":21,"line_end":21,"column_start":20,"column_end":21,"is_primary":false,"text":[{"text":"    expect_sig(|a, b| b); // ought to return `a`","highlight_start":20,"highlight_end":21}],"label":"region `'1` appears in this argument","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/closure-requirements/return-wrong-bound-region.rs","byte_start":737,"byte_end":738,"line_start":21,"line_end":21,"column_start":17,"column_end":18,"is_primary":false,"text":[{"text":"    expect_sig(|a, b| b); // ought to return `a`","highlight_start":17,"highlight_end":18}],"label":"region `'2` appears in this argument","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/closure-requirements/return-wrong-bound-region.rs","byte_start":743,"byte_end":744,"line_start":21,"line_end":21,"column_start":23,"column_end":24,"is_primary":true,"text":[{"text":"    expect_sig(|a, b| b); // ought to return `a`","highlight_start":23,"highlight_end":24}],"label":"free region requires that `'1` must outlive `'2`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: unsatisfied lifetime constraints\n  --> /checkout/src/test/ui/nll/closure-requirements/return-wrong-bound-region.rs:21:23\n   |\nLL |     expect_sig(|a, b| b); // ought to return `a`\n   |                 -  -  ^ free region requires that `'1` must outlive `'2`\n   |                 |  |\n   |                 |  region `'1` appears in this argument\n   |                 region `'2` appears in this argument\n\n"}
[00:41:20] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/return-wrong-bound-region.rs","byte_start":736,"byte_end":744,"line_start":21,"line_end":21,"column_start":16,"column_end":24,"is_primary":true,"text":[{"text":"    expect_sig(|a, b| b); // ought to return `a`","highlight_start":16,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:9 ~ return_wrong_bound_region[317d]::test[0]::{{closure}}[0]) with closure substs [\n    i16,\n    for<'r, 's> extern \"rust-call\" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) i32, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) i32)) -> &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) i32\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/closure-requirements/return-wrong-bound-region.rs:21:16\n   |\nLL |     expect_sig(|a, b| b); // ought to return `a`\n   |                ^^^^^^^^\n   |\n   = note: defining type: DefId(0/1:9 ~ return_wrong_bound_region[317d]::test[0]::{{closure}}[0]) with closure substs [\n               i16,\n               for<'r, 's> extern \"rust-call\" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) i32, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) i32)) -> &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) i32\n           ]\n\n"}
[00:41:20] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/return-wrong-bound-region.rs","byte_start":709,"byte_end":867,"line_start":20,"line_end":24,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn test() {","highlight_start":1,"highlight_end":12},{"text":"    expect_sig(|a, b| b); // ought to return `a`","highlight_start":1,"highlight_end":49},{"text":"    //~^ WARN not reporting region error due to nll","highlight_start":1,"highlight_end":52},{"text":"    //~| ERROR does not outlive free region","highlight_start":1,"highlight_end":44},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/0:3 ~ return_wrong_bound_region[317d]::test[0]) with substs []","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/closure-requirements/return-wrong-bound-region.rs:20:1\n   |\nLL | / fn test() {\nLL | |     expect_sig(|a, b| b); // ought to return `a`\nLL | |     //~^ WARN not reporting region error due to nll\nLL | |     //~| ERROR does not outlive free region\nLL | | }\n   | |_^\n   |\n   = note: defining type: DefId(0/0:3 ~ return_wrong_bound_region[317d]::test[0]) with substs []\n\n"}
[00:41:20] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:41:20] ------------------------------------------
[00:41:20] 
[00:41:20] thread '[ui] ui/nll/closure-requirements/return-wrong-bound-region.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3140:9
[00:41:20] 
[00:41:20] 
[00:41:20] ---- [ui] ui/nll/issue-48238.rs stdout ----
[00:41:20] diff of stderr:
[00:41:20] 
[00:41:20] - error: free region `` does not outlive free region `'_#1r`
[00:41:20] -   --> $DIR/issue-48238.rs:21:21
[00:41:20] + error: internal compiler error: librustc_mir/borrow_check/nll/region_infer/error_reporting/region_name.rs:77: can't make a name for free region '_#2r
[00:41:20] +   --> $DIR/issue-48238.rs:21:5
[00:41:20] 3    |
[00:41:20] 4 LL |     move || use_val(&orig); //~ ERROR free region `` does not outlive free region `'_#1r`
[00:41:20] +    |     ^^^^^^^^^^^^^^^^^^^^^^
[00:41:20] 6 
[00:41:20] 7 error: aborting due to previous error
[00:41:20] 8 
[00:41:20] 8 
[00:41:20] 
[00:41:20] 
[00:41:20] The actual stderr differed from the expected stderr.
[00:41:20] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/issue-48238/issue-48238.stderr
[00:41:20] To update references, rerun the tests and pass the `--bless` flag
[00:41:20] To only update this specific test, also pass `--test-args nll/issue-48238.rs`
[00:41:20] error: 1 errors occurred comparing output.
[00:41:20] status: exit code: 101
[00:41:20] status: exit code: 101
[00:41:20] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/issue-48238.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/issue-48238/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/issue-48238/auxiliary" "-A" "unused"
[00:41:20] ------------------------------------------
[00:41:20] 
[00:41:20] ------------------------------------------
[00:41:20] stderr:
[00:41:20] stderr:
[00:41:20] ------------------------------------------
[00:41:20] {"message":"librustc_mir/borrow_check/nll/region_infer/error_reporting/region_name.rs:77: can't make a name for free region '_#2r","code":null,"level":"error: internal compiler error","spans":[{"file_name":"/checkout/src/test/ui/nll/issue-48238.rs","byte_start":611,"byte_end":633,"line_start":21,"line_end":21,"column_start":5,"column_end":27,"is_primary":true,"text":[{"text":"    move || use_val(&orig); //~ ERROR free region `` does not outlive free region `'_#1r`","highlight_start":5,"highlight_end":27}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: internal compiler error: librustc_mir/borrow_check/nll/region_infer/error_reporting/region_name.rs:77: can't make a name for free region '_#2r\n  --> /checkout/src/test/ui/nll/issue-48238.rs:21:5\n   |\nLL |     move || use_val(&orig); //~ ERROR free region `` does not outlive free region `'_#1r`\n   |     ^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[00:41:20] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:41:20] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:41:20] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:41:20] 
[00:41:20] note: the compiler unexpectedly panicked. this is a bug.
[00:41:20] 
[00:41:20] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:41:20] note: rustc 1.29.0-dev running on x86_64-unknown-linux-gnu
[00:41:20] 
[00:41:20] 
[00:41:20] note: compiler flags: -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath
[00:41:20] 
[00:41:20] ------------------------------------------
[00:41:20] 
[00:41:20] thread '[ui] ui/nll/issue-48238.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3140:9
[00:41:20] thread '[ui] ui/nll/issue-48238.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3140:9
[00:41:20] 
[00:41:20] ---- [ui] ui/nll/issue-50716.rs stdout ----
[00:41:20] diff of stderr:
[00:41:20] 
[00:41:20] - error: assignment requires that data must outlive free region `'static`
[00:41:20] + error: unsatisfied lifetime constraints
[00:41:20] 3    |
[00:41:20] 3    |
[00:41:20] 4 LL |     let _x = *s; //~ ERROR assignment requires that data must outlive free region `'static`
[00:41:20] -    |              ^^
[00:41:20] -    |              ^^
[00:41:20] +    |              ^^ assignment requires that `'a` must outlive `'static`
[00:41:20] 7 error: aborting due to previous error
[00:41:20] 8 
[00:41:20] 
[00:41:20] 
[00:41:20] 
[00:41:20] The actual stderr differed from the expected stderr.
[00:41:20] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/issue-50716/issue-50716.stderr
---
[00:41:20] test result: FAILED. 1522 passed; 14 failed; 5 ignored; 0 measured; 0 filtered out
[00:41:20] 
[00:41:20] 
[00:41:20] 
[00:41:20] 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-3.9/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" "3.9.1\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:41:20] 
[00:41:20] 
[00:41:20] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:41:20] Build completed unsuccessfully in 0:02:03
[00:41:20] Build completed unsuccessfully in 0:02:03
[00:41:20] make: *** [check] Error 1
[00:41:20] Makefile:58: recipe for target 'check' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:1c5604d8
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)

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)

@estebank
Copy link
Contributor

estebank commented Jul 3, 2018

Let me know if you wish to merge as is or with a mild clean up and I can give it a further pass once they're in master.

@nikomatsakis
Copy link
Contributor Author

@estebank

Let me know if you wish to merge as is or with a mild clean up and I can give it a further pass once they're in master.

Mostly I don't want to try and get the "perfect message" in this PR. I'd be happy to do some mild cleanup, but also happy to land as is and do cleanup after landing.

Also, this code will hopefully pass travis now. (Had a few things to fix.)

@rust-highfive
Copy link
Contributor

The job x86_64-gnu-llvm-3.9 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:05:01] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:05:01] tidy error: /checkout/src/librustc_mir/borrow_check/nll/region_infer/error_reporting/region_name.rs:185: line longer than 100 chars
[00:05:01] tidy error: /checkout/src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs:240: line longer than 100 chars
[00:05:02] some tidy checks failed
[00:05:02] 
[00:05:02] 
[00:05:02] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:05:02] 
[00:05:02] 
[00:05:02] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:05:02] Build completed unsuccessfully in 0:01:33
[00:05:02] Build completed unsuccessfully in 0:01:33
[00:05:02] make: *** [tidy] Error 1
[00:05:02] Makefile:79: recipe for target 'tidy' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:005a68ac
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:0fa43bf1:start=1530665234959664446,finish=1530665234967328121,duration=7663675
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:223ba2c2
$ head -30 ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
head: cannot open ‘./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers’ for reading: No such file or directory
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:01773228
$ 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)

@rust-highfive
Copy link
Contributor

The job x86_64-gnu-llvm-3.9 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:50:49] ....................................................................................................
[00:50:55] ....................................................................................................
[00:51:01] ....................................................................................................
[00:51:09] ....................................................................................................
[00:51:14] i........................................................................................FFFF......i
[00:51:21] ..ii................................................................................................
[00:51:34] ....................................................................................................
[00:51:34] ....................................................................................................
[00:51:39] ...................................F...............................................i................
[00:51:50] ....................................................................................................
[00:51:55] ....................................................................................................
errors (from JSON output): [
[00:52:00]     Error {
---
[00:52:00]         line_num: 305,
[00:52:00]         kind: Some(
[00:52:00]             Error
[00:52:00]         ),
[00:52:00]         msg: "free region `` does not outlive"
[00:52:00] ]
[00:52:00] 
[00:52:00] thread '[compile-fail] compile-fail/borrowck/borrowck-describe-lvalue.rs#mir' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1284:13
[00:52:00] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:52:00] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:52:00] 
[00:52:00] ---- [compile-fail] compile-fail/mir_check_cast_closure.rs stdout ----
[00:52:00] 
[00:52:00] error: /checkout/src/test/compile-fail/mir_check_cast_closure.rs:16: unexpected error: '16:28: 16:37: unsatisfied lifetime constraints'
[00:52:00] 
[00:52:00] error: /checkout/src/test/compile-fail/mir_check_cast_closure.rs:16: expected error not found: free region `'b` does not outlive free region `'a`
[00:52:00] error: 1 unexpected errors found, 1 expected errors not found
[00:52:00] status: exit code: 101
[00:52:00] status: exit code: 101
[00:52:00] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/mir_check_cast_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/compile-fail/mir_check_cast_closure/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Z" "borrowck=mir" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/mir_check_cast_closure/auxiliary" "-A" "unused"
[00:52:00]     Error {
[00:52:00]         line_num: 16,
[00:52:00]         kind: Some(
[00:52:00]             Error
---
[00:52:00]         line_num: 16,
[00:52:00]         kind: Some(
[00:52:00]             Error
[00:52:00]         ),
[00:52:00]         msg: "free region `\'b` does not outlive free region `\'a`"
[00:52:00] ]
[00:52:00] 
[00:52:00] thread '[compile-fail] compile-fail/mir_check_cast_closure.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1284:13
[00:52:00] 
[00:52:00] 
[00:52:00] ---- [compile-fail] compile-fail/mir_check_cast_reify.rs stdout ----
[00:52:00] 
[00:52:00] error: /checkout/src/test/compile-fail/mir_check_cast_reify.rs:46: unexpected error: '46:25: 46:28: unsatisfied lifetime constraints'
[00:52:00] 
[00:52:00] error: /checkout/src/test/compile-fail/mir_check_cast_reify.rs:46: expected error not found: free region `'a` does not outlive free region `'static`
[00:52:00] error: 1 unexpected errors found, 1 expected errors not found
[00:52:00] status: exit code: 101
[00:52:00] status: exit code: 101
[00:52:00] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/mir_check_cast_reify.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/compile-fail/mir_check_cast_reify/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Zborrowck=mir" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/mir_check_cast_reify/auxiliary" "-A" "unused"
[00:52:00]     Error {
[00:52:00]         line_num: 46,
[00:52:00]         kind: Some(
[00:52:00]             Error
---
[00:52:00]         line_num: 46,
[00:52:00]         kind: Some(
[00:52:00]             Error
[00:52:00]         ),
[00:52:00]         msg: "free region `\'a` does not outlive free region `\'static`"
[00:52:00] ]
[00:52:00] 
[00:52:00] thread '[compile-fail] compile-fail/mir_check_cast_reify.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1284:13
[00:52:00] 
[00:52:00] 
[00:52:00] ---- [compile-fail] compile-fail/mir_check_cast_unsafe_fn.rs stdout ----
[00:52:00] 
[00:52:00] error: /checkout/src/test/compile-fail/mir_check_cast_unsafe_fn.rs:18: unexpected error: '18:32: 18:33: unsatisfied lifetime constraints'
[00:52:00] 
[00:52:00] error: /checkout/src/test/compile-fail/mir_check_cast_unsafe_fn.rs:18: expected error not found: free region `'a` does not outlive free region `'static`
[00:52:00] error: 1 unexpected errors found, 1 expected errors not found
[00:52:00] status: exit code: 101
[00:52:00] status: exit code: 101
[00:52:00] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/mir_check_cast_unsafe_fn.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/compile-fail/mir_check_cast_unsafe_fn/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Zborrowck=mir" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/mir_check_cast_unsafe_fn/auxiliary" "-A" "unused"
[00:52:00]     Error {
[00:52:00]         line_num: 18,
[00:52:00]         kind: Some(
[00:52:00]             Error
---
[00:52:00]         line_num: 18,
[00:52:00]         kind: Some(
[00:52:00]             Error
[00:52:00]         ),
[00:52:00]         msg: "free region `\'a` does not outlive free region `\'static`"
[00:52:00] ]
[00:52:00] 
[00:52:00] thread '[compile-fail] compile-fail/mir_check_cast_unsafe_fn.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1284:13
[00:52:00] 
[00:52:00] 
[00:52:00] ---- [compile-fail] compile-fail/mir_check_cast_unsize.rs stdout ----
[00:52:00] 
[00:52:00] error: /checkout/src/test/compile-fail/mir_check_cast_unsize.rs:19: unexpected error: '19:5: 19:6: unsatisfied lifetime constraints'
[00:52:00] 
[00:52:00] error: /checkout/src/test/compile-fail/mir_check_cast_unsize.rs:17: expected error not found: free region `'a` does not outlive free region `'static`
[00:52:00] error: 1 unexpected errors found, 1 expected errors not found
[00:52:00] status: exit code: 101
[00:52:00] status: exit code: 101
[00:52:00] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/mir_check_cast_unsize.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/compile-fail/mir_check_cast_unsize/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Z" "borrowck=mir" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/mir_check_cast_unsize/auxiliary" "-A" "unused"
[00:52:00]     Error {
[00:52:00]         line_num: 19,
[00:52:00]         kind: Some(
[00:52:00]             Error
---
[00:52:00]         line_num: 17,
[00:52:00]         kind: Some(
[00:52:00]             Error
[00:52:00]         ),
[00:52:00]         msg: "free region `\'a` does not outlive free region `\'static`"
[00:52:00] ]
[00:52:00] 
[00:52:00] thread '[compile-fail] compile-fail/mir_check_cast_unsize.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1284:13
[00:52:00] 
[00:52:00] 
[00:52:00] ---- [compile-fail] compile-fail/regions-static-bound.rs#nll stdout ----
[00:52:00] 
[00:52:00] error in revision `nll`: /checkout/src/test/compile-fail/regions-static-bound.rs:19: unexpected error: '19:5: 19:6: unsatisfied lifetime constraints'
[00:52:00] 
[00:52:00] error in revision `nll`: /checkout/src/test/compile-fail/regions-static-bound.rs:19: expected error not found: free region `'a` does not outlive free region `'static`
[00:52:00] 
[00:52:00] error in revision `nll`: 1 unexpected errors found, 1 expected errors not found
[00:52:00] status: exit code: 101
[00:52:00] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/regions-static-bound.rs" "--target=x86_64-unknown-linux-gnu" "--cfg" "nll" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/regions-static-bound.nll/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Zborrowck=mir" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/regions-static-bound.nll/auxiliary" "-A" "unused"
[00:52:00]     Error {
[00:52:00]         line_num: 19,
[00:52:00]         kind: Some(
[00:52:00]             Error
---
[00:52:00]         line_num: 19,
[00:52:00]         kind: Some(
[00:52:00]             Error
[00:52:00]         ),
[00:52:00]         msg: "free region `\'a` does not outlive free region `\'static`"
[00:52:00] ]
[00:52:00] 
[00:52:00] thread '[compile-fail] compile-fail/regions-static-bound.rs#nll' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1284:13
[00:52:00] 
---
[00:52:00] 
[00:52:00] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:498:22
[00:52:00] 
[00:52:00] 
[00:52:00] 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/compile-fail" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "compile-fail" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-3.9/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" "3.9.1\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:52:00] 
[00:52:00] 
[00:52:00] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:52:00] Build completed unsuccessfully in 0:13:33
[00:52:00] Build completed unsuccessfully in 0:13:33
[00:52:00] Makefile:58: recipe for target 'check' failed
[00:52:00] make: *** [check] Error 1
57324 ./obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release
52728 ./obj/build/x86_64-unknown-linux-gnu/stage0/bin
52028 ./obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/bin
51848 ./obj/build/x86_64-unknown-linux-gnu/test/ui

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] refactor and cleanup region errors for NLL refactor and cleanup region errors for NLL Jul 4, 2018
@nikomatsakis
Copy link
Contributor Author

LL | self.x.iter().map(|a| a.0)
| ^^^^^^^^^^^^^
| ^^^^^^ cast requires that `'1` must outlive `'static`
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm intrigued where the cast category is coming from here...

@estebank
Copy link
Contributor

estebank commented Jul 5, 2018

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 5, 2018

📌 Commit 727f017 has been approved by estebank

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

bors commented Jul 6, 2018

⌛ Testing commit 727f017 with merge a178cba...

bors added a commit that referenced this pull request Jul 6, 2018
refactor and cleanup region errors for NLL

This is a WIP commit. It simplifies some of the code from #51536 and extends a few more steps towards the errors that @davidtwco and I were shooting for. These are intended as a replacement for the general "unable to infer lifetime" messages -- one that is actually actionable. We're certainly not there yet, but the overall shape hopefully gets a bit clearer.

I'm thinking about trying to open up an internals thread to sketch out the overall plan and perhaps discuss how to get the wording right, which special cases to handle, etc.

r? @estebank
cc @davidtwco
@bors
Copy link
Collaborator

bors commented Jul 7, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: estebank
Pushing a178cba to master...

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.

4 participants