Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Make the NonZero* methods const fn #54799

Closed
wants to merge 3 commits into from

Conversation

JamesHinshelwood
Copy link
Contributor

Fixes #53331

r? @oli-obk

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @oli-obk (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 Oct 3, 2018
@rust-highfive
Copy link
Collaborator

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

Click to expand the log.
[00:46:15] .................................................................................................... 2800/4546
[00:46:18] .................................................................................................... 2900/4546
[00:46:21] ..........................i......................................................................... 3000/4546
[00:46:24] ......................................................................................i.i..ii....... 3100/4546
[00:46:27] .......................................................FF..FFFFFFFFF....F........................... 3200/4546
[00:46:31] ...............................................................F..F....F...F........................ 3300/4546
[00:46:37] .................................................................................................... 3500/4546
[00:46:39] .................................................................................................... 3600/4546
[00:46:42] .................................................................................................... 3700/4546
[00:46:45] ...............................................................i.................................... 3800/4546
[00:46:45] ...............................................................i.................................... 3800/4546
[00:46:50] .................................................................................................... 3900/4546
[00:46:53] .................................................................................................... 4000/4546
[00:46:56] .................................................................................................... 4100/4546
[00:47:00] ...............................i.................................................................... 4200/4546
[00:47:03] .................................................................................................... 4300/4546
[00:47:08] .....................................................................................i.............. 4500/4546
pected stderr.
[00:47:10] 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:47:10] To update references, rerun the tests and pass the `--bless` flag
[00:47:10] To only update this specific test, also pass `--test-args nll/closure-requirements/escape-argument-callee.rs`
[00:47:10] error: 1 errors occurred comparing output.
[00:47:10] status: exit code: 1
[00:47:10] status: exit code: 1
[00:47:10] 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:47:10] ------------------------------------------
[00:47:10] 
[00:47:10] ------------------------------------------
[00:47:10] stderr:
[00:47:10] stderr:
[00:47:10] ------------------------------------------
[00:47:10] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/escape-argument-callee.rs","byte_start":1353,"byte_end":1366,"line_start":36,"line_end":36,"column_start":38,"column_end":51,"is_primary":true,"text":[{"text":"        let mut closure = expect_sig(|p, y| *p = y);","highlight_start":38,"highlight_end":51}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:9 ~ escape_argument_callee[317d]::test[0]::{{closure}}[0]) with closure substs [\n    i16,\n    for<'r, 's, 't0> extern \"rust-call\" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) mut &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) i32, &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't0)) i32))\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/closure-requirements/escape-argument-callee.rs:36:38\n   |\nLL |         let mut closure = expect_sig(|p, y| *p = y);\n   |                                      ^^^^^^^^^^^^^\n   |\n   = note: defining type: DefId(0/1:9 ~ escape_argument_callee[317d]::test[0]::{{closure}}[0]) with closure substs [\n               i16,\n               for<'r, 's, 't0> extern \"rust-call\" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) mut &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) i32, &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't0)) i32))\n           ]\n\n"}
[00:47:10] {"message":"unsatisfied lifetime constraints","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/escape-argument-callee.rs","byte_start":1357,"byte_end":1358,"line_start":36,"line_end":36,"column_start":42,"column_end":43,"is_primary":false,"tequirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/escape-argument-callee.rs","byte_start":1241,"byte_end":1439,"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":"        //~^ ERROR","highlight_start":1,"highlight_end":19},{"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   = nonlet 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":"`y` dropped here while still borrowed","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   |     - `y` dropped here while still borrowed\nLL | \nLL |     deref(p);\n   |           - borrow later used here\n\n"}
[00:47:10] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:47:10] {"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:47:10] ------------------------------------------
[00:47:10] 
[00:47:10] thread '[ui] ui/nll/closure-requirements/escape-argument.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:10] 
[00:47:10] 
[00:47:10] ---- [ui] ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs stdout ----
[00:47:10] diff of stderr:
[00:47:10] 
[00:47:10] 10    |
[00:47:10] 11    = note: defining type: DefId(0/1:20 ~ propagate_approximated_fail_no_postdom[317d]::supply[0]::{{closure}}[0]) with closure substs [
[00:47:10] 12                i16,
[00:47:10] -                for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::nt":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:20 ~ propagate_approximated_fail_no_postdom[317d]::supply[0]::{{closure}}[0]) with closure substs [\n    i16,\n    for<'r, 's> extern \"rust-call\" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) &'_#3r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) u32>))\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"late-bound region is '_#4r","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"late-bound region is '_#5r","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"late-bound region is '_#6r","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 | |             demand_y(x, y, p) //~ ERROR\nLL | |         },\n   | |_________^\n   |\n   = note: defining type: DefId(0/1:20 ~ propagate_approximated_fail_no_postdom[317d]::supply[0]::{{closure}}[0]) with closure substs [\n               i16,\n               for<'r, 's> extern \"rust-call\" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) &'_#3r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) u32>))\n           ]\n   = note: late-bound region is '_#4r\n   = note: late-bound region is '_#5r\n   = note: late-bound region is '_#6r\n\n"}
[00:47:10] {"message":"unsatisfied lifetime constraints","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs","byte_start":1570,"byte_end":1580,"line_start":53,"line_end":53,"column_start":10,"column_end":20,"is_primary":false,"text":[{"text":"        |_outlives1, _outlives2, _outlives3, x, y| {","highlight_start":10,"highlight_end":20}],"label":"has type `std::cell::Cell<&&'1 u32>`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs","byte_start":1594,"byte_end":1604,"line_start":53,"line_end":53,"column_start":34,"column_end":44,"is_primary":false,"text":[{"text":"        |_outlives1, _outlives2, _outlives3, x, y| {","highlight_start":34,"highlight_end":44}],"label":"has type `std::cell::Cell<&'2 &u32>`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs","byte_start":1692,"byte_end":1709,"line_start":56,"line_end":56,"column_start":13,"column_end":30,"is_primary":true,"text":[{"text":"            demand_y(x, y, p) //~ ERROR","highlight_start":13,"highlight_end":30}],"label":"argument requires that `'1` must outlive `'2`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: unsatisfied lifetime constraints\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs:56:13\n   |\nLL |         |_outlives1, _outlives2, _outlives3, x, y| {\n   |          ----------              ---------- has type `std::cell::Cell<&'2 &u32>`\n   |          |\n   |          has type `std::cell::Cell<&&'1 u32>`\n...\nLL |             demand_y(x, y, p) //~ ERROR\n   |             ^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`\n\n"}
[00:47:10] {"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":1739,"line_start":48,"line_end":59,"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":"            demand_y(x, y, p) //~ ERROR","highlight_start":1,"highlight_end":40},{"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:47:10] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:47:10] ------------------------------------------
[00:47:10] 
[00:47:10] thread '[ui] ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:10] 
[00:47:10] 
[00:47:10] ---- [ui] ui/nll/closure-requirements/propagate-approximated-ref.rs stdout ----
[00:47:10] diff of stderr:
[00:47:10] 
[00:47:10] 12    |
[00:47:10] 13    = note: defining type: DefId(0/1:18 ~ propagate_approximated_ref[317d]::supply[0]::{{closure}}[0]) with closure substs [
[00:47:10] 14                i16,
[00:47:10] -                for<'r, 's, 't0, 't1, 't2, 't3> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't1)) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't3)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't1)) u32>))
[00:47:10] +                for<'r, 's, 't0, 't1, 't2, 't3> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't1)) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't3)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't1)) u32>))
[00:47:10] 16            ]
[00:47:10] 17    = note: late-bound region is '_#3r
[00:47:10] 18    = note: late-bound region is '_#4r
[00:47:10] 
[00:47:10] The actual stderr differed from the expected stderr.
[00:47:10] The actual stderr differed from the expected stderr.
[00:47:10] 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:47:10] To update references, rerun the tests and pass the `--bless` flag
[00:47:10] To only update this specific test, also pass `--test-args nll/closure-requirements/propagate-approximated-ref.rs`
[00:47:10] error: 1 errors occurred comparing output.
[00:47:10] status: exit code: 1
[00:47:10] status: exit code: 1
[00:47:10] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-approximated-ref/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Zborrowck=mir" "-Zverbose" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/closure-requirements/propagate-approximated-ref/auxiliary" "-A" "unused"
[00:47:10] ------------------------------------------
[00:47:10] 
[00:47:10] ------------------------------------------
[00:47:10] stderr:
[00:47:10] stderr:
[00:47:10] ------------------------------------------
[00:47:10] {"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":2017,"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 unsatisfied lifetime constraints","highlight_start":1,"highlight_end":52},{"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())","highlight_start":1,"highlight_end":32},{"text":"    });","highlight_start":1,"highlight_end":6}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:18 ~ propagate_approximated_ref[317d]::supply[0]::{{closure}}[0]) with closure substs [\n    i16,\n    for<'r, 's, 't0, 't1, 't2, 't3> extern \"rust-call\" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't1)) &'_#2r u32>, &":"lifetime `'b` defined here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs","byte_start":1861,"byte_end":2017,"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 unsatisfied lifetime constraints","highlight_start":1,"highlight_end":52},{"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())","highlight_start":1,"highlight_end":32},{"text":"    });","highlight_start":1,"highlight_end":6}],"label":"closure body requires that `'a` must outlive `'b`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: unsatisfied lifetime constraints\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs:53:47\n   |\nLL |   fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {\n   |             --  -- lifetime `'b` defined here\n   |             |\n   |             lifetime `'a` defined here\nLL |       establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {\n   |  _______________________________________________^\nLL | |         //~^ ERROR unsatisfied lifetime constraints\nLL | |\nLL | |         // Only works if 'x: 'y:\nLL | |         demand_y(x, y, x.get())\nLL | |     });\n   | |_____^ closure 0), BrNamed(crate1:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't1)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't2)) u32>))
[00:47:10] 17            ]
[00:47:10] 18    = note: late-bound region is '_#2r
[00:47:10] 19    = note: late-bound region is '_#3r
[00:47:10] 
[00:47:10] The actual stderr differed from the expected stderr.
[00:47:10] 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:47:10] 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:47:10] To update references, rerun the tests and pass the `--bless` flag
[00:47:10] To only update this specific test, also pass `--test-args nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs`
[00:47:10] error: 1 errors occurred comparing output.
[00:47:10] status: exit code: 1
[00:47:10] status: exit code: 1
[00:47:10] 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/x8ght_end":32},{"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 borrowed data escapes outside of function\nLL | |         //~| ERROR unsatisfied lifetime constraints\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:47:10] {"message":"borrowed data escapes outside of function","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs","byte_start":1434,"byte_end":1440,"line_start":44,"line_end":44,"column_start":19,"column_end":25,"is_primary":false,"text":[{"text":"fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {","highlight_start":19,"highlight_end":25}],"label":"`cell_a` is a reference that is only valid in the function body","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs","byte_start":1486,"byte_end":1733,"line_start":45,"line_end":51,"column_start":5,"column_end":7,"is_primary":true,"text":[{"text":"    establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {","highlight_start":5,"highlight_end":66},{"text":"        //~^ ERROR borrowed data escapes outside of function","highlight_start":1,"highlight_end":61},{"text":"        //~| ERROR unsatisfied lifetime constraints","highlight_start":1,"highlight_end":52},{"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())","highlight_start":1,"highlight_end":32},{"text":"    });","highlight_start":1,"highlight_end":7}],"label":"`cell_a` escapes the function body here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: borrowed data escapes outside of function\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs:45:5\n   |\nLL |   fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {\n   |                     ------ `cell_a` is a reference that is only valid in the function body\nLL | /     establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {\nLL | |         //~^ ERROR borrowed data escapes outside of function\nLL | |         //~| ERROR unsatisfied lifetime constraints\nLL | |\nLL | |         // Only works if 'x: 'y:\nLL | |         demand_y(x, y, x.get())\nLL | |     });\n   | |___:3267:9
[00:47:10] ---- [ui] ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs stdout ----
[00:47:10] diff of stderr:
[00:47:10] 
[00:47:10] 10    |
[00:47:10] 10    |
[00:47:10] 11    = note: defining type: DefId(0/1:12 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case1[0]::{{closure}}[0]) with closure substs [
[00:47:10] 12                i32,
[00:47:10] -                for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>))
[00:47:10] +                for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) u32>))
[00:47:10] 15 
[00:47:10] 15 
[00:47:10] 16 error: borrowed data escapes outside of closure
[00:47:10] 48    |
[00:47:10] 48    |
[00:47:10] 49    = note: defining type: DefId(0/1:13 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case2[0]::{{closure}}[0]) with closure substs [
[00:47:10] 50                i32,
[00:47:10] -                for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>))
[00:47:10] +                for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) u32>))
[00:47:10] 52            ]
[00:47:10] 53    = note: number of external vids: 2
[00:47:10] 54    = note: where '_#1r: '_#0r
[00:47:10] 
[00:47:10] The actual stderr differed from the expected stderr.
[00:47:10] The actual stderr differed from the expected stderr.
[00:47:10] 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:47:10] To update references, rerun the tests and pass the `--bless` flag
[00:47:10] To only update this specific test, also pass `--test-args nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs`
[00:47:10] error: 1 errors occurred comparing output.
[00:47:10] status: exit code: 1
[00:47:10] status: exit code: 1
[00:47:10] 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:47:10] ------------------------------------------
[00:47:10] 
[00:47:10] ------------------------------------------
[00:47:10] stderr:
[00:47:10] stderr:
[00:47:10] ------------------------------------------
[00:47:10] {"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":1055,"line_start":31,"line_end":34,"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_a.set(cell_x.get()); // forces 'x: 'a, error in closure","highlight_start":1,"highlight_end":69},{"text":"        //~^ ERROR","highlight_start":1,"highlight_end":19},{"text":"    })","highlight_start":1,"highlight_end":6}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:12 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case1[0]::{{closure}}[0]) with closure substs [\n    i32,\n    for<'r> extern \"rust-call\" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1: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 | |         cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure\nLL | |         //~^ ERROR\nLL | |     })\n   | |_____^\n   |\n   = note: defining type: DefId(0/1:12 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case1[0]::{{closure}}[0]) with closure substs [\n               i32,\n               for<'r> extern \"rust-call\" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) u32>))\n           ]\n\n"}
[00:47:10] {"message":"borrowed data escapes outside of closure","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":944,"byte_end":950,"line_start":31,"line_end":31,"column_start":16,"column_end":22,"is_primary":false,"text":[{"text":"    foo(cell, |cell_a, cell_x| {","highlight_start":16,"highlight_end":22}],"label":"`cell_a` is declared here, outside of the closure body","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":952,"byte_end":958,"line_start":31,"line_end":31,"column_start":24,"column_end":30,"is_primary":false,"text":[{"text":"    foo(cell, |cell_a, cell_x| {","highlight_start":24,"highlight_end":30}],"label":"`cell_x` is a reference that is only valid in the closure body","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":970,"byte_end":994,"line_start":32,"line_end":32,"column_start":9,"column_end":33,"is_primary":true,"text":[{"text":"        cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure","highlight_start":9,"highlight_end":33}],"label":"`cell_x` escapes the closure body here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: borrowed data escapes outside of closure\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs:32:9\n   |\nLL |     foo(cell, |cell_a, cell_x| {\n   |                ------  ------ `cell_x` is a reference that is only valid in the closure body\n   |                |\n   |                `cell_a` is declared here, outside of the closure body\nLL |         cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure\n   |         ^^^^^^^^^^^^^^^^^^^^^^^^ `cell_x` escapes the closure body here\n\n"}
[00:47:10] {"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":1058,"line_start":28,"line_end":35,"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":"        cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure","highlight_start":1,"highlight_end":69},{"text":"        //~^ ERROR","highlight_start":1,"highlight_end":19},{"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:47:10] {"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":1305,"byte_end":1418,"line_start":45,"line_end":47,"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_"label":"`a` dropped here while still borrowed","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:40:26\n   |\nLL |     let cell = Cell::new(&a);\n   |                          ^^ borrowed value does not live long enough\n...\nLL | }\n   | - `a` dropped here while still borrowed\n   |\n   = note: borrowed value must be valid for the static lifetime...\n\n"}
[00:47:10] {"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 2 previous errors\n\n"}
[00:47:10] {"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:47:10] ------------------------------------------
[00:47:10] 
[00:47:10] thread '[ui] ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:10] 
[00:47:10] 
[00:47:10] ---- [ui] ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs stdout ----
[00:47:10] diff of stderr:
[00:47:10] 
[00:47:10] 12    |
[00:47:10] 13    = note: defining type: DefId(0/1:18 ~ propagate_approximated_shorter_to_static_wrong_bound[317d]::supply[0]::{{closure}}[0]) with closure substs [
[00:47:10] 14                i16,
[00:47:10] -                for<'r, 's, 't0, 't1, 't2, 't3> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't1)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't3)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't1)) u32>))
[00:47:10] +                for<'r, 's, 't0, 't1, 't2, 't3> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't0)) std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't1)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't3)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't1)) u32>))
[00:47:10] 16            ]
[00:47:10] 17    = note: late-bound region is '_#3r
[00:47:10] 18    = note: late-bound region is '_#4r
[00:47:10] 
[00:47:10] The actual stderr differed from the expected stderr.
[00:47:10] 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:47:10] 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:47:10] To update references, rerun the tests and pass the `--bless` flag
[00:47:10] To only update this specific test, also pass `--test-args nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs`
[00:47:10] error: 1 errors occurred comparing output.
[00:47:10] status: exit code: 1
[00:47:10] status: exit code: 1
[00:47:10] 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:47:10] ------------------------------------------
[00:47:10] 
[00:47:10] ------------------------------------------
[00:47:10] stderr:
[00:47:10] stderr:
[00:47:10] ------------------------------------------
[00:47:10] {"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":1819,"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 borrowed data escapes outside of function","highlight_start":1,"highlight_end":61},{"text":"        //~| ERROR unsatisfied lifetime constraints","highlight_start":1,"highlight_end":52},{"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":"    });","highlight_start":1,"highlight_end":6}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:18 ~ propagate_approximated_shorter_to_static_wrong_bound[317d]::supply[0]::{{closure}}[0]) with closure substs [\n    i16,\n    for<'r, 's, 't0, 't1, 't2, 't3> extern \"rust-call\" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't0)) std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't1)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't3)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't1)) u32>))\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"late-bound region is '_#3r","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"late-bound region is '_#4r","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"number of external vids: 5","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"where '_#1r: '_#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 borrowed data escapes outside of function\nLL | |         //~| ERROR unsatisfied lifetime constraints\nLL | |         // Only works if 'x: 'y:\nLL | |         demand_y(x, y, x.get())\nLL | |     });\n   | |_____^\n   |\n   = note: defining type: DefId(0/1:18 ~ propagate_approximated_shorter_to_static_wrong_bound[317d]::supply[0]::{{closure}}[0]) with closure substs [\n               i16,\n               for<'r, 's, 't0, 't1, 't2, 't3> extern \"rust-call\" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't0)) std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't1)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't3)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't1)) u32>))\n           ]\n   = note: late-bound region is '_#3r\n   = note: late-bound region is '_#4r\n   = note: number of external vids: 5\n   = note: where '_#1r: '_#0r\n\n"}
[00:47:10] {"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":1823,"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 borrowed data escapes outside of function","highlight_start":1,"highlight_end":61},{"text":"        //~| ERROR unsatisfied lifetime constraints","highlight_start":1,"highlight_end":52},{"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":"    });","highlight_start":1,"highlight_end":8},{"t"highlight_start":1,"highlight_end":33},{"text":"        demand_y(x, y, x.get())","highlight_start":1,"highlight_end":32},{"text":"    });","highlight_start":1,"highlight_end":6}],"label":"closure body requires that `'a` must outlive `'b`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: unsatisfied lifetime constraints\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs:48:47\n   |\nLL |   fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {\n   |             --  -- lifetime `'b` defined here\n   |             |\n   |             lifetime `'a` defined here\nLL |       establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {\n   |  _______________________________________________^\nLL | |         //~^ ERROR borrowed data escapes outside of function\nLL | |         //~| ERROR unsatisfied lifetime constraints\nLL | |         // Only works if 'x: 'y:\nLL | |         demand_y(x, y, x.get())\nLL | |     });\n   | |_____^ closure body requires that `'a` must outlive `'b`\n\n"}
[00:47:10] {"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 2 previous errors\n\n"}
[00:47:10] ------------------------------------------
[00:47:10] 
[00:47:10] thread '[ui] ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:10] 
[00:47:10] 
[00:47:10] ---- [ui] ui/nll/closure-requirements/propagate-approximated-val.rs stdout ----
[00:47:10] diff of stderr:
[00:47:10] 
[00:47:10] 12    |
[00:47:10] 13    = note: defining type: DefId(0/1:18 ~ propagate_approximated_val[317d]::test[0]::{{closure}}[0]) with closure substs [
[00:47:10] 14                i16,
[00:47:10] -                for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) u32>))
[00:47:10] +                for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) u32>))
[00:47:10] 16            ]
[00:47:10] 17    = note: late-bound region is '_#3r
[00:47:10] 18    = note: late-bound region is '_#4r
[00:47:10] 
[00:47:10] The actual stderr differed from the expected stderr.
[00:47:10] 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:47:10] 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:47:10] To update references, rerun the tests and pass the `--bless` flag
[00:47:10] To only update this specific test, also pass `-'x: 'y:","highlight_start":1,"highlight_end":33},{"text":"        demand_y(outlives1, outlives2, x.get())","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_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(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) u32>))\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"late-bound region is '_#3r","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"late-bound region is '_#4r","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"number of external vids: 5","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"where '_#1r: '_#2r","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: External requirements\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-approximated-val.rs:46:45\n   |\nLL |       establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {\n   |  _____________________________________________^\nLL | |         //~^ ERROR47:10] +                for<'r, 's, 't0, 't1, 't2> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't1)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) u32>))
[00:47:10] 15            ]
[00:47:10] 16    = note: late-bound region is '_#2r
[00:47:10] 17    = note: late-bound region is '_#3r
[00:47:10] 
[00:47:10] The actual stderr differed from the expected stderr.
[00:47:10] 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:47:10] 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:47:10] To update references, rerun the tests and pass the `--bless` flag
[00:47:10] To only update this specific test, also pass `--test-args nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs`
[00:47:10] error: 1 errors occurred comparing output.
[00:47:10] status: exit code: 1
[00:47:10] status: exit code: 1
[00:47:10] 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:47:10] ------------------------------------------
[00:47:10] 
[00:47:10] ------------------------------------------
[00:47:10] stderr:
[00:47:10] stderr:
[00:47:10] ------------------------------------------
[00:47:10] {"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":1684,"line_start":45,"line_end":49,"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":"        //~^ ERROR","highlight_start":1,"highlight_end":19},{"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(ell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't1)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) u32>))\n           ]\n   = note: late-bound region is '_#2r\n   = note: late-bound region is '_#3r\n\n"}
[00:47:10] {"message":"unsatisfied lifetime constraints","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs","byte_start":1587,"byte_end":1588,"line_start":45,"line_end":45,"column_start":59,"column_end":60,"is_primary":false,"text":[{"text":"    establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {","highlight_start":59,"highlight_end":60}],"label":"has type `&std::cell::Cell<&'1 u32>`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs","byte_start":1576,"byte_end":1585,"line_start":45,"line_end":45,"column_start":48,"column_end":57,"is_primary":false,"text":[{"text":"    establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {","highlight_start":48,"highlight_end":57}],"label":"has type `&std::cell::Cell<&'2 &u32>`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs","byte_start":1636,"byte_end":1659,"line_start":47,"line_end":47,"column_start":9,"column_end":32,"is_primary":true,"text":[{"text":"        demand_y(x, y, x.get())","highlight_start":9,"highlight_end":32}],"label":"argument requires that `'1` must outlive `'2`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: unsatisfied lifetime constraints\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs:47:9\n   |\nLL |     establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {\n   |                                                ---------  - has type `&std::cell::Cell<&'1 u32>`\n   |                                                |\n   |                                                has type `&std::cell::Cell<&'2 &u32>`\nLL |         // Only works if 'x: 'y:\nLL |         demand_y(x, y, x.get())\n   |         ^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`\n\n"}
[00:47:10] {"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":1688,"line_start":44,"line_end":50,"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":"        //~^ ERROR","highlight_start":1,"highlight_end":19},{"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())\nLL | |         //~^ ERROR\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:47:10] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:47:10] ------------------------------------------
[00:47:10] 
[00:47:10] thread '[ui] ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:10] 
[00:47:10] 
[00:47:10] ---- [ui] ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs stdout ----
[00:47:10] diff of stderr:
[00:47:10] 
[00:47:10] 11    |
[00:47:10] 12    = note: defining type: DefId(0/1:18 ~ propagate_fail_to_approximate_longer_wrong_bounds[317d]::supply[0]::{{closure}}[0]) with closure substs [
[00:47:10] 13                i16,
[00:47:10] -                for<'r, 's, 't0, 't1, 't2, 't3> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't1)) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't3)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't1)) u32>))
[00:47:10] +                for<'r, 's, 't0, 't1, 't2, 't3> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't1)) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't3)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 't1)) u32>))
[00:47:10] 15            ]
[00:47:10] 16    = note: late-bound region is '_#3r
[00:47:10] 17    = note: late-bound region is '_#4r
[00:47:10] 
[00:47:10] The actual stderr differed from the expected stderr.
[00:47:10] 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:47:10] 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:47:10] To update references, rerun the tests and pass the `--bless` flag
[00:47:10] To only update this specific test, also pass `--test-args nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs`
[00:47:10] error: 1 errors occurred comparing output.
[00:47:10] status: exit code: 1
[00:47:10] status: exit code: 1
[00:47:10] 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:47:10] ------------------------------------------
[00:47:10] 
[00:47:10] ------------------------------------------
[00:47:10] stderr:
[00:47:10] stderr:
[00:47:10] ------------------------------------------
[00:47:11)) u32>))\n           ]\n   = note: late-bound region is '_#3r\n   = note: late-bound region is '_#4r\n\n"}
[00:47:10] {"message":"unsatisfied lifetime constraints","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs","byte_start":1752,"byte_end":1762,"line_start":49,"line_end":49,"column_start":48,"column_end":58,"is_primary":false,"text":[{"text":"    establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {","highlight_start":48,"highlight_end":58}],"label":"has type `&std::cell::Cell<&'1 &u32>`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs","byte_start":1764,"byte_end":1774,"line_start":49,"line_end":49,"column_start":60,"column_end":70,"is_primary":false,"text":[{"text":"    establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {","highlight_start":60,"highlight_end":70}],"label":"has type `&std::cell::Cell<&'2 &u32>`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs","byte_start":1825,"byte_end":1848,"line_start":51,"line_end":51,"column_start":9,"column_end":32,"is_primary":true,"text":[{"text":"        demand_y(x, y, x.get())","highlight_start":9,"highlight_end":32}],"label":"argument requires that `'1` must outlive `'2`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: unsatisfied lifetime constraints\n  --> /checkout/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.rs:51:9\n   |\nLL |     establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {\n   |                                                ----------  ---------- has type `&std::cell::Cell<&'2 &u32>`\n   |                                                |\n   |                                                has type `&std::cell::Cell<&'1 &u32>`\nLL |         // Only works if 'x: 'y:\nLL |         demand_y(x, y, x.get())\n   |         ^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`\n\n"}
[00:47:10] {"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":1877,"line_start":48,"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":"        // 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":"        //~^ ERROR","highlight_start":1,"highlight_end":19},{"text":"    });","highlight_start":1,"highlight_end":8},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,               for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) u32>))
[00:47:10] +                for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) u32>))
[00:47:10] 14            ]
[00:47:10] 15    = note: late-bound region is '_#3r
[00:47:10] 16    = note: number of external vids: 4
[00:47:10] 
[00:47:10] The actual stderr differed from the expected stderr.
[00:47:10] 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:47:10] 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:47:10] To update references, rerun the tests and pass the `--bless` flag
[00:47:10] To only update this specific test, also pass `--test-args nll/closure-requirements/propagate-despite-same-free-region.rs`
[00:47:10] error: 1 errors occurred comparing output.
[00:47:10] status: exit code: 0
[00:47:10] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin 
[00:47:10] 12 error: unsatisfied lifetime constraints
[00:47:10] 12 error: unsatisfied lifetime constraints
[00:47:10] 
[00:47:10] 
[00:47:10] The actual stderr differed from the expected stderr.
[00:47:10] 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:47:10] To update references, rerun the tests and pass the `--bless` flag
[00:47:10] To only update this specific test, also pass `--test-args nll/closure-requirements/return-wrong-bound-region.rs`
[00:47:10] error: 1 errors occurred comparing output.
[00:47:10] status: exit code: 1
[00:47:10] status: exit code: 1
[00:47:10] 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:47:10] ------------------------------------------
[00:47:10] 
[00:47:10] ------------------------------------------
[00:47:10] stderr:
[00:47:10] stderr:
[00:47:10] ------------------------------------------
[00:47:10] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/return-wrong-bound-region.rs","byte_start":736,"byte_end":744,"line_start":21,"line_end":21,"column_start":16,"column_end":24,"is_primary":true,"text":[{"text":"    expect_sig(|a, b| b); // ought to return `a`","highlight_start":16,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:9 ~ return_wrong_bound_region[317d]::test[0]::{{closure}}[0]) with closure substs [\n    i16,\n    for<'r, 's> extern \"rust-call\" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) i32, &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) i32)) -> &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) i32\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/closure-requirements/return-wrong-bound-region.rs:21:16\n   |\nLL |     expect_sig(|a, b| b); // ought to return `a`\n   |                ^^^^^^^^\n   |\n   = note: defining type: DefId(0/1:9 ~ return_wrong_bound_region[317d]::test[0]::{{closure}}[0]) with closure substs [\n               i16,\n               for<'r, 's> extern \"rust-call\" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) i32, &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) i32)) -> &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) i32\n           ]\n\n"}
[00:47:10] {"message":"unsatisfied lifetime constraints","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/closure-requirements/return-wrong-bound-region.compiletest/src/runtest.rs:3267:9
[00:47:10] ---- [ui] ui/nll/ty-outlives/projection-one-region-closure.rs stdout ----
[00:47:10] diff of stderr:
[00:47:10] 
[00:47:10] 
[00:47:10] 38 LL |     with_signature(cell, t, |cell, t| require(cell, t));
[00:47:10] 40    |
[00:47:10] 40    |
[00:47:10] -    = help: consider adding an explicit lifetime bound `T: ReFree(DefId(0/0:8 ~ projection_one_region_closure[317d]::no_relationships_late[0]), BrNamed(crate0:DefIndex(1:16), 'a))`...
[00:47:10] +    = help: consider adding an explicit lifetime bound `T: ReFree(DefId(0/0:8 ~ projection_one_region_closure[317d]::no_relationships_late[0]), BrNamed(crate1:DefIndex(1:16), 'a))`...
[00:47:10] 43 error: unsatisfied lifetime constraints
[00:47:10] 44   --> $DIR/projection-one-region-closure.rs:55:29
[00:47:10] 
[00:47:10] 
[00:47:10] 
[00:47:10] The actual stderr differed from the expected stderr.
[00:47:10] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/projection-one-region-closure/projection-one-region-closure.stderr
[00:47:10] To update references, rerun the tests and pass the `--bless` flag
[00:47:10] To only update this specific test, also pass `--test-args nll/ty-outlives/projection-one-region-closure.rs`
[00:47:10] error: 1 errors occurred comparing output.
[00:47:10] status: exit code: 1
[00:47:10] status: exit code: 1
[00:47:10] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/ty-outlives/projection-one-region-closure.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/projection-one-region-closure/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Zborrowck=mir" "-Zverbose" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/projection-one-region-closure/auxiliary" "-A" "unused"
[00:47:10] ------------------------------------------
[00:47:10] 
[00:47:10] ------------------------------------------
[00:47:10] stderr:
[00:47:10] stderr:
[00:47:10] ------------------------------------------
[00:47:10] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-one-region-closure.rs","byte_start":1572,"byte_end":1598,"line_start":55,"line_end":55,"column_start":29,"column_end":55,"is_primary":true,"text":[{"text":"    with_signature(cell, t, |cell, t| require(cell, t));","highlight_start":29,"highlight_end":55}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:19 ~ projection_one_region_closure[317d]::no_relationships_late[0]::{{closure}}[0]) with closure substs [\n    '_#1r,\n    T,\n    i32,\n    extern \"rust-call\" fn((std::cell::Cell<&'_#2r ()>, T))\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"late-bound region is '_#3r","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"number of external vids: 4","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"where T: '_#2r","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"where '_#1r: '_#2r","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: External requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-one-region-closure.rs:55:29\n   |\nLL |     with_signature(cell, t, |cell, t| require(cell, t));\n   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = note: defining type: DefId(0/1:19 ~ projection_one_region_closure[317d]::no_relationships_late[0]::{{closure}}[0]) with closure substs [\n               '_#1r,\n               T,\n               i32,\n               extern \"rust-call\" fn((std::cell::Cell<&'_#2r ()>, T))\n           ]\n   = note: late-bound region is '_#3r\n   = note: number of external vids: 4\n   = note: where T: '_#2r\n   = note: where '_#1r: '_#2r\n\n"}
[00:47:10] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-one-region-closure.rs","byte_start":1453,"byte_end":1680,"line_start":51,"line_end":58,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T)","highlight_start":1,"highlight_end":62},{"text":"where","highlight_start":1,"highlight_end":6},{"text":"    T: Anything<'b>,","highlight_start":1,"highlight_end":21},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"    with_signature(cell, t, |cell, t| require(cell, t));","highlight_start":1,"highlight_end":57},{"text":"    //~^ ERROR the parameter type `T` may not live long enough","highlight_start":1,"highlight_end":63},{"text":"    //~| ERROR","highlight_start":1,"highlight_end":15},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/0:8 ~ projection_one_region_closure[317d]::no_relationships_late[0]) with substs [\n    '_#1r,\n    T\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-one-region-closure.rs:51:1\n   |\nLL | / fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T)\nLL | | where\nLL | |     T: Anything<'b>,\nLL | | {\n...  |\nLL | |     //~| ERROR\nLL | | }\n   | |_^\n   |\n   = note: defining type: DefId(0/0:8 ~ projection_one_region_closure[317d]::no_relationships_late[0]) with substs [\n               '_#1r,\n               T\n           ]\n\n"}
[00:47:10] {"message":"the parameter type `T` may not live long enough","code":{"code":"E0309","explanation":"\nThe type definition contains some field whose type\nrequires an outlives annotation. Outlives annotations\n(e.g., `T: 'a`) are used to guarantee that all the data in T is valid\nfor at least the lifetime `'a`. This scenario most commonly\narises when the type contains an associated type reference\nlike `<T as SomeTrait<'a>>::Output`, as shown in this example:\n\n```compile_fail,E0309\n// This won't compile because the applicable impl of\n// `SomeTrait` (below) requires that `T: 'a`, but the struct does\n// not have a matching where-clause.\nstruct Foo<'a, T> {\n    foo: <T as SomeTrait<'a>>::Output,\n}\n\ntrait SomeTrait<'a> {\n    type Output;\n}\n\nimpl<'a, T> SomeTrait<'a> for T\nwhere\n    T: 'a,\n{\n    type Output = u32;\n}\n```\n\nHere, the where clause `T: 'a` that appears on the impl is not known to be\nsatisfied on the struct. To make this example compile, you have to add\na where-clause like `T: 'a` to the struct definition:\n\n```\nstruct Foo<'a, T>\nwhere\n    T: 'a,\n{\n    foo: <T as SomeTrait<'a>>::Output\n}\n\ntrait SomeTrait<'a> {\n    type Output;\n}\n\nimpl<'a, T> SomeTrait<'a> for T\nwhere\n    T: 'a,\n{\n    type Output = u32;\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-one-region-closure.rs","byte_start":1572,"byte_end":1598,"line_start":55,"line_end":55,"column_start":29,"column_end":55,"is_primary":true,"text":[{"text":"    with_signature(cell, t, |cell, t| require(cell, t));","highlight_start":29,"highlight_end":55}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider adding an explicit lifetime bound `T: ReFree(DefId(0/0:8 ~ projection_one_region_closure[317d]::no_relationships_late[0]), BrNamed(crate1:DefIndex(1:16), '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/projection-one-region-closure.rs:55:29\n   |\nLL |     with_signature(cell, t, |cell, t| require(cell, t));\n   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = help: consider adding an explicit lifetime bound `T: ReFree(DefId(0/0:8 ~ projection_one_region_closure[317d]::no_relationships_late[0]), BrNamed(crate1:DefIndex(1:16), 'a))`...\n\n"}
[00:47:10] {"message":"unsatisfied lifetime constraints","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-one-region-closure.rs","byte_start":1482,"byte_end":1484,"line_start":51,"line_end":51,"column_start":30,"column_end":32,"is_primary":false,"text":[{"text":"fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T)","highlight_start":30,"highlight_end":32}],"label":"lifetime `'b` defined here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-one-region-closure.rs","byte_start":1478,"byte_end":1480,"line_start":51,"line_end":51,"column_start":26,"column_end":28,"is_primary":false,"text":[{"text":"fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T)","highlight_start":26,"highlight_end":28}],"label":"lifetime `'a` defined here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-one-region-closure.rs","byte_start":1572,"byte_end":1598,"line_start":55,"line_end":55,"column_start":29,"column_end":55,"is_primary":true,"text":[{"text":"    with_signature(cell, t, |cell, t| require(cell, t));","highlight_start":29,"highlight_end":55}],"label":"closure body requires that `'b` must outlive `'a`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: unsatisfied lifetime constraints\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-one-region-closure.rs:55:29\n   |\nLL | fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T)\n   |                          --  -- lifetime `'b` defined here\n   |                          |\n   |                          lifetime `'a` defined here\n...\nLL |     with_signature(cell, t, |cell, t| require(cell, t));\n   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^ closure body requires that `'b` must outlive `'a`\n\n"}
[00:47:10] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-one-region-closure.rs","byte_start":1831,"byte_end":1857,"line_start":66,"line_end":66,"column_start":29,"column_end":55,"is_primary":true,"text":[{"text":"    with_signature(cell, t, |cell, t| require(cell, t));","highlight_start":29,"highlight_end":55}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:23 ~ projection_one_region_closure[317d]::no_relationships_early[0]::{{closure}}[0]) with closure substs [\n    '_#1r,\n    '_#2r,\n    T,\n    i32,\n    extern \"rust-call\" fn((std::cell::Cell<&'_#3r ()>, T))\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"number of external vids: 4","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"where T: '_#3r","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"where '_#2r: '_#3r","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rende2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/0:9 ~ projection_one_region_closure[317d]::no_relationships_early[0]) with substs [\n    '_#1r,\n    '_#2r,\n    T\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-one-region-closure.rs:61:1\n   |\nLL | / fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T)\nLL | | where\nLL | |     T: Anything<'b>,\nLL | |     'a: 'a,\n...  |\nLL | |     //~| ERROR\nLL | | }\n   | |_^\n   |\n   = note: defining type: DefId(0/0:9 ~ projection_one_region_closure[317d]::no_relationships_early[0]) with substs [\n               '_#1r,\n               '_#2r,\n               T\n           ]\n\n"}
[00:47:10] {"message":"the parameter type `T` may not live long enough","code":{"code":"E0309","explanation":"\nThe type definition contains some field whose type\nrequires an outlives annotation. Outlives annotations\n(e.g., `T: 'a`) are used to guarantee that all the data in T is valid\nfor at least the lifetime `'a`. This scenario most commonly\narises when the type contains an associated type reference\nlike `<T as SomeTrait<'a>>::Output`, as shown in this example:\n\n```compile_fail,E0309\n// This won't compile because the applicable impl of\n// `SomeTrait` (below) requires that `T: 'a`, but the struct does\n// not have a matching where-clause.\nstruct Foo<'a, T> {\n    foo: <T as SomeTrait<'a>>::Output,\n}\n\ntrait SomeTrait<'a> {\n    type Output;\n}\n\nimpl<'a, T> SomeTrait<]","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-one-region-closure.rs:72:1\n   |\nLL | / fn projection_outlives<'a, 'b, T>(cell: Cell<&'a ()>, t: T)\nLL | | where\nLL | |     T: Anything<'b>,\nLL | |     T::AssocType: 'a,\n...  |\nLL | |     with_signature(cell, t, |cell, t| require(cell, t));\nLL | | }\n   | |_^\n   |\n   = note: defining type: DefId(0/0:10 ~ projection_one_region_closure[317d]::projection_outlives[0]) with substs [\n               '_#1r,\n               '_#2r,\n               T\n           ]\n\n"}
[00:47:10] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-one-region-closure.rs","byte_start":2415,"byte_end":2441,"line_start":90,"line_end":90,"column_start":29,"column_end":55,"is_primary":true,"text":[{"text":"    with_signature(cell, t, |cell, t| require(cell, t));","highlight_start":29,"highlight_end":55}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:31 ~ projection_one_region_closure[317d]::elements_outlive[0]::{{closure}}[0]) with closure substs [\n    '_#1r,\n    '_#2r,\n    T,\n    i32,\n    extern \"rust-call\" fn((std::cell::Cell<&'_#3r ()>, T))\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"number of external vids: 4","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"where T: '_#3r","code":null,"level":"note","spans":[],"children"47:10] 
[00:47:10] 39 LL |     with_signature(cell, t, |cell, t| require(cell, t));
[00:47:10] 41    |
[00:47:10] 41    |
[00:47:10] -    = help: consider adding an explicit lifetime bound `<T as Anything<'_#5r, '_#6r>>::AssocType: ReFree(DefId(0/0:8 ~ projection_two_region_trait_bound_closure[317d]::no_relationships_late[0]), BrNamed(crate0:DefIndex(1:18), 'a))`...
[00:47:10] +    = help: consider adding an explicit lifetime bound `<T as Anything<'_#5r, '_#6r>>::AssocType: ReFree(DefId(0/0:8 ~ projection_two_region_trait_bound_closure[317d]::no_relationships_late[0]), BrNamed(crate1:DefIndex(1:18), 'a))`...
[00:47:10] 44 note: External requirements
[00:47:10] 45   --> $DIR/projection-two-region-trait-bound-closure.rs:58:29
[00:47:10] 
[00:47:10] 
[00:47:10] 
[00:47:10] The actual stderr differed from the expected stderr.
[00:47:10] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure/projection-two-region-trait-bound-closure.stderr
[00:47:10] To update references, rerun the tests and pass the `--bless` flag
[00:47:10] To only update this specific test, also pass `--test-args nll/ty-outlives/projection-two-region-trait-bound-closure.rs`
[00:47:10] error: 1 errors occurred comparing output.
[00:47:10] status: exit code: 1
[00:47:10] status: exit code: 1
[00:47:10] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Zborrowck=mir" "-Zverbose" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure/auxiliary" "-A" "unused"
[00:47:10] ------------------------------------------
[00:47:10] 
[00:47:10] ------------------------------------------
[00:47:10] stderr:
[00:47:10] stderr:
[00:47:10] ------------------------------------------
[00:47:10] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs","byte_start":1368,"byte_end":1394,"line_start":48,"line_end":48,"column_start":29,"column_end":55,"is_primary":true,"text":[{"text":"    with_signature(cell, t, |cell, t| require(cell, t));","highlight_start":29,"highlight_end":55}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:22 ~ projection_two_region_trait_bound_closure[317d]::no_relationships_late[0]::{{closure}}[0]) with closure substs [\n    '_#1r,\n    '_#2r,\n    T,\n    i32,\n    extern \"rust-call\" fn((std::cell::Cell<&'_#3r ()>, T))\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"late-bound region is '_#4r","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"number of external vids: 5","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#2r)>>::AssocType: '_#3r","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: External requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs:48:29\n   |\nLL |     with_signature(cell, t, |cell, t| require(cell, t));\n   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = note: defining type: DefId(0/1:22 ~ projection_two_region_trait_bound_closure[317d]::no_relationships_late[0]::{{closure}}[0]) with closure substs [\n               '_#1r,\n               '_#2r,\n               T,\n               i32,\n               extern \"rust-call\" fn((std::cell::Cell<&'_#3r ()>, T))\n           ]\n   = note: late-bound region is '_#4r\n   = note: number of external vids: 5\n   = note: where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#2r)>>::AssocType: '_#3r\n\n"}
[00:47:10] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs","byte_start":1241,"byte_end":1497,"line_start":44,"line_end":50,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn no_relationships_late<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T)","highlight_start":1,"highlight_end":66},{"text":"where","highlight_start":1,"highlight_end":6},{"text":"    T: Anything<'b, 'c>,","highlight_start":1,"highlight_end":25},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"    with_signature(cell, t, |cell, t| require(cell, t));","highlight_start":1,"highlight_end":57},{"text":"    //~^ ERROR associated type `<T as Anything<'_#5r, '_#6r>>::AssocType` may not live long enough","highlight_start":1,"highlight_end":99},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/0:8 ~ projection_two_region_trait_bound_closure[317d]::no_relationships_late[0]) with substs [\n    '_#1r,\n    '_#2r,\n    T\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs:44:1\n   |\nLL | / fn no_relationships_late<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T)\nLL | | where\nLL | |     T: Anything<'b, 'c>,\nLL | | {\nLL | |     with_signature(cell, t, |cell, t| require(cell, t));\nLL | |     //~^ ERROR associated type `<T as Anything<'_#5r, '_#6r>>::AssocType` may not live long enough\nLL | | }\n   | |_^\n   |\n   = note: defining type: DefId(0/0:8 ~ projection_two_region_trait_bound_closure[317d]::no_relationships_late[0]) with substs [\n               '_#1r,\n               '_#2r,\n               T\n           ]\n\n"}
[00:47:10] {"message":"the associated type `<T as Anything<'_#5r, '_#6r>>::AssocType` may not live long enough","code":{"code":"E0309","explanation":"\nThe type definition contains some field whose type\nrequires an outlives annotation. Outlives annotations\n(e.g., `T: 'a`) are used to guarantee that all the data in T is valid\nfor at least the lifetime `'a`. This scenario most commonly\narises when the type contains an associated type reference\nlike `<T as SomeTrait<'a>>::Output`, as shown in this example:\n\n```compile_fail,E0309\n// This won't compile because the applicable impl of\n// `SomeTrait` (below) requires that `T: 'a`, but the struct does\n// not have a matching where-clause.\nstruct Foo<'a, T> {\n    foo: <T as SomeTrait<'a>>::Output,\n}\n\ntrait SomeTrait<'a> {\n    type Output;\n}\n\nimpl<'a, T> SomeTrait<'a> for T\nwhere\n    T: 'a,\n{\n    type Output = u32;\n}\n```\n\nHere, the where clause `T: 'a` that appears on the impl is not known to be\nsatisfied on the struct. To make this example compile, you have to add\na where-clause like `T: 'a` to the struct definition:\n\n```\nstruct Foo<'a, T>\nwhere\n    T: 'a,\n{\n    foo: <T as SomeTrait<'a>>::Output\n}\n\ntrait SomeTrait<'a> {\n    type Output;\n}\n\nimpl<'a, T> SomeTrait<'a> for T\nwhere\n    T: 'a,\n{\n    type Output = u32;\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs","byte_start":1368,"byte_end":1394,"line_start":48,"line_end":48,"column_start":29,"column_end":55,"is_primary":true,"text":[{"text":"    with_signature(cell, t, |cell, t| require(cell, t));","highlight_start":29,"highlight_end":55}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider adding an explicit lifetime bound `<T as Anything<'_#5r, '_#6r>>::AssocType: ReFree(DefId(0/0:8 ~ projection_two_region_trait_bound_closure[317d]::no_relationships_late[0]), BrNamed(crate1:DefIndex(1:18), 'a))`...","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0309]: the associated type `<T as Anything<'_#5r, '_#6r>>::AssocType` may not live long enough\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs:48:29\n   |\nLL |     with_signature(cell, t, |cell, t| require(cell, t));\n   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = help: consider adding an explicit lifetime bound `<T as Anything<'_#5r, '_#6r>>::AssocType: ReFree(DefId(0/0:8 ~ projection_two_region_trait_bound_closure[317d]::no_relationships_late[0]), BrNamed(crate1:DefIndex(1:18), 'a))`...\n\n"}
[00:47:10] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs","byte_start":1656,"byte_end":1682,"line_start":58,"line_end":58,"column_start":29,"column_end":55,"is_primary":true,"text":[{"text":"    with_signature(cell, t, |cell, t| require(cell, t));","highlight_start":29,"highlight_end":55}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:27 ~ projection_two_region_trait_bound_closure[317d]::no_relationships_early[0]::{{closure}}[0]) with closure substs [\n    '_#1r,\n    '_#2r,\n    '_#3r,\n    T,\n    i32,\n    extern \"rust-call\" fn((std::cell::Cell<&'_#4r ()>, T))\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"number of external vids: 5","code":null,"level":"note","spans":[],"children":[],"rendered":null}e `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs:58:29\n   |\nLL |     with_signature(cell, t, |cell, t| require(cell, t));\n   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = help: consider adding an explicit lifetime bound `<T as Anything<'_#6r, '_#7r>>::AssocType: ReEarlyBound(0, 'a)`...\n\n"}
[00:47:10] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs","byte_start":2083,"byte_end":2109,"line_start":71,"line_end":71,"column_start":29,"column_end":55,"is_primary":true,"text":[{"text":"    with_signature(cell, t, |cell, t| require(cell, t));","highlight_start":29,"highlight_end":55}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:32 ~ projection_two_region_trait_bound_closure[317d]::projection_outlives[0]::{{closure}}[0]) with closure substs [\n    '_#1r,\n    '_#2r,\n    '_#3r,\n    T,\n    i32,\n    extern \"rust-call\" fn((std::cell::Cell<&'_#4r ()>, T))\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"number of external vids: 5","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: External requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs:71:29\n   |\nLL |     with_signature(cell, t, |cell, t| require(cell, t));\n   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = note: defining type: DefId(0/1:32 ~ projection_two_region_trait_bound_closure[317d]::projection_outlives[0]::{{closure}}[0]) with closure substs [\n               '_#1r,\n               '_#2r,\n               '_#3r,\n               T,\n               i32,\n               extern \"rust-call\" fn((std::cell::Cell<&'_#4r ()>, T))\n           ]\n   = note: number of external vids: 5\n   = note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r\n\n"}
[00:47:10] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:499:22
[00:47:10] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs","byte_start":1804,"byte_end":2113,"line_start":63,"line_end":72,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn projection_outlives<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T)","highlight_start":1,"highlight_end":64},{"text":"where","highlight_start":1,"highlight_end":6},{"text":"    T: Anything<'b, 'c>,","highlight_start":1,"highlight_end":25},{"text":"    T::AssocType: 'a,","highlight_start":1,"highlight_end":22},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"    // We are projecting `<T as Anything<'b>>::AssocType`, and we know","highlight_start":1,"highlight_end":71},{"text":"    // that this outlives `'a` because of the where-clause.","highlight_streplacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:37 ~ projection_two_region_trait_bound_closure[317d]::elements_outlive1[0]::{{closure}}[0]) with closure substs [\n    '_#1r,\n    '_#2r,\n    '_#3r,\n    T,\n    i32,\n    extern \"rust-call\" fn((std::cell::Cell<&'_#4r ()>, T))\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"number of external vids: 5","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: External requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs:80:29\n   |\nLL |     with_signature(cell, t, |cell, t| require(cell, t));\n   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = note: defining type: DefId(0/1:37 ~ projection_two_region_trait_bound_closure[317d]::elements_outlive1[0]::{{closure}}[0]) with closure substs [\n               '_#1r,\n               '_#2r,\n               '_#3r,\n               T,\n               i32,\n               extern \"rust-call\" fn((std::cell::Cell<&'_#4r ()>, T))\n           ]\n   = note: number of external vids: 5\n   = note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r\n\n"}
[00:47:10] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs","byte_stclosure.rs:97:29\n   |\nLL |     with_signature(cell, t, |cell, t| require(cell, t));\n   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = note: defining type: DefId(0/1:46 ~ projection_two_region_trait_bound_closure[317d]::two_regions[0]::{{closure}}[0]) with closure substs [\n               '_#1r,\n               T,\n               i32,\n               extern \"rust-call\" fn((std::cell::Cell<&'_#2r ()>, T))\n           ]\n   = note: late-bound region is '_#3r\n   = note: number of external vids: 4\n   = note: where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#1r)>>::AssocType: '_#2r\n\n"}
[00:47:10] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs","byte_start":2500,"byte_end":2691,"line_start":93,"line_end":99,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn two_regions<'a, 'b, T>(cell: Cell<&'a ()>, t: T)","highlight_start":1,"highlight_end":52},{"text":"where","highlight_start":1,"highlight_end":6},{"text":"    T: Anything<'b, 'b>,","highlight_start":1,"highlight_end":25},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"    with_signature(cell, t, |cell, t| require(cell, t));","highlight_start":1,"highlight_end":57},{"text":"    //~^ ERROR unsatisfied lifetime constraints","highlight_start":1,"highlight_end":48},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/0:13 ~ projection_two_region_trait_bound_closure[317d]::two_regions[0]) with substs [\n    '_#1r,\n    T\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs:93:1\n   |\nLL | / fn two_regions<'a, 'b, T>(cell: Cell<&'a ()>, t: T)\nLL | | where\nLL | |     T: Anything<'b, 'b>,\nLL | | {\nLL | |     with_signature(cell, t, |cell, t| require(cell, t));\nLL | |     //~^ ERROR unsatisfied lifetime constraints\nLL | | }\n   | |_^\n   |\n   = note: defining type: DefId(0/0:13 ~ projection_two_region_trait_bound_closure[317d]::two_regions[0]) with substs [\n               '_#1r,\n               T\n           ]\n\n"}
[00:47:10] {"message":"unsatisfied lifetime constraints","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs","byte_start":2519,"byte_end":2521,"line_start":93,"line_end":93,"column_start":20,"column_end":22,"is_primary":false,"text":[{"text":"fn two_regions<'a, 'b, T>(cell: Cell<&'a ()>, t: T)","highlight_start":20,"highlight_end":22}],"label":"lifetime `'b` defined here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs","byte_start":2515,"byte_end":2517,"line_start":93,"line_end":93,"column_start":16,"column_end":18,"is_primary":false,"text":[{"text":"fn two_regions<'a, 'b, T>(cell: Cell<&'a ()>, t: T)","highlight_start":16,"highlight_end":18}],"label":"lifetime `'a` defined here","suggested_replacem)>, t: T)","highlight_start":1,"highlight_end":60},{"text":"where","highlight_start":1,"highlight_end":6},{"text":"    T: Anything<'b, 'b>,","highlight_start":1,"highlight_end":25},{"text":"    'b: 'a,","highlight_start":1,"highlight_end":12},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"    with_signature(cell, t, |cell, t| require(cell, t));","highlight_start":1,"highlight_end":57},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/0:14 ~ projection_two_region_trait_bound_closure[317d]::two_regions_outlive[0]) with substs [\n    '_#1r,\n    '_#2r,\n    T\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs:102:1\n   |\nLL | / fn two_regions_outlive<'a, 'b, T>(cell: Cell<&'a ()>, t: T)\nLL | | where\nLL | |     T: Anything<'b, 'b>,\nLL | |     'b: 'a,\nLL | | {\nLL | |     with_signature(cell, t, |cell, t| require(cell, t));\nLL | | }\n   | |_^\n   |\n   = note: defining type: DefId(0/0:14 ~ projection_two_region_trait_bound_closure[317d]::two_regions_outlive[0]) with substs [\n               '_#1r,\n               '_#2r,\n               T\n           ]\n\n"}
[00:47:10] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs","byte_start":3218,"byte_end":3244,"line_start":119,"line_end":119,"column_start":29,"column_end":55,"is_primary":true,"text":[{"text":"    with_signature(cell, t, |cell, t| require(cell, t));","highlight_start":29,"highlight_end":55}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:53 ~ projection_two_region_trait_bound_closure[317d]::one_region[0]::{{closure}}[0]) with closure substs [\n    '_#1r,\n    T,\n    i32,\n    extern \"rust-call\" fn((std::cell::Cell<&'_#2r ()>, T))\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"number of external vids: 3","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#1r)>>::AssocType: '_#2r","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: External requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs:119:29\n   |\nLL |     with_signature(cell, t, |cell, t| require(cell, t));\n   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = note: defining type: DefId(0/1:53 ~ projection_two_region_trait_bound_closure[317d]::one_region[0]::{{closure}}[0]) with closure substs [\n               '_#1r,\n               T,\n               i32,\n               extern \"rust-call\" fn((std::cell::Cell<&'_#2r ()>, T))\n           ]\n   = note: number of external vids: 3\n   = note: where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#1r)>>::AssocType: '_#2r\n\n"}
[00:47:10] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs","byte_start":2892,"byte_end":3248,"line_start":111,"line_end":120,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn one_region<'a, T>(cell: Cell<&'a ()>, t: T)","highlight_start":1,"highlight_end":47},{"text":"where","highlight_start":1,"highlight_end":6},{"text":"    T: Anything<'a, 'a>,","highlight_start":1,"highlight_end":25},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"    // Note that in this case the closure still propagates an external","highlight_start":1,"highlight_end":71},{"text":"    // requirement between two variables in its signature, but the","highlight_start":1,"highlight_end":67},{"text":"    // creator maps both those two region variables to `'a` on its","highlight_start":1,"highlight_end":67},{"text":"    // side.","highlight_start":1,"highlight_end":13},{"text":"    with_signature(cell, t, |cell, t| require(cell, t));","highlight_start":1,"highlight_end":57},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/0:15 ~ projection_two_region_trait_bound_closure[317d]::one_region[0]) with substs [\n    '_#1r,\n    T\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs:111:1\n   |\nLL | / fn one_region<'a, T>(cell: Cell<&'a ()>, t: T)\nLL | | where\nLL | |     T: Anything<'a, 'a>,\nLL | | {\n...  |\nLL | |     with_signature(cell, t, |cell, t| require(cell, t));\nLL | | }\n   | |_^\n   |\n   = note: defining type: DefId(0/0:15 ~ projection_two_region_trait_bound_closure[317d]::one_region[0]) with substs [\n               '_#1r,\n               T\n           ]\n\n"}
[00:47:10] {"message":"aborting due to 3 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 3 previous errors\n\n"}
[00:47:10] {"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:47:10] ------------------------------------------
[00:47:10] 
[00:47:10] thread '[ui] ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:10] 
[00:47:10] 
[00:47:10] ---- [ui] ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs stdout ----
[00:47:10] diff of stderr:
[00:47:10] 
[00:47:10] 7    = note: defining type: DefId(0/1:14 ~ ty_param_closure_approximate_lower_bound[317d]::generic[0]::{{closure}}[0]) with closure substs [
[00:47:10] 8                T,
[00:47:10] 9                i16,
[00:47:10] -                for<'r, 's> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) ()>>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) T))
[00:47:10] +                for<'r, 's> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) ()>>, &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) T))
[00:47:10] 11            ]
[00:47:10] 12    = note: number of external vids: 2
[00:47:10] 13    = note: where T: '_#1r
[00:47:10] 
[00:47:10] 34    = note: defining type: DefId(0/1:17 ~ ty_param_closure_approximate_lower_bound[317d]::generic_fail[0]::{{closure}}[0]) with closure substs [
[00:47:10] 35                T,
[00:47:10] 36                i16,
[00:47:10] -                for<'r, 's> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) ()>>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) T))
[00:47:10] +                for<'r, 's> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) ()>>, &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) T))
[00:47:10] 38            ]
[00:47:10] 39    = note: late-bound region is '_#2r
[00:47:10] 40    = note: number of external vids: 3
[00:47:10] 
[00:47:10] 59 LL |     twice(cell, value, |a, b| invoke(a, b));
[00:47:10] 61    |
[00:47:10] 61    |
[00:47:10] -    = 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))`...
[00:47:10] +    = help: consider adding an explicit lifetime bound `T: ReFree(DefId(0/0:6 ~ ty_param_closure_approximate_lower_bound[317d]::generic_fail[0]), BrNamed(crate1:DefIndex(1heckout/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs","byte_start":1085,"byte_end":1104,"line_start":39,"line_end":39,"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(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) ()>>, &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) T))\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"late-bound region is '_#2r","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"number of external vids: 3","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:39: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(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 'r)) ()>>, &ReLateBound(DebruijnIndex(0), BrNamed(crate1:DefIndex(0:0), 's)) T))\n           ]\n   = note: late-bound region is '_#2r\n   = note: number of external vids: 3\n   = note: where T: '_#1r\n\n"}
[00:47:10] {"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":1007,"byte_end":1171,"line_start":38,"line_end":41,"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":"    //~^ 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:38:1\n   |\nLL | / fn generic_fail<'a, T>(cell: Cell<&'a ()>, value: T) {\nLL | |     twice(cell, value, |a, b| invoke(a, b));\nLL | |     //~^ ERROR the parameter type `T` may not live long enough\nLL | | }\n   | |_^art":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(crate1: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:39: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(crate1:DefIndex(1:15), 'a))`...\n\n"}
[00:47:10] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:47:10] {"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:47:10] ------------------------------------------
[00:47:10] 
[00:47:10] thread '[ui] ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:10] 
[00:47:10] 
[00:47:10] ---- [ui] ui/nllhis won't compile because the applicable impl of\n// `SomeTrait` (below) requires that `T: 'a`, but the struct does\n// not have a matching where-clause.\nstruct Foo<'a, T> {\n    foo: <T as SomeTrait<'a>>::Output,\n}\n\ntrait SomeTrait<'a> {\n    type Output;\n}\n\nimpl<'a, T> SomeTrait<'a> for T\nwhere\n    T: 'a,\n{\n    type Output = u32;\n}\n```\n\nHere, the where clause `T: 'a` that appears on the impl is not known to be\nsatisfied on the struct. To make this example compile, you have to add\na where-clause like `T: 'a` to the struct definition:\n\n```\nstruct Foo<'a, T>\nwhere\n    T: 'a,\n{\n    foo: <T as SomeTrait<'a>>::Output\n}\n\ntrait SomeTrait<'a> {\n    type Output;\n}\n\nimpl<'a, T> SomeTrait<'a> for T\nwhere\n    T: 'a,\n{\n    type Output = u32;\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs","byte_start":1011,"byte_end":1394,"line_start":37,"line_end":45,"column_start":26,"column_end":6,"is_primary":true,"text":[{"text":"    with_signature(a, b, |x, y| {","highlight_start":26,"highlight_end":34},{"text":"        //~^ ERROR the parameter type `T` may not live long enough","highlight_start":1,"highlight_end":67},{"text":"        //","highlight_start":1,"highlight_end":11},{"text":"        // See `correct_region`, which explains the point of this","highlight_start":1,"highlight_end":66},{"text":"        // test.  The only difference is that, in the case of this","highlight_start":1,"highlight_end":67},{"text":"        // function, there is no where clause *anywhere*, and hence we","highlight_start":1,"highlight_end":71},{"text":"        // get an error (but reported by the closure creator).","highlight_start":1,"highlight_end":63},{"text":"        require(&x, &y)","highlight_start":1,"highlight_end":24},{"text":"    })","highlight_start":1,"highlight_end":6}],"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_outlives_from_where_clause[317d]::no_region[0]), BrNamed(crate1:DefIndex(1:14), '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-outlives-from-where-clause.rs:37:26\n   |\nLL |       with_signature(a, b, |x, y| {\n   |  __________________________^\nLL | |         //~^ ERROR the parameter type `T` may not live long enough\nLL | |         //\nLL | |         // See `correct_region`, which explains the point of this\n...  |\nLL | |         require(&x, &y)\nLL | |     })\n   | |_____^\n   |\n   = help: consider adding an explicit lifetime bound `T: ReFree(DefId(0/0:6 ~ ty_param_closure_outlives_from_where_clause[317d]::no_region[0]), BrNamed(crate1:DefIndex(1:14), 'a))`...\n\n"}
[00:47:10] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs","byte_start":1508,"byte_end":2194,"line_start":53,"line_end":66,"column_start":26,"column_end":6,"is_primary":true,"text":[{"text":"    with_signature(a, b, |x, y| {","highlight_start":26,"highlight_end":34},{"text":"        // Key point of this test:","highlight_start":1,"highlight_end":35},{"text":"        //","highlight_start":1,"highlight_end":11},{"text":"        // The *closure* is being type-checked with all of its free","highlight_start":1,"highlight_end":68},{"text":"        // regions \"universalized\". In particular, it does not know","highlight_start":1,"highlight_end":68},{"text":"        // that `x` has the type `Cell<&'a ()>`, but rather treats it","highlight_start":1,"highlight_end":70},{"text":"        // as if the type of `x` is `Cell<&'A ()>`, where `'A` is some","highlight_start":1,"highlight_end":71},{"text":"        // fresh, independent region distinct from the `'a` which","highlight_start":1,"highlight_end":66},{"text":"        // appears in the environment. The call to `require` here","highlight_start":1,"highlight_end":66},{"text":"        // forces us then to prove that `T: 'A`, but the closure","highlight_start":1,"highlight_end":65},{"text":"        // cannot do it on its own. It has to surface this requirement","highlight_start":1,"highlight_end":71},{"text":"        // to its creator (which knows that `'a == 'A`).","highlight_start":1,"highlight_end":57},{"text":"        require(&x, &y)","highlight_start":1,"highlight_end":24},{"text":"    })","highlight_start":1,"highlight_end":6}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:19 ~ ty_param_closure_outlives_from_where_clause[317d]::correct_region[0]::{{closure}}[0]) with closure substs [\n    '_#1r,\n    T,\n    i32,\n    extern \"rust-call\" fn((std::cell::Cell<&'_#2r ()>, T))\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"number of external vids: 3","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"where T: '_#2r","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: External requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs:53:26\n   |\nLL |       with_signature(a, b, |x, y| {\n   |  __________________________^\nLL | |         // Key point of this test:\nLL | |         //\nLL | |         // The *closure* is being type-checked with all of its free\n...  |\nLL | |         require(&x, &y)\nLL | |     })\n   | |_____^\n   |\n   = note: defining type: DefId(0/1:19 ~ ty_param_closure_outlives_from_where_clause[317d]::correct_region[0]::{{closure}}[0]) with closure substs [\n               '_#1r,\n               T,\n               i32,\n               extern \"rust-call\" fn((std::cell::Cell<&'_#2r ()>, T))\n           ]\n   = note: number of external vids: 3\n   = note: where T: '_#2r\n\n"}
[00:47:10] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs","byte_start":1416,"byte_end":2197,"line_start":49,"line_end":67,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn correct_region<'a, T>(a: Cell<&'a ()>, b: T)","highlight_start":1,"highlight_end":48},{"text":"where","highlight_start":1,"highlight_end":6},{"text":"    T: 'a,","highlight_start":1,"highlight_end":11},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"    with_signature(a, b, |x, y| {","highlight_start":1,"highlight_end":34},{"text":"        // Key point of this test:","highlight_start":1,"highlight_end":35},{"text":"        //","highlight_start":1,"highlight_end":11},{"text":"        // The *closure* is being type-checked with all of its free","highlight_start":1,"highlight_end":68},{"text":"        // regions \"universalized\". In particular, it does not know","highlight_start":1,"highlight_end":68},{"text":"        // that `x` has the type `Cell<&'a ()>`, but rather treats it","highlight_start":1,"highlight_end":70},{"text":"        // as if the type of `x` is `Cell<&'A ()>`, where `'A` is some","highlight_start":1,"highlight_end":71},{"text":"        // fresh, independent region distinct from the `'a` which","highlight_start":1,"highlight_end":66},{"text":"        // appears in the environment. The call to `require` here","highlight_start":1,"highlight_end":66},{"text":"        // forces us then to prove that `T: 'A`, but the closure","highlight_start":1,"highlight_end":65},{"text":"        // cannot do it on its own. It has to surface this requirement","highlight_start":1,"highlight_end":71},{"text":"        // to its creator (which knows that `'a == 'A`).","highlight_start":1,"highlight_end":57},{"text":"        require(&x, &y)","highlight_start":1,"highlight_end":24},{"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:7 ~ ty_param_closure_outlives_from_where_clause[317d]::correct_region[0]) with substs [\n    '_#1r,\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-outlives-from-where-clause.rs:49:1\n   |\nLL | / fn correct_region<'a, T>(a: Cell<&'a ()>, b: T)\nLL | | where\nLL | |     T: 'a,\nLL | | {\n...  |\nLL | |     })\nLL | | }\n   | |_^\n   |\n   = note: defining type: DefId(0/0:7 ~ ty_param_closure_outlives_from_where_clause[317d]::correct_region[0]) with substs [\n               '_#1r,\n               T\n           ]\n\n"}
[00:47:10] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs","byte_start":2310,"byte_end":2447,"line_start":74,"line_end":78,"column_start":26,"column_end":6,"is_primary":true,"text":[{"text":"    with_signature(a, b, |x, y| {","highlight_start":26,"highlight_end":34},{"text":"        //~^ ERROR the parameter type `T` may not live long enough","highlight_start":1,"highlight_end":67},{"text":"        // See `correct_region`","highlight_start":1,"highlight_end":32},{"text":"        require(&x, &y)","highlight_start":1,"highlight_end":24},{"text":"    })","highlight_start":1,"highlight_end":6}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:23 ~ ty_param_closure_outlives_from_where_clause[317d]::wrong_region[0]::{{closure}}[0]) with closure substs [{"text":"        require(&x, &y)","highlight_start":1,"highlight_end":24},{"text":"    })","highlight_start":1,"highlight_end":6}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider adding an explicit lifetime bound `T: ReFree(DefId(0/0:8 ~ ty_param_closure_outlives_from_where_clause[317d]::wrong_region[0]), BrNamed(crate1:DefIndex(1:20), '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-outlives-from-where-clause.rs:74:26\n   |\nLL |       with_signature(a, b, |x, y| {\n   |  __________________________^\nLL | |         //~^ ERROR the parameter type `T` may not live long enough\nLL | |         // See `correct_region`\nLL | |         require(&x, &y)\nLL | |     })\n   | |_____^\n   |\n   = help: consider adding an explicit lifetime bound `T: ReFree(DefId(0/0:8 ~ ty_param_closure_outlives_from_where_clause[317d]::wrong_region[0]), BrNamed(crate1:DefIndex(1:20), 'a))`...\n\n"}
[00:47:10] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs","byte_start":2578,"byte_end":2648,"line_start":87,"line_end":90,"column_start":26,"column_end":6,"is_primary":true,"text":[{"text":"    with_signature(a, b, |x, y| {","highlight_start":26,"highlight_end":34},{"text":"        // See `correct_region`","highlight_start":1,"highlight_end":32},{"text":"        require(&x, &y)","highlight_start":1,"highlight_end":24},{"text":"    })","highlight_start":1,"highlight_end":6}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:27 ~ ty_param_closure_outlives_from_where_clause[317d]::outlives_region[0]::{{closure}}[0]) with closure substs [\n    '_#1r,\n    '_#2r,\n    T,\n    i32,\n    extern \"rust-call\" fn((std::cell::Cell<&'_#3r ()>, T))\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"number of external vids: 4","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"where T: '_#3r","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: External requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs:87:26\n   |\nLL |       with_signature(a, b, |x, y| {\n   |  __________________________^\nLL | |         // See `correct_region`\nLL | |         require(&x, &y)\nLL | |     })\n   | |_____^\n   |\n   = note: defining type: DefId(0/1:27 ~ ty_param_closure_outlives_from_where_clause[317d]::outlives_region[0]::{{closure}}[0]) with closure substs [\n               '_#1r,\n               '_#2r,\n               T,\n               i32,\n               extern \"rust-call\" fn((std::cell::Cell<&'_#3r ()>, T))\n           ]\n   = note: number of external vids: 4\n   = note: where T: '_#3r\n\n"}
[00:47:10] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs","byte_start":2469,"byte_e":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 2 previous errors\n\n"}
[00:47:10] {"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:47:10] ------------------------------------------
[00:47:10] 
[00:47:10] thread '[ui] ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:47:10] 
---
151416 ./obj/build/bootstrap/debug/incremental
151412 ./src/tools/clang
149116 ./src/llvm-emscripten/test
135952 ./obj/build/bootstrap/debug/incremental/bootstrap-3ivyub3ic2113
135948 ./obj/build/bootstrap/debug/incremental/bootstrap-3ivyub3ic2113/s-f5e1kzzkxm-1eupocu-8vudgacockuw
134192 ./obj

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)

@@ -101,13 +101,13 @@ macro_rules! newtype_index {
#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, $($derives),*)]
#[rustc_layout_scalar_valid_range_end($max)]
$v struct $type {
private: u32
private: ::std::num::NonZeroU32
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need this anymore now that we have rustc_layout_scalar_valid_range_end, just keep the u32

@TimNN TimNN 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 Oct 9, 2018
@bors
Copy link
Contributor

bors commented Oct 16, 2018

☔ The latest upstream changes (presumably #55067) made this pull request unmergeable. Please resolve the merge conflicts.

@TimNN
Copy link
Contributor

TimNN commented Oct 23, 2018

Ping from triage @JamesHinshelwood: It looks like some changes have been requested to your PR and it also needs to be rebased.

@JamesHinshelwood
Copy link
Contributor Author

@TimNN Sorry, been very busy lately. I will get these changes made within a week.

@TimNN TimNN added A-allocators Area: Custom and system allocators and removed A-allocators Area: Custom and system allocators labels Nov 6, 2018
@rust-highfive
Copy link
Collaborator

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

Click to expand the log.
travis_time:end:00ee4fc3:start=1541974644860955567,finish=1541974645908421961,duration=1047466394
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0
---
[00:05:59]    Compiling syntax_pos v0.0.0 (/checkout/src/libsyntax_pos)
[00:06:06]    Compiling rustc_errors v0.0.0 (/checkout/src/librustc_errors)
[00:07:20]    Compiling proc_macro v0.0.0 (/checkout/src/libproc_macro)
[00:07:30]    Compiling syntax_ext v0.0.0 (/checkout/src/libsyntax_ext)
[00:07:56] error[E0599]: no function or associated item named `from_u32_const` found for type `ty::UniverseIndex` in the current scope
[00:07:56]      |
[00:07:56]      |
[00:07:56] 1492 | / newtype_index! {
[00:07:56] 1493 | |     pub struct UniverseIndex {
[00:07:56] 1494 | |         DEBUG_FORMAT = "U{}",
[00:07:56] 1496 | | }
[00:07:56] 1496 | | }
[00:07:56]      | |_- function or associated item `from_u32_const` not found for this
[00:07:56] ...
[00:07:56] 1501 |       pub const ROOT: UniverseIndex = UniverseIndex::from_u32_const(0);
[00:07:56]      |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function or associated item not found in `ty::UniverseIndex`
[00:07:56]      = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:07:56] 
[00:08:00] error[E0308]: mismatched types
[00:08:00] error[E0308]: mismatched types
[00:08:00]   --> librustc/dep_graph/serialized.rs:17:1
[00:08:00]    |
[00:08:00] 17 | / newtype_index! {
[00:08:00] 18 | |     pub struct SerializedDepNodeIndex { .. }
[00:08:00] 19 | | }
[00:08:00]    | |_^ expected u32, found struct `std::num::NonZeroU32`
[00:08:00]    = note: expected type `u32`
[00:08:00]               found type `std::num::NonZeroU32`
[00:08:00]    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:08:00] 
[00:08:00] 
[00:08:00] error[E0308]: mismatched types
[00:08:00]   --> librustc/hir/def_id.rs:18:1
[00:08:00]    |
[00:08:00] 18 | / newtype_index! {
[00:08:00] 19 | |     pub struct CrateId {
[00:08:00] 20 | |         ENCODABLE = custom
[00:08:00] 22 | | }
[00:08:00] 22 | | }
[00:08:00]    | |_^ expected u32, found struct `std::num::NonZeroU32`
[00:08:00]    = note: expected type `u32`
[00:08:00]               found type `std::num::NonZeroU32`
[00:08:00]    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:08:00] 
[00:08:00] 
[00:08:01] error[E0308]: mismatched types
[00:08:01]    --> librustc/middle/region.rs:163:1
[00:08:01]     |
[00:08:01] 163 | / newtype_index! {
[00:08:01] 164 | |     pub struct FirstStatementIndex { .. }
[00:08:01] 165 | | }
[00:08:01]     | |_^ expected u32, found struct `std::num::NonZeroU32`
[00:08:01]     = note: expected type `u32`
[00:08:01]                found type `std::num::NonZeroU32`
[00:08:01]     = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:08:01] 
[00:08:01] 
[00:08:01] error[E0308]: mismatched types
[00:08:01]    --> librustc/mir/mod.rs:576:1
[00:08:01]     |
[00:08:01] 576 | / newtype_index! {
[00:08:01] 577 | |     pub struct Local {
[00:08:01] 578 | |         DEBUG_FORMAT = "_{}",
[00:08:01] 579 | |         const RETURN_PLACE = 0,
[00:08:01] 581 | | }
[00:08:01] 581 | | }
[00:08:01]     | |_^ expected u32, found struct `std::num::NonZeroU32`
[00:08:01]     = note: expected type `u32`
[00:08:01]                found type `std::num::NonZeroU32`
[00:08:01]     = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:08:01] 
[00:08:01] 
[00:08:01] error[E0308]: mismatched types
[00:08:01]    --> librustc/mir/mod.rs:986:1
[00:08:01]     |
[00:08:01] 986 | / newtype_index! {
[00:08:01] 987 | |     pub struct BasicBlock {
[00:08:01] 988 | |         DEBUG_FORMAT = "bb{}",
[00:08:01] 989 | |         const START_BLOCK = 0,
[00:08:01] 991 | | }
[00:08:01] 991 | | }
[00:08:01]     | |_^ expected u32, found struct `std::num::NonZeroU32`
[00:08:01]     = note: expected type `u32`
[00:08:01]                found type `std::num::NonZeroU32`
[00:08:01]     = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:08:01] 
[00:08:01] 
[00:08:01] error[E0308]: mismatched types
[00:08:01]     --> librustc/mir/mod.rs:1957:1
[00:08:01]      |
[00:08:01] 1957 | / newtype_index! {
[00:08:01] 1958 | |     pub struct Field {
[00:08:01] 1959 | |         DEBUG_FORMAT = "field[{}]"
[00:08:01] 1961 | | }
[00:08:01] 1961 | | }
[00:08:01]      | |_^ expected u32, found struct `std::num::NonZeroU32`
[00:08:01]      = note: expected type `u32`
[00:08:01]                 found type `std::num::NonZeroU32`
[00:08:01]      = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:08:01] 
[00:08:01] 
[00:08:01] error[E0308]: mismatched types
[00:08:01]     --> librustc/mir/mod.rs:2058:1
[00:08:01]      |
[00:08:01] | / newtype_index! {
[00:08:01] 2574 | |     pub struct Promoted {
[00:08:01] 2575 | |         DEBUG_FORMAT = "promoted[{}]"
[00:08:01] 2577 | | }
[00:08:01] 2577 | | }
[00:08:01]      | |_^ expected u32, found struct `std::num::NonZeroU32`
[00:08:01]      = note: expected type `u32`
[00:08:01]                 found type `std::num::NonZeroU32`
[00:08:01]      = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:08:01] 
[00:08:01] 
[00:08:01] error[E0308]: mismatched types
[00:08:01]     --> librustc/ty/sty.rs:1070:1
[00:08:01]      |
[00:08:01] 1070 | / newtype_index! {
[00:08:01] 1071 | |     pub struct DebruijnIndex {
[00:08:01] 1072 | |         DEBUG_FORMAT = "DebruijnIndex({})",
[00:08:01] 1073 | |         const INNERMOST = 0,
[00:08:01] 1075 | | }
[00:08:01] 1075 | | }
[00:08:01]      | |_^ expected u32, found struct `std::num::NonZeroU32`
[00:08:01]      = note: expected type `u32`
[00:08:01]                 found type `std::num::NonZeroU32`
[00:08:01]      = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:08:01] 
[00:08:01] 
[00:08:01] [38;5;
[00:08:02] 1235 | / newtype_index! {
[00:08:02] 1236 | |     pub struct BoundVar { .. }
[00:08:02] 1237 | | }
[00:08:02]      | |_^ expected u32, found struct `std::num::NonZeroU32`
[00:08:02]      = note: expected type `u32`
[00:08:02]                 found type `std::num::NonZeroU32`
[00:08:02]      = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:08:02] 
[00:08:02] 
[00:08:02] error[E0308]: mismatched types
[00:08:02]     --> librustc/ty/mod.rs:1492:1
[00:08:02]      |
[00:08:02] 1492 | / newtype_index! {
[00:08:02] 1493 | |     pub struct UniverseIndex {
[00:08:02] 1494 | |         DEBUG_FORMAT = "U{}",
[00:08:02] 1496 | | }
[00:08:02] 1496 | | }
[00:08:02]      | |_^ expected u32, found struct `std::num::NonZeroU32`
[00:08:02]      = note: expected type `u32`
[00:08:02]                 found type `std::num::NonZeroU32`
[00:08:02]      = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:08:02] 
[00:08:02] 
[00:08:02] error[E0599]: no method named `get` found for type `u32` in the current scope
[00:08:02]   --> librustc/dep_graph/graph.rs:42:1
[00:08:02]    |
[00:08:02] 42 | / newtype_index! {
[00:08:02] 43 | |     pub struct DepNodeIndex { .. }
[00:08:02]    | |_^
[00:08:02]    |
[00:08:02]    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:08:02] 
[00:08:02] 
[00:08:02] error[E0599]: no method named `get` found for type `u32` in the current scope
[00:08:02]   --> librustc/dep_graph/serialized.rs:17:1
[00:08:02]    |
[00:08:02] 17 | / newtype_index! {
[00:08:02] 18 | |     pub struct SerializedDepNodeIndex { .. }
[00:08:02]    | |_^
[00:08:02]    |
[00:08:02]    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:08:02] 
[00:08:02] 
[00:08:02] error[E0599]: no method named `get` found for type `u32` in the current scope
[00:08:02]   --> librustc/hir/def_id.rs:18:1
[00:08:02]    |
[00:08:02] 18 | / newtype_index! {
[00:08:02] 19 | |     pub struct CrateId {race for more info)
[00:08:02] error[E0599]: no method named `get` found for type `u32` in the current scope
[00:08:02]    --> librustc/mir/mod.rs:576:1
[00:08:02]     |
[00:08:02]     |
[00:08:02] 576 | / newtype_index! {
[00:08:02] 577 | |     pub struct Local {
[00:08:02] 578 | |         DEBUG_FORMAT = "_{}",
[00:08:02] 579 | |         const RETURN_PLACE = 0,
[00:08:02] 581 | | }
[00:08:02]     | |_^
[00:08:02]     |
[00:08:02]     = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:08:02]     = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:08:02] 
[00:08:02] error[E0599]: no method named `get` found for type `u32` in the current scope
[00:08:02]    --> librustc/mir/mod.rs:986:1
[00:08:02]     |
;12m1959 | |         DEBUG_FORMAT = "field[{}]"
[00:08:02] 1961 | | }
[00:08:02]      | |_^
[00:08:02]      |
[00:08:02]      = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:08:02]      = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:08:02] 
[00:08:02] error[E0599]: no method named `get` found for type `u32` in the current scope
[00:08:02]     --> librustc/mir/mod.rs:2058:1
[00:08:02]      |
[00:08:02] 2058 | / newtype_index! {
[00:08:02] 2059 | |     pub struct SourceScope {
[00:08:02] 2060 | |         DEBUG_FORMAT = "scope[{}]",
[00:08:02] 2061 | |         const OUTERMOST_SOURCE_SCOPE = 0,
[00:08:02] o)
[00:08:02] 
[00:08:02] error[E0599]: no method named `get` found for type `u32` in the current scope
[00:08:02]     --> librustc/ty/sty.rs:1070:1
[00:08:02]     --> librustc/ty/sty.rs:1070:1
[00:08:02]      |
[00:08:02] 1070 | / newtype_index! {
[00:08:02] 1071 | |     pub struct DebruijnIndex {
[00:08:02] 1072 | |         DEBUG_FORMAT = "DebruijnIndex({})",
[00:08:02] 1073 | |         const INNERMOST = 0,
[00:08:02] 1075 | | }
[00:08:02]      | |_^
[00:08:02]      |
[00:08:02]      = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:08:02]      = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:08:02] 
[00:08:02] error[E0599]: no method named `get` found for type `u32` in the current scope
[00:08:02]     --> librustc/ty/sty.rs:1209:1
[00:08:02]      |
[00:08:02] 1209 | / newtype_index! {
[00:08:02] 1210 | |     pub struct RegionVid {
[00:08:02] 1211 | |         DEBUG_FORMAT = custom,
[00:08:02] 1213 | | }
[00:08:02]      | |_^
[00:08:02]      |
[00:08:02]      = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:08:02]      = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:08:02] 
[00:08:02] error[E0599]: no method named `get` found for type `u32` in the current scope
[00:08:02]     --> librustc/ty/sty.rs:1235:1
[00:08:02]      |
[00:08:02] 1235 | / newtype_index! {
[00:08:02] 1236 | |     pub struct BoundVar { .. }
[00:08:02]      | |_^
[00:08:02]      |
[00:08:02]      = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:08:02] 
[00:08:02] 
[00:08:02] error[E0599]: no method named `get` found for type `u32` in the current scope
[00:08:02]     --> librustc/ty/mod.rs:1492:1
[00:08:02]      |
[00:08:02] 1492 | / newtype_index! {
[00:08:02] 1493 | |     pub struct UniverseIndex {
[00:08:02] 1494 | |         DEBUG_FORMAT = "U{}",
[00:08:02] 1496 | | }
[00:08:02]      | |_^
[00:08:02]      |
[00:08:02]      = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
---
[00:08:02] 
[00:08:02] To learn more, run the command again with --verbose.
[00:08:02] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:08:02] expected success, got: exit code: 101
[00:08:02] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1101:9
[00:08:02] travis_fold:end:stage0-rustc

