Skip to content

Declare DebruijnIndex via newtype_index macro - #51248

Merged
bors merged 7 commits into
masterfrom
unknown repository
Jun 19, 2018
Merged

bors merged 7 commits into
masterfrom
unknown repository

Conversation

@ghost

@ghost ghost commented May 31, 2018 •

Copy link
Copy Markdown

Part of #49887

Declare DebruijnIndex via the newtype_index macro.

@rust-highfive

Copy link
Copy Markdown
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @eddyb (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 31, 2018
@rust-highfive

Copy link
Copy Markdown
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:45:30] ....................................................................................................
[00:45:35] ....................................................................................................
[00:45:40] ....................................................................................................
[00:45:46] .............................................................................................i......
[00:45:51] ...........FF..FFFFFFFF.F...F................................F........i.............................
[00:46:02] ....................................................................................................
[00:46:08] ....................................................................................................
[00:46:08] ....................................................................................................
[00:46:12] ..i.................iiiiiiiii...................................................
[00:46:12] 
[00:46:12] ---- [ui] ui/nll/closure-requirements/escape-argument-callee.rs stdout ----
[00:46:12] diff of stderr:
[00:46:12] 
[00:46:12] 
[00:46:12] 18    |
[00:46:12] 19    = note: defining type: DefId(0/1:9 ~ escape_argument_callee[317d]::test[0]::{{closure}}[0]) with closure substs [
[00:46:12] 20                i16,
[00:46:12] -                for<'r, 's, 't0> extern "rust-call" fn((&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 'r)) mut &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 's)) i32, &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 't0)) i32))
[00:46:12] +                for<'r, 's, 't0> extern "rust-call" fn((&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) mut &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) i32, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't0)) i32))
[00:46:12] 23 
[00:46:12] 24 note: No external requirements
[00:46:12] 
[00:46:12] 
[00:46:12] 
[00:46:12] The actual stderr differed from the expected stderr.
[00:46:12] 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:46:12] To update references, rerun the tests and pass the `--bless` flag
[00:46:12] To only update this specific test, also pass `--test-args nll/closure-requirements/escape-argument-callee.rs`
[00:46:12] error: 1 errors occurred comparing output.
[00:46:12] status: exit code: 101
[00:46:12] status: exit code: 101
[00:46:12] 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:46:12] ------------------------------------------
[00:46:12] 
[00:46:12] 
[00:46:12] -------------------------------------nt_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))`\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   |                                             ^^^^^^\n\n"}
[00:46:12] {"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(0, BrNamed(crate0:DefIndex(0:0), 'r)) mut &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) i32, &ReLateBound(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(0, BrNamed(crate0:DefIndex(0:0), 'r)) mut &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) i32, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't0)) i32))\n           ]\n\n"}
[00:46:12] {"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:46:12] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:46:12] ------------------------------------------
[00:46:12] 
[00:46:12] thread '[ui] ui/nll/closure-requirements/escape-argument-callee.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3096:9
[00:46:12] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:46:12] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:46:12] 
[00:46:12] ---- [ui] ui/nll/closure-requirements/escape-argument.rs stdout ----
[00:46:12] diff of stderr:
[00:46:12] 
[00:46:12] 6    |
[00:46:12] 7    = note: defining type: DefId(0/1:9 ~ escape_argument[317d]::test[0]::{{closure}}[0]) with closure substs [
[00:46:12] 8                i16,
[00:46:12] -                for<'r, 's> extern "rust-call" fn((&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 'r)) mut &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 's)) i32, &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 's)) i32))
[00:46:12] +                for<'r, 's> extern "rust-call" fn((&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) mut &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) i32, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) i32))
[00:46:12] 11 
[00:46:12] 12 note: No external requirements
[00:46:12] 
[00:46:12] 
[00:46:12] 
[00:46:12] The actual stderr differed from the expected stderr.
[00:46:12] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/escape-argument/escape-argument.stderr
[00:46:12] To update references, rerun the tests and pass the `--bless` flag
[00:46:12] To only update this specific test, also pass `--test-args nll/closure-requirements/escape-argument.rs`
[00:46:12] error: 1 errors occurred comparing output.
[00:46:12] status: exit code: 101
[00:46:12] status: exit code: 101
[00:46:12] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/closure-requirements/escape-argument.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/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/auxiliary" "-A" "unused"
[00:46:12] ------------------------------------------
[00:46:12] 
[00:46:12] ------------------------------------------
[00:46:12] stderr:
[00:46:12] stderr:
[00:46:12] ------------------------------------------
[00:46:12] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/escape-argument.rs","byte_start":1148,"byte_end":1161,"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[317d]::test[0]::{{closure}}[0]) with closure substs [\n    i16,\n    for<'r, 's> extern \"rust-call\" fn((&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) mut &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) i32, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) 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.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[317d]::test[0]::{{closure}}[0]) with closure substs [\n               i16,\n               for<'r, 's> extern \"rust-call\" fn((&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) mut &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) i32, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) i32))\n           ]\n\n"}
[00:46:12] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/escape-argument.rs","byte_start":1036,"byte_end":1272,"line_start":30,"line_end":42,"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":"        closure(&mut p, &y);","highlight_start":1,"highlight_end":29},{"text":"        //~^ ERROR `y` does not live long enough [E0597]","highlight_start":1,"highlight_end":57},{"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[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.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[317d]::test[0]) with substs []\n\n"}
[00:46:12] {"message":"`y` 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/escape-argument.rs","byte_start":1188,"byte_end":1190,"line_start":37,"line_end":37,"column_start":25,"column_end":27,"is_primary":true,"text":[{"text":"        closure(&mut p, &y);","highlight_start":25,"highlight_end":27}],"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/escape-argument.rs","byte_start":1254,"byte_end":1255,"line_start":39,"line_end":39,"column_start":5,"column_end":6,"is_primary":false,"text":[{"text":"    }","highlight_start":5,"highlight_end":6}],"label":"borrowed value only lives until here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/closure-requirements/escape-argument.rs","byte_start":1267,"byte_end":1268,"line_start":41,"line_end":41,"column_start":11,"column_end":12,"is_primary":false,"text":[{"text":"    deref(p);","highlight_start":11,"highlight_end":12}],"label":"borrow later used here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0597]: `y` does not live long enough\n  --> /checkout/src/test/ui/nll/closure-requirements/escape-argument.rs:37:25\n   |\nLL |         closure(&mut p, &y);\n   |                         ^^ borrowed value does not live long enough\nLL |         //~^ ERROR `y` does not live long enough [E0597]\nLL |     }\n   |     - borrowed value only lives until here\nLL | \nLL |     deref(p);\n   |           - borrow later used here\n\n"}
[00:46:12] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:46:12] {"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:46:12] ------------------------------------------
[00:46:12] 
[00:46:12] thread '[ui] ui/nll/closure-requirements/escape-argument.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3096:9
[00:46:12] 
[00:46:12] 
[00:46:12] ---- [ui] ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs stdout ----
[00:46:12] diff of stderr:
[00:46:12] 
[00:46:12] 24    |
[00:46:12] 25    = note: defining type: DefId(0/1:20 ~ propagate_approximated_fail_no_postdom[317d]::supply[0]::{{closure}}[0]) with closure substs [
[00:46:12] 26                i16,
[00:46:12] -                for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 's)) &'_#3r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 's)) u32>))
[00:46:12] +                for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&'_#2r &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) &'_#3r u32>, std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>))
[00:46:12] 29 
[00:46:12] 30 note: No external requirements
[00:46:12] 
[00:46:12] 
[00:46:12] 
[00:46:12] The actual stderr differed from the expected stderr.
[00:46:12] 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:46:12] To update references, rerun the tests and pass the `--bless` flag
[00:46:12] To only update this specific test, also pass `--test-args nll/closure-requirements/propagate-approximated-fail-no-postdom.rs`
[00:46:12] error: 1 errors occurred comparing output.
[00:46:12] status: exit code: 101
[00:46:12] status: exit code: 101
[00:46:12] 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:46:12] ------------------------------------------
[00:46:12] 
[00:46:12] ------------------------------------------
[00:46:12] stderr:
[00:46:12] stderr:
[00:46:12] ------------------------------------------
[00:46:12] {"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,"suggesated-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(0, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&'_#2r &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) &'_#3r u32>, std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(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(0, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&'_#2r &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) &'_#3r u32>, std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>))\n           ]\n\n"}
[00:46:12] {"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:46:12] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:46:12] ------------------------------------------
[00:46:12] 
[00:46:12] thread '[ui] ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3096:9
[00:46:12] 
[00:46:12] 
[00:46:12] ---- [ui] ui/nll/closure-requirements/propagate-approximated-ref.rs stdout ----
[00:46:12] diff of stderr:
[00:46:12] 
[00:46:12] 18    |
[00:46:12] 19    = note: defining type: DefId(0/1:18 ~ propagate_approximated_ref[317d]::supply[0]::{{closure}}[0]) with closure substs [
[00:46:12] 20                i16,
[00:46:12] -                for<'r, 's, 't0, 't1, 't2, 't3> extern "rust-call" fn((&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 't1)) &'_#2r u32>, &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 't3)) std::cell::Cell<&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 't1)) u32>))
[00:46:12] +                for<'r, 's, 't0, 't1, 't2, 't3> extern "rust-call" fn((&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&'_#1r &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't1)) &'_#2r u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't3)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't1)) u32>))
[00:46:12] 22            ]
[00:46:12] 23    = note: number of external vids: 3
[00:46:12] 24    = note: where '_#1r: '_#2r
[00:46:12] 
[00:46:12] The actual stderr differed from the expected stderr.
[00:46:12] The actual stderr differed from the expected stderr.
[00:46:12] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-approximated-ref/propagate-approximated-ref.stderr
[00:46:12] To update references, rerun the tests and pass the `--bless` flag
[00:46:12] To only update this specific test, also pass `--test-args nll/closure-requirements/propagate-approximated-ref.rs`
[00:46:12] error: 1 errors occurred comparing output.
[00:46:12] status: exit code: 101
[00:46:12] status: exit code: 101
[00:46:12] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-approximated-ref/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Zborrowck=mir" "-Zverbose" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-approximated-ref/auxiliary" "-A" "unused"
[00:46:12] ------------------------------------------
[00:46:12] 
[00:46:12] ------------------------------------------
[00:46:12] stderr:
[00:46:12] stderr:
[00:46:12] ------------------------------------------
[00:46:12] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs","byte_start":1973,"byte_end":1996,"line_start":57,"line_end":57,"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-ref.rs:57:9\n   |\nLL |         demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll\n   |         ^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[00:46:12] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs","byte_start":1861,"byte_end":2052,"line_start":53,"line_end":58,"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 lifetime mismatch","highlight_start":1,"highlight_end":37},{"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_ref[317d]::supply[0]::{{closure}}[0]) with closure substs [\n    i16,\n    for<'r, 's, 't0, 't1, 't2, 't3> extern \"rust-call\" fn((&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&'_#1r &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't1)) &'_#2r u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't3)) std::cell::Cell<&ReLateBound(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: '_#2r","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: External requirements\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs:53:47\n   |\nLL |       establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {\n   |  _______________________________________________^\nLL | |         //~^ ERROR lifetime mismatch\nLL | |\nLL | |         // Only works if 'x: 'y:\nLL | |         demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll\nLL | |     });\n   | |_____^\n   |\n   = note: defining type: DefId(0/1:18 ~ propagate_approximated_ref[317d]::supply[0]::{{closure}}[0]) with closure substs [\n               i16,\n               for<'r, 's, 't0, 't1, 't2, 't3> extern \"rust-call\" fn((&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&'_#1r &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't1)) &'_#2r u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't3)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't1)) u32>))\n           ]\n   = note: number of external vids: 3\n   = note: where '_#1r: '_#2r\n\n"}
[00:46:12] {"message":"lifetime mismatch","code":{"code":"E0623","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs","byte_start":1780,"byte_end":1787,"line_start":52,"line_end":52,"column_start":32,"column_end":39,"is_primary":false,"text":[{"text":"fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {","highlight_start":32,"highlight_end":39}],"label":"these two types are declared with different lifetimes...","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs","byte_start":1803,"byte_end":1810,"line_start":52,"line_end":52,"column_start":55,"column_end":62,"is_primary":false,"text":[{"text":"fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {","highlight_start":55,"highlight_end":62}],"label":"","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs","byte_start":1843,"byte_end":1850,"line_start":53,"line_end":53,"column_start":29,"column_end":36,"is_primary":true,"text":[{"text":"    establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {","highlight_start":29,"highlight_end":36}],"label":"...but data from `cell_a` flows into `cell_b` here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0623]: lifetime mismatch\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs:53:29\n   |\nLL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {\n   |                                -------                -------\n   |                                |\n   |                                these two types are declared with different lifetimes...\nLL |     establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {\n   |                             ^^^^^^^ ...but data from `cell_a` flows into `cell_b` here\n\n"}
[00:46:12] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs","byte_start":1749,"byte_end":2056,"line_start":52,"line_end":59,"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 lifetime mismatch","highlight_start":1,"highlight_end":37},{"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_ref[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-ref.rs:52: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 lifetime mismatch\nLL | |\n...  |\nLL | |     });\nLL | | }\n   | |_^\n   |\n   = note: defining type: DefId(0/0:6 ~ propagate_approximated_ref[317d]::supply[0]) with substs []\n\n"}
[00:46:12] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:46:12] {"message":"For more information about this error, try `rustc --explain E0623`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0623`.\n"}
[00:46:12] ------------------------------------------
[00:46:12] 
[00:46:12] thread '[ui] ui/nll/closure-requirements/propagate-approximated-ref.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3096:9
[00:46:12] 
[00:46:12] 
[00:46:12] ---- [ui] ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs stdout ----
[00:46:12] diff of stderr:
[00:46:12] 
[00:46:12] 23    |
[00:46:12] 24    = note: defining type: DefId(0/1:12 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case1[0]::{{closure}}[0]) with closure substs [
[00:46:12] 25                i32,
[00:46:12] -                for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 'r)) u32>))
[00:46:12] +                for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) u32>))
[00:46:12] 28 
[00:46:12] 29 note: No external requirements
[00:46:12] 
[00:46:12] 51    |
[00:46:12] 51    |
[00:46:12] 52    = note: defining type: DefId(0/1:13 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case2[0]::{{closure}}[0]) with closure substs [
[00:46:12] 53                i32,
[00:46:12] -                for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 'r)) u32>))
[00:46:12] +                for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) u32>))
[00:46:12] 55            ]
[00:46:12] 56    = note: number of external vids: 2
[00:46:12] 57    = note: where '_#1r: '_#0r
[00:46:12] 
[00:46:12] The actual stderr differed from the expected stderr.
[00:46:12] The actual stderr differed from the expected stderr.
[00:46:12] 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:46:12] To update references, rerun the tests and pass the `--bless` flag
[00:46:12] To only update this specific test, also pass `--test-args nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs`
[00:46:12] error: 1 errors occurred comparing output.
[00:46:12] status: exit code: 101
[00:46:12] status: exit code: 101
[00:46:12] 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:46:12] ------------------------------------------
[00:46:12] 
[00:46:12] ------------------------------------------
[00:46:12] stderr:
[00:46:12] stderr:
[00:46:12] ------------------------------------------
[00:46:12] {"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:46:12] {"message":"free region `ReFree(DefId(0/1:12 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case1[0]::{{closure}}[0]), BrAnon(1))` does not outlive free region `'_#1r`","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":1029,"byte_end":1035,"line_start":33,"line_end":33,"column_start":9,"column_end":15,"is_primary":true,"text":[{"text":"        cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure","highlight_start":9,"highlight_end":15}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: free region `ReFree(DefId(0/1:12 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case1[0]::{{closure}}[0]), BrAnon(1))` does not outlive free region `'_#1r`\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs:33:9\n   |\nLL |         cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure\n   |         ^^^^^^\n\n"}
[00:46:12] {"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":1143,"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 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: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(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 does not 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(0, BrNamed(crate0:DefIndex(0:0), 'r)) u32>))\n           ]\n\n"}
[00:46:12] {"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":1146,"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 does not outlive free region","highlight_start":1,"highlight_end":48},{"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:46:12] {"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":1393,"byte_end":1506,"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(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(0, BrNamed(crate0:DefIndex(0:0), 'r)) u32>))\n           ]\n   = note: number of external vids: 2\n   = note: where '_#1r: '_#0r\n\n"}
[00:46:12] {"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":1165,"byte_end":1509,"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:46:12] {"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":1218,"byte_end":1220,"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":1508,"byte_end":1509,"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:46:12] {"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to :cell::Cell<&'_#1r &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't1)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't2)) u32>))
[00:46:12] 22            ]
[00:46:12] 23    = note: number of external vids: 2
[00:46:12] 24    = note: where '_#1r: '_#0r
[00:46:12] 
[00:46:12] The actual stderr differed from the expected stderr.
[00:46:12] 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:46:12] 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:46:12] To update references, rerun the tests and pass the `--bless` flag
[00:46:12] To only update this specific test, also pass `--test-args nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs`
[00:46:12] error: 1 errors occurred comparing output.
[00:46:12] status: exit code: 101
[00:46:12] status: exit code: 101
[00:46:12] 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:46:12] ------------------------------------------
[00:46:12] 
[00:46:12] ------------------------------------------
[00:46:12] stderr:
[00:46:12] stderr:
[00:46:12] ------------------------------------------
[00:46:12] {"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":1638,"byte_end":1661,"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:46:12] {"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":1717,"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 does not outlive free region","highlight_start":1,"highlight_end":48},{"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(0, BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&'_#1r &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't1)) std::cell::Cell<&ReLateBound(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 does not 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(0, BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&'_#1r &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't1)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't2)) u32>))\n           ]\n   = note: number of external vids: 2\n   = note: where '_#1r: '_#0r\n\n"}
[00:46:12] {"message":"free region `ReFree(DefId(0/0:6 ~ propagate_approximated_shorter_to_static_no_bound[317d]::supply[0]), BrNamed(crate0:DefIndex(1:16), 'a))` does not outlive free region `ReStatic`","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs","byte_start":1528,"byte_end":1717,"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 does not outlive free region","highlight_start":1,"highlight_end":48},{"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":[],"rendered":"error: free region `ReFree(DefId(0/0:6 ~ propagate_approximated_shorter_to_static_no_bound[317d]::supply[0]), BrNamed(crate0:DefIndex(1:16), 'a))` does not outlive free region `ReStatic`\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 does not 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"}
[00:46:12] {"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":1721,"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 does not outlive free region","highlight_start":1,"highlight_end":48},{"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 does not 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:46:12] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:46:12] ------------------------------------------
[00:46:12] 
[00:46:12] thread '[ui] ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3096:9
[00:46:12] 
[00:46:12] 
[00:46:12] ---- [ui] ui/nll/closure-requirements/propagate-approximated-val.rs stdout ----
[00:46:12] diff of stderr:
[00:46:12] 
[00:46:12] 18    |
[00:46:12] 19    = note: defining type: DefId(0/1:18 ~ propagate_approximated_val[317d]::test[0]::{{closure}}[0]) with closure substs [
[00:46:12] 20                i16,
[00:46:12] -                for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 's)) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 's)) u32>))
[00:46:12] +                for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) &'_#2r u32>, std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>))
[00:46:12] 22            ]
[00:46:12] 23    = note: number of external vids: 3
[00:46:12] 24    = note: where '_#1r: '_#2r
[00:46:12] 
[00:46:12] The actual stderr differed from the expected stderr.
[00:46:12] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-approximated-val/propagate-approximated-val.stderr
[00:46:12] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-approximated-val/propagate-approximated-val.stderr
[00:46:12] To update references, rerun the tests and pass the `--bless` flag
[00:46:12] To only update this specific test, also pass `--test-args nll/closure-requirements/propagate-approximated-val.rs`
[00:46:12] error: 1 errors occurred comparing output.
[00:46:12] status: exit code: 101
[00:46:12] status: exit code: 101
[00:46:12] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-val.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-approximated-val/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Zborrowck=mir" "-Zverbose" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-approximated-val/auxiliary" "-A" "unused"
[00:46:12] ------------------------------------------
[00:46:12] 
[00:46:12] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:498:22
[00:46:12] ------------------------------------------
[00:46:12] ------------------------------------------
[00:46:12] stderr:
[00:46:12] ------------------------------------------
[00:46:12] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-val.rs","byte_start":1536,"byte_end":1575,"line_start":50,"line_end":50,"column_start":9,"column_end":48,"is_primary":true,"text":[{"text":"        demand_y(outlives1, outlives2, x.get()) //~ WARNING not reporting region error due to nll","highlight_start":9,"highlight_end":48}],"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-val.rs:50:9\n   |\nLL |         demand_y(outlives1, outlives2, x.get()) //~ WARNING not reporting region error due to nll\n   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[00:46:12] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-val.rs","byte_start":1426,"byte_end":1631,"line_start":46,"line_end":51,"column_start":45,"column_end":6,"is_primary":true,"text":[{"text":"    establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {","highlight_start":45,"highlight_end":75},{"text":"        //~^ ERROR lifetime mismatch","highlight_start":1,"highlight_end":37},{"text":"","highlight_start":1,"highlight_end":1},{"text":"        // Only works if 'x: 'y:","highlight_start":1,"highlight_end":33},{"text":"        demand_y(outlives1, outlives2, x.get()) //~ WARNING not reporting region error due to nll","highlight_start":1,"highlight_end":98},{"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_val[317d]::test[0]::{{closure}}[0]) with closure substs [\n    i16,\n    for<'r, 's> extern \"rust-call\" fn((std::cell::Cell<&'_#1r &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) &'_#2r u32>, std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) 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: '_#2r","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: External requirements\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-val.rs:46:45\n   |\nLL |       establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {\n   |  _____________________________________________^\nLL | |         //~^ ERROR lifetime mismatch\nLL | |\nLL | |         // Only works if 'x: 'y:\nLL | |         demand_y(outlives1, outlives2, x.get()) //~ WARNING not reporting region error due to nll\nLL | |     });\n   | |_____^\n   |\n   = note: defining type: DefId(0/1:18 ~ propagate_approximated_val[317d]::test[0]::{{closure}}[0]) with closure substs [\n               i16,\n               for<'r, 's> extern \"rust-call\" fn((std::cell::Cell<&'_#1r &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) &'_#2r u32>, std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>))\n           ]\n   = note: number of external vids: 3\n   = note: where '_#1r: '_#2r\n\n"}
[00:46:12] {"message":"lifetime mismatch","code":{"code":"E0623","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-val.rs","byte_start":1347,"byte_end":1354,"line_start":45,"line_end":45,"column_start":30,"column_end":37,"is_primary":false,"text":[{"text":"fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {","highlight_start":30,"highlight_end":37}],"label":"these two types are declared with different lifetimes...","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-val.rs","byte_start":1370,"byte_end":1377,"line_start":45,"line_end":45,"column_start":53,"column_end":60,"is_primary":false,"text":[{"text":"fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {","highlight_start":53,"highlight_end":60}],"label":"","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-val.rs","byte_start":1410,"byte_end":1416,"line_start":46,"line_end":46,"column_start":29,"column_end":35,"is_primary":true,"text":[{"text":"    establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {","highlight_start":29,"highlight_end":35}],"label":"...but data from `cell_a` flows into `cell_b` here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0623]: lifetime mismatch\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-val.rs:46:29\n   |\nLL | fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {\n   |                              -------                -------\n   |                              |\n   |                              these two types are declared with different lifetimes...\nLL |     establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {\n   |                             ^^^^^^ ...but data from `cell_a` flows into `cell_b` here\n\n"}
[00:46:12] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-val.rs","byte_start":1318,"byte_end":1635,"line_start":45,"line_end":52,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {","highlight_start":1,"highlight_end":64},{"text":"    establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {","highlight_start":1,"highlight_end":75},{"text":"        //~^ ERROR lifetime mismatch","highlight_start":1,"highlight_end":37},{"text":"","highlight_start":1,"highlight_end":1},{"text":"        // Only works if 'x: 'y:","highlight_start":1,"highlight_end":33},{"text":"        demand_y(outlives1, outlives2, x.get()) //~ WARNING not reporting region error due to nll","highlight_start":1,"highlight_end":98},{"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_val[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/propagate-approximated-val.rs:45:1\n   |\nLL | / fn test<'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 lifetime mismatch\nLL | |\n...  |\nLL | |     });\nLL | | }\n   | |_^\n   |\n   = note: defining type: DefId(0/0:6 ~ propagate_approximated_val[317d]::test[0]) with substs []\n\n"}
[00:46:12] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:46:12] {"message":"For more information about this error, try `rustc --explain E0623`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0623`.\n"}
[00:46:12] ------------------------------------------
[00:46:12] 
[00:46:12] thread '[ui] ui/nll/closure-requirements/propagate-approximated-val.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3096:9
[00:46:12] 
[00:46:12] 
[00:46:12] ---- [ui] ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs stdout ----
[00:46:12] diff of stderr:
[00:46:12] 
[00:46:12] 18    |
[00:46:12] 19    = note: defining type: DefId(0/1:18 ~ propagate_approximated_shorter_to_static_wrong_bound[317d]::supply[0]::{{closure}}[0]) with closure substs [
[00:46:12] 20                i16,
[00:46:12] -                for<'r, 's, 't0, 't1, 't2, 't3> extern "rust-call" fn((&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 't1)) u32>, &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 't3)) std::cell::Cell<&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 't1)) u32>))
[00:46:12] +                for<'r, 's, 't0, 't1, 't2, 't3> extern "rust-call" fn((&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&'_#1r &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&'_#2r &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't1)) u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't3)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't1)) u32>))
[00:46:12] 22            ]
[00:46:12] 23    = note: number of external vids: 3
[00:46:12] 24    = note: where '_#1r: '_#0r
[00:46:12] 
[00:46:12] The actual stderr differed from the expected stderr.
[00:46:12] 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:46:12] 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:46:12] To update references, rerun the tests and pass the `--bless` flag
[00:46:12] To only update this specific test, also pass `--test-args nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs`
[00:46:12] error: 1 errors occurred comparing output.
[00:46:12] status: exit code: 101
[00:46:12] status: exit code: 101
[00:46:12] 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:46:12] ------------------------------------------
[00:46:12] 
[00:46:12] ------------------------------------------
[00:46:12] stderr:
[00:46:12] stderr:
[00:46:12] ------------------------------------------
[00:46:12] {"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":1725,"byte_end":1748,"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:46:12] {"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":1813,"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 does not outlive free region","highlight_start":1,"highlight_end":48},{"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(0, BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&'_#1r &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&'_#2r &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't1)) u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't3)) std::cell::Cell<&ReLateBound(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 does not 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(0, BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&'_#1r &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&'_#2r &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't1)) u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't3)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't1)) u32>))\n           ]\n   = note: number of external vids: 3\n   = note: where '_#1r: '_#0r\n\n"}
[00:46:12] {"message":"free region `ReFree(DefId(0/0:6 ~ propagate_approximated_shorter_to_static_wrong_bound[317d]::supply[0]), BrNamed(crate0:DefIndex(1:16), 'a))` does not outlive free region `ReStatic`","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs","byte_start":1603,"byte_end":1813,"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 does not outlive free region","highlight_start":1,"highlight_end":48},{"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":[],"rendered":"error: free region `ReFree(DefId(0/0:6 ~ propagate_approximated_shorter_to_static_wrong_bound[317d]::supply[0]), BrNamed(crate0:DefIndex(1:16), 'a))` does not outlive free region `ReStatic`\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 does not 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"}
[00:46:12] {"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":1817,"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 does not outlive free region","highlight_start":1,"highlight_end":48},{"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 does not 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:46:12] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:46:12] ------------------------------------------
[00:46:12] 
[00:46:12] thread '[ui] ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3096:9
[00:46:12] 
[00:46:12] 
[00:46:12] ---- [ui] ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs stdout ----
[00:46:12] diff of stderr:
[00:46:12] 
[00:46:12] 24    |
[00:46:12] 25    = note: defining type: DefId(0/1:18 ~ propagate_fail_to_approximate_longer_no_bounds[317d]::supply[0]::{{closure}}[0]) with closure substs [
[00:46:12] 26                i16,
[00:46:12] -                for<'r, 's, 't0, 't1, 't2> extern "rust-call" fn((&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 's)) &'_#1r u32>, &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 't1)) u32>, &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 's)) u32>))
[00:46:12] +                for<'r, 's, 't0, 't1, 't2> extern "rust-call" fn((&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) &'_#1r u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't1)) u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>))
[00:46:12] 29 
[00:46:12] 30 note: No external requirements
[00:46:12] 
[00:46:12] 
[00:46:12] 
[00:46:12] The actual stderr differed from the expected stderr.
[00:46:12] 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:46:12] To update references, rerun the tests and pass the `--bless` flag
[00:46:12] To only update this specific test, also pass `--test-args nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs`
[00:46:12] error: 1 errors occurred comparing output.
[00:46:12] status: exit code: 101
[00:46:12] status: exit code: 101
[00:46:12] 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:46:12] ------------------------------------------
[00:46:12] 
[00:46:12] ------------------------------------------
[00:46:12] stderr:
[00:46:12] stderr:
[00:46:12] ------------------------------------------
[00:46:12] {"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:46:12] {"message":"free region `ReFree(DefId(0/1:18 ~ propagate_fail_to_approximate_longer_no_bounds[317d]::supply[0]::{{closure}}[0]), BrAnon(4))` does not outlive free region `ReFree(DefId(0/1:18 ~ propagate_fail_to_approximate_longer_no_bounds[317d]::supply[0]::{{closure}}[0]), BrAnon(2))`","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs","byte_start":1645,"byte_end":1646,"line_start":47,"line_end":47,"column_start":18,"column_end":19,"is_primary":true,"text":[{"text":"        demand_y(x, y, x.get())","highlight_start":18,"highlight_end":19}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: free region `ReFree(DefId(0/1:18 ~ propagate_fail_to_approximate_longer_no_bounds[317d]::supply[0]::{{closure}}[0]), BrAnon(4))` does not outlive free region `ReFree(DefId(0/1:18 ~ propagate_fail_to_approximate_longer_no_bounds[317d]::supply[0]::{{closure}}[0]), BrAnon(2))`\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs:47:18\n   |\nLL |         demand_y(x, y, x.get())\n   |                  ^\n\n"}
[00:46:12] {"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":1769,"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 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_no_bounds[317d]::supply[0]::{{closure}}[0]) with closure substs [\n    i16,\n    for<'r, 's, 't0, 't1, 't2> extern \"rust-call\" fn((&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) &'_#1r u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't1)) u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(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 does not 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(0, BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) &'_#1r u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't1)) u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>))\n           ]\n\n"}
[00:46:12] {"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":1773,"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 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_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:46:12] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:46:12] ------------------------------------------
[00:46:12] 
[00:46:12] thread '[ui] ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3096:9
[00:46:12] 
[00:46:12] 
[00:46:12] ---- [ui] ui/nll/closure-requirements/propagate-despite-same-free-region.rs stdout ----
[00:46:12] diff of stderr:
[00:46:12] 
[00:46:12] 16    |
[00:46:12] 17    = note: defining type: DefId(0/1:16 ~ propagate_despite_same_free_region[317d]::supply[0]::{{closure}}[0]) with closure substs [
[00:46:12] 18                i16,
[00:46:12] -                for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 's)) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 's)) u32>))
[00:46:12] +                for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) &'_#2r u32>, std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>))
[00:46:12] 20            ]
[00:46:12] 21    = note: number of external vids: 3
[00:46:12] 22    = note: where '_#1r: '_#2r
[00:46:12] 
[00:46:12] The actual stderr differed from the expected stderr.
[00:46:12] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-despite-same-free-region/propagate-despite-same-free-region.stderr
[00:46:12] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-despite-same-free-region/propagate-despite-same-free-region.stderr
[00:46:12] To update references, rerun the tests and pass the `--bless` flag
[00:46:12] To only update this specific test, also pass `--test-args nll/closure-requirements/propagate-despite-same-free-region.rs`
[00:46:12] error: 1 errors occurred comparing output.
[00:46:12] status: exit code: 0
[00:46:12] status: exit code: 0
[00:46:12] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/closure-requirements/propagate-despite-same-free-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/propagate-despite-same-free-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/propagate-despite-same-free-region/auxiliary" "-A" "unused"
[00:46:12] ------------------------------------------
[00:46:12] 
[00:46:12] ------------------------------------------
[00:46:12] stderr:
[00:46:12] stderr:
[00:46:12] ------------------------------------------
[00:46:12] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.rs","byte_start":1710,"byte_end":1717,"line_start":54,"line_end":54,"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-despite-same-free-region.rs:54:21\n   |\nLL |             let p = x.get();\n   |                     ^^^^^^^\n\n"}
[00:46:12] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.rs","byte_start":1620,"byte_end":1758,"line_start":52,"line_end":56,"column_start":9,"column_end":10,"is_primary":true,"text":[{"text":"        |_outlives1, _outlives2, x, y| {","highlight_start":9,"highlight_end":41},{"text":"            // Only works if 'x: 'y:","highlight_start":1,"highlight_end":37},{"text":"            let p = x.get();","highlight_start":1,"highlight_end":29},{"text":"            demand_y(x, y, p)","highlight_start":1,"highlight_end":30},{"text":"        },","highlight_start":1,"highlight_end":10}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:16 ~ propagate_despite_same_free_region[317d]::supply[0]::{{closure}}[0]) with closure substs [\n    i16,\n    for<'r, 's> extern \"rust-call\" fn((std::cell::Cell<&'_#1r &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) &'_#2r u32>, std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) 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: '_#2r","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: External requirements\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.rs:52:9\n   |\nLL | /         |_outlives1, _outlives2, x, y| {\nLL | |             // Only works if 'x: 'y:\nLL | |             let p = x.get();\nLL | |             demand_y(x, y, p)\nLL | |         },\n   | |_________^\n   |\n   = note: defining type: DefId(0/1:16 ~ propagate_despite_same_free_region[317d]::supply[0]::{{closure}}[0]) with closure substs [\n               i16,\n               for<'r, 's> extern \"rust-call\" fn((std::cell::Cell<&'_#1r &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) &'_#2r u32>, std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>))\n           ]\n   = note: number of external vids: 3\n   = note: where '_#1r: '_#2r\n\n"}
[00:46:12] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.rs","byte_start":1528,"byte_end":1768,"line_start":49,"line_end":58,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn supply<'a>(cell_a: Cell<&'a u32>) {","highlight_start":1,"highlight_end":39},{"text":"    establish_relationships(","highlight_start":1,"highlight_end":29},{"text":"        cell_a,","highlight_start":1,"highlight_end":16},{"text":"        |_outlives1, _outlives2, x, y| {","highlight_start":1,"highlight_end":41},{"text":"            // Only works if 'x: 'y:","highlight_start":1,"highlight_end":37},{"text":"            let p = x.get();","highlight_start":1,"highlight_end":29},{"text":"            demand_y(x, y, p)","highlight_start":1,"highlight_end":30},{"text":"        },","highlight_start":1,"highlight_end":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_despite_same_free_region[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-despite-same-free-region.rs:49:1\n   |\nLL | / fn supply<'a>(cell_a: Cell<&'a u32>) {\nLL | |     establish_relationships(\nLL | |         cell_a,\nLL | |         |_outlives1, _outlives2, x, y| {\n...  |\nLL | |     );\nLL | | }\n   | |_^\n   |\n   = note: defining type: DefId(0/0:Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) &'_#1r u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't1)) &'_#2r u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't3)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't1)) u32>))
[00:46:12] 29 
[00:46:12] 30 note: No external requirements
[00:46:12] 
[00:46:12] 
[00:46:12] 
[00:46:12] The actual stderr differed from the expected stderr.
[00:46:12] 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:46:12] To update references, rerun the tests and pass the `--bless` flag
[00:46:12] To only update this specific test, also pass `--test-args nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs`
[00:46:12] error: 1 errors occurred comparing output.
[00:46:12] status: exit code: 101
[00:46:12] status: exit code: 101
[00:46:12] 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:46:12] ------------------------------------------
[00:46:12] 
[00:46:12] ------------------------------------------
[00:46:12] stderr:
[00:46:12] stderr:
[00:46:12] ------------------------------------------
[00:46:12] {"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:46:12] {"message":"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))`","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs","byte_start":1834,"byte_end":1835,"line_start":51,"line_end":51,"column_start":18,"column_end":19,"is_primary":true,"text":[{"text":"        demand_y(x, y, x.get())","highlight_start":18,"highlight_end":19}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"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))`\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs:51:18\n   |\nLL |         demand_y(x, y, x.get())\n   |                  ^\n\n"}
[00:46:12] {"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(0, BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) &'_#1r u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't1)) &'_#2r u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't3)) std::cell::Cell<&ReLateBound(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(0, BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) &'_#1r u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't1)) &'_#2r u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't3)) std::cell::Cell<&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 't1)) u32>))\n           ]\n\n"}
[00:46:12] {"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:46:12] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:46:12] ------------------------------------------
[00:46:12] 
[00:46:12] thread '[ui] ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3096:9
[00:46:12] 
[00:46:12] 
[00:46:12] ---- [ui] ui/nll/closure-requirements/return-wrong-bound-region.rs stdout ----
[00:46:12] diff of stderr:
[00:46:12] 
[00:46:12] 18    |
[00:46:12] 19    = note: defining type: DefId(0/1:9 ~ return_wrong_bound_region[317d]::test[0]::{{closure}}[0]) with closure substs [
[00:46:12] 20                i16,
[00:46:12] -                for<'r, 's> extern "rust-call" fn((&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 'r)) i32, &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 's)) i32)) -> &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 'r)) i32
[00:46:12] +                for<'r, 's> extern "rust-call" fn((&ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) i32, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) i32)) -> &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) i32
[00:46:12] 23 
[00:46:12] 24 note: No external requirements
[00:46:12] 
[00:46:12] 
[00:46:12] 
[00:46:12] The actual stderr differed from the expected stderr.
[00:46:12] 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:46:12] To update references, rerun the tests and pass the `--bless` flag
[00:46:12] To only update this specific test, also pass `--test-args nll/closure-requirements/return-wrong-bound-region.rs`
[00:46:12] error: 1 errors occurred comparing output.
[00:46:12] status: exit code: 101
[00:46:12] status: exit code: 101
[00:46:12] 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:46:12] ------------------------------------------
[00:46:12] 
[00:46:12] ------------------------------------------
[00:46:12] stderr:
[00:46:12] stderr:
[00:46:12] ------------------------------------------
[00:46:12] {"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:46:12] {"message":"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))`","code":null,"level":"error","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":"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))`\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:46:12] {"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(0, BrNamed(crate0:DefIndex(0:0), 'r)) i32, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) i32)) -> &ReLateBound(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(0, BrNamed(crate0:DefIndex(0:0), 'r)) i32, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) i32)) -> &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) i32\n           ]\n\n"}
[00:46:12] {"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:46:12] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:46:12] ------------------------------------------
[00:46:12] 
[00:46:12] thread '[ui] ui/nll/closure-requirements/return-wrong-bound-region.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3096:9
[00:46:12] 
[00:46:12] 
[00:46:12] ---- [ui] ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs stdout ----
[00:46:12] diff of stderr:
[00:46:12] 
[00:46:12] 25    = note: defining type: DefId(0/1:14 ~ ty_param_closure_approximate_lower_bound[317d]::generic[0]::{{closure}}[0]) with closure substs [
[00:46:12] 26                T,
[00:46:12] 27                i16,
[00:46:12] -                for<'r, 's> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 'r)) ()>>, &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 's)) T))
[00:46:12] +                for<'r, 's> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) ()>>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) T))
[00:46:12] 29            ]
[00:46:12] 30    = note: number of external vids: 2
[00:46:12] 31    = note: where T: '_#1r
[00:46:12] 
[00:46:12] 55    = note: defining type: DefId(0/1:17 ~ ty_param_closure_approximate_lower_bound[317d]::generic_fail[0]::{{closure}}[0]) with closure substs [
[00:46:12] 56                T,
[00:46:12] 57                i16,
[00:46:12] -                for<'r, 's> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 'r)) ()>>, &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 's)) T))
[00:46:12] +                for<'r, 's> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) ()>>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) T))
[00:46:12] 59            ]
[00:46:12] 60    = note: number of external vids: 2
[00:46:12] 61    = note: where T: '_#1r
[00:46:12] 
[00:46:12] The actual stderr differed from the expected stderr.
[00:46:12] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound/ty-param-closure-approximate-lower-bound.stderr
[00:46:12] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound/ty-param-closure-approximate-lower-bound.stderr
[00:46:12] To update references, rerun the tests and pass the `--bless` flag
[00:46:12] To only update this specific test, also pass `--test-args nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs`
[00:46:12] error: 1 errors occurred comparing output.
[00:46:12] status: exit code: 101
[00:46:12] status: exit code: 101
[00:46:12] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Zborrowck=mir" "-Zverbose" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound/auxiliary" "-A" "unused"
[00:46:12] ------------------------------------------
[00:46:12] 
[00:46:12] ------------------------------------------
[00:46:12] stderr:
[00:46:12] stderr:
[00:46:12] ------------------------------------------
[00:46:12] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs","byte_start":972,"byte_end":984,"line_start":34,"line_end":34,"column_start":31,"column_end":43,"is_primary":true,"text":[{"text":"    twice(cell, value, |a, b| invoke(a, b));","highlight_start":31,"highlight_end":43}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"warning: not reporting region error due to nll\n  --> /checkout/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs:34:31\n   |\nLL |     twice(cell, value, |a, b| invoke(a, b));\n   |                               ^^^^^^^^^^^^\n\n"}
[00:46:12] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs","byte_start":1201,"byte_end":1207,"line_start":42,"line_end":42,"column_start":31,"column_end":37,"is_primary":true,"text":[{"text":"    twice(cell, value, |a, b| invoke(a, b));","highlight_start":31,"highlight_end":37}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"warning: not reporting region error due to nll\n  --> /checkout/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs:42:31\n   |\nLL |     twice(cell, value, |a, b| invoke(a, b));\n   |                               ^^^^^^\n\n"}
[00:46:12] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs","byte_start":1201,"byte_end":1213,"line_start":42,"line_end":42,"column_start":31,"column_end":43,"is_primary":true,"text":[{"text":"    twice(cell, value, |a, b| invoke(a, b));","highlight_start":31,"highlight_end":43}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"warning: not reporting region error due to nll\n  --> /checkout/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs:42:31\n   |\nLL |     twice(cell, value, |a, b| invoke(a, b));\n   |                               ^^^^^^^^^^^^\n\n"}
[00:46:12] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs","byte_start":965,"byte_end":984,"line_start":34,"line_end":34,"column_start":24,"column_end":43,"is_primary":true,"text":[{"text":"    twice(cell, value, |a, b| invoke(a, b));","highlight_start":24,"highlight_end":43}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:14 ~ ty_param_closure_approximate_lower_bound[317d]::generic[0]::{{closure}}[0]) with closure substs [\n    T,\n    i16,\n    for<'r, 's> extern \"rust-call\" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) ()>>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) T))\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 T: '_#1r","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: External requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs:34:24\n   |\nLL |     twice(cell, value, |a, b| invoke(a, b));\n   |                        ^^^^^^^^^^^^^^^^^^^\n   |\n   = note: defining type: DefId(0/1:14 ~ ty_param_closure_approximate_lower_bound[317d]::generic[0]::{{closure}}[0]) with closure substs [\n               T,\n               i16,\n               for<'r, 's> extern \"rust-call\" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) ()>>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) T))\n           ]\n   = note: number of external vids: 2\n   = note: where T: '_#1r\n\n"}
[00:46:12] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs","byte_start":885,"byte_end":1097,"line_start":32,"line_end":38,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn generic<T>(value: T) {","highlight_start":1,"highlight_end":26},{"text":"    let cell = Cell::new(&());","highlight_start":1,"highlight_end":31},{"text":"    twice(cell, value, |a, b| invoke(a, b));","highlight_start":1,"highlight_end":45},{"text":"    //~^ WARNING not reporting region error","highlight_start":1,"highlight_end":44},{"text":"    //","highlight_start":1,"highlight_end":7},{"text":"    // This error from the old region solver looks bogus.","highlight_start":1,"highlight_end":58},{"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 ~ ty_param_closure_approximate_lower_bound[317d]::generic[0]) with substs [\n    T\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs:32:1\n   |\nLL | / fn generic<T>(value: T) {\nLL | |     let cell = Cell::new(&());\nLL | |     twice(cell, value, |a, b| invoke(a, b));\nLL | |     //~^ WARNING not reporting region error\nLL | |     //\nLL | |     // This error from the old region solver looks bogus.\nLL | | }\n   | |_^\n   |\n   = note: defining type: DefId(0/0:5 ~ ty_param_closure_approximate_lower_bound[317d]::generic[0]) with substs [\n               T\n           ]\n\n"}
[00:46:12] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs","byte_start":1194,"byte_end":1213,"line_start":42,"line_end":42,"column_start":24,"column_end":43,"is_primary":true,"text":[{"text":"    twice(cell, value, |a, b| invoke(a, b));","highlight_start":24,"highlight_end":43}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:17 ~ ty_param_closure_approximate_lower_bound[317d]::generic_fail[0]::{{closure}}[0]) with closure substs [\n    T,\n    i16,\n    for<'r, 's> extern \"rust-call\" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) ()>>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) T))\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 T: '_#1r","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: External requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs:42:24\n   |\nLL |     twice(cell, value, |a, b| invoke(a, b));\n   |                        ^^^^^^^^^^^^^^^^^^^\n   |\n   = note: defining type: DefId(0/1:17 ~ ty_param_closure_approximate_lower_bound[317d]::generic_fail[0]::{{closure}}[0]) with closure substs [\n               T,\n               i16,\n               for<'r, 's> extern \"rust-call\" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 'r)) ()>>, &ReLateBound(0, BrNamed(crate0:DefIndex(0:0), 's)) T))\n           ]\n   = note: number of external vids: 2\n   = note: where T: '_#1r\n\n"}
[00:46:12] {"message":"the parameter type `T` may not live long enough","code":{"code":"E0309","explanation":"\nTypes in type definitions have lifetimes associated with them that represent\nhow long the data stored within them is guaranteed to be live. This lifetime\nmust be as long as the data needs to be alive, and missing the constraint that\ndenotes this will cause this error.\n\n```compile_fail,E0309\n// This won't compile because T is not constrained, meaning the data\n// stored in it is not guaranteed to last as long as the reference\nstruct Foo<'a, T> {\n    foo: &'a T\n}\n```\n\nThis will compile, because it has the constraint on the type parameter:\n\n```\nstruct Foo<'a, T: 'a> {\n    foo: &'a T\n}\n```\n\nTo see why this is important, consider the case where `T` is itself a reference\n(e.g., `T = &str`). If we don't include the restriction that `T: 'a`, the\nfollowing code would be perfectly legal:\n\n```compile_fail,E0309\nstruct Foo<'a, T> {\n    foo: &'a T\n}\n\nfn main() {\n    let v = \"42\".to_string();\n    let f = Foo{foo: &v};\n    drop(v);\n    println!(\"{}\", f.foo); // but we've already dropped v!\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs","byte_start":1194,"byte_end":1213,"line_start":42,"line_end":42,"column_start":24,"column_end":43,"is_primary":true,"text":[{"text":"    twice(cell, value, |a, b| invoke(a, b));","highlight_start":24,"highlight_end":43}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider adding an explicit lifetime bound `T: ReFree(DefId(0/0:6 ~ ty_param_closure_approximate_lower_bound[317d]::generic_fail[0]), BrNamed(crate0:DefIndex(1:15), 'a))`...","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0309]: the parameter type `T` may not live long enough\n  --> /checkout/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs:42:24\n   |\nLL |     twice(cell, value, |a, b| invoke(a, b));\n   |                        ^^^^^^^^^^^^^^^^^^^\n   |\n   = help: consider adding an explicit lifetime bound `T: ReFree(DefId(0/0:6 ~ ty_param_closure_approximate_lower_bound[317d]::generic_fail[0]), BrNamed(crate0:DefIndex(1:15), 'a))`...\n\n"}
[00:46:12] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs","byte_start":1116,"byte_end":1368,"line_start":41,"line_end":46,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn generic_fail<'a, T>(cell: Cell<&'a ()>, value: T) {","highlight_start":1,"highlight_end":55},{"text":"    twice(cell, value, |a, b| invoke(a, b));","highlight_start":1,"highlight_end":45},{"text":"    //~^ WARNING not reporting region error","highlight_start":1,"highlight_end":44},{"text":"    //~| WARNING not reporting region error","highlight_start":1,"highlight_end":44},{"text":"    //~| ERROR the parameter type `T` may not live long enough","highlight_start":1,"highlight_end":63},{"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 ~ ty_param_closure_approximate_lower_bound[317d]::generic_fail[0]) with substs [\n    T\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs:41:1\n   |\nLL | / fn generic_fail<'a, T>(cell: Cell<&'a ()>, value: T) {\nLL | |     twice(cell, value, |a, b| invoke(a, b));\nLL | |     //~^ WARNING not reporting region error\nLL | |     //~| WARNING not reporting region error\nLL | |     //~| ERROR the parameter type `T` may not live long enough\nLL | | }\n   | |_^\n   |\n   = note: defining type: DefId(0/0:6 ~ ty_param_closure_approximate_lower_bound[317d]::generic_fail[0]) with substs [\n               T\n           ]\n\n"}
[00:46:12] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:46:12] {"message":"For more information about this error, try `rustc --explain E0309`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0309`.\n"}
[00:46:12] ------------------------------------------
[00:46:12] 
[00:46:12] thread '[ui] ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3096:9
[00:46:12] 
---
[00:46:12] test result: FAILED. 1453 passed; 13 failed; 14 ignored; 0 measured; 0 filtered out
[00:46:12] 
[00:46:12] 
[00:46:12] 
[00:46:12] 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:46:12] 
[00:46:12] 
[00:46:12] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:46:12] Build completed unsuccessfully in 0:02:36
[00:46:12] Build completed unsuccessfully in 0:02:36
[00:46:12] make: *** [check] Error 1
[00:46:12] Makefile:58: recipe for target 'check' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:016a54b5
$ 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)

