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

Improve diagnostics for Precise Capture #81062

Merged
merged 4 commits into from
Jan 28, 2021

Conversation

ChrisPardy
Copy link
Member

This is just the capture analysis part and borrow checker logging will updated as part of rust-lang/project-rfc-2229#8

Closes rust-lang/project-rfc-2229#22

@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 @davidtwco (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 Jan 16, 2021
@rust-log-analyzer
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
configure: rust.channel         := nightly
configure: rust.debug-assertions := True
configure: llvm.assertions      := True
configure: dist.missing-tools   := True
configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
configure: writing `config.toml` in current directory
configure: 
configure: run `python /checkout/x.py --help`
configure: 
---
Checking which error codes lack tests...
Found 435 error codes
Found 0 error codes with no tests
Done!
tidy error: /checkout/src/test/ui/closures/2229_closure_analysis/capture-analysis-2.rs: leading newline
tidy error: /checkout/src/test/ui/closures/2229_closure_analysis/capture-analysis-2.rs: missing trailing newline
tidy error: /checkout/src/test/ui/closures/2229_closure_analysis/capture-analysis-1.rs: leading newline
tidy error: /checkout/src/test/ui/closures/2229_closure_analysis/capture-analysis-1.rs: missing trailing newline
tidy error: /checkout/src/test/ui/closures/2229_closure_analysis/deep-multilevel-tuple.rs: leading newline
some tidy checks failed

command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "/checkout/obj/build"
expected success, got: exit code: 1

@ChrisPardy
Copy link
Member Author

r? nikomatsakis

@arora-aman
Copy link
Member

r? @nikomatsakis

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-9 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
.................................................................................................... 900/11263
.................................................................................................... 1000/11263
............................................i....................................................... 1100/11263
.................................................................................................... 1200/11263
.....................................F..F.F......................................................... 1300/11263
.................................................................................................... 1500/11263
.................................................................................................... 1600/11263
.................................................................................................... 1700/11263
.................................................................................................... 1800/11263
---
......................................................i............................................. 11200/11263
...............................................................
failures:

---- [ui] ui/closures/2229_closure_analysis/capture-analysis-1.rs stdout ----

1 error[E0658]: attributes on expressions are experimental
-   --> $DIR/capture-analysis-1.rs:18:13
+   --> $DIR/capture-analysis-1.rs:17:13
+   --> $DIR/capture-analysis-1.rs:17:13
3    |
4 LL |     let c = #[rustc_capture_analysis]


8    = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
9 
10 warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
-   --> $DIR/capture-analysis-1.rs:2:12
+   --> $DIR/capture-analysis-1.rs:1:12
12    |
13 LL | #![feature(capture_disjoint_fields)]

17    = note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
18 
18 
19 error: First Pass analysis includes:
-   --> $DIR/capture-analysis-1.rs:21:5
+   --> $DIR/capture-analysis-1.rs:20:5
22 LL | /     || {
23 LL | |

29    | |_____^
29    | |_____^
30    |
31 note: Capturing p[] -> ImmBorrow
-   --> $DIR/capture-analysis-1.rs:24:26
+   --> $DIR/capture-analysis-1.rs:23:26
33    |
34 LL |         println!("{:?}", p);


36 note: Capturing p[(0, 0)] -> ImmBorrow
-   --> $DIR/capture-analysis-1.rs:27:26
+   --> $DIR/capture-analysis-1.rs:26:26
38    |
39 LL |         println!("{:?}", p.x);


41 note: Capturing q[(0, 0)] -> ImmBorrow
-   --> $DIR/capture-analysis-1.rs:30:26
+   --> $DIR/capture-analysis-1.rs:29:26
43    |
44 LL |         println!("{:?}", q.x);


46 note: Capturing q[] -> ImmBorrow
-   --> $DIR/capture-analysis-1.rs:32:26
+   --> $DIR/capture-analysis-1.rs:31:26
48    |
49 LL |         println!("{:?}", q);

51 
51 
52 error: Min Capture analysis includes:
-   --> $DIR/capture-analysis-1.rs:21:5
+   --> $DIR/capture-analysis-1.rs:20:5
55 LL | /     || {
56 LL | |

62    | |_____^
62    | |_____^
63    |
64 note: Min Capture p[] -> ImmBorrow
-   --> $DIR/capture-analysis-1.rs:24:26
+   --> $DIR/capture-analysis-1.rs:23:26
66    |
67 LL |         println!("{:?}", p);


69 note: Min Capture q[] -> ImmBorrow
-   --> $DIR/capture-analysis-1.rs:32:26
+   --> $DIR/capture-analysis-1.rs:31:26
71    |
72 LL |         println!("{:?}", q);


The actual stderr differed from the expected stderr.
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/closures/2229_closure_analysis/capture-analysis-1/capture-analysis-1.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args closures/2229_closure_analysis/capture-analysis-1.rs`
error: 1 errors occurred comparing output.
status: exit code: 1
status: exit code: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/closures/2229_closure_analysis/capture-analysis-1.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zemit-future-incompat-report" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/closures/2229_closure_analysis/capture-analysis-1" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/closures/2229_closure_analysis/capture-analysis-1/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error[E0658]: attributes on expressions are experimental
  --> /checkout/src/test/ui/closures/2229_closure_analysis/capture-analysis-1.rs:17:13
   |
LL |     let c = #[rustc_capture_analysis]
   |
   = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
   = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
   = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable

warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
  --> /checkout/src/test/ui/closures/2229_closure_analysis/capture-analysis-1.rs:1:12
   |
LL | #![feature(capture_disjoint_fields)]
   |
   = note: `#[warn(incomplete_features)]` on by default
   = note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information


error: First Pass analysis includes:
  --> /checkout/src/test/ui/closures/2229_closure_analysis/capture-analysis-1.rs:20:5
LL | /     || {
LL | /     || {
LL | |     //~^ First Pass analysis includes:
LL | |     //~| Min Capture analysis includes:
LL | |         println!("{:?}", p);
...  |
LL | |         //~| NOTE: Min Capture q[] -> ImmBorrow
LL | |     };
   |
   |
note: Capturing p[] -> ImmBorrow
  --> /checkout/src/test/ui/closures/2229_closure_analysis/capture-analysis-1.rs:23:26
   |
LL |         println!("{:?}", p);
   |                          ^
note: Capturing p[(0, 0)] -> ImmBorrow
  --> /checkout/src/test/ui/closures/2229_closure_analysis/capture-analysis-1.rs:26:26
   |
LL |         println!("{:?}", p.x);
   |                          ^^^
note: Capturing q[(0, 0)] -> ImmBorrow
  --> /checkout/src/test/ui/closures/2229_closure_analysis/capture-analysis-1.rs:29:26
   |
LL |         println!("{:?}", q.x);
   |                          ^^^
note: Capturing q[] -> ImmBorrow
  --> /checkout/src/test/ui/closures/2229_closure_analysis/capture-analysis-1.rs:31:26
   |
LL |         println!("{:?}", q);


error: Min Capture analysis includes:
  --> /checkout/src/test/ui/closures/2229_closure_analysis/capture-analysis-1.rs:20:5
LL | /     || {
LL | /     || {
LL | |     //~^ First Pass analysis includes:
LL | |     //~| Min Capture analysis includes:
LL | |         println!("{:?}", p);
...  |
LL | |         //~| NOTE: Min Capture q[] -> ImmBorrow
LL | |     };
   |
   |
note: Min Capture p[] -> ImmBorrow
  --> /checkout/src/test/ui/closures/2229_closure_analysis/capture-analysis-1.rs:23:26
   |
LL |         println!("{:?}", p);
   |                          ^
note: Min Capture q[] -> ImmBorrow
  --> /checkout/src/test/ui/closures/2229_closure_analysis/capture-analysis-1.rs:31:26
   |
LL |         println!("{:?}", q);

error: aborting due to 3 previous errors; 1 warning emitted

For more information about this error, try `rustc --explain E0658`.
For more information about this error, try `rustc --explain E0658`.

------------------------------------------


---- [ui] ui/closures/2229_closure_analysis/capture-analysis-2.rs stdout ----

1 error[E0658]: attributes on expressions are experimental
-   --> $DIR/capture-analysis-2.rs:17:13
+   --> $DIR/capture-analysis-2.rs:16:13
+   --> $DIR/capture-analysis-2.rs:16:13
3    |
4 LL |     let c = #[rustc_capture_analysis]


8    = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
9 
10 warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
-   --> $DIR/capture-analysis-2.rs:2:12
+   --> $DIR/capture-analysis-2.rs:1:12
12    |
13 LL | #![feature(capture_disjoint_fields)]

17    = note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
18 
18 
19 error: First Pass analysis includes:
-   --> $DIR/capture-analysis-2.rs:20:5
+   --> $DIR/capture-analysis-2.rs:19:5
22 LL | /     || {
23 LL | |

29    | |_____^
29    | |_____^
30    |
31 note: Capturing p[(0, 0)] -> ByValue
-   --> $DIR/capture-analysis-2.rs:23:18
+   --> $DIR/capture-analysis-2.rs:22:18
33    |
34 LL |         let _x = p.x;


36 note: Capturing p[] -> ImmBorrow
-   --> $DIR/capture-analysis-2.rs:26:26
+   --> $DIR/capture-analysis-2.rs:25:26
38    |
39 LL |         println!("{:?}", p);

41 
41 
42 error: Min Capture analysis includes:
-   --> $DIR/capture-analysis-2.rs:20:5
+   --> $DIR/capture-analysis-2.rs:19:5
45 LL | /     || {
46 LL | |

52    | |_____^
52    | |_____^
53    |
54 note: Min Capture p[] -> ByValue
-   --> $DIR/capture-analysis-2.rs:23:18
+   --> $DIR/capture-analysis-2.rs:22:18
56    |
57 LL |         let _x = p.x;
58    |                  ^^^ p[] captured as ByValue here

The actual stderr differed from the expected stderr.
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/closures/2229_closure_analysis/capture-analysis-2/capture-analysis-2.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args closures/2229_closure_analysis/capture-analysis-2.rs`
error: 1 errors occurred comparing output.
status: exit code: 1
status: exit code: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/closures/2229_closure_analysis/capture-analysis-2.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zemit-future-incompat-report" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/closures/2229_closure_analysis/capture-analysis-2" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/closures/2229_closure_analysis/capture-analysis-2/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error[E0658]: attributes on expressions are experimental
  --> /checkout/src/test/ui/closures/2229_closure_analysis/capture-analysis-2.rs:16:13
   |
LL |     let c = #[rustc_capture_analysis]
   |
   = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
   = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
   = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable

warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
  --> /checkout/src/test/ui/closures/2229_closure_analysis/capture-analysis-2.rs:1:12
   |
LL | #![feature(capture_disjoint_fields)]
   |
   = note: `#[warn(incomplete_features)]` on by default
   = note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information


error: First Pass analysis includes:
  --> /checkout/src/test/ui/closures/2229_closure_analysis/capture-analysis-2.rs:19:5
LL | /     || {
LL | /     || {
LL | |     //~^ First Pass analysis includes:
LL | |     //~| Min Capture analysis includes:
LL | |         let _x = p.x;
...  |
LL | |         //~| NOTE: p[] used here
LL | |     };
   |
   |
note: Capturing p[(0, 0)] -> ByValue
  --> /checkout/src/test/ui/closures/2229_closure_analysis/capture-analysis-2.rs:22:18
Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
LL |         let _x = p.x;
   |                  ^^^
note: Capturing p[] -> ImmBorrow
  --> /checkout/src/test/ui/closures/2229_closure_analysis/capture-analysis-2.rs:25:26
   |
LL |         println!("{:?}", p);


error: Min Capture analysis includes:
  --> /checkout/src/test/ui/closures/2229_closure_analysis/capture-analysis-2.rs:19:5
LL | /     || {
LL | /     || {
LL | |     //~^ First Pass analysis includes:
LL | |     //~| Min Capture analysis includes:
LL | |         let _x = p.x;
...  |
LL | |         //~| NOTE: p[] used here
LL | |     };
   |
   |
note: Min Capture p[] -> ByValue
  --> /checkout/src/test/ui/closures/2229_closure_analysis/capture-analysis-2.rs:22:18
   |
LL |         let _x = p.x;
   |                  ^^^ p[] captured as ByValue here
...
LL |         println!("{:?}", p);
   |                          ^ p[] used here
error: aborting due to 3 previous errors; 1 warning emitted

For more information about this error, try `rustc --explain E0658`.


------------------------------------------


---- [ui] ui/closures/2229_closure_analysis/deep-multilevel-tuple.rs stdout ----

1 error[E0658]: attributes on expressions are experimental
1 error[E0658]: attributes on expressions are experimental
-   --> $DIR/deep-multilevel-tuple.rs:12:13
+   --> $DIR/deep-multilevel-tuple.rs:11:13
3    |
4 LL |     let c = #[rustc_capture_analysis]


8    = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
9 
10 warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
-   --> $DIR/deep-multilevel-tuple.rs:2:12
+   --> $DIR/deep-multilevel-tuple.rs:1:12
12    |
13 LL | #![feature(capture_disjoint_fields)]

17    = note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
18 
18 
19 error: First Pass analysis includes:
-   --> $DIR/deep-multilevel-tuple.rs:15:5
+   --> $DIR/deep-multilevel-tuple.rs:14:5
22 LL | /     || {
23 LL | |

29    | |_____^
29    | |_____^
30    |
31 note: Capturing t[(0, 0),(0, 0),(0, 0)] -> ImmBorrow
-   --> $DIR/deep-multilevel-tuple.rs:18:18
+   --> $DIR/deep-multilevel-tuple.rs:17:18
33    |
34 LL |         let x = &t.0.0.0;


36 note: Capturing t[(1, 0),(1, 0),(1, 0)] -> MutBorrow
-   --> $DIR/deep-multilevel-tuple.rs:20:9
+   --> $DIR/deep-multilevel-tuple.rs:19:9
38    |
39 LL |         t.1.1.1 = 9;


41 note: Capturing t[] -> ImmBorrow
-   --> $DIR/deep-multilevel-tuple.rs:23:26
+   --> $DIR/deep-multilevel-tuple.rs:22:26
43    |
44 LL |         println!("{:?}", t);

46 
46 
47 error: Min Capture analysis includes:
-   --> $DIR/deep-multilevel-tuple.rs:15:5
+   --> $DIR/deep-multilevel-tuple.rs:14:5
50 LL | /     || {
51 LL | |

57    | |_____^
57    | |_____^
58    |
59 note: Min Capture t[] -> MutBorrow
-   --> $DIR/deep-multilevel-tuple.rs:20:9
+   --> $DIR/deep-multilevel-tuple.rs:19:9
61    |
62 LL |         t.1.1.1 = 9;
63    |         ^^^^^^^ t[] captured as MutBorrow here

The actual stderr differed from the expected stderr.
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/closures/2229_closure_analysis/deep-multilevel-tuple/deep-multilevel-tuple.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args closures/2229_closure_analysis/deep-multilevel-tuple.rs`
error: 1 errors occurred comparing output.
status: exit code: 1
status: exit code: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/closures/2229_closure_analysis/deep-multilevel-tuple.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zemit-future-incompat-report" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/closures/2229_closure_analysis/deep-multilevel-tuple" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/closures/2229_closure_analysis/deep-multilevel-tuple/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error[E0658]: attributes on expressions are experimental
  --> /checkout/src/test/ui/closures/2229_closure_analysis/deep-multilevel-tuple.rs:11:13
   |
LL |     let c = #[rustc_capture_analysis]
   |
   = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
   = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
   = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable

warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
  --> /checkout/src/test/ui/closures/2229_closure_analysis/deep-multilevel-tuple.rs:1:12
   |
LL | #![feature(capture_disjoint_fields)]
   |
   = note: `#[warn(incomplete_features)]` on by default
   = note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information


error: First Pass analysis includes:
  --> /checkout/src/test/ui/closures/2229_closure_analysis/deep-multilevel-tuple.rs:14:5
LL | /     || {
LL | /     || {
LL | |     //~^ ERROR: First Pass analysis includes:
LL | |     //~| ERROR: Min Capture analysis includes:
LL | |         let x = &t.0.0.0;
...  |
LL | |         //~| NOTE: t[] used here
LL | |     };
   |
   |
note: Capturing t[(0, 0),(0, 0),(0, 0)] -> ImmBorrow
  --> /checkout/src/test/ui/closures/2229_closure_analysis/deep-multilevel-tuple.rs:17:18
   |
LL |         let x = &t.0.0.0;
   |                  ^^^^^^^
note: Capturing t[(1, 0),(1, 0),(1, 0)] -> MutBorrow
  --> /checkout/src/test/ui/closures/2229_closure_analysis/deep-multilevel-tuple.rs:19:9
   |
LL |         t.1.1.1 = 9;
   |         ^^^^^^^
note: Capturing t[] -> ImmBorrow
  --> /checkout/src/test/ui/closures/2229_closure_analysis/deep-multilevel-tuple.rs:22:26
   |
LL |         println!("{:?}", t);


error: Min Capture analysis includes:
  --> /checkout/src/test/ui/closures/2229_closure_analysis/deep-multilevel-tuple.rs:14:5
LL | /     || {
LL | /     || {
LL | |     //~^ ERROR: First Pass analysis includes:
LL | |     //~| ERROR: Min Capture analysis includes:
LL | |         let x = &t.0.0.0;
...  |
LL | |         //~| NOTE: t[] used here
LL | |     };
   |
   |
note: Min Capture t[] -> MutBorrow
  --> /checkout/src/test/ui/closures/2229_closure_analysis/deep-multilevel-tuple.rs:19:9
   |
LL |         t.1.1.1 = 9;
   |         ^^^^^^^ t[] captured as MutBorrow here
...
LL |         println!("{:?}", t);
   |                          ^ t[] used here
error: aborting due to 3 previous errors; 1 warning emitted

For more information about this error, try `rustc --explain E0658`.


------------------------------------------



failures:
    [ui] ui/closures/2229_closure_analysis/capture-analysis-1.rs
    [ui] ui/closures/2229_closure_analysis/capture-analysis-2.rs
    [ui] ui/closures/2229_closure_analysis/deep-multilevel-tuple.rs
test result: FAILED. 11174 passed; 3 failed; 86 ignored; 0 measured; 0 filtered out; finished in 119.60s




command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--suite" "ui" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-9/bin/FileCheck" "--nodejs" "/usr/bin/node" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python3" "--lldb-python" "/usr/bin/python3" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "9.0.0" "--llvm-components" "aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets amdgpu amdgpuasmparser amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgpuutils analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver engine executionengine fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interpreter ipo irreader jitlink lanai lanaiasmparser lanaicodegen lanaidesc lanaidisassembler lanaiinfo libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts object objectyaml option orcjit passes perfjitevents powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvutils runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target textapi transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86utils xcore xcorecodegen xcoredesc xcoredisassembler xcoreinfo xray" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"


failed to run: /checkout/obj/build/bootstrap/debug/bootstrap --stage 2 test --exclude src/tools/tidy
Build completed unsuccessfully in 0:13:53

@davidtwco davidtwco assigned nikomatsakis and unassigned davidtwco Jan 16, 2021
Copy link
Contributor

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

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

This looks good. I was thinking about what kinds of tests make sense. I'm going to post a separate comment.

@nikomatsakis
Copy link
Contributor

It seems like we want to cover the following cases:

Use 1 Use 2 Expected result Covered
move p.x read p cite both ✔️
write p.b.q.y read p cite both ✔️
write t.0.0.0 read t cite both ✔️
move a.b.c read a.b cite both
move a.b read a.b.c just cite a.b

Maybe add those two tests?

At that point feel free to r=nikomatsakis

@bors delegate+

@bors
Copy link
Contributor

bors commented Jan 25, 2021

✌️ @ChrisPardy can now approve this pull request

@ChrisPardy
Copy link
Member Author

@bors r=nikomatsakis

@bors
Copy link
Contributor

bors commented Jan 26, 2021

📌 Commit cf71d83 has been approved by nikomatsakis

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 26, 2021
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Jan 27, 2021
…tics, r=nikomatsakis

Improve diagnostics for Precise Capture

This is just the capture analysis part and borrow checker logging will updated as part of rust-lang/project-rfc-2229#8

Closes rust-lang/project-rfc-2229#22
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Jan 27, 2021
…tics, r=nikomatsakis

Improve diagnostics for Precise Capture

This is just the capture analysis part and borrow checker logging will updated as part of rust-lang/project-rfc-2229#8

Closes rust-lang/project-rfc-2229#22
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 28, 2021
Rollup of 13 pull requests

Successful merges:

 - rust-lang#70904 (Stabilize `Seek::stream_position` (feature `seek_convenience`))
 - rust-lang#79951 (Refractor a few more types to `rustc_type_ir` )
 - rust-lang#80868 (Print failure message on all tests that should panic, but don't)
 - rust-lang#81062 (Improve diagnostics for Precise Capture)
 - rust-lang#81277 (Make more traits of the From/Into family diagnostic items)
 - rust-lang#81284 (Make `-Z time-passes` less noisy)
 - rust-lang#81379 (Improve URLs handling)
 - rust-lang#81416 (Tweak suggestion for missing field in patterns)
 - rust-lang#81426 (const_evaluatable: expand abstract consts in try_unify)
 - rust-lang#81428 (compiletest: Add two more unit tests)
 - rust-lang#81430 (add const_evaluatable_checked test)
 - rust-lang#81433 (const_evaluatable: stop looking into type aliases)
 - rust-lang#81445 (Update cargo)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 84ad95b into rust-lang:master Jan 28, 2021
@rustbot rustbot added this to the 1.51.0 milestone Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve diagnostics for Precise Capture
8 participants