[00:08:02] travis_time:end:stage0-rustc:start=1541974971256797120,finish=1541975138597368630,duration=167340571510


[00:08:02] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:08:02] Build completed unsuccessfully in 0:03:54
[00:08:02] Makefile:28: recipe for target 'all' failed
[00:08:02] make: *** [all] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0c080c3f
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Sun Nov 11 22:25:38 UTC 2018

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

@rust-highfive
Copy link
Collaborator

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

Click to expand the log.
travis_time:end:05b6fb20:start=1541976243711663214,finish=1541976246247023829,duration=2535360615
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0
---
[00:55:23] .................................................................................................... 100/5015
[00:55:26] .................................................................................................... 200/5015
[00:55:29] .............................ii............................................ii...................ii.. 300/5015
[00:55:32] ..............................................................................................iii... 400/5015
[00:55:35] .....iiiiiiii.iii............................iii...........................................i........ 500/5015
[00:55:42] .................................................................................................... 700/5015
[00:55:49] ..............................................................................i...........i......... 800/5015
[00:55:52] .................................................................................................iii 900/5015
[00:55:56] ii..................ii.iiii......................................................................... 1000/5015
---
[00:56:33] .................................................................................................... 2200/5015
[00:56:37] .................................................................................................... 2300/5015
[00:56:41] .................................................................................................... 2400/5015
[00:56:45] .................................................................................................... 2500/5015
[00:56:49] ..............................................................................iiiiiiiii............. 2600/5015
[00:56:56] ...........................................ii....................................................... 2800/5015
[00:56:59] .................................................................................................... 2900/5015
[00:57:03] .................................................................................................... 3000/5015
[00:57:06] .....................................i.............................................................. 3100/5015
---
travis_time:start:test_codegen
Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:11:50] 
[01:11:50] running 115 tests
[01:11:53] i..ii...iii..iii.....i...i.........i..iii...........i.....i.....ii...i..i.ii..............i...ii..ii 100/115
[01:11:53] .i....iiii.....
[01:11:53] 
[01:11:53]  finished in 3.722
[01:11:53] travis_fold:end:test_codegen