@varkor

varkor commented May 31, 2018

Copy link
Copy Markdown
Contributor

r? @nikomatsakis

@rust-highfive rust-highfive assigned nikomatsakis and unassigned eddyb May 31, 2018
@eddyb

eddyb commented May 31, 2018 •

Copy link
Copy Markdown
Contributor

@fabric-and-ink You can use DebrujinIndex(0), for example, directly, so you don't need to lose much, if anything - it's only the asserts that can't (yet) be const fn.

EDIT: @nikomatsakis had a better suggestion below, ignore me.

@nikomatsakis

Copy link
Copy Markdown
Contributor

@fabric-and-ink two things:

  1. there are some tests that embed the Debug output of DebruijnIndex into the reference files; to fix those test failures, you can run ./x.py test src/test/ui --bless and then make a commit with the resulting updates (I will double-check what you add).

  2. there is a syntax for adding constants using the newtype_index! macro. Here is how the Local type does it:

newtype_index!(Local
{
DEBUG_FORMAT = "_{}",
const RETURN_PLACE = 0,
});

@nikomatsakis nikomatsakis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good start! Left some suggestions (in addition to running ./x.py test src/test/ui --bless to fix the reference files).

Comment thread src/librustc/middle/resolve_lifetime.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we could change this from amount: u32 to amount: usize and avoid the casts below.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(but see my comment below about maybe changing shifted_in instead)

Comment thread src/librustc/middle/resolve_lifetime.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd prefer to keep the constant, using the macro extension I suggested in the main PR.

Comment thread src/librustc/ty/fold.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can prob change these back to CAPITALS, but it looks like the original had a typo (INNTERMOST) though, we should fix that :)

Comment thread src/librustc/ty/fold.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hmm, instead of changing all of these to make amount: usize — which we could do — perhaps we should just change shifted_in to take a u32 instead

Comment thread src/librustc/ty/sty.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yeah, I think we should make this u32 still...

Comment thread src/librustc/ty/sty.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

...and cast to usize here, just the once

@nikomatsakis nikomatsakis added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 31, 2018
@eddyb

eddyb commented May 31, 2018

Copy link
Copy Markdown
Contributor

there is a syntax for adding constants using the newtype_index! macro.

We should use that more in MIR, sorry about my own suggestion 😄.

@ghost

ghost commented Jun 4, 2018

Copy link
Copy Markdown
Author

Thanks for the feedback! I try to work it in as soon as I can. (Quite possibly tomorrow.)

@nikomatsakis

Copy link
Copy Markdown
Contributor

@fabric-and-ink ok lemme know :)

@ghost

ghost commented Jun 10, 2018 •

Copy link
Copy Markdown
Author

Got it!

I'm stuck here

error[E0599]: no associated item named `INNERMOST` found for type `ty::sty::DebruijnIndex` in the current scope
    --> librustc/ty/sty.rs:1314:46
     |
1024 | / newtype_index!(DebruijnIndex
1025 | |     {
1026 | |         const INNERMOST = 0,
1027 | |     });
     | |_______- associated item `INNERMOST` not found for this
...
1314 |           self.shifted_out(to_binder.index() - Self::INNERMOST.index())
     |                                                ^^^^^^^^^^^^^^^ associated item not found in `ty::sty::DebruijnIndex`
     |
     = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

@ghost

ghost commented Jun 10, 2018

Copy link
Copy Markdown
Author

Dang, made a typo. Hang on...

@ghost

ghost commented Jun 10, 2018 •

Copy link
Copy Markdown
Author

Ok, should be fine now.

Just one thing seemed strange: INNERMOST lives in ty::sty and not ty::sty::DebruijnIndex and I don't know why.

@rust-highfive

Copy link
Copy Markdown
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.
-linux-gnu
121656 ./obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release
116060 ./obj/build/x86_64-unknown-linux-gnu/test/mir-opt
103932 ./obj/build/bootstrap/debug/incremental/bootstrap-c730863262pt
103928 ./obj/build/bootstrap/debug/incremental/bootstrap-c730863262pt/s-f1ux75svm0-ljqpav-no75lmxs5rt9
102908 ./obj/build/x86_64-unknown-linux-gnu/stage0-tools/x86_64-unknown-linux-gnu
102904 ./obj/build/x86_64-unknown-linux-gnu/stage0-tools/x86_64-unknown-linux-gnu/release
99524 ./obj/build/x86_64-unknown-linux-gnu/stage0-tools/x86_64-unknown-linux-gnu/release/deps
93244 ./obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps

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)

@ghost

ghost commented Jun 10, 2018 •

Copy link
Copy Markdown
Author

Ok, it seems that the index() function should better be const but the the Idx::index() function can't be declared as const since it is a trait function. This is where we need the shifted_in(...) function to be const which relies on the index() function.

[01:20:32] error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants
[01:20:32]    --> librustc_driver/test.rs:187:31
[01:20:32]     |
[01:20:32] 187 | const D2: ty::DebruijnIndex = D1.shifted_in(1);
[01:20:32]     |                               ^^^^^^^^^^^^^^^^

I suppose that DebruijnIndex::new(1) wouldn't work either and I think I will just write DebrujinIndex(1)

@rust-highfive

Copy link
Copy Markdown
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.
[01:15:35] 
[01:15:35] To learn more, run the command again with --verbose.
[01:15:35] 
[01:15:35] 
[01:15:35] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" " jemalloc" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "-p" "rustc_driver" "--" "--quiet"
[01:15:35] 
[01:15:35] 
[01:15:35] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:15:35] Build completed unsuccessfully in 0:35:35
[01:15:35] Build completed unsuccessfully in 0:35:35
[01:15:35] make: *** [check] Error 1
[01:15:35] Makefile:58: recipe for target 'check' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:1f2c5400
$ 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)

@eddyb

eddyb commented Jun 11, 2018

Copy link
Copy Markdown
Contributor

@fabric-and-ink You can avoid using .index() and new if you access the field directly with .0.

Also, I don't think having INNERMOST directly in ty is ideal, but I don't know how to tell the macro to use an associated constant (or you might just have to do this yourself, it's not that bad).

@ghost

ghost commented Jun 11, 2018 •

Copy link
Copy Markdown
Author

I can leave index() out if you want, it's a matter of taste I suppose. Regarding your second point: I would like to wait for @nikomatsakis' input since he proposed to use the macro. But I also would prefer DebruijnIndex::INNERMOST.

I don't know why the current build fails. The type is a tuple struct, isn't it? But why the error message?

@rust-highfive

Copy link
Copy Markdown
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.
[01:21:14] travis_fold:start:test_stage1-rustc_driver
travis_time:start:test_stage1-rustc_driver
Testing rustc_driver stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:21:14]    Compiling rustc_driver v0.0.0 (file:///checkout/src/librustc_driver)
[01:21:15] error[E0423]: expected function, found struct `ty::DebruijnIndex`
[01:21:15]    --> librustc_driver/test.rs:187:31
[01:21:15]     |
[01:21:15] 187 | const D2: ty::DebruijnIndex = ty::DebruijnIndex(1);
[01:21:15]     |                               ^^^^^^^^^^^^^^^^^ did you mean `ty::DebruijnIndex { /* fields */ }`?
[01:21:16] error: aborting due to previous error
[01:21:16] 
[01:21:16] For more information about this error, try `rustc --explain E0423`.
[01:21:16] error: Could not compile `rustc_driver`.
[01:21:16] error: Could not compile `rustc_driver`.
[01:21:16] 
[01:21:16] To learn more, run the command again with --verbose.
[01:21:16] 
[01:21:16] 
[01:21:16] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" " jemalloc" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "-p" "rustc_driver" "--" "--quiet"
[01:21:16] 
[01:21:16] 
[01:21:16] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:21:16] Build completed unsuccessfully in 0:38:05
[01:21:16] Build completed unsuccessfully in 0:38:05
[01:21:16] Makefile:58: recipe for target 'check' failed
[01:21:16] make: *** [check] Error 1

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:20392e06
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:04d86f68:start=1529000091602002402,finish=1529000091609688778,duration=7686376
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:00150318
$ 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:0dc55a0a
$ 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)

@ghost

ghost commented Jun 14, 2018

Copy link
Copy Markdown
Author

Ah now I get why the error is happening. Well, I think the newtype_index macro isn't all that helpful in this context... I think I will just write things manually.

@nikomatsakis

Copy link
Copy Markdown
Contributor

@fabric-and-ink I'd rather keep using the macro, just so that everything is consolidated, and you can use IndexVec, etc; we can write that code as

const D2: DebuijnIndex = DebruijnIndex::INNERMOST.shifted_in(1);

@ghost

ghost commented Jun 15, 2018

Copy link
Copy Markdown
Author

Ok, I think I got it now.

@nikomatsakis

Copy link
Copy Markdown
Contributor

@bors r+ -- nice!

@bors

bors commented Jun 18, 2018

Copy link
Copy Markdown
Collaborator

📌 Commit 862d25c has been approved by nikomatsakis

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 18, 2018
@bors

bors commented Jun 18, 2018

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 862d25c with merge fc19590...

bors added a commit that referenced this pull request Jun 18, 2018
…atsakis

Declare DebruijnIndex via newtype_index macro

Part of #49887

Declare `DebruijnIndex` via the `newtype_index` macro.
@bors

bors commented Jun 19, 2018

Copy link
Copy Markdown
Collaborator

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

@bors
bors merged commit 862d25c into rust-lang:master Jun 19, 2018
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.

6 participants