---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-both (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:12:08] 
[01:12:08] running 118 tests
[01:12:33] .iiiii...i.....i..i...i..i.i..i.i..i.....i..i....i..........iiii.........i.i....i...i.......ii.i.i.i 100/118
[01:12:37] ......iii.i.....ii
[01:12:37] 
[01:12:37]  finished in 28.575
[01:12:37] travis_fold:end:test_debuginfo

---
travis_time:start:test_run-pass-fulldeps
Check compiletest suite=run-pass-fulldeps mode=run-pass (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:13:18] 
[01:13:18] running 97 tests
[01:15:27] ........................................F............test [run-pass] run-pass-fulldeps/myriad-closures.rs has been running for over 60 seconds
[01:18:40] failures:
[01:18:40] 
[01:18:40] ---- [run-pass] run-pass-fulldeps/newtype_index.rs stdout ----
[01:18:40] 
[01:18:40] 
[01:18:40] error: test compilation failed although it shouldn't!
[01:18:40] status: exit code: 1
[01:18:40] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/run-pass-fulldeps/newtype_index.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/run-pass-fulldeps/newtype_index/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps/newtype_index/auxiliary"
[01:18:40] ------------------------------------------
[01:18:40] 
[01:18:40] ------------------------------------------
[01:18:40] stderr:
[01:18:40] stderr:
[01:18:40] ------------------------------------------
[01:18:40] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:503:22
[01:18:40] {"message":"call to unsafe function is unsafe and unsafe operations are not allowed in const fn","code":null,"level":"error","spans":[{"file_name":"<::rustc_data_structures::indexed_vec::newtype_index macros>","byte_start":1131,"byte_end":1132,"line_start":23,"line_end":23,"column_start":47,"column_end":48,"is_primary":true,"text":[{"text":"unsafe { $ type :: from_u32_unchecked ( value ) } } # [ inline ] $ v const","highlight_start":47,"highlight_end":48}],"label":"call to unsafe function","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"<::rustc_data_structures::indexed_vec::newtype_index macros>","byte_start":6601,"byte_end":6755,"line_start":120,"line_end":122,"column_start":1,"column_end":61,"is_primary":false,"text":[{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ ( $ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":61}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"<::rustc_data_structures::indexed_vec::newtype_index macros>","byte_start":5804,"byte_end":5963,"line_start":107,"line_end":109,"column_start":1,"column_end":66,"is_primary":false,"text":[{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ name = $ constant , ) ; ) ; (","highlight_start":1,"highlight_end":66}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"<::rustc_data_structures::indexed_vec::newtype_index macros>","byte_start":5437,"byte_end":5605,"line_start":100,"line_end":102,"column_start":1,"column_end":77,"is_primary":false,"text":[{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ RustcDecodable , RustcEncodable , ] @ type [ $ type ] @ max [","highlight_start":1,"highlight_end":74},{"text":"$ max ] @ vis [ $ v ] @ debug_format [ $ debug_format ] $ ( $ tokens ) * ) ; )","highlight_start":1,"highlight_end":77}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"<::rustc_data_structures::indexed_vec::newtype_index macros>","byte_start":219,"byte_end":335,"line_start":5,"line_end":7,"column_start":1,"column_end":21,"is_primary":false,"text":[{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ type [ $ name ] @ max [ 0xFFFF_FF00 ] @ vis [ $ v ] @ debug_format [ \"{}\" ]","highlight_start":1,"highlight_end":78},{"text":"$ ( $ tokens ) + ) ; ) ; (","highlight_start":1,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/run-pass-fulldeps/newtype_index.rs","byte_start":179,"byte_end":230,"line_start":8,"line_end":8,"column_start":1,"column_end":52,"is_primary":false,"text":[{"text":"newtype_index!(struct MyIdx { MAX = 0xFFFF_FFFA });","highlight_start":1,"highlight_end":52}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"newtype_index!","def_site_span":{"file_name":"<::rustc_data_structures::indexed_vec::newtype_index macros>","byte_start":0,"byte_end":7643,"line_start":1,"line_end":136,"column_start":1,"column_end":65,"is_primary":false,"text":[{"text":"( $ v : vis struct $ name : ident { .. } ) => (","highlight_start":1,"highlight_end":48},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ type [ $ name ] @ max [ 0xFFFF_FF00 ] @ vis [ $ v ] @ debug_format [ \"{}\" ]","highlight_start":1,"highlight_end":78},{"text":") ; ) ; ( $ v : vis struct $ name : ident { $ ( $ tokens : tt ) + } ) => (","highlight_start":1,"highlight_end":75},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ type [ $ name ] @ max [ 0xFFFF_FF00 ] @ vis [ $ v ] @ debug_format [ \"{}\" ]","highlight_start":1,"highlight_end":78},{"text":"$ ( $ tokens ) + ) ; ) ; (","highlight_start":1,"highlight_end":27},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ debug_format : tt ] ) =>","highlight_start":1,"highlight_end":79},{"text":"(","highlight_start":1,"highlight_end":2},{"text":"# [","highlight_start":1,"highlight_end":4},{"text":"derive (","highlight_start":1,"highlight_end":9},{"text":"Copy , Clone , PartialEq , Eq , Hash , PartialOrd , Ord , $ ( $ derives ) , *","highlight_start":1,"highlight_end":78},{"text":") ] # [ rustc_layout_scalar_valid_range_end ( $ max ) ] $ v struct $ type {","highlight_start":1,"highlight_end":76},{"text":"private : u32 } impl $ type {","highlight_start":1,"highlight_end":30},{"text":"$ v const MAX_AS_U32 : u32 = $ max ; $ v const MAX : $ type = $ type ::","highlight_start":1,"highlight_end":72},{"text":"from_u32 ( $ max ) ; # [ inline ] $ v fn from_usize ( value : usize ) -> Self","highlight_start":1,"highlight_end":78},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"assert ! ( value <= ( $ max as usize ) ) ; unsafe {","highlight_start":1,"highlight_end":52},{"text":"$ type :: from_u32_unchecked ( value as u32 ) } } # [ inline ] $ v const fn","highlight_start":1,"highlight_end":76},{"text":"from_u32 ( value : u32 ) -> Self {","highlight_start":1,"highlight_end":35},{"text":"let _ = [ \"out of range value used\" ] [ ! ( value <= $ max ) as usize ] ;","highlight_start":1,"highlight_end":74},{"text":"unsafe { $ type :: from_u32_unchecked ( value ) } } # [ inline ] $ v const","highlight_start":1,"highlight_end":75},{"text":"unsafe fn from_u32_unchecked ( value : u32 ) -> Self {","highlight_start":1,"highlight_end":55},{"text":"$ type { private : value } } /// Extract value of this index as an integer.","highlight_start":1,"highlight_end":76},{"text":" # [ inline ] $ v fn index ( self ) -> usize { self . as_usize (  ) }","highlight_start":1,"highlight_end":70},{"text":"/// Extract value of this index as a usize.","highlight_start":1,"highlight_end":44},{"text":" # [ inline ] $ v const fn as_u32 ( self ) -> u32 { self . private }","highlight_start":1,"highlight_end":69},{"text":"/// Extract value of this index as a u32.","highlight_start":1,"highlight_end":42},{"text":" # [ inline ] $ v fn as_usize ( self ) -> usize { self . as_u32 (  ) as usize","highlight_start":1,"highlight_end":78},{"text":"} } impl Idx for $ type {","highlight_start":1,"highlight_end":26},{"text":"# [ inline ] fn new ( value : usize ) -> Self { Self :: from ( value ) } # [","highlight_start":1,"highlight_end":77},{"text":"inline ] fn index ( self ) -> usize { usize :: from ( self ) } } impl :: std","highlight_start":1,"highlight_end":77},{"text":":: iter :: Step for $ type {","highlight_start":1,"highlight_end":29},{"text":"# [ inline ] fn steps_between ( start : & Self , end : & Self ) -> Option <","highlight_start":1,"highlight_end":76},{"text":"usize > {","highlight_start":1,"highlight_end":10},{"text":"< usize as :: std :: iter :: Step > :: steps_between (","highlight_start":1,"highlight_end":55},{"text":"& Idx :: index ( * start ) , & Idx :: index ( * end ) , ) } # [ inline ] fn","highlight_start":1,"highlight_end":76},{"text":"replace_one ( & mut self ) -> Self {","highlight_start":1,"highlight_end":37},{"text":":: std :: mem :: replace ( self , Self :: new ( 1 ) ) } # [ inline ] fn","highlight_start":1,"highlight_end":72},{"text":"replace_zero ( & mut self ) -> Self {","highlight_start":1,"highlight_end":38},{"text":":: std :: mem :: replace ( self , Self :: new ( 0 ) ) } # [ inline ] fn","highlight_start":1,"highlight_end":72},{"text":"add_one ( & self ) -> Self { Self :: new ( Idx :: index ( * self ) + 1 ) } # [","highlight_start":1,"highlight_end":79},{"text":"inline ] fn sub_one ( & self ) -> Self {","highlight_start":1,"highlight_end":41},{"text":"Self :: new ( Idx :: index ( * self ) - 1 ) } # [ inline ] fn add_usize (","highlight_start":1,"highlight_end":74},{"text":"& self , u : usize ) -> Option < Self > {","highlight_start":1,"highlight_end":42},{"text":"Idx :: index ( * self ) . checked_add ( u ) . map ( Self :: new ) } } impl","highlight_start":1,"highlight_end":75},{"text":"From < $ type > for u32 {","highlight_start":1,"highlight_end":26},{"text":"# [ inline ] fn from ( v : $ type ) -> u32 { v . as_u32 (  ) } } impl From < $","highlight_start":1,"highlight_end":79},{"text":"type > for usize {","highlight_start":1,"highlight_end":19},{"text":"# [ inline ] fn from ( v : $ type ) -> usize { v . as_usize (  ) } } impl From","highlight_start":1,"highlight_end":79},{"text":"< usize > for $ type {","highlight_start":1,"highlight_end":23},{"text":"# [ inline ] fn from ( value : usize ) -> Self {","highlight_start":1,"highlight_end":49},{"text":"$ type :: from_usize ( value ) } } impl From < u32 > for $ type {","highlight_start":1,"highlight_end":66},{"text":"# [ inline ] fn from ( value : u32 ) -> Self { $ type :: from_u32 ( value ) }","highlight_start":1,"highlight_end":78},{"text":"} newtype_index ! (","highlight_start":1,"highlight_end":20},{"text":"@ handle_debug @ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @","highlight_start":1,"highlight_end":69},{"text":"debug_format [ $ debug_format ] ) ; ) ; (","highlight_start":1,"highlight_end":42},{"text":"@ handle_debug @ derives [ $ ( $ _derives : ident , ) * ] @ type [","highlight_start":1,"highlight_end":67},{"text":"$ type : ident ] @ debug_format [ custom ] ) => (  ) ; (","highlight_start":1,"highlight_end":57},{"text":"@ handle_debug @ derives [  ] @ type [ $ type : ident ] @ debug_format [","highlight_start":1,"highlight_end":73},{"text":"$ debug_format : tt ] ) => (","highlight_start":1,"highlight_end":29},{"text":"impl :: std :: fmt :: Debug for $ type {","highlight_start":1,"highlight_end":41},{"text":"fn fmt ( & self , fmt : & mut :: std :: fmt :: Formatter ) -> :: std :: fmt ::","highlight_start":1,"highlight_end":79},{"text":"Result { write ! ( fmt , $ debug_format , self . as_u32 (  ) ) } } ) ; (","highlight_start":1,"highlight_end":73},{"text":"@ handle_debug @ derives [ Debug , $ ( $ derives : ident , ) * ] @ type [","highlight_start":1,"highlight_end":74},{"text":"$ type : ident ] @ debug_format [ $ debug_format : tt ] ) => (  ) ; (","highlight_start":1,"highlight_end":70},{"text":"@ handle_debug @ derives [ $ _derive : ident , $ ( $ derives : ident , ) * ] @","highlight_start":1,"highlight_end":79},{"text":"type [ $ type : ident ] @ debug_format [ $ debug_format : tt ] ) => (","highlight_start":1,"highlight_end":70},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ handle_debug @ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @","highlight_start":1,"highlight_end":69},{"text":"debug_format [ $ debug_format ] ) ; ) ; (","highlight_start":1,"highlight_end":42},{"text":"@ type [ $ type : ident ] @ max [ $ max : expr ] @ vis [ $ v : vis ] @","highlight_start":1,"highlight_end":71},{"text":"debug_format [ $ debug_format : tt ] derive [ $ ( $ derives : ident ) , * ] $","highlight_start":1,"highlight_end":78},{"text":"( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":27},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ type [ $ type ] @ max [ $ max ] @ vis [ $ v ] @ debug_format [","highlight_start":1,"highlight_end":65},{"text":"$ debug_format ] derive [ $ ( $ derives , ) * ] $ ( $ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":75},{"text":"@ type [ $ type : ident ] @ max [ $ max : expr ] @ vis [ $ v : vis ] @","highlight_start":1,"highlight_end":71},{"text":"debug_format [ $ debug_format : tt ] derive [ $ ( $ derives : ident , ) + ]","highlight_start":1,"highlight_end":76},{"text":"ENCODABLE = custom $ ( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":48},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) + ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ ( $ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":67},{"text":"@ type [ $ type : ident ] @ max [ $ max : expr ] @ vis [ $ v : vis ] @","highlight_start":1,"highlight_end":71},{"text":"debug_format [ $ debug_format : tt ] derive [ $ ( $ derives : ident , ) + ] $","highlight_start":1,"highlight_end":78},{"text":"( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":27},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) + RustcDecodable , RustcEncodable , ] @ type [","highlight_start":1,"highlight_end":77},{"text":"$ type ] @ max [ $ max ] @ vis [ $ v ] @ debug_format [ $ debug_format ] $ (","highlight_start":1,"highlight_end":77},{"text":"$ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":23},{"text":"@ type [ $ type : ident ] @ max [ $ max : expr ] @ vis [ $ v : vis ] @","highlight_start":1,"highlight_end":71},{"text":"debug_format [ $ debug_format : tt ] ENCODABLE = custom $ ( $ tokens : tt ) *","highlight_start":1,"highlight_end":78},{"text":") => (","highlight_start":1,"highlight_end":7},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [  ] @ type [ $ type ] @ max [ $ max ] @ vis [ $ v ] @ debug_format","highlight_start":1,"highlight_end":78},{"text":"[ $ debug_format ] $ ( $ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":46},{"text":"@ type [ $ type : ident ] @ max [ $ max : expr ] @ vis [ $ v : vis ] @","highlight_start":1,"highlight_end":71},{"text":"debug_format [ $ debug_format : tt ] $ ( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":66},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ RustcDecodable , RustcEncodable , ] @ type [ $ type ] @ max [","highlight_start":1,"highlight_end":74},{"text":"$ max ] @ vis [ $ v ] @ debug_format [ $ debug_format ] $ ( $ tokens ) * ) ; )","highlight_start":1,"highlight_end":79},{"text":"; (","highlight_start":1,"highlight_end":4},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ debug_format : tt ] $","highlight_start":1,"highlight_end":76},{"text":"name : ident = $ constant : expr ) => (","highlight_start":1,"highlight_end":40},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ name = $ constant , ) ; ) ; (","highlight_start":1,"highlight_end":72},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ _max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ debug_format : tt ] $ (","highlight_start":1,"highlight_end":79},{"text":"# [ doc = $ doc : expr ] ) * const $ name : ident = $ constant : expr ) => (","highlight_start":1,"highlight_end":77},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ ( # [ doc = $ doc ] ) * const $ name","highlight_start":1,"highlight_end":79},{"text":"= $ constant , ) ; ) ; (","highlight_start":1,"highlight_end":25},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ _max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ debug_format : tt ] MAX","highlight_start":1,"highlight_end":79},{"text":"= $ max : expr , $ ( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":46},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ ( $ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":67},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ _debug_format : tt ]","highlight_start":1,"highlight_end":75},{"text":"DEBUG_FORMAT = $ debug_format : tt , $ ( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":66},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ ( $ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":67},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ debug_format : tt ] $ (","highlight_start":1,"highlight_end":78},{"text":"# [ doc = $ doc : expr ] ) * const $ name : ident = $ constant : expr , $ (","highlight_start":1,"highlight_end":76},{"text":"$ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":25},{"text":"$ ( # [ doc = $ doc ] ) * pub const $ name : $ type = $ type :: from_u32 (","highlight_start":1,"highlight_end":75},{"text":"$ constant ) ; newtype_index ! (","highlight_start":1,"highlight_end":33},{"text":"@ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ ( $ tokens ) * ) ; ) ;","highlight_start":1,"highlight_end":65}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"newtype_index!","def_site_span":{"file_name":"<::rustc_data_structures::indexed_vec::newtype_index macros>","byte_start":0,"byte_end":7643,"line_start":1,"line_end":136,"column_start":1,"column_end":65,"is_primary":false,"text":[{"text":"( $ v : vis struct $ name : ident { .. } ) => (","highlight_start":1,"highlight_end":48},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ type [ $ name ] @ max [ 0xFFFF_FF00 ] @ vis [ $ v ] @ debug_format [ \"{}\" ]","highlight_start":1,"highlight_end":78},{"text":") ; ) ; ( $ v : vis struct $ name : ident { $ ( $ tokens : tt ) + } ) => (","highlight_start":1,"highlight_end":75},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ type [ $ name ] @ max [ 0xFFFF_FF00 ] @ vis [ $ v ] @ debug_format [ \"{}\" ]","highlight_start":1,"highlight_end":78},{"text":"$ ( $ tokens ) + ) ; ) ; (","highlight_start":1,"highlight_end":27},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ debug_format : tt ] ) =>","highlight_start":1,"highlight_end":79},{"text":"(","highlight_start":1,"highlight_end":2},{"text":"# [","highlight_start":1,"highlight_end":4},{"text":"derive (","highlight_start":1,"highlight_end":9},{"text":"Copy , Clone , PartialEq , Eq , Hash , PartialOrd , Ord , $ ( $ derives ) , *","highlight_start":1,"highlight_end":78},{"text":") ] # [ rustc_layout_scalar_valid_range_end ( $ max ) ] $ v struct $ type {","highlight_start":1,"highlight_end":76},{"text":"private : u32 } impl $ type {","highlight_start":1,"highlight_end":30},{"text":"$ v const MAX_AS_U32 : u32 = $ max ; $ v const MAX : $ type = $ type ::","highlight_start":1,"highlight_end":72},{"text":"from_u32 ( $ max ) ; # [ inline ] $ v fn from_usize ( value : usize ) -> Self","highlight_start":1,"highlight_end":78},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"assert ! ( value <= ( $ max as usize ) ) ; unsafe {","highlight_start":1,"highlight_end":52},{"text":"$ type :: from_u32_unchecked ( value as u32 ) } } # [ inline ] $ v const fn","highlight_start":1,"highlight_end":76},{"text":"from_u32 ( value : u32 ) -> Self {","highlight_start":1,"highlight_end":35},{"text":"let _ = [ \"out of range value used\" ] [ ! ( value <= $ max ) as usize ] ;","highlight_start":1,"highlight_end":74},{"text":"unsafe { $ type :: from_u32_unchecked ( value ) } } # [ inline ] $ v const","highlight_start":1,"highlight_end":75},{"text":"unsafe fn from_u32_unchecked ( value : u32 ) -> Self {","highlight_start":1,"highlight_end":55},{"text":"$ type { private : value } } /// Extract value of this index as an integer.","highlight_start":1,"highlight_end":76},{"text":" # [ inline ] $ v fn index ( self ) -> usize { self . as_usize (  ) }","highlight_start":1,"highlight_end":70},{"text":"/// Extract value of this index as a usize.","highlight_start":1,"highlight_end":44},{"text":" # [ inline ] $ v const fn as_u32 ( self ) -> u32 { self . private }","highlight_start":1,"highlight_end":69},{"text":"/// Extract value of this index as a u32.","highlight_start":1,"highlight_end":42},{"text":" # [ inline ] $ v fn as_usize ( self ) -> usize { self . as_u32 (  ) as usize","highlight_start":1,"highlight_end":78},{"text":"} } impl Idx for $ type {","highlight_start":1,"highlight_end":26},{"text":"# [ inline ] fn new ( value : usize ) -> Self { Self :: from ( value ) } # [","highlight_start":1,"highlight_end":77},{"text":"inline ] fn index ( self ) -> usize { usize :: from ( self ) } } impl :: std","highlight_start":1,"highlight_end":77},{"text":":: iter :: Step for $ type {","highlight_start":1,"highlight_end":29},{"text":"# [ inline ] fn steps_between ( start : & Self , end : & Self ) -> Option <","highlight_start":1,"highlight_end":76},{"text":"usize > {","highlight_start":1,"highlight_end":10},{"text":"< usize as :: std :: iter :: Step > :: steps_between (","highlight_start":1,"highlight_end":55},{"text":"& Idx :: index ( * start ) , & Idx :: index ( * end ) , ) } # [ inline ] fn","highlight_start":1,"highlight_end":76},{"text":"replace_one ( & mut self ) -> Self {","highlight_start":1,"highlight_end":37},{"text":":: std :: mem :: replace ( self , Self :: new ( 1 ) ) } # [ inline ] fn","highlight_start":1,"highlight_end":72},{"text":"replace_zero ( & mut self ) -> Self {","highlight_start":1,"highlight_end":38},{"text":":: std :: mem :: replace ( self , Self :: new ( 0 ) ) } # [ inline ] fn","highlight_start":1,"highlight_end":72},{"text":"add_one ( & self ) -> Self { Self :: new ( Idx :: index ( * self ) + 1 ) } # [","highlight_start":1,"highlight_end":79},{"text":"inline ] fn sub_one ( & self ) -> Self {","highlight_start":1,"highlight_end":41},{"text":"Self :: new ( Idx :: index ( * self ) - 1 ) } # [ inline ] fn add_usize (","highlight_start":1,"highlight_end":74},{"text":"& self , u : usize ) -> Option < Self > {","highlight_start":1,"highlight_end":42},{"text":"Idx :: index ( * self ) . checked_add ( u ) . map ( Self :: new ) } } impl","highlight_start":1,"highlight_end":75},{"text":"From < $ type > for u32 {","highlight_start":1,"highlight_end":26},{"text":"# [ inline ] fn from ( v : $ type ) -> u32 { v . as_u32 (  ) } } impl From < $","highlight_start":1,"highlight_end":79},{"text":"type > for usize {","highlight_start":1,"highlight_end":19},{"text":"# [ inline ] fn from ( v : $ type ) -> usize { v . as_usize (  ) } } impl From","highlight_start":1,"highlight_end":79},{"text":"< usize > for $ type {","highlight_start":1,"highlight_end":23},{"text":"# [ inline ] fn from ( value : usize ) -> Self {","highlight_start":1,"highlight_end":49},{"text":"$ type :: from_usize ( value ) } } impl From < u32 > for $ type {","highlight_start":1,"highlight_end":66},{"text":"# [ inline ] fn from ( value : u32 ) -> Self { $ type :: from_u32 ( value ) }","highlight_start":1,"highlight_end":78},{"text":"} newtype_index ! (","highlight_start":1,"highlight_end":20},{"text":"@ handle_debug @ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @","highlight_start":1,"highlight_end":69},{"text":"debug_format [ $ debug_format ] ) ; ) ; (","highlight_start":1,"highlight_end":42},{"text":"@ handle_debug @ derives [ $ ( $ _derives : ident , ) * ] @ type [","highlight_start":1,"highlight_end":67},{"text":"$ type : ident ] @ debug_format [ custom ] ) => (  ) ; (","highlight_start":1,"highlight_end":57},{"text":"@ handle_debug @ derives [  ] @ type [ $ type : ident ] @ debug_format [","highlight_start":1,"highlight_end":73},{"text":"$ debug_format : tt ] ) => (","highlight_start":1,"highlight_end":29},{"text":"impl :: std :: fmt :: Debug for $ type {","highlight_start":1,"highlight_end":41},{"text":"fn fmt ( & self , fmt : & mut :: std :: fmt :: Formatter ) -> :: std :: fmt ::","highlight_start":1,"highlight_end":79},{"text":"Result { write ! ( fmt , $ debug_format , self . as_u32 (  ) ) } } ) ; (","highlight_start":1,"highlight_end":73},{"text":"@ handle_debug @ derives [ Debug , $ ( $ derives : ident , ) * ] @ type [","highlight_start":1,"highlight_end":74},{"text":"$ type : ident ] @ debug_format [ $ debug_format : tt ] ) => (  ) ; (","highlight_start":1,"highlight_end":70},{"text":"@ handle_debug @ derives [ $ _derive : ident , $ ( $ derives : ident , ) * ] @","highlight_start":1,"highlight_end":79},{"text":"type [ $ type : ident ] @ debug_format [ $ debug_format : tt ] ) => (","highlight_start":1,"highlight_end":70},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ handle_debug @ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @","highlight_start":1,"highlight_end":69},{"text":"debug_format [ $ debug_format ] ) ; ) ; (","highlight_start":1,"highlight_end":42},{"text":"@ type [ $ type : ident ] @ max [ $ max : expr ] @ vis [ $ v : vis ] @","highlight_start":1,"highlight_end":71},{"text":"debug_format [ $ debug_format : tt ] derive [ $ ( $ derives : ident ) , * ] $","highlight_start":1,"highlight_end":78},{"text":"( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":27},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ type [ $ type ] @ max [ $ max ] @ vis [ $ v ] @ debug_format [","highlight_start":1,"highlight_end":65},{"text":"$ debug_format ] derive [ $ ( $ derives , ) * ] $ ( $ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":75},{"text":"@ type [ $ type : ident ] @ max [ $ max : expr ] @ vis [ $ v : vis ] @","highlight_start":1,"highlight_end":71},{"text":"debug_format [ $ debug_format : tt ] derive [ $ ( $ derives : ident , ) + ]","highlight_start":1,"highlight_end":76},{"text":"ENCODABLE = custom $ ( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":48},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) + ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ ( $ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":67},{"text":"@ type [ $ type : ident ] @ max [ $ max : expr ] @ vis [ $ v : vis ] @","highlight_start":1,"highlight_end":71},{"text":"debug_format [ $ debug_format : tt ] derive [ $ ( $ derives : ident , ) + ] $","highlight_start":1,"highlight_end":78},{"text":"( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":27},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) + RustcDecodable , RustcEncodable , ] @ type [","highlight_start":1,"highlight_end":77},{"text":"$ type ] @ max [ $ max ] @ vis [ $ v ] @ debug_format [ $ debug_format ] $ (","highlight_start":1,"highlight_end":77},{"text":"$ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":23},{"text":"@ type [ $ type : ident ] @ max [ $ max : expr ] @ vis [ $ v : vis ] @","highlight_start":1,"highlight_end":71},{"text":"debug_format [ $ debug_format : tt ] ENCODABLE = custom $ ( $ tokens : tt ) *","highlight_start":1,"highlight_end":78},{"text":") => (","highlight_start":1,"highlight_end":7},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [  ] @ type [ $ type ] @ max [ $ max ] @ vis [ $ v ] @ debug_format","highlight_start":1,"highlight_end":78},{"text":"[ $ debug_format ] $ ( $ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":46},{"text":"@ type [ $ type : ident ] @ max [ $ max : expr ] @ vis [ $ v : vis ] @","highlight_start":1,"highlight_end":71},{"text":"debug_format [ $ debug_format : tt ] $ ( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":66},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ RustcDecodable , RustcEncodable , ] @ type [ $ type ] @ max [","highlight_start":1,"highlight_end":74},{"text":"$ max ] @ vis [ $ v ] @ debug_format [ $ debug_format ] $ ( $ tokens ) * ) ; )","highlight_start":1,"highlight_end":79},{"text":"; (","highlight_start":1,"highlight_end":4},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ debug_format : tt ] $","highlight_start":1,"highlight_end":76},{"text":"name : ident = $ constant : expr ) => (","highlight_start":1,"highlight_end":40},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ name = $ constant , ) ; ) ; (","highlight_start":1,"highlight_end":72},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ _max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ debug_format : tt ] $ (","highlight_start":1,"highlight_end":79},{"text":"# [ doc = $ doc : expr ] ) * const $ name : ident = $ constant : expr ) => (","highlight_start":1,"highlight_end":77},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ ( # [ doc = $ doc ] ) * const $ name","highlight_start":1,"highlight_end":79},{"text":"= $ constant , ) ; ) ; (","highlight_start":1,"highlight_end":25},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ _max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ debug_format : tt ] MAX","highlight_start":1,"highlight_end":79},{"text":"= $ max : expr , $ ( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":46},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ ( $ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":67},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ _debug_format : tt ]","highlight_start":1,"highlight_end":75},{"text":"DEBUG_FORMAT = $ debug_format : tt , $ ( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":66},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ ( $ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":67},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ debug_format : tt ] $ (","highlight_start":1,"highlight_end":78},{"text":"# [ doc = $ doc : expr ] ) * const $ name : ident = $ constant : expr , $ (","highlight_start":1,"highlight_end":76},{"text":"$ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":25},{"text":"$ ( # [ doc = $ doc ] ) * pub const $ name : $ type = $ type :: from_u32 (","highlight_start":1,"highlight_end":75},{"text":"$ constant ) ; newtype_index ! (","highlight_start":1,"highlight_end":33},{"text":"@ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ ( $ tokens ) * ) ; ) ;","highlight_start":1,"highlight_end":65}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"newtype_index!","def_site_span":{"file_name":"<::rustc_data_structures::indexed_vec::newtype_index macros>","byte_start":0,"byte_end":7643,"line_start":1,"line_end":136,"column_start":1,"column_end":65,"is_primary":false,"text":[{"text":"( $ v : vis struct $ name : ident { .. } ) => (","highlight_start":1,"highlight_end":48},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ type [ $ name ] @ max [ 0xFFFF_FF00 ] @ vis [ $ v ] @ debug_format [ \"{}\" ]","highlight_start":1,"highlight_end":78},{"text":") ; ) ; ( $ v : vis struct $ name : ident { $ ( $ tokens : tt ) + } ) => (","highlight_start":1,"highlight_end":75},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ type [ $ name ] @ max [ 0xFFFF_FF00 ] @ vis [ $ v ] @ debug_format [ \"{}\" ]","highlight_start":1,"highlight_end":78},{"text":"$ ( $ tokens ) + ) ; ) ; (","highlight_start":1,"highlight_end":27},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ debug_format : tt ] ) =>","highlight_start":1,"highlight_end":79},{"text":"(","highlight_start":1,"highlight_end":2},{"text":"# [","highlight_start":1,"highlight_end":4},{"text":"derive (","highlight_start":1,"highlight_end":9},{"text":"Copy , Clone , PartialEq , Eq , Hash , PartialOrd , Ord , $ ( $ derives ) , *","highlight_start":1,"highlight_end":78},{"text":") ] # [ rustc_layout_scalar_valid_range_end ( $ max ) ] $ v struct $ type {","highlight_start":1,"highlight_end":76},{"text":"private : u32 } impl $ type {","highlight_start":1,"highlight_end":30},{"text":"$ v const MAX_AS_U32 : u32 = $ max ; $ v const MAX : $ type = $ type ::","highlight_start":1,"highlight_end":72},{"text":"from_u32 ( $ max ) ; # [ inline ] $ v fn from_usize ( value : usize ) -> Self","highlight_start":1,"highlight_end":78},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"assert ! ( value <= ( $ max as usize ) ) ; unsafe {","highlight_start":1,"highlight_end":52},{"text":"$ type :: from_u32_unchecked ( value as u32 ) } } # [ inline ] $ v const fn","highlight_start":1,"highlight_end":76},{"text":"from_u32 ( value : u32 ) -> Self {","highlight_start":1,"highlight_end":35},{"text":"let _ = [ \"out of range value used\" ] [ ! ( value <= $ max ) as usize ] ;","highlight_start":1,"highlight_end":74},{"text":"unsafe { $ type :: from_u32_unchecked ( value ) } } # [ inline ] $ v const","highlight_start":1,"highlight_end":75},{"text":"unsafe fn from_u32_unchecked ( value : u32 ) -> Self {","highlight_start":1,"highlight_end":55},{"text":"$ type { private : value } } /// Extract value of this index as an integer.","highlight_start":1,"highlight_end":76},{"text":" # [ inline ] $ v fn index ( self ) -> usize { self . as_usize (  ) }","highlight_start":1,"highlight_end":70},{"text":"/// Extract value of this index as a usize.","highlight_start":1,"highlight_end":44},{"text":" # [ inline ] $ v const fn as_u32 ( self ) -> u32 { self . private }","highlight_start":1,"highlight_end":69},{"text":"/// Extract value of this index as a u32.","highlight_start":1,"highlight_end":42},{"text":" # [ inline ] $ v fn as_usize ( self ) -> usize { self . as_u32 (  ) as usize","highlight_start":1,"highlight_end":78},{"text":"} } impl Idx for $ type {","highlight_start":1,"highlight_end":26},{"text":"# [ inline ] fn new ( value : usize ) -> Self { Self :: from ( value ) } # [","highlight_start":1,"highlight_end":77},{"text":"inline ] fn index ( self ) -> usize { usize :: from ( self ) } } impl :: std","highlight_start":1,"highlight_end":77},{"text":":: iter :: Step for $ type {","highlight_start":1,"highlight_end":29},{"text":"# [ inline ] fn steps_between ( start : & Self , end : & Self ) -> Option <","highlight_start":1,"highlight_end":76},{"text":"usize > {","highlight_start":1,"highlight_end":10},{"text":"< usize as :: std :: iter :: Step > :: steps_between (","highlight_start":1,"highlight_end":55},{"text":"& Idx :: index ( * start ) , & Idx :: index ( * end ) , ) } # [ inline ] fn","highlight_start":1,"highlight_end":76},{"text":"replace_one ( & mut self ) -> Self {","highlight_start":1,"highlight_end":37},{"text":":: std :: mem :: replace ( self , Self :: new ( 1 ) ) } # [ inline ] fn","highlight_start":1,"highlight_end":72},{"text":"replace_zero ( & mut self ) -> Self {","highlight_start":1,"highlight_end":38},{"text":":: std :: mem :: replace ( self , Self :: new ( 0 ) ) } # [ inline ] fn","highlight_start":1,"highlight_end":72},{"text":"add_one ( & self ) -> Self { Self :: new ( Idx :: index ( * self ) + 1 ) } # [","highlight_start":1,"highlight_end":79},{"text":"inline ] fn sub_one ( & self ) -> Self {","highlight_start":1,"highlight_end":41},{"text":"Self :: new ( Idx :: index ( * self ) - 1 ) } # [ inline ] fn add_usize (","highlight_start":1,"highlight_end":74},{"text":"& self , u : usize ) -> Option < Self > {","highlight_start":1,"highlight_end":42},{"text":"Idx :: index ( * self ) . checked_add ( u ) . map ( Self :: new ) } } impl","highlight_start":1,"highlight_end":75},{"text":"From < $ type > for u32 {","highlight_start":1,"highlight_end":26},{"text":"# [ inline ] fn from ( v : $ type ) -> u32 { v . as_u32 (  ) } } impl From < $","highlight_start":1,"highlight_end":79},{"text":"type > for usize {","highlight_start":1,"highlight_end":19},{"text":"# [ inline ] fn from ( v : $ type ) -> usize { v . as_usize (  ) } } impl From","highlight_start":1,"highlight_end":79},{"text":"< usize > for $ type {","highlight_start":1,"highlight_end":23},{"text":"# [ inline ] fn from ( value : usize ) -> Self {","highlight_start":1,"highlight_end":49},{"text":"$ type :: from_usize ( value ) } } impl From < u32 > for $ type {","highlight_start":1,"highlight_end":66},{"text":"# [ inline ] fn from ( value : u32 ) -> Self { $ type :: from_u32 ( value ) }","highlight_start":1,"highlight_end":78},{"text":"} newtype_index ! (","highlight_start":1,"highlight_end":20},{"text":"@ handle_debug @ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @","highlight_start":1,"highlight_end":69},{"text":"debug_format [ $ debug_format ] ) ; ) ; (","highlight_start":1,"highlight_end":42},{"text":"@ handle_debug @ derives [ $ ( $ _derives : ident , ) * ] @ type [","highlight_start":1,"highlight_end":67},{"text":"$ type : ident ] @ debug_format [ custom ] ) => (  ) ; (","highlight_start":1,"highlight_end":57},{"text":"@ handle_debug @ derives [  ] @ type [ $ type : ident ] @ debug_format [","highlight_start":1,"highlight_end":73},{"text":"$ debug_format : tt ] ) => (","highlight_start":1,"highlight_end":29},{"text":"impl :: std :: fmt :: Debug for $ type {","highlight_start":1,"highlight_end":41},{"text":"fn fmt ( & self , fmt : & mut :: std :: fmt :: Formatter ) -> :: std :: fmt ::","highlight_start":1,"highlight_end":79},{"text":"Result { write ! ( fmt , $ debug_format , self . as_u32 (  ) ) } } ) ; (","highlight_start":1,"highlight_end":73},{"text":"@ handle_debug @ derives [ Debug , $ ( $ derives : ident , ) * ] @ type [","highlight_start":1,"highlight_end":74},{"text":"$ type : ident ] @ debug_format [ $ debug_format : tt ] ) => (  ) ; (","highlight_start":1,"highlight_end":70},{"text":"@ handle_debug @ derives [ $ _derive : ident , $ ( $ derives : ident , ) * ] @","highlight_start":1,"highlight_end":79},{"text":"type [ $ type : ident ] @ debug_format [ $ debug_format : tt ] ) => (","highlight_start":1,"highlight_end":70},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ handle_debug @ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @","highlight_start":1,"highlight_end":69},{"text":"debug_format [ $ debug_format ] ) ; ) ; (","highlight_start":1,"highlight_end":42},{"text":"@ type [ $ type : ident ] @ max [ $ max : expr ] @ vis [ $ v : vis ] @","highlight_start":1,"highlight_end":71},{"text":"debug_format [ $ debug_format : tt ] derive [ $ ( $ derives : ident ) , * ] $","highlight_start":1,"highlight_end":78},{"text":"( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":27},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ type [ $ type ] @ max [ $ max ] @ vis [ $ v ] @ debug_format [","highlight_start":1,"highlight_end":65},{"text":"$ debug_format ] derive [ $ ( $ derives , ) * ] $ ( $ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":75},{"text":"@ type [ $ type : ident ] @ max [ $ max : expr ] @ vis [ $ v : vis ] @","highlight_start":1,"highlight_end":71},{"text":"debug_format [ $ debug_format : tt ] derive [ $ ( $ derives : ident , ) + ]","highlight_start":1,"highlight_end":76},{"text":"ENCODABLE = custom $ ( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":48},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) + ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ ( $ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":67},{"text":"@ type [ $ type : ident ] @ max [ $ max : expr ] @ vis [ $ v : vis ] @","highlight_start":1,"highlight_end":71},{"text":"debug_format [ $ debug_format : tt ] derive [ $ ( $ derives : ident , ) + ] $","highlight_start":1,"highlight_end":78},{"text":"( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":27},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) + RustcDecodable , RustcEncodable , ] @ type [","highlight_start":1,"highlight_end":77},{"text":"$ type ] @ max [ $ max ] @ vis [ $ v ] @ debug_format [ $ debug_format ] $ (","highlight_start":1,"highlight_end":77},{"text":"$ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":23},{"text":"@ type [ $ type : ident ] @ max [ $ max : expr ] @ vis [ $ v : vis ] @","highlight_start":1,"highlight_end":71},{"text":"debug_format [ $ debug_format : tt ] ENCODABLE = custom $ ( $ tokens : tt ) *","highlight_start":1,"highlight_end":78},{"text":") => (","highlight_start":1,"highlight_end":7},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [  ] @ type [ $ type ] @ max [ $ max ] @ vis [ $ v ] @ debug_format","highlight_start":1,"highlight_end":78},{"text":"[ $ debug_format ] $ ( $ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":46},{"text":"@ type [ $ type : ident ] @ max [ $ max : expr ] @ vis [ $ v : vis ] @","highlight_start":1,"highlight_end":71},{"text":"debug_format [ $ debug_format : tt ] $ ( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":66},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ RustcDecodable , RustcEncodable , ] @ type [ $ type ] @ max [","highlight_start":1,"highlight_end":74},{"text":"$ max ] @ vis [ $ v ] @ debug_format [ $ debug_format ] $ ( $ tokens ) * ) ; )","highlight_start":1,"highlight_end":79},{"text":"; (","highlight_start":1,"highlight_end":4},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ debug_format : tt ] $","highlight_start":1,"highlight_end":76},{"text":"name : ident = $ constant : expr ) => (","highlight_start":1,"highlight_end":40},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ name = $ constant , ) ; ) ; (","highlight_start":1,"highlight_end":72},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ _max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ debug_format : tt ] $ (","highlight_start":1,"highlight_end":79},{"text":"# [ doc = $ doc : expr ] ) * const $ name : ident = $ constant : expr ) => (","highlight_start":1,"highlight_end":77},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ ( # [ doc = $ doc ] ) * const $ name","highlight_start":1,"highlight_end":79},{"text":"= $ constant , ) ; ) ; (","highlight_start":1,"highlight_end":25},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ _max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ debug_format : tt ] MAX","highlight_start":1,"highlight_end":79},{"text":"= $ max : expr , $ ( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":46},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ ( $ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":67},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ _debug_format : tt ]","highlight_start":1,"highlight_end":75},{"text":"DEBUG_FORMAT = $ debug_format : tt , $ ( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":66},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ ( $ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":67},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ debug_format : tt ] $ (","highlight_start":1,"highlight_end":78},{"text":"# [ doc = $ doc : expr ] ) * const $ name : ident = $ constant : expr , $ (","highlight_start":1,"highlight_end":76},{"text":"$ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":25},{"text":"$ ( # [ doc = $ doc ] ) * pub const $ name : $ type = $ type :: from_u32 (","highlight_start":1,"highlight_end":75},{"text":"$ constant ) ; newtype_index ! (","highlight_start":1,"highlight_end":33},{"text":"@ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ ( $ tokens ) * ) ; ) ;","highlight_start":1,"highlight_end":65}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"newtype_index!","def_site_span":{"file_name":"<::rustc_data_structures::indexed_vec::newtype_index macros>","byte_start":0,"byte_end":7643,"line_start":1,"line_end":136,"column_start":1,"column_end":65,"is_primary":false,"text":[{"text":"( $ v : vis struct $ name : ident { .. } ) => (","highlight_start":1,"highlight_end":48},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ type [ $ name ] @ max [ 0xFFFF_FF00 ] @ vis [ $ v ] @ debug_format [ \"{}\" ]","highlight_start":1,"highlight_end":78},{"text":") ; ) ; ( $ v : vis struct $ name : ident { $ ( $ tokens : tt ) + } ) => (","highlight_start":1,"highlight_end":75},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ type [ $ name ] @ max [ 0xFFFF_FF00 ] @ vis [ $ v ] @ debug_format [ \"{}\" ]","highlight_start":1,"highlight_end":78},{"text":"$ ( $ tokens ) + ) ; ) ; (","highlight_start":1,"highlight_end":27},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ debug_format : tt ] ) =>","highlight_start":1,"highlight_end":79},{"text":"(","highlight_start":1,"highlight_end":2},{"text":"# [","highlight_start":1,"highlight_end":4},{"text":"derive (","highlight_start":1,"highlight_end":9},{"text":"Copy , Clone , PartialEq , Eq , Hash , PartialOrd , Ord , $ ( $ derives ) , *","highlight_start":1,"highlight_end":78},{"text":") ] # [ rustc_layout_scalar_valid_range_end ( $ max ) ] $ v struct $ type {","highlight_start":1,"highlight_end":76},{"text":"private : u32 } impl $ type {","highlight_start":1,"highlight_end":30},{"text":"$ v const MAX_AS_U32 : u32 = $ max ; $ v const MAX : $ type = $ type ::","highlight_start":1,"highlight_end":72},{"text":"from_u32 ( $ max ) ; # [ inline ] $ v fn from_usize ( value : usize ) -> Self","highlight_start":1,"highlight_end":78},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"assert ! ( value <= ( $ max as usize ) ) ; unsafe {","highlight_start":1,"highlight_end":52},{"text":"$ type :: from_u32_unchecked ( value as u32 ) } } # [ inline ] $ v const fn","highlight_start":1,"highlight_end":76},{"text":"from_u32 ( value : u32 ) -> Self {","highlight_start":1,"highlight_end":35},{"text":"let _ = [ \"out of range value used\" ] [ ! ( value <= $ max ) as usize ] ;","highlight_start":1,"highlight_end":74},{"text":"unsafe { $ type :: from_u32_unchecked ( value ) } } # [ inline ] $ v const","highlight_start":1,"highlight_end":75},{"text":"unsafe fn from_u32_unchecked ( value : u32 ) -> Self {","highlight_start":1,"highlight_end":55},{"text":"$ type { private : value } } /// Extract value of this index as an integer.","highlight_start":1,"highlight_end":76},{"text":" # [ inline ] $ v fn index ( self ) -> usize { self . as_usize (  ) }","highlight_start":1,"highlight_end":70},{"text":"/// Extract value of this index as a usize.","highlight_start":1,"highlight_end":44},{"text":" # [ inline ] $ v const fn as_u32 ( self ) -> u32 { self . private }","highlight_start":1,"highlight_end":69},{"text":"/// Extract value of this index as a u32.","highlight_start":1,"highlight_end":42},{"text":" # [ inline ] $ v fn as_usize ( self ) -> usize { self . as_u32 (  ) as usize","highlight_start":1,"highlight_end":78},{"text":"} } impl Idx for $ type {","highlight_start":1,"highlight_end":26},{"text":"# [ inline ] fn new ( value : usize ) -> Self { Self :: from ( value ) } # [","highlight_start":1,"highlight_end":77},{"text":"inline ] fn index ( self ) -> usize { usize :: from ( self ) } } impl :: std","highlight_start":1,"highlight_end":77},{"text":":: iter :: Step for $ type {","highlight_start":1,"highlight_end":29},{"text":"# [ inline ] fn steps_between ( start : & Self , end : & Self ) -> Option <","highlight_start":1,"highlight_end":76},{"text":"usize > {","highlight_start":1,"highlight_end":10},{"text":"< usize as :: std :: iter :: Step > :: steps_between (","highlight_start":1,"highlight_end":55},{"text":"& Idx :: index ( * start ) , & Idx :: index ( * end ) , ) } # [ inline ] fn","highlight_start":1,"highlight_end":76},{"text":"replace_one ( & mut self ) -> Self {","highlight_start":1,"highlight_end":37},{"text":":: std :: mem :: replace ( self , Self :: new ( 1 ) ) } # [ inline ] fn","highlight_start":1,"highlight_end":72},{"text":"replace_zero ( & mut self ) -> Self {","highlight_start":1,"highlight_end":38},{"text":":: std :: mem :: replace ( self , Self :: new ( 0 ) ) } # [ inline ] fn","highlight_start":1,"highlight_end":72},{"text":"add_one ( & self ) -> Self { Self :: new ( Idx :: index ( * self ) + 1 ) } # [","highlight_start":1,"highlight_end":79},{"text":"inline ] fn sub_one ( & self ) -> Self {","highlight_start":1,"highlight_end":41},{"text":"Self :: new ( Idx :: index ( * self ) - 1 ) } # [ inline ] fn add_usize (","highlight_start":1,"highlight_end":74},{"text":"& self , u : usize ) -> Option < Self > {","highlight_start":1,"highlight_end":42},{"text":"Idx :: index ( * self ) . checked_add ( u ) . map ( Self :: new ) } } impl","highlight_start":1,"highlight_end":75},{"text":"From < $ type > for u32 {","highlight_start":1,"highlight_end":26},{"text":"# [ inline ] fn from ( v : $ type ) -> u32 { v . as_u32 (  ) } } impl From < $","highlight_start":1,"highlight_end":79},{"text":"type > for usize {","highlight_start":1,"highlight_end":19},{"text":"# [ inline ] fn from ( v : $ type ) -> usize { v . as_usize (  ) } } impl From","highlight_start":1,"highlight_end":79},{"text":"< usize > for $ type {","highlight_start":1,"highlight_end":23},{"text":"# [ inline ] fn from ( value : usize ) -> Self {","highlight_start":1,"highlight_end":49},{"text":"$ type :: from_usize ( value ) } } impl From < u32 > for $ type {","highlight_start":1,"highlight_end":66},{"text":"# [ inline ] fn from ( value : u32 ) -> Self { $ type :: from_u32 ( value ) }","highlight_start":1,"highlight_end":78},{"text":"} newtype_index ! (","highlight_start":1,"highlight_end":20},{"text":"@ handle_debug @ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @","highlight_start":1,"highlight_end":69},{"text":"debug_format [ $ debug_format ] ) ; ) ; (","highlight_start":1,"highlight_end":42},{"text":"@ handle_debug @ derives [ $ ( $ _derives : ident , ) * ] @ type [","highlight_start":1,"highlight_end":67},{"text":"$ type : ident ] @ debug_format [ custom ] ) => (  ) ; (","highlight_start":1,"highlight_end":57},{"text":"@ handle_debug @ derives [  ] @ type [ $ type : ident ] @ debug_format [","highlight_start":1,"highlight_end":73},{"text":"$ debug_format : tt ] ) => (","highlight_start":1,"highlight_end":29},{"text":"impl :: std :: fmt :: Debug for $ type {","highlight_start":1,"highlight_end":41},{"text":"fn fmt ( & self , fmt : & mut :: std :: fmt :: Formatter ) -> :: std :: fmt ::","highlight_start":1,"highlight_end":79},{"text":"Result { write ! ( fmt , $ debug_format , self . as_u32 (  ) ) } } ) ; (","highlight_start":1,"highlight_end":73},{"text":"@ handle_debug @ derives [ Debug , $ ( $ derives : ident , ) * ] @ type [","highlight_start":1,"highlight_end":74},{"text":"$ type : ident ] @ debug_format [ $ debug_format : tt ] ) => (  ) ; (","highlight_start":1,"highlight_end":70},{"text":"@ handle_debug @ derives [ $ _derive : ident , $ ( $ derives : ident , ) * ] @","highlight_start":1,"highlight_end":79},{"text":"type [ $ type : ident ] @ debug_format [ $ debug_format : tt ] ) => (","highlight_start":1,"highlight_end":70},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ handle_debug @ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @","highlight_start":1,"highlight_end":69},{"text":"debug_format [ $ debug_format ] ) ; ) ; (","highlight_start":1,"highlight_end":42},{"text":"@ type [ $ type : ident ] @ max [ $ max : expr ] @ vis [ $ v : vis ] @","highlight_start":1,"highlight_end":71},{"text":"debug_format [ $ debug_format : tt ] derive [ $ ( $ derives : ident ) , * ] $","highlight_start":1,"highlight_end":78},{"text":"( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":27},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ type [ $ type ] @ max [ $ max ] @ vis [ $ v ] @ debug_format [","highlight_start":1,"highlight_end":65},{"text":"$ debug_format ] derive [ $ ( $ derives , ) * ] $ ( $ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":75},{"text":"@ type [ $ type : ident ] @ max [ $ max : expr ] @ vis [ $ v : vis ] @","highlight_start":1,"highlight_end":71},{"text":"debug_format [ $ debug_format : tt ] derive [ $ ( $ derives : ident , ) + ]","highlight_start":1,"highlight_end":76},{"text":"ENCODABLE = custom $ ( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":48},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) + ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ ( $ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":67},{"text":"@ type [ $ type : ident ] @ max [ $ max : expr ] @ vis [ $ v : vis ] @","highlight_start":1,"highlight_end":71},{"text":"debug_format [ $ debug_format : tt ] derive [ $ ( $ derives : ident , ) + ] $","highlight_start":1,"highlight_end":78},{"text":"( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":27},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) + RustcDecodable , RustcEncodable , ] @ type [","highlight_start":1,"highlight_end":77},{"text":"$ type ] @ max [ $ max ] @ vis [ $ v ] @ debug_format [ $ debug_format ] $ (","highlight_start":1,"highlight_end":77},{"text":"$ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":23},{"text":"@ type [ $ type : ident ] @ max [ $ max : expr ] @ vis [ $ v : vis ] @","highlight_start":1,"highlight_end":71},{"text":"debug_format [ $ debug_format : tt ] ENCODABLE = custom $ ( $ tokens : tt ) *","highlight_start":1,"highlight_end":78},{"text":") => (","highlight_start":1,"highlight_end":7},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [  ] @ type [ $ type ] @ max [ $ max ] @ vis [ $ v ] @ debug_format","highlight_start":1,"highlight_end":78},{"text":"[ $ debug_format ] $ ( $ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":46},{"text":"@ type [ $ type : ident ] @ max [ $ max : expr ] @ vis [ $ v : vis ] @","highlight_start":1,"highlight_end":71},{"text":"debug_format [ $ debug_format : tt ] $ ( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":66},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ RustcDecodable , RustcEncodable , ] @ type [ $ type ] @ max [","highlight_start":1,"highlight_end":74},{"text":"$ max ] @ vis [ $ v ] @ debug_format [ $ debug_format ] $ ( $ tokens ) * ) ; )","highlight_start":1,"highlight_end":79},{"text":"; (","highlight_start":1,"highlight_end":4},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ debug_format : tt ] $","highlight_start":1,"highlight_end":76},{"text":"name : ident = $ constant : expr ) => (","highlight_start":1,"highlight_end":40},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ name = $ constant , ) ; ) ; (","highlight_start":1,"highlight_end":72},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ _max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ debug_format : tt ] $ (","highlight_start":1,"highlight_end":79},{"text":"# [ doc = $ doc : expr ] ) * const $ name : ident = $ constant : expr ) => (","highlight_start":1,"highlight_end":77},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ ( # [ doc = $ doc ] ) * const $ name","highlight_start":1,"highlight_end":79},{"text":"= $ constant , ) ; ) ; (","highlight_start":1,"highlight_end":25},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ _max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ debug_format : tt ] MAX","highlight_start":1,"highlight_end":79},{"text":"= $ max : expr , $ ( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":46},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ ( $ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":67},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ _debug_format : tt ]","highlight_start":1,"highlight_end":75},{"text":"DEBUG_FORMAT = $ debug_format : tt , $ ( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":66},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ ( $ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":67},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ debug_format : tt ] $ (","highlight_start":1,"highlight_end":78},{"text":"# [ doc = $ doc : expr ] ) * const $ name : ident = $ constant : expr , $ (","highlight_start":1,"highlight_end":76},{"text":"$ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":25},{"text":"$ ( # [ doc = $ doc ] ) * pub const $ name : $ type = $ type :: from_u32 (","highlight_start":1,"highlight_end":75},{"text":"$ constant ) ; newtype_index ! (","highlight_start":1,"highlight_end":33},{"text":"@ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ ( $ tokens ) * ) ; ) ;","highlight_start":1,"highlight_end":65}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"newtype_index!","def_site_span":{"file_name":"<::rustc_data_structures::indexed_vec::newtype_index macros>","byte_start":0,"byte_end":7643,"line_start":1,"line_end":136,"column_start":1,"column_end":65,"is_primary":false,"text":[{"text":"( $ v : vis struct $ name : ident { .. } ) => (","highlight_start":1,"highlight_end":48},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ type [ $ name ] @ max [ 0xFFFF_FF00 ] @ vis [ $ v ] @ debug_format [ \"{}\" ]","highlight_start":1,"highlight_end":78},{"text":") ; ) ; ( $ v : vis struct $ name : ident { $ ( $ tokens : tt ) + } ) => (","highlight_start":1,"highlight_end":75},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ type [ $ name ] @ max [ 0xFFFF_FF00 ] @ vis [ $ v ] @ debug_format [ \"{}\" ]","highlight_start":1,"highlight_end":78},{"text":"$ ( $ tokens ) + ) ; ) ; (","highlight_start":1,"highlight_end":27},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ debug_format : tt ] ) =>","highlight_start":1,"highlight_end":79},{"text":"(","highlight_start":1,"highlight_end":2},{"text":"# [","highlight_start":1,"highlight_end":4},{"text":"derive (","highlight_start":1,"highlight_end":9},{"text":"Copy , Clone , PartialEq , Eq , Hash , PartialOrd , Ord , $ ( $ derives ) , *","highlight_start":1,"highlight_end":78},{"text":") ] # [ rustc_layout_scalar_valid_range_end ( $ max ) ] $ v struct $ type {","highlight_start":1,"highlight_end":76},{"text":"private : u32 } impl $ type {","highlight_start":1,"highlight_end":30},{"text":"$ v const MAX_AS_U32 : u32 = $ max ; $ v const MAX : $ type = $ type ::","highlight_start":1,"highlight_end":72},{"text":"from_u32 ( $ max ) ; # [ inline ] $ v fn from_usize ( value : usize ) -> Self","highlight_start":1,"highlight_end":78},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"assert ! ( value <= ( $ max as usize ) ) ; unsafe {","highlight_start":1,"highlight_end":52},{"text":"$ type :: from_u32_unchecked ( value as u32 ) } } # [ inline ] $ v const fn","highlight_start":1,"highlight_end":76},{"text":"from_u32 ( value : u32 ) -> Self {","highlight_start":1,"highlight_end":35},{"text":"let _ = [ \"out of range value used\" ] [ ! ( value <= $ max ) as usize ] ;","highlight_start":1,"highlight_end":74},{"text":"unsafe { $ type :: from_u32_unchecked ( value ) } } # [ inline ] $ v const","highlight_start":1,"highlight_end":75},{"text":"unsafe fn from_u32_unchecked ( value : u32 ) -> Self {","highlight_start":1,"highlight_end":55},{"text":"$ type { private : value } } /// Extract value of this index as an integer.","highlight_start":1,"highlight_end":76},{"text":" # [ inline ] $ v fn index ( self ) -> usize { self . as_usize (  ) }","highlight_start":1,"highlight_end":70},{"text":"/// Extract value of this index as a usize.","highlight_start":1,"highlight_end":44},{"text":" # [ inline ] $ v const fn as_u32 ( self ) -> u32 { self . private }","highlight_start":1,"highlight_end":69},{"text":"/// Extract value of this index as a u32.","highlight_start":1,"highlight_end":42},{"text":" # [ inline ] $ v fn as_usize ( self ) -> usize { self . as_u32 (  ) as usize","highlight_start":1,"highlight_end":78},{"text":"} } impl Idx for $ type {","highlight_start":1,"highlight_end":26},{"text":"# [ inline ] fn new ( value : usize ) -> Self { Self :: from ( value ) } # [","highlight_start":1,"highlight_end":77},{"text":"inline ] fn index ( self ) -> usize { usize :: from ( self ) } } impl :: std","highlight_start":1,"highlight_end":77},{"text":":: iter :: Step for $ type {","highlight_start":1,"highlight_end":29},{"text":"# [ inline ] fn steps_between ( start : & Self , end : & Self ) -> Option <","highlight_start":1,"highlight_end":76},{"text":"usize > {","highlight_start":1,"highlight_end":10},{"text":"< usize as :: std :: iter :: Step > :: steps_between (","highlight_start":1,"highlight_end":55},{"text":"& Idx :: index ( * start ) , & Idx :: index ( * end ) , ) } # [ inline ] fn","highlight_start":1,"highlight_end":76},{"text":"replace_one ( & mut self ) -> Self {","highlight_start":1,"highlight_end":37},{"text":":: std :: mem :: replace ( self , Self :: new ( 1 ) ) } # [ inline ] fn","highlight_start":1,"highlight_end":72},{"text":"replace_zero ( & mut self ) -> Self {","highlight_start":1,"highlight_end":38},{"text":":: std :: mem :: replace ( self , Self :: new ( 0 ) ) } # [ inline ] fn","highlight_start":1,"highlight_end":72},{"text":"add_one ( & self ) -> Self { Self :: new ( Idx :: index ( * self ) + 1 ) } # [","highlight_start":1,"highlight_end":79},{"text":"inline ] fn sub_one ( & self ) -> Self {","highlight_start":1,"highlight_end":41},{"text":"Self :: new ( Idx :: index ( * self ) - 1 ) } # [ inline ] fn add_usize (","highlight_start":1,"highlight_end":74},{"text":"& self , u : usize ) -> Option < Self > {","highlight_start":1,"highlight_end":42},{"text":"Idx :: index ( * self ) . checked_add ( u ) . map ( Self :: new ) } } impl","highlight_start":1,"highlight_end":75},{"text":"From < $ type > for u32 {","highlight_start":1,"highlight_end":26},{"text":"# [ inline ] fn from ( v : $ type ) -> u32 { v . as_u32 (  ) } } impl From < $","highlight_start":1,"highlight_end":79},{"text":"type > for usize {","highlight_start":1,"highlight_end":19},{"text":"# [ inline ] fn from ( v : $ type ) -> usize { v . as_usize (  ) } } impl From","highlight_start":1,"highlight_end":79},{"text":"< usize > for $ type {","highlight_start":1,"highlight_end":23},{"text":"# [ inline ] fn from ( value : usize ) -> Self {","highlight_start":1,"highlight_end":49},{"text":"$ type :: from_usize ( value ) } } impl From < u32 > for $ type {","highlight_start":1,"highlight_end":66},{"text":"# [ inline ] fn from ( value : u32 ) -> Self { $ type :: from_u32 ( value ) }","highlight_start":1,"highlight_end":78},{"text":"} newtype_index ! (","highlight_start":1,"highlight_end":20},{"text":"@ handle_debug @ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @","highlight_start":1,"highlight_end":69},{"text":"debug_format [ $ debug_format ] ) ; ) ; (","highlight_start":1,"highlight_end":42},{"text":"@ handle_debug @ derives [ $ ( $ _derives : ident , ) * ] @ type [","highlight_start":1,"highlight_end":67},{"text":"$ type : ident ] @ debug_format [ custom ] ) => (  ) ; (","highlight_start":1,"highlight_end":57},{"text":"@ handle_debug @ derives [  ] @ type [ $ type : ident ] @ debug_format [","highlight_start":1,"highlight_end":73},{"text":"$ debug_format : tt ] ) => (","highlight_start":1,"highlight_end":29},{"text":"impl :: std :: fmt :: Debug for $ type {","highlight_start":1,"highlight_end":41},{"text":"fn fmt ( & self , fmt : & mut :: std :: fmt :: Formatter ) -> :: std :: fmt ::","highlight_start":1,"highlight_end":79},{"text":"Result { write ! ( fmt , $ debug_format , self . as_u32 (  ) ) } } ) ; (","highlight_start":1,"highlight_end":73},{"text":"@ handle_debug @ derives [ Debug , $ ( $ derives : ident , ) * ] @ type [","highlight_start":1,"highlight_end":74},{"text":"$ type : ident ] @ debug_format [ $ debug_format : tt ] ) => (  ) ; (","highlight_start":1,"highlight_end":70},{"text":"@ handle_debug @ derives [ $ _derive : ident , $ ( $ derives : ident , ) * ] @","highlight_start":1,"highlight_end":79},{"text":"type [ $ type : ident ] @ debug_format [ $ debug_format : tt ] ) => (","highlight_start":1,"highlight_end":70},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ handle_debug @ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @","highlight_start":1,"highlight_end":69},{"text":"debug_format [ $ debug_format ] ) ; ) ; (","highlight_start":1,"highlight_end":42},{"text":"@ type [ $ type : ident ] @ max [ $ max : expr ] @ vis [ $ v : vis ] @","highlight_start":1,"highlight_end":71},{"text":"debug_format [ $ debug_format : tt ] derive [ $ ( $ derives : ident ) , * ] $","highlight_start":1,"highlight_end":78},{"text":"( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":27},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ type [ $ type ] @ max [ $ max ] @ vis [ $ v ] @ debug_format [","highlight_start":1,"highlight_end":65},{"text":"$ debug_format ] derive [ $ ( $ derives , ) * ] $ ( $ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":75},{"text":"@ type [ $ type : ident ] @ max [ $ max : expr ] @ vis [ $ v : vis ] @","highlight_start":1,"highlight_end":71},{"text":"debug_format [ $ debug_format : tt ] derive [ $ ( $ derives : ident , ) + ]","highlight_start":1,"highlight_end":76},{"text":"ENCODABLE = custom $ ( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":48},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) + ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ ( $ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":67},{"text":"@ type [ $ type : ident ] @ max [ $ max : expr ] @ vis [ $ v : vis ] @","highlight_start":1,"highlight_end":71},{"text":"debug_format [ $ debug_format : tt ] derive [ $ ( $ derives : ident , ) + ] $","highlight_start":1,"highlight_end":78},{"text":"( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":27},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) + RustcDecodable , RustcEncodable , ] @ type [","highlight_start":1,"highlight_end":77},{"text":"$ type ] @ max [ $ max ] @ vis [ $ v ] @ debug_format [ $ debug_format ] $ (","highlight_start":1,"highlight_end":77},{"text":"$ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":23},{"text":"@ type [ $ type : ident ] @ max [ $ max : expr ] @ vis [ $ v : vis ] @","highlight_start":1,"highlight_end":71},{"text":"debug_format [ $ debug_format : tt ] ENCODABLE = custom $ ( $ tokens : tt ) *","highlight_start":1,"highlight_end":78},{"text":") => (","highlight_start":1,"highlight_end":7},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [  ] @ type [ $ type ] @ max [ $ max ] @ vis [ $ v ] @ debug_format","highlight_start":1,"highlight_end":78},{"text":"[ $ debug_format ] $ ( $ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":46},{"text":"@ type [ $ type : ident ] @ max [ $ max : expr ] @ vis [ $ v : vis ] @","highlight_start":1,"highlight_end":71},{"text":"debug_format [ $ debug_format : tt ] $ ( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":66},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ RustcDecodable , RustcEncodable , ] @ type [ $ type ] @ max [","highlight_start":1,"highlight_end":74},{"text":"$ max ] @ vis [ $ v ] @ debug_format [ $ debug_format ] $ ( $ tokens ) * ) ; )","highlight_start":1,"highlight_end":79},{"text":"; (","highlight_start":1,"highlight_end":4},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ debug_format : tt ] $","highlight_start":1,"highlight_end":76},{"text":"name : ident = $ constant : expr ) => (","highlight_start":1,"highlight_end":40},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ name = $ constant , ) ; ) ; (","highlight_start":1,"highlight_end":72},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ _max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ debug_format : tt ] $ (","highlight_start":1,"highlight_end":79},{"text":"# [ doc = $ doc : expr ] ) * const $ name : ident = $ constant : expr ) => (","highlight_start":1,"highlight_end":77},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ ( # [ doc = $ doc ] ) * const $ name","highlight_start":1,"highlight_end":79},{"text":"= $ constant , ) ; ) ; (","highlight_start":1,"highlight_end":25},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ _max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ debug_format : tt ] MAX","highlight_start":1,"highlight_end":79},{"text":"= $ max : expr , $ ( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":46},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ ( $ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":67},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ _debug_format : tt ]","highlight_start":1,"highlight_end":75},{"text":"DEBUG_FORMAT = $ debug_format : tt , $ ( $ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":66},{"text":"newtype_index ! (","highlight_start":1,"highlight_end":18},{"text":"@ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ ( $ tokens ) * ) ; ) ; (","highlight_start":1,"highlight_end":67},{"text":"@ derives [ $ ( $ derives : ident , ) * ] @ type [ $ type : ident ] @ max [","highlight_start":1,"highlight_end":76},{"text":"$ max : expr ] @ vis [ $ v : vis ] @ debug_format [ $ debug_format : tt ] $ (","highlight_start":1,"highlight_end":78},{"text":"# [ doc = $ doc : expr ] ) * const $ name : ident = $ constant : expr , $ (","highlight_start":1,"highlight_end":76},{"text":"$ tokens : tt ) * ) => (","highlight_start":1,"highlight_end":25},{"text":"$ ( # [ doc = $ doc ] ) * pub const $ name : $ type = $ type :: from_u32 (","highlight_start":1,"highlight_end":75},{"text":"$ constant ) ; newtype_index ! (","highlight_start":1,"highlight_end":33},{"text":"@ derives [ $ ( $ derives , ) * ] @ type [ $ type ] @ max [ $ max ] @ vis [","highlight_start":1,"highlight_end":76},{"text":"$ v ] @ debug_format [ $ debug_format ] $ ( $ tokens ) * ) ; ) ;","highlight_start":1,"highlight_end":65}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[{"message":"consult the function's documentation for information on how to avoid undefined behavior","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error: call to unsafe function is unsafe and unsafe operations are not allowed in const fn\n  --> /checkout/src/test/run-pass-fulldeps/newtype_index.rs:8:1\n   |\nLL | newtype_index!(struct MyIdx { MAX = 0xFFFF_FFFA });\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function\n   |\n   = note: consult the function's documentation for information on how to avoid undefined behavior\n   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)\n\n"}
[01:18:40] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[01:18:40] ------------------------------------------
[01:18:40] 
[01:18:40] thread '[run-pass] run-pass-fulldeps/newtype_index.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3282:9
[01:18:40] note: Run with `RUST_BACKTRACE=1` for a backtrace.
---
[01:18:40] test result: FAILED. 96 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
[01:18:40] 
[01:18:40] 
[01:18:40] 
[01:18:40] 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/run-pass-fulldeps" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "run-pass" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-5.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options " "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "5.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:18:40] 
[01:18:40] 
[01:18:40] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:18:40] Build completed unsuccessfully in 0:27:16
[01:18:40] Build completed unsuccessfully in 0:27:16
[01:18:40] make: *** [check] Error 1
[01:18:40] Makefile:58: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:18bf0fde
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Mon Nov 12 00:02:56 UTC 2018
---
travis_time:end:1c475b88:start=1541980980272670216,finish=1541980980280568063,duration=7897847
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:054ee110
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!check

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)

@oli-obk
Copy link
Contributor

oli-obk commented Nov 12, 2018

A test in run-pass-fulldeps is failing (it is testing the internal rustc API, so there's probably a call to from_u32_const left.

@JamesHinshelwood
Copy link
Contributor Author

Yep, will check it out. Weird that this didn't fail locally though.

@oli-obk
Copy link
Contributor

oli-obk commented Nov 12, 2018

did you run x.py test all the way through? These tests happen pretty late. You can directly run them with x.py test src/test/run-pass-fulldeps

@rust-highfive
Copy link
Collaborator

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

Click to expand the log.
travis_time:end:081d6492:start=1542128310448860848,finish=1542129313293672947,duration=1002844812099
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0
---
[00:09:14]    Compiling syntax_pos v0.0.0 (/checkout/src/libsyntax_pos)
[00:09:17] error: build failed
[00:09:17] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:09:17] expected success, got: exit code: 101
[00:09:17] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1101:9
[00:09:17] travis_fold:end:stage0-rustc

[00:09:17] travis_time:end:stage0-rustc:start=1542129836854469445,finish=1542129881272278727,duration=44417809282


[00:09:17] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:09:17] Build completed unsuccessfully in 0:01:47
[00:09:17] Makefile:28: recipe for target 'all' failed
[00:09:17] make: *** [all] Error 1

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)

@bors
Copy link
Contributor

bors commented Nov 13, 2018

☔ The latest upstream changes (presumably #55356) made this pull request unmergeable. Please resolve the merge conflicts.

@Dylan-DPC-zz
Copy link

pinging from triage. @JamesHinshelwood You have a few failures and conflicts to address. Any updates?

@Dylan-DPC-zz
Copy link

pinging from triage @JamesHinshelwood Unfortunately we haven't heard from you on this in a while, so I'm closing the PR to keep things tidy. Don't worry though, if you'll have time again in the future please reopen this PR, we'll be happy to review it again!

@Dylan-DPC-zz Dylan-DPC-zz added S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants