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

Add src/test/ui regression testing for NLL #49900

Merged
merged 9 commits into from
Apr 19, 2018

Conversation

pnkfelix
Copy link
Member

@pnkfelix pnkfelix commented Apr 12, 2018

This PR changes x.py test so that when you are running the ui test suite, it will also always run compiletest in the new --compare-mode=nll, which just double-checks that when running under the experimental NLL mode, the output matches the <source-name>.nll.stderr file, if present.

In order to reduce the chance of a developer revolt in response to this change, this PR also includes some changes to make the --compare-mode=nll more user-friendly:

  1. It now generates nll-specific .stamp files, and uses them (so that repeated runs can reuse previously cached results).
  2. Each line of terminal output distinguishes whether we are running under --compare-mode=nll by printing with the prefix [ui (nll)] instead of just the prefix [ui].

Subtask of #48879

@rust-highfive
Copy link
Collaborator

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 12, 2018
@pnkfelix
Copy link
Member Author

r? @nikomatsakis

@pnkfelix
Copy link
Member Author

(Hmm it seems like the output from NLL may have changed even in the short time period between now and when I created #49861 ! Good thing we're putting this in now!)

@pnkfelix
Copy link
Member Author

Whenever this gets r+'ed, it probably needs to have p=10 or something because clearly these .nll.stderr files can go stale very quickly

@rust-highfive
Copy link
Collaborator

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:00:49] configure: rust.quiet-tests     := True
---
[00:46:40] ...............................................................................i....................
[00:46:46] ......................i.............................................................................
---
[00:47:28] ..i...........................................................................i.....................
---
[00:47:50] travis_fold:start:test_ui_nll
travis_time:start:test_ui_nll
Check compiletest suite=ui mode=ui compare_mode=nll (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[00:47:51]
[00:47:51] running 1324 tests
[00:47:57] ....................................F..........................................i....................
[00:48:05] ......................i...................F....F..F..F..............................................
[00:48:09] ....................................................................................................
[00:48:14] ......................F.............................................................................
[00:48:19] ....................................................................................................
[00:48:25] ....................................................................................................
[00:48:32] ....................................................................................................
[00:48:39] ..............................F.....................................................................
[00:48:46] ....................................................................................................
[00:48:54] ..i...........................................................................i.....................
[00:49:00] ......................................................................................FF............
[00:49:10] ....................F..F............................................................................
[00:49:21] ....................................................................................................
[00:49:37] ........................
[00:49:37] failures:
[00:49:37]
[00:49:37] ---- [ui (nll)] ui/borrowck/issue-45983.rs stdout ----
[00:49:37]  diff of stderr:
[00:49:37]
[00:49:37] 16 LL |     give_any(|y| x = Some(y));
[00:49:37] 17    |                  ^^^^^^^^^^^ cannot mutate
[00:49:37] 18    |
[00:49:37] -    = note: Value not mutable causing this error: `x`
[00:49:37] +    = note: the value which is causing this path not to be mutable is...: `x`
[00:49:37] 20
[00:49:37] 21 error[E0596]: cannot borrow immutable item `x` as mutable
[00:49:37] 22   --> $DIR/issue-45983.rs:17:14
[00:49:37]
[00:49:37]
[00:49:37] The actual stderr differed from the expected stderr.
[00:49:37] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/borrowck/issue-45983.stderr
[00:49:37] To update references, run this command from build directory:
[00:49:37] /checkout/src/test/ui/update-references.sh '/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui' 'borrowck/issue-45983.rs'
[00:49:37]
[00:49:37] error: 1 errors occurred comparing output.
[00:49:37] status: exit code: 101
[00:49:37] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/borrowck/issue-45983.rs" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--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/borrowck/issue-45983.stage2-x86_64-unknown-linux-gnu" "-Znll" "-Zborrowck=mir" "-Ztwo-phase-borrows" "-Crpath" "-O" "-Zmiri" "-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/borrowck/issue-45983.stage2-x86_64-unknown-linux-gnu.aux" "-A" "unused"
---
[00:49:37] {"message":"not reporting region error due to -Znll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/borrowck/issue-45983.rs","byte_start":585,"byte_end":586,"line_start":17,"line_end":17,"column_start":27,"column_end":28,"is_primary":true,"text":[{"text":"    give_any(|y| x = Some(y));","highlight_start":27,"highlight_end":28}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: not reporting region error due to -Znll\n  --> /checkout/src/test/ui/borrowck/issue-45983.rs:17:27\n   |\nLL |     give_any(|y| x = Some(y));\n   |                           ^\n\n"}
[00:49:37] {"message":"free region `` does not outlive free region `'_#2r`","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/borrowck/issue-45983.rs","byte_start":585,"byte_end":586,"line_start":17,"line_end":17,"column_start":27,"column_end":28,"is_primary":true,"text":[{"text":"    give_any(|y| x = Some(y));","highlight_start":27,"highlight_end":28}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":"error: free region `` does not outlive free region `'_#2r`\n  --> /checkout/src/test/ui/borrowck/issue-45983.rs:17:27\n   |\nLL |     give_any(|y| x = Some(y));\n   |                           ^\n\n"}
[00:49:37] {"message":"cannot assign to immutable item `x`","code":{"code":"E0594","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/borrowck/issue-45983.rs","byte_start":576,"byte_end":587,"line_start":17,"line_end":17,"column_start":18,"column_end":29,"is_primary":true,"text":[{"text":"    give_any(|y| x = Some(y));","highlight_start":18,"highlight_end":29}],"label":"cannot mutate","suggested_replacement":null,"expansion":null}],"children":[{"message":"the value which is causing this path not to be mutable is...: `x`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0594]: cannot assign to immutable item `x`\n  --> /checkout/src/test/ui/borrowck/issue-45983.rs:17:18\n   |\nLL |     give_any(|y| x = Some(y));\n   |                  ^^^^^^^^^^^ cannot mutate\n   |\n   = note: the value which is causing this path not to be mutable is...: `x`\n\n"}
[00:49:37] {"message":"cannot borrow immutable item `x` as mutable","code":{"code":"E0596","explanation":"\nThis error occurs because you tried to mutably borrow a non-mutable variable.\n\nExample of erroneous code:\n\n```compile_fail,E0596\nlet x = 1;\nlet y = &mut x; // error: cannot borrow mutably\n```\n\nIn here, `x` isn't mutable, so when we try to mutably borrow it in `y`, it\nfails. To fix this error, you need to make `x` mutable:\n\n```\nlet mut x = 1;\nlet y = &mut x; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/borrowck/issue-45983.rs","byte_start":572,"byte_end":587,"line_start":17,"line_end":17,"column_start":14,"column_end":29,"is_primary":true,"text":[{"text":"    give_any(|y| x = Some(y));","highlight_start":14,"highlight_end":29}],"label":"cannot borrow as mutable","suggested_replacement":null,"expansion":null}],"children":[],"rendered":"error[E0596]: cannot borrow immutable item `x` as mutable\n  --> /checkout/src/test/ui/borrowck/issue-45983.rs:17:14\n   |\nLL |     give_any(|y| x = Some(y));\n   |              ^^^^^^^^^^^^^^^ cannot borrow as mutable\n\n"}
[00:49:37] {"message":"aborting due to 3 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 3 previous errors\n\n"}
[00:49:37] {"message":"Some errors occurred: E0594, E0596.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0594, E0596.\n"}
[00:49:37] {"message":"For more information about an error, try `rustc --explain E0594`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about an error, try `rustc --explain E0594`.\n"}
[00:49:37]
[00:49:37] ------------------------------------------
[00:49:37]
[00:49:37] thread '[ui (nll)] ui/borrowck/issue-45983.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:2919:9
[00:49:37] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:49:37]
[00:49:37] ---- [ui (nll)] ui/did_you_mean/issue-35937.rs stdout ----
[00:49:37]  diff of stderr:
[00:49:37]
[00:49:37] 4 LL |     f.v.push("cat".to_string()); //~ ERROR cannot borrow
[00:49:37] 5    |     ^^^ cannot borrow as mutable
[00:49:37] 6    |
[00:49:37] -    = note: Value not mutable causing this error: `f`
[00:49:37] +    = note: the value which is causing this path not to be mutable is...: `f`
[00:49:37] 8
[00:49:37] 9 error[E0384]: cannot assign twice to immutable variable `s.x`
[00:49:37] 10   --> $DIR/issue-35937.rs:26:5
[00:49:37]
[00:49:37]
[00:49:37] The actual stderr differed from the expected stderr.
[00:49:37] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/did_you_mean/issue-35937.stderr
[00:49:37] To update references, run this command from build directory:
[00:49:37] /checkout/src/test/ui/update-references.sh '/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui' 'did_you_mean/issue-35937.rs'
[00:49:37]
[00:49:37] error: 1 errors occurred comparing output.
[00:49:37] status: exit code: 101
[00:49:37] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/did_you_mean/issue-35937.rs" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--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/did_you_mean/issue-35937.stage2-x86_64-unknown-linux-gnu" "-Znll" "-Zborrowck=mir" "-Ztwo-phase-borrows" "-Crpath" "-O" "-Zmiri" "-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/did_you_mean/issue-35937.stage2-x86_64-unknown-linux-gnu.aux" "-A" "unused"
---
[00:49:37] {"message":"cannot borrow immutable item `f.v` as mutable","code":{"code":"E0596","explanation":"\nThis error occurs because you tried to mutably borrow a non-mutable variable.\n\nExample of erroneous code:\n\n```compile_fail,E0596\nlet x = 1;\nlet y = &mut x; // error: cannot borrow mutably\n```\n\nIn here, `x` isn't mutable, so when we try to mutably borrow it in `y`, it\nfails. To fix this error, you need to make `x` mutable:\n\n```\nlet mut x = 1;\nlet y = &mut x; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/did_you_mean/issue-35937.rs","byte_start":557,"byte_end":560,"line_start":17,"line_end":17,"column_start":5,"column_end":8,"is_primary":true,"text":[{"text":"    f.v.push(\"cat\".to_string()); //~ ERROR cannot borrow","highlight_start":5,"highlight_end":8}],"label":"cannot borrow as mutable","suggested_replacement":null,"expansion":null}],"children":[{"message":"the value which is causing this path not to be mutable is...: `f`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0596]: cannot borrow immutable item `f.v` as mutable\n  --> /checkout/src/test/ui/did_you_mean/issue-35937.rs:17:5\n   |\nLL |     f.v.push(\"cat\".to_string()); //~ ERROR cannot borrow\n   |     ^^^ cannot borrow as mutable\n   |\n   = note: the value which is causing this path not to be mutable is...: `f`\n\n"}
[00:49:37] {"message":"cannot assign twice to immutable variable `s.x`","code":{"code":"E0384","explanation":"\nThis error occurs when an attempt is made to reassign an immutable variable.\nFor example:\n\n```compile_fail,E0384\nfn main() {\n    let x = 3;\n    x = 5; // error, reassignment of immutable variable\n}\n```\n\nBy default, variables in Rust are immutable. To fix this error, add the keyword\n`mut` after the keyword `let` when declaring the variable. For example:\n\n```\nfn main() {\n    let mut x = 3;\n    x = 5;\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/did_you_mean/issue-35937.rs","byte_start":662,"byte_end":673,"line_start":25,"line_end":25,"column_start":13,"column_end":24,"is_primary":false,"text":[{"text":"    let s = S { x: 42 };","highlight_start":13,"highlight_end":24}],"label":"first assignment to `s.x`","suggested_replacement":null,"expansion":null},{"file_name":"/checkout/src/test/ui/did_you_mean/issue-35937.rs","byte_start":679,"byte_end":687,"line_start":26,"line_end":26,"column_start":5,"column_end":13,"is_primary":true,"text":[{"text":"    s.x += 1; //~ ERROR cannot assign","highlight_start":5,"highlight_end":13}],"label":"cannot assign twice to immutable variable","suggested_replacement":null,"expansion":null}],"children":[],"rendered":"error[E0384]: cannot assign twice to immutable variable `s.x`\n  --> /checkout/src/test/ui/did_you_mean/issue-35937.rs:26:5\n   |\nLL |     let s = S { x: 42 };\n   |             ----------- first assignment to `s.x`\nLL |     s.x += 1; //~ ERROR cannot assign\n   |     ^^^^^^^^ cannot assign twice to immutable variable\n\n"}
[00:49:37] {"message":"cannot assign twice to immutable variable `s.x`","code":{"code":"E0384","explanation":"\nThis error occurs when an attempt is made to reassign an immutable variable.\nFor example:\n\n```compile_fail,E0384\nfn main() {\n    let x = 3;\n    x = 5; // error, reassignment of immutable variable\n}\n```\n\nBy default, variables in Rust are immutable. To fix this error, add the keyword\n`mut` after the keyword `let` when declaring the variable. For example:\n\n```\nfn main() {\n    let mut x = 3;\n    x = 5;\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/did_you_mean/issue-35937.rs","byte_start":723,"byte_end":724,"line_start":29,"line_end":29,"column_start":8,"column_end":9,"is_primary":false,"text":[{"text":"fn bar(s: S) {","highlight_start":8,"highlight_end":9}],"label":"first assignment to `s.x`","suggested_replacement":null,"expansion":null},{"file_name":"/checkout/src/test/ui/did_you_mean/issue-35937.rs","byte_start":735,"byte_end":743,"line_start":30,"line_end":30,"column_start":5,"column_end":13,"is_primary":true,"text":[{"text":"    s.x += 1; //~ ERROR cannot assign","highlight_start":5,"highlight_end":13}],"label":"cannot assign twice to immutable variable","suggested_replacement":null,"expansion":null}],"children":[],"rendered":"error[E0384]: cannot assign twice to immutable variable `s.x`\n  --> /checkout/src/test/ui/did_you_mean/issue-35937.rs:30:5\n   |\nLL | fn bar(s: S) {\n   |        - first assignment to `s.x`\nLL |     s.x += 1; //~ ERROR cannot assign\n   |     ^^^^^^^^ cannot assign twice to immutable variable\n\n"}
[00:49:37] {"message":"aborting due to 3 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 3 previous errors\n\n"}
[00:49:37] {"message":"Some errors occurred: E0384, E0596.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0384, E0596.\n"}
[00:49:37] {"message":"For more information about an error, try `rustc --explain E0384`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about an error, try `rustc --explain E0384`.\n"}
[00:49:37]
[00:49:37] ------------------------------------------
[00:49:37]
[00:49:37] thread '[ui (nll)] ui/did_you_mean/issue-35937.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:2919:9
[00:49:37]
[00:49:37] ---- [ui (nll)] ui/did_you_mean/issue-38147-1.rs stdout ----
[00:49:37]  diff of stderr:
[00:49:37]
[00:49:37] 4 LL |         self.s.push('x'); //~ ERROR cannot borrow data mutably
[00:49:37] 5    |         ^^^^^^ cannot borrow as mutable
[00:49:37] 6    |
[00:49:37] -    = note: Value not mutable causing this error: `*self`
[00:49:37] +    = note: the value which is causing this path not to be mutable is...: `*self`
---
[00:49:37] /checkout/src/test/ui/update-references.sh '/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui' 'did_you_mean/issue-38147-1.rs'
[00:49:37]
[00:49:37] error: 1 errors occurred comparing output.
[00:49:37] status: exit code: 101
[00:49:37] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/did_you_mean/issue-38147-1.rs" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--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/did_you_mean/issue-38147-1.stage2-x86_64-unknown-linux-gnu" "-Znll" "-Zborrowck=mir" "-Ztwo-phase-borrows" "-Crpath" "-O" "-Zmiri" "-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/did_you_mean/issue-38147-1.stage2-x86_64-unknown-linux-gnu.aux" "-A" "unused"
---
[00:49:37] {"message":"cannot borrow immutable item `*self.s` as mutable","code":{"code":"E0596","explanation":"\nThis error occurs because you tried to mutably borrow a non-mutable variable.\n\nExample of erroneous code:\n\n```compile_fail,E0596\nlet x = 1;\nlet y = &mut x; // error: cannot borrow mutably\n```\n\nIn here, `x` isn't mutable, so when we try to mutably borrow it in `y`, it\nfails. To fix this error, you need to make `x` mutable:\n\n```\nlet mut x = 1;\nlet y = &mut x; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/did_you_mean/issue-38147-1.rs","byte_start":674,"byte_end":680,"line_start":27,"line_end":27,"column_start":9,"column_end":15,"is_primary":true,"text":[{"text":"        self.s.push('x'); //~ ERROR cannot borrow data mutably","highlight_start":9,"highlight_end":15}],"label":"cannot borrow as mutable","suggested_replacement":null,"expansion":null}],"children":[{"message":"the value which is causing this path not to be mutable is...: `*self`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0596]: cannot borrow immutable item `*self.s` as mutable\n  --> /checkout/src/test/ui/did_you_mean/issue-38147-1.rs:27:9\n   |\nLL |         self.s.push('x'); //~ ERROR cannot borrow data mutably\n   |         ^^^^^^ cannot borrow as mutable\n   |\n   = note: the value which is causing this path not to be mutable is...: `*self`\n\n"}
[00:49:37] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:49:37] {"message":"For more information about this error, try `rustc --explain E0596`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0596`.\n"}
[00:49:37]
[00:49:37] ------------------------------------------
[00:49:37]
[00:49:37] thread '[ui (nll)] ui/did_you_mean/issue-38147-1.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:2919:9
[00:49:37]
[00:49:37] ---- [ui (nll)] ui/did_you_mean/issue-38147-4.rs stdout ----
[00:49:37]  diff of stderr:
[00:49:37]
[00:49:37] 4 LL |     f.s.push('x'); //~ ERROR cannot borrow data mutably
[00:49:37] 5    |     ^^^ cannot borrow as mutable
[00:49:37] 6    |
[00:49:37] -    = note: Value not mutable causing this error: `*f`
[00:49:37] +    = note: the value which is causing this path not to be mutable is...: `*f`
---
[00:49:37] /checkout/src/test/ui/update-references.sh '/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui' 'did_you_mean/issue-38147-4.rs'
[00:49:37]
[00:49:37] error: 1 errors occurred comparing output.
[00:49:37] status: exit code: 101
[00:49:37] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:486:22
[00:49:37] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/did_you_mean/issue-38147-4.rs" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--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/did_you_mean/issue-38147-4.stage2-x86_64-unknown-linux-gnu" "-Znll" "-Zborrowck=mir" "-Ztwo-phase-borrows" "-Crpath" "-O" "-Zmiri" "-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/did_you_mean/issue-38147-4.stag `*f`\n\n"}
[00:49:37] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:49:37] {"message":"For more information about this error, try `rustc --explain E0596`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0596`.\n"}
[00:49:37]
[00:49:37] ------------------------------------------
[00:49:37]
[00:49:37] thread '[ui (nll)] ui/did_you_mean/issue-38147-4.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:2919:9
[00:49:37]
[00:49:37] ---- [ui (nll)] ui/did_you_mean/issue-39544.rs stdout ----
[00:49:37]  diff of stderr:
[00:49:37]
[00:49:37] 4 LL |     let _ = &mut z.x; //~ ERROR cannot borrow
[00:49:37] 5    |             ^^^^^^^^ cannot borrow as mutable
[00:49:37] 6    |
[00:49:37] -    = note: Value not mutable causing this error: `z`
[00:49:37] +    = note: the value which is causing this path not to be mutable is...: `z`
[00:49:37] 8
[00:49:37] 9 error[E0596]: cannot borrow immutable item `self.x` as mutable
[00:49:37] 10   --> $DIR/issue-39544.rs:26:17
[00:49:37]
[00:49:37] 12 LL |         let _ = &mut self.x; //~ ERROR cannot borrow
[00:49:37] 13    |                 ^^^^^^^^^^^ cannot borrow as mutable
[00:49:37] 14    |
[00:49:37] -    = note: Value not mutable causing this error: `*self`
[00:49:37] +    = note: the value which is causing this path not to be mutable is...: `*self`
[00:49:37] 16
[00:49:37] 17 error[E0596]: cannot borrow immutable item `self.x` as mutable
[00:49:37] 18   --> $DIR/issue-39544.rs:30:17
[00:49:37]
[00:49:37] 20 LL |         let _ = &mut self.x; //~ ERROR cannot borrow
[00:49:37] 21    |                 ^^^^^^^^^^^ cannot borrow as mutable
[00:49:37] 22    |
[00:49:37] -    = note: Value not mutable causing this error: `*self`
[00:49:37] +    = note: the value which is causing this path not to be mutable is...: `*self`
[00:49:37] 24
[00:49:37] 25 error[E0596]: cannot borrow immutable item `other.x` as mutable
[00:49:37] 26   --> $DIR/issue-39544.rs:31:17
[00:49:37]
[00:49:37] 28 LL |         let _ = &mut other.x; //~ ERROR cannot borrow
[00:49:37] 29    |                 ^^^^^^^^^^^^ cannot borrow as mutable
[00:49:37] 30    |
[00:49:37] -    = note: Value not mutable causing this error: `*other`
[00:49:37] +    = note: the value which is causing this path not to be mutable is...: `*other`
[00:49:37] 32
[00:49:37] 33 error[E0596]: cannot borrow immutable item `self.x` as mutable
[00:49:37] 34   --> $DIR/issue-39544.rs:35:17
[00:49:37]
[00:49:37] 36 LL |         let _ = &mut self.x; //~ ERROR cannot borrow
[00:49:37] 37    |                 ^^^^^^^^^^^ cannot borrow as mutable
[00:49:37] 38    |
[00:49:37] -    = note: Value not mutable causing this error: `*self`
[00:49:37] +    = note: the value which is causing this path not to be mutable is...: `*self`
[00:49:37] 40
[00:49:37] 41 error[E0596]: cannot borrow immutable item `other.x` as mutable
[00:49:37] 42   --> $DIR/issue-39544.rs:36:17
[00:49:37]
[00:49:37] 44 LL |         let _ = &mut other.x; //~ ERROR cannot borrow
[00:49:37] 45    |                 ^^^^^^^^^^^^ cannot borrow as mutable
[00:00:49:37] 72
[00:49:37] 73 error[E0596]: cannot borrow immutable item `z.x` as mutable
[00:49:37] 74   --> $DIR/issue-39544.rs:51:13
[00:49:37]
[00:49:37] 76 LL |     let _ = &mut z.x; //~ ERROR cannot borrow
[00:49:37] 77    |             ^^^^^^^^ cannot borrow as mutable
[00:49:37] 78    |
[00:49:37] -    = note: Value not mutable causing this error: `z`
[00:49:37] +    = note: the value which is causing this path not to be mutable is...: `z`
[00:49:37] 80
[00:49:37] 81 error[E0596]: cannot borrow immutable item `w.x` as mutable
[00:49:37] 82   --> $DIR/issue-39544.rs:52:13
[00:49:37]
[00:49:37] 84 LL |     let _ = &mut w.x; //~ ERROR cannot borrow
[00:49:37] 85    |             ^^^^^^^^ cannot borrow as mutable
[00:49:37] 86    |
[00:49:37] -    = note: Value not mutable causing this error: `*w`
[00:49:37] +    = note: the value which is causing this path not to be mutable is...: `*w`
[00:49:37] 88
[00:49:37] 89 error[E0594]: cannot assign to immutable item `*x.0`
[00:49:37] 90   --> $DIR/issue-39544.rs:58:5
[00:49:37]
[00:49:37]
[00:49:37] The actual stderr differed from the expected stderr.
[00:49:37] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/did_you_mean/issue-39544.stderr
[00:49:37] To update references, run this command from build directory:
[00:49:37] /checkout/src/test/ui/update-references.sh '/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui' 'did_you_mean/issue-39544.rs'
[00:49:37]
[00:49:37] error: 1 errors occurred comparing output.
[00:49:37] status: exit code: 101
[00:49:37] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/did_you_mean/issue-39544.rs" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--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/did_you_mean/issue-39544.stage2-x86_64-unknown-linux-gnu" "-Znll" "-Zborrowck=mir" "-Ztwo-phase-borrows" "-Crpath" "-O" "-Zmiri" "-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/did_you_mean/issue-39544.stage2-x86_64-unknown-linux-gnu.aux" "-A" "unused"
---
[00:49:37] {"message":"cannot borrow immutable item `z.x` as mutable","code":{"code":"E0596","explanation":"\nThis error occurs because you tried to mutably borrow a non-mutable variable.\n\nExample of erroneous code:\n\n```compile_fail,E0596\nlet x = 1;\nlet y = &mut x; // error: cannot borrow mutably\n```\n\nIn here, `x` isn't mutable, so when we try to mutably borrow it in `y`, it\nfails. To fix this error, you need to make `x` mutable:\n\n```\nlet mut x = 1;\nlet y = &mut x; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/did_you_mean/issue-39544.rs","byte_start":567,"byte_end":575,"line_start":21,"line_end":21,"column_start":13,"column_end":21,"is_primary":true,"text":[{"text":"    let _ = &mut z.x; //~ ERROR cannot borrow","highlight_start":13,"highlight_end":21}],"label":"cannot borrow as mutable","suggested_replacement":null,"expansion":null}],"children":[{"message":"the value which is causing this path not to be mutable is...: `z`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0596]: cannot borrow immutable item `z.x` as mutable\n  --> /checkout/src/test/ui/did_you_mean/issue-39544.rs:21:13\n   |\nLL |     let _ = &mut z.x; //~ ERROR cannot borrow\n   |             ^^^^^^^^ cannot borrow as mutable\n   |\n   = note: the value which is causing this path not to be mutable is...: `z`\n\n"}
[00:49:37] {"message":"cannot borrow immutable item `self.x` as mutable","code":{"code":"E0596","explanation":"\nThis error occurs because you tried to mutably borrow a non-mutable variable.\n\nExample of erroneous code:\n\n```compile_fail,E0596\nlet x = 1;\nlet y = &mut x; // error: cannot borrow mutably\n```\n\nIn here, `x` isn't mutable, so when we try to mutably borrow it in `y`, it\nfails. To fix this error, you need to make `x` mutable:\n\n```\nlet mut x = 1;\nlet y = &mut x; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/did_you_mean/issue-39544.rs","byte_start":656,"byte_end":667,"line_start":26,"line_end":26,"column_start":17,"column_end":28,"is_primary":true,"text":[{"text":"        let _ = &mut self.x; //~ ERROR cannot borrow","highlight_start":17,"highlight_end":28}],"label":"cannot borrow as mutable","suggested_replacement":null,"expansion":null}],"children":[{"message":"the value which is causing this path not to be mutable is...: `*self`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0596]: cannot borrow immutable item `self.x` as mutable\n  --> /checkout/src/test/ui/did_you_mean/issue-39544.rs:26:17\n   |\nLL |         let _ = &mut self.x; //~ ERROR cannot borrow\n   |                 ^^^^^^^^^^^ cannot borrow as mutable\n   |\n   = note: the value which is causing this path not to be mutable is...: `*self`\n\n"}
[00:49:37] {"message":"cannot borrow immutable item `self.x` as mutable","code":{"code":"E0596","explanation":"\nThis error occurs because you tried to mutably borrow a non-mutable variable.\n\nExample of erroneous code:\n\n```compile_fail,E0596\nlet x = 1;\nlet y = &mut x; // error: cannot borrow mutably\n```\n\nIn here, `x` isn't mutable, so when we try to mutably borrow it in `y`, it\nfails. To fix this error, you need to make `x` mutable:\n\n```\nlet mut x = 1;\nlet y = &mut x; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/did_you_mean/issue-39544.rs","byte_start":748,"byte_end":759,"line_start":30,"line_end":30,"column_start":17,"column_end":28,"is_primary":true,"text":[{"text":"        let _ = &mut self.x; //~ ERROR cannot borrow","highlight_start":17,"highlight_end":28}],"label":"cannot borrow as mutable","suggested_replacement":null,"expansion":null}],"children":[{"message":"the value which is causing this path not to be mutable is...: `*self`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0596]: cannot borrow immutable item `self.x` as mutable\n  --> /checkout/src/test/ui/did_you_mean/issue-39544.rs:30:17\n   |\nLL |         let _ = &mut self.x; //~ ERROR cannot borrow\n   |                 ^^^^^^^^^^^ cannot borrow as mutable\n   |\n   = note: the value which is causing this path not to be mutable is...: `*self`\n\n"}
[00:49:37] {"message":"cannot borrow immutable item `other.x` as mutable","code":{"code":"E0596","explanation":"\nThis error occurs because you tried to mutably borrow a non-mutable variable.\n\nExample of erroneous code:\n\n```compile_fail,E0596\nlet x = 1;\nlet y = &mut x; // error: cannot borrow mutably\n```\n\nIn here, `x` isn't mutable, so when we try to mutably borrow it in `y`, it\nfails. To fix this error, you need to make `x` mutable:\n\n```\nlet mut x = 1;\nlet y = &mut x; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/did_you_mean/issue-39544.rs","byte_start":801,"byte_end":813,"line_start":31,"line_end":31,"column_start":17,"column_end":29,"is_primary":true,"text":[{"text":"        let _ = &mut other.x; //~ ERROR cannot borrow","highlight_start":17,"highlight_end":29}],"label":"cannot borrow as mutable","suggested_replacement":null,"expansion":null}],"children":[{"message":"the value which is causing this path not to be mutable is...: `*other`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0596]: cannot borrow immutable item `other.x` as mutable\n  --> /checkout/src/test/ui/did_you_mean/issue-39544.rs:31:17\n   |\nLL |         let _ = &mut other.x; //~ ERROR cannot borrow\n   |                 ^^^^^^^^^^^^ cannot borrow as mutable\n   |\n   = note: the value which is causing this path not to be mutable is...: `*other`\n\n"}
[00:49:37] {"message":"cannot borrow immutable item `self.x` as mutable","code":{"code":"E0596","explanation":"\nThis error occurs because you tried to mutably borrow a non-mutable variable.\n\nExample of erroneous code:\n\n```compile_fail,E0596\nlet x = 1;\nlet y = &mut x; // error: cannot borrow mutably\n```\n\nIn here, `x` isn't mutable, so when we try to mutably borrow it in `y`, it\nfails. To fix this error, you need to make `x` mutable:\n\n```\nlet mut x = 1;\nlet y = &mut x; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/did_you_mean/issue-39544.rs","byte_start":901,"byte_end":912,"line_start":35,"line_end":35,"column_start":17,"column_end":28,"is_primary":true,"text":[{"text":"        let _ = &mut self.x; //~ ERROR cannot borrow","highlight_start":17,"highlight_end":28}],"label":"cannot borrow as mutable","suggested_replacement":null,"expansion":null}],"children":[{"message":"the value which is causing this path not to be mutable is...: `*self`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0596]: cannot borrow immutable item `self.x` as mutable\n  --> /checkout/src/test/ui/did_you_mean/issue-39544.rs:35:17\n   |\nLL |         let _ = &mut self.x; //~ ERROR cannot borrow\n   |                 ^^^^^^^^^^^ cannot borrow as mutable\n   |\n   = note: the value which is causing this path not to be mutable is...: `*self`\n\n"}
[00:49:37] {"message":"cannot borrow immutable item `other.x` as mutable","code":{"code":"E0596","explanation":"\nThis error occurs because you tried to mutably borrow a non-mutable variable.\n\nExample of erroneous code:\n\n```compile_fail,E0596\nlet x = 1;\nlet y = &mut x; // error: cannot borrow mutably\n```\n\nIn here, `x` isn't mutable, so when we try to mutably borrow it in `y`, it\nfails. To fix this error, you need to make `x` mutable:\n\n```\nlet mut x = 1;\nlet y = &mut x; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/did_you_mean/issue-39544.rs","byte_start":954,"byte_end":966,"line_start":36,"line_end":36,"column_start":17,"column_end":29,"is_primary":true,"text":[{"text":"        let _ = &mut other.x; //~ ERROR cannot borrow","highlight_start":17,"highlight_end":29}],"label":"cannot borrow as mutable","suggested_replacement":null,"expansion":null}],"children":[{"message":"the value which is causing this path not to be mutable is...: `*other`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0596]: cannot borrow immutable item `other.x` as mutable\n  --> /checkout/src/test/ui/did_you_mean/issue-39544.rs:36:17\n   |\nLL |         let _ = &mut other.x; //~ ERROR cannot borrow\n   |                 ^^^^^^^^^^^^ cannot borrow as mutable\n   |\n   = note: the value which is causing this path not to be mutable is...: `*other`\n\n"}
[00:49:37] {"message":"cannot borrow immutable item `self.x` as mutable","code":{"code":"E0596","explanation":"\nThis error occurs because you tried to mutably borrow a non-mutable variable.\n\nExample of erroneous code:\n\n```compile_fail,E0596\nlet x = 1;\nlet y = &mut x; // error: cannot borrow mutably\n```\n\nIn here, `x` isn't mutable, so when we try to mutably borrow it in `y`, it\nfails. To fix this error, you need to make `x` mutable:\n\n```\nlet mut x = 1;\nlet y = &mut x; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/did_you_mean/issue-39544.rs","byte_start":1060,"byte_end":1071,"line_start":40,"line_end":40,"column_start":17,"column_end":28,"is_primary":true,"text":[{"text":"        let _ = &mut self.x; //~ ERROR cannot borrow","highlight_start":17,"highlight_end":28}],"label":"cannot borrow as mutable","suggested_replacement":null,"expansion":null}],"children":[{"message":"the value which is causing this path not to be mutable is...: `*self`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0596]: cannot borrow immutable item `self.x` as mutable\n  --> /checkout/src/test/ui/did_you_mean/issue-39544.rs:40:17\n   |\nLL |         let _ = &mut self.x; //~ ERROR cannot borrow\n   |                 ^^^^^^^^^^^ cannot borrow as mutable\n   |\n   = note: the value which is causing this path not to be mutable is...: `*self`\n\n"}
[00:49:37] {"message":"cannot borrow immutable item `other.x` as mutable","code":{"code":"E0596","explanation":"\nThis error occurs because you tried to mutably borrow a non-mutable variable.\n\nExample of erroneous code:\n\n```compile_fail,E0596\nlet x = 1;\nlet y = &mut x; // error: cannot borrow mutably\n```\n\nIn here, `x` isn't mutable, so when we try to mutably borrow it in `y`, it\nfails. To fix this error, you need to make `x` mutable:\n\n```\nlet mut x = 1;\nlet y = &mut x; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/did_you_mean/issue-39544.rs","byte_start":1113,"byte_end":1125,"line_start":41,"line_end":41,"column_start":17,"column_end":29,"is_primary":true,"text":[{"text":"        let _ = &mut other.x; //~ ERROR cannot borrow","highlight_start":17,"highlight_end":29}],"label":"cannot borrow as mutable","suggested_replacement":null,"expansion":null}],"children":[{"message":"the value which is causing this path not to be mutable is...: `*other`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0596]: cannot borrow immutable item `other.x` as mutable\n  --> /checkout/src/test/ui/did_you_mean/issue-39544.rs:41:17\n   |\nLL |         let _ = &mut other.x; //~ ERROR cannot borrow\n   |                 ^^^^^^^^^^^^ cannot borrow as mutable\n   |\n   = note: the value which is causing this path not to be mutable is...: `*other`\n\n"}
[00:49:37] {"message":"cannot borrow immutable item `other.x` as mutable","code":{"code":"E0596","explanation":"\nThis error occurs because you tried to mutably borrow a non-mutable variable.\n\nExample of erroneous code:\n\n```compile_fail,E0596\nlet x = 1;\nlet y = &mut x; // error: cannot borrow mutably\n```\n\nIn here, `x` isn't mutable, so when we try to mutably borrow it in `y`, it\nfails. To fix this error, you need to make `x` mutable:\n\n```\nlet mut x = 1;\nlet y = &mut x; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/did_you_mean/issue-39544.rs","byte_start":1199,"byte_end":1211,"line_start":45,"line_end":45,"column_start":17,"column_end":29,"is_primary":true,"text":[{"text":"        let _ = &mut other.x; //~ ERROR cannot borrow","highlight_start":17,"highlight_end":29}],"label":"cannot borrow as mutable","suggested_replacement":null,"expansion":null}],"children":[{"message":"the value which is causing this path not to be mutable is...: `*other`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0596]: cannot borrow immutable item `other.x` as mutable\n  --> /checkout/src/test/ui/did_you_mean/issue-39544.rs:45:17\n   |\nLL |         let _ = &mut other.x; //~ ERROR cannot borrow\n   |                 ^^^^^^^^^^^^ cannot borrow as mutable\n   |\n   = note: the value which is causing this path not to be mutable is...: `*other`\n\n"}
[00:49:37] {"message":"cannot borrow immutable item `z.x` as mutable","code":{"code":"E0596","explanation":"\nThis error occurs because you tried to mutably borrow a non-mutable variable.\n\nExample of erroneous code:\n\n```compile_fail,E0596\nlet x = 1;\nlet y = &mut x; // error: cannot borrow mutably\n```\n\nIn here, `x` isn't mutable, so when we try to mutably borrow it in `y`, it\nfails. To fix this error, you need to make `x` mutable:\n\n```\nlet mut x = 1;\nlet y = &mut x; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/did_you_mean/issue-39544.rs","byte_start":1290,"byte_end":1298,"line_start":51,"line_end":51,"column_start":13,"column_end":21,"is_primary":true,"text":[{"text":"    let _ = &mut z.x; //~ ERROR cannot borrow","highlight_start":13,"highlight_end":21}],"label":"cannot borrow as mutable","suggested_replacement":null,"expansion":null}],"children":[{"message":"the value which is causing this path not to be mutable is...: `z`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0596]: cannot borrow immutable item `z.x` as mutable\n  --> /checkout/src/test/ui/did_you_mean/issue-39544.rs:51:13\n   |\nLL |     let _ = &mut z.x; //~ ERROR cannot borrow\n   |             ^^^^^^^^ cannot borrow as mutable\n   |\n   = note: the value which is causing this path not to be mutable is...: `z`\n\n"}
[00:49:37] {"message":"cannot borrow immutable item `w.x` as mutable","code":{"code":"E0596","explanation":"\nThis error occurs because you tried to mutably borrow a non-mutable variable.\n\nExample of erroneous code:\n\n```compile_fail,E0596\nlet x = 1;\nlet y = &mut x; // error: cannot borrow mutably\n```\n\nIn here, `x` isn't mutable, so when we try to mutably borrow it in `y`, it\nfails. To fix this error, you need to make `x` mutable:\n\n```\nlet mut x = 1;\nlet y = &mut x; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/did_you_mean/issue-39544.rs","byte_start":1336,"byte_end":1344,"line_start":52,"line_end":52,"column_start":13,"column_end":21,"is_primary":true,"text":[{"text":"    let _ = &mut w.x; //~ ERROR cannot borrow","highlight_start":13,"highlight_end":21}],"label":"cannot borrow as mutable","suggested_replacement":null,"expansion":null}],"children":[{"message":"the value which is causing this path not to be mutable is...: `*w`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0596]: cannot borrow immutable item `w.x` as mutable\n  --> /checkout/src/test/ui/did_you_mean/issue-39544.rs:52:13\n   |\nLL |     let _ = &mut w.x; //~ ERROR cannot borrow\n   |             ^^^^^^^^ cannot borrow as mutable\n   |\n   = note: the value which is causing this path not to be mutable is...: `*w`\n\n"}
[00:49:37] {"message":"cannot assign to immutable item `*x.0`","code":{"code":"E0594","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/did_you_mean/issue-39544.rs","byte_start":1437,"byte_end":1445,"line_start":58,"line_end":58,"column_start":5,"column_end":13,"is_primary":true,"text":[{"text":"    *x.0 = 1;","highlight_start":5,"highlight_end":13}],"label":"cannot mutate","suggested_replacement":null,"expansion":null}],"children":[],"rendered":"error[E0594]: cannot assign to immutable item `*x.0`\n  --> /checkout/src/test/ui/did_you_mean/issue-39544.rs:58:5\n   |\nLL |     *x.0 = 1;\n   |     ^^^^^^^^ cannot mutate\n\n"}
[00:49:37] {"message":"aborting due to 12 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 12 previous errors\n\n"}
[00:49:37] {"message":"Some errors occurred: E0594, E0596.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0594, E0596.\n"}
[00:49:37] {"message":"For more information about an error, try `rustc --explain E0594`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about an error, try `rustc --explain E0594`.\n"}
[00:49:37]
[00:49:37] ------------------------------------------
[00:49:37]
[00:49:37] thread '[ui (nll)] ui/did_you_mean/issue-39544.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:2919:9
[00:49:37]
[00:49:37] ---- [ui (nll)] ui/error-codes/E0389.rs stdout ----
[00:49:37]  diff of stderr:
[00:49:37]
[00:49:37] - error[E0594]: cannot assign to immutable item `fancy_ref.num`
[00:49:37] + error[E0594]: cannot assign to data in a `&` reference
[00:49:37] 2   --> $DIR/E0389.rs:18:5
[00:49:37] 3    |
[00:49:37] + LL |     let fancy_ref = &(&mut fancy);
[00:49:37] +    |                     ------------- help: consider changing this to be a mutable reference: `&mut`
[00:49:37] 4 LL |     fancy_ref.num = 6; //~ ERROR E0389
[00:49:37] -    |     ^^^^^^^^^^^^^^^^^ cannot mutate
[00:49:37] -    |
[00:49:37] -    = note: Value not mutable causing this error: `*fancy_ref`
[00:49:37] +    |     ^^^^^^^^^^^^^^^^^ `fancy_ref` is a `&` reference, so the data it refers to cannot be written
---
[00:49:37] /checkout/src/test/ui/update-references.sh '/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui' 'error-codes/E0389.rs'
[00:49:37]
[00:49:37] error: 1 errors occurred comparing output.
[00:49:37] status: exit code: 101
[00:49:37] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/error-codes/E0389.rs" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--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/error-codes/E0389.stage2-x86_64-unknown-linux-gnu" "-Znll" "-Zborrowck=mir" "-Ztwo-phase-borrows" "-Crpath" "-O" "-Zmiri" "-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/error-codes/E0389.stage2-x86_64-unknown-linux-gnu.aux" "-A" "unused"
---
[00:49:37] {"message":"cannot assign to data in a `&` reference","code":{"code":"E0594","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/error-codes/E0389.rs","byte_start":592,"byte_end":609,"line_start":18,"line_end":18,"column_start":5,"column_end":22,"is_primary":true,"text":[{"text":"    fancy_ref.num = 6; //~ ERROR E0389","highlight_start":5,"highlight_end":22}],"label":"`fancy_ref` is a `&` reference, so the data it refers to cannot be written","suggested_replacement":null,"expansion":null}],"children":[{"message":"consider changing this to be a mutable reference: `&mut`","code":null,"level":"help","spans":[{"file_name":"/checkout/src/test/ui/error-codes/E0389.rs","byte_start":573,"byte_end":586,"line_start":17,"line_end":17,"column_start":21,"column_end":34,"is_primary":true,"text":[{"text":"    let fancy_ref = &(&mut fancy);","highlight_start":21,"highlight_end":34}],"label":null,"suggested_replacement":"","expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0594]: cannot assign to data in a `&` reference\n  --> /checkout/src/test/ui/error-codes/E0389.rs:18:5\n   |\nLL |     let fancy_ref = &(&mut fancy);\n   |                     ------------- help: consider changing this to be a mutable reference: `&mut`\nLL |     fancy_ref.num = 6; //~ ERROR E0389\n   |     ^^^^^^^^^^^^^^^^^ `fancy_ref` is a `&` reference, so the data it refers to cannot be written\n\n"}
[00:49:37] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:49:37] {"message":"For more information about this error, try `rustc --explain E0594`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0594`.\n"}
[00:49:37]
[00:49:37] ------------------------------------------
[00:49:37]
[00:49:37] thread '[ui (nll)] ui/error-codes/E0389.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:2919:9
[00:49:37]
[00:49:37] ---- [ui (nll)] ui/issue-36400.rs stdout ----
[00:49:37]  diff of stderr:
[00:49:37]
[00:49:37] 4 LL |     f(&mut *x); //~ ERROR cannot borrow immutable
[00:49:37] 5    |       ^^^^^^^ cannot borrow as mutable
[00:49:37] 6    |
[00:49:37] -    = note: Value not mutable causing this error: `x`
[00:49:37] +    = note: the value which is causing this path not to be mutable is...: `x`
---
[00:49:37] /checkout/src/test/ui/update-references.sh '/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui' 'issue-36400.rs'
[00:49:37]
[00:49:37] error: 1 errors occurred comparing output.
[00:49:37] status: exit code: 101
[00:49:37] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issue-36400.rs" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--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/issue-36400.stage2-x86_64-unknown-linux-gnu" "-Znll" "-Zborrowck=mir" "-Ztwo-phase-borrows" "-Crpath" "-O" "-Zmiri" "-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/issue-36400.stage2-x86_64-unknown-linux-gnu.aux" "-A" "unused"
---
[00:49:37] {"message":"cannot borrow immutable item `*x` as mutable","code":{"code":"E0596","explanation":"\nThis error occurs because you tried to mutably borrow a non-mutable variable.\n\nExample of erroneous code:\n\n```compile_fail,E0596\nlet x = 1;\nlet y = &mut x; // error: cannot borrow mutably\n```\n\nIn here, `x` isn't mutable, so when we try to mutably borrow it in `y`, it\nfails. To fix this error, you need to make `x` mutable:\n\n```\nlet mut x = 1;\nlet y = &mut x; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issue-36400.rs","byte_start":532,"byte_end":539,"line_start":15,"line_end":15,"column_start":7,"column_end":14,"is_primary":true,"text":[{"text":"    f(&mut *x); //~ ERROR cannot borrow immutable","highlight_start":7,"highlight_end":14}],"label":"cannot borrow as mutable","suggested_replacement":null,"expansion":null}],"children":[{"message":"the value which is causing this path not to be mutable is...: `x`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0596]: cannot borrow immutable item `*x` as mutable\n  --> /checkout/src/test/ui/issue-36400.rs:15:7\n   |\nLL |     f(&mut *x); //~ ERROR cannot borrow immutable\n   |       ^^^^^^^ cannot borrow as mutable\n   |\n   = note: the value which is causing this path not to be mutable is...: `x`\n\n"}
[00:49:37] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:49:37] {"message":"For more information about this error, try `rustc --explain E0596`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0596`.\n"}
[00:49:37]
[00:49:37] ------------------------------------------
[00:49:37]
[00:49:37] thread '[ui (nll)] ui/issue-36400.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:2919:9
[00:49:37]
[00:49:37] ---- [ui (nll)] ui/rfc-2005-default-binding-mode/explicit-mut.rs stdout ----
[00:49:37]  diff of stderr:
[00:49:37]
[00:49:37] - error[E0594]: cannot assign to immutable item `*n`
[00:49:37] + error[E0594]: cannot assign to data in a `&` reference
[00:49:37] 2   --> $DIR/explicit-mut.rs:17:13
[00:49:37] 3    |
[00:49:37] + LL |         Some(n) => {
[00:49:37] +    |              - help: consider changing this to be a mutable reference: `&mut`
[00:49:37] 4 LL |             *n += 1; //~ ERROR cannot assign to immutable
[00:49:37] -    |             ^^^^^^^ cannot mutate
[00:49:37] +    |             ^^^^^^^
[00:49:37] 6
[00:49:37] - error[E0594]: cannot assign to immutable item `*n`
[00:49:37] + error[E0594]: cannot assign to data in a `&` reference
[00:49:37] 8   --> $DIR/explicit-mut.rs:25:13
[00:49:37] 9    |
[00:49:37] + LL |         Some(n) => {
[00:49:37] +    |              - help: consider changing this to be a mutable reference: `&mut`
[00:49:37] 10 LL |             *n += 1; //~ ERROR cannot assign to immutable
[00:49:37] -    |             ^^^^^^^ cannot mutate
[00:49:37] +    |             ^^^^^^^
[00:49:37] 12
[00:49:37] - error[E0594]: cannot assign to immutable item `*n`
[00:49:37] + error[E0594]: cannot assign to data in a `&` reference
[00:49:37] 14   --> $DIR/explicit-mut.rs:33:13
[00:49:37] 15    |
[00:49:37] + LL |         Some(n) => {
[00:49:37] +    |              - help: consider changing this to be a mutable reference: `&mut`
[00:49:37] 16 LL |             *n += 1; //~ ERROR cannot assign to immutable
---
[00:49:37] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rfc-2005-default-bi"column_end":20,"is_primary":true,"text":[{"text":"            *n += 1; //~ ERROR cannot assign to immutable","highlight_start":13,"highlight_end":20}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[{"message":"consider changing this to be a mutable reference: `&mut`","code":null,"level":"help","spans":[{"file_name":"/checkout/src/test/ui/rfc-2005-default-binding-mode/explicit-mut.rs","byte_start":639,"byte_end":640,"line_start":16,"line_end":16,"column_start":14,"column_end":15,"is_primary":true,"text":[{"text":"        Some(n) => {","highlight_start":14,"highlight_end":15}],"label":null,"suggested_replacement":"","expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0594]: cannot assign to data in a `&` reference\n  --> /checkout/src/test/ui/rfc-2005-default-binding-mode/explicit-mut.rs:17:13\n   |\nLL |         Some(n) => {\n   |              - help: consider changing this to be a mutable reference: `&mut`\nLL |             *n += 1; //~ ERROR cannot assign to immutable\n   |             ^^^^^^^\n\n"}
[00:49:37] {"message":"cannot assign to data in a `&` reference","code":{"code":"E0594","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/rfc-2005-default-binding-mode/explicit-mut.rs","byte_start":828,"byte_end":835,"line_start":25,"line_end":25,"column_start":13,"column_end":20,"is_primary":true,"text":[{"text":"            *n += 1; //~ ERROR cannot assign to immutable","highlight_start":13,"highlight_end":20}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[{"message":"consider changing this to be a mutable reference: `&mut`","code":null,"level":"help","spans":[{"file_name":"/checkout/src/test/ui/rfc-2005-default-binding-mode/explicit-mut.rs","byte_start":808,"byte_end":809,"line_start":24,"line_end":24,"column_start":14,"column_end":15,"is_primary":true,"text":[{"text":"        Some(n) => {","highlight_start":14,"highlight_end":15}],"label":null,"suggested_replacement":"","expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0594]: cannot assign to data in a `&` reference\n  --> /checkout/src/test/ui/rfc-2005-default-binding-mode/explicit-mut.rs:25:13\n   |\nLL |         Some(n) => {\n   |              - help: consider changing this to be a mutable reference: `&mut`\nLL |             *n += 1; //~ ERROR cannot assign to immutable\n   |             ^^^^^^^\n\n"}
[00:49:37] {"message":"cannot assign to data in a `&` reference","code":{"code":"E0594","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/rfc-2005-default-binding-mode/explicit-mut.rs","byte_start":997,"byte_end":1004,"line_start":33,"line_end":33,"column_start":13,"column_end":20,"is_primary":true,"text":[{"text":"            *n += 1; //~ ERROR cannot assign to immutable","highlight_start":13,"highlight_end":20}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[{"message":"consider changing this to be a mutable reference: `&mut`","code":null,"level":"help","spans":[{"file_name":"/checkout/src/test/ui/rfc-2005-default-binding-mode/explicit-mut.rs","byte_start":977,"byte_end":978,"line_start":32,"line_end":32,"column_start":14,"column_end":15,"is_primary":true,"text":[{"text":"        Some(n) => {","highlight_start":14,"highlight_end":15}],"label":null,"suggested_replacement":"","expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0594]: cannot assign to data in a `&` reference\n  --> /checkout/src/test/ui/rfc-2005-default-binding-mode/explicit-mut.rs:33:13\n   |\nLL |         Some(n) => {\n   |              - help: consider changing this to be a mutable reference: `&mut`\nLL |             *n += 1; //~ ERROR cannot assign to immutable\n   |             ^^^^^^^\n\n"}
[00:49:37] {"message":"aborting due to 3 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 3 previous errors\n\n"}
[00:49:37] {"message":"For more information about this error, try `rustc --explain E0594`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0594`.\n"}
[00:49:37]
[00:49:37] ------------------------------------------
[00:49:37]
[00:49:37] thread '[ui (nll)] ui/rfc-2005-default-binding-mode/explicit-mut.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:2919:9
[00:49:37]
[00:49:37] ---- [ui (nll)] ui/rfc-2005-default-binding-mode/enum.rs stdout ----
[00:49:37]  diff of stderr:
[00:49:37]
[00:49:37] - error[E0594]: cannot assign to immutable item `*x`
[00:49:37] + error[E0594]: cannot assign to data in a `&` reference
[00:49:37] 2   --> $DIR/enum.rs:19:5
[00:49:37] 3    |
[00:49:37] + LL |     let Wrap(x) = &Wrap(3);
[00:49:37] +    |              - help: consider changing this to be a mutable reference: `&mut`
[00:49:37] 4 LL |     *x += 1; //~ ERROR cannot assign to immutable
[00:49:37] -    |     ^^^^^^^ cannot mutate
[00:49:37] +    |     ^^^^^^^
[00:49:37] 6
[00:49:37] - error[E0594]: cannot assign to immutable item `*x`
[00:49:37] + error[E0594]: cannot assign to data in a `&` reference
[00:49:37] 8   --> $DIR/enum.rs:23:9
[00:49:37] 9    |
[00:49:37] + LL |     if let Some(x) = &Some(3) {
[00:49:37] +    |                 - help: consider changing this to be a mutable reference: `&mut`
[00:49:37] 10 LL |         *x += 1; //~ ERROR cannot assign to immutable
[00:49:37] -    |         ^^^^^^^ cannot mutate
[00:49:37] +    |         ^^^^^^^
[00:49:37] 12
[00:49:37] - error[E0594]: cannot assign to immutable item `*x`
[00:49:37] + error[E0594]: cannot assign to data in a `&` reference
[00:49:37] 14   --> $DIR/enum.rs:29:9
[00:49:37] 15    |
[00:49:37] + LL |     while let Some(x) = &Some(3) {
[00:49:37] +    |                    - help: consider changing this to be a mutable reference: `&mut`
[00:49:37] 16 LL |         *x += 1; //~ ERROR cannot assign to immutable
---
[00:49:37] /checkout/src/test/ui/update-references.sh '/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui' 'rfc-2005-default-binding-mode/enum.rs'
[00:49:37]
[00:49:37] error: 1 errors occurred comparing output.
[00:49:37] status: exit code: 101
[00:49:37] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/rfc-2005-default-binding-mode/enum.rs" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--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/rfc-2005-default-binding-mode/enum.stage2-x86_64-unknown-linux-gnu" "-Znll" "-Zborrowck=mir" "-Ztwo-phase-borrows" "-Crpath" "-O" "-Zmiri" "-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/rfc-2005-default-binding-mode/enum.stage2-x86_64-unknown-linux-gnu.aux" "-A" "unused"
---
[00:49:37] {"message":"cannot assign to data in a `&` reference","code":{"code":"E0594","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/rfc-2005-default-binding-mode/enum.rs","byte_start":568,"byte_end":575,"line_start":19,"line_end":19,"column_start":5,"column_end":12,"is_primary":true,"text":[{"text":"    *x += 1; //~ ERROR cannot assign to immutable","highlight_start":5,"highlight_end":12}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[{"message":"consider changing this to be a mutable reference: `&mut`","code":null,"level":"help","spans":[{"file_name":"/checkout/src/test/ui/rfc-2005-default-binding-mode/enum.rs","byte_start":549,"byte_end":550,"line_start":18,"line_end":18,"column_start":14,"column_end":15,"is_primary":true,"text":[{"text":"    let Wrap(x) = &Wrap(3);","highlight_start":14,"highlight_end":15}],"label":null,"suggested_replacement":"","expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0594]: cannot assign to data in a `&` reference\n  --> /checkout/src/test/ui/rfc-2005-default-binding-mode/enum.rs:19:5\n   |\nLL |     let Wrap(x) = &Wrap(3);\n   |              - help: consider changing this to be a mutable reference: `&mut`\nLL |     *x += 1; //~ ERROR cannot assign to immutable\n   |     ^^^^^^^\n\n"}
[00:49:37] {"message":"cannot assign to data in a `&` reference","code":{"code":"E0594","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/rfc-2005-default-binding-mode/enum.rs","byte_start":656,"byte_end":663,"line_start":23,"line_end":23,"column_start":9,"column_end":16,"is_primary":true,"text":[{"text":"        *x += 1; //~ ERROR cannot assign to immutable","highlight_start":9,"highlight_end":16}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[{"message":"consider changing this to be a mutable reference: `&mut`","code":null,"level":"help","spans":[{"file_name":"/checkout/src/test/ui/rfc-2005-default-binding-mode/enum.rs","byte_start":632,"byte_end":633,"line_start":22,"line_end":22,"column_start":17,"column_end":18,"is_primary":true,"text":[{"text":"    if let Some(x) = &Some(3) {","highlight_start":17,"highlight_end":18}],"label":null,"suggested_replacement":"","expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0594]: cannot assign to data in a `&` reference\n  --> /checkout/src/test/ui/rfc-2005-default-binding-mode/enum.rs:23:9\n   |\nLL |     if let Some(x) = &Some(3) {\n   |                 - help: consider changing this to be a mutable reference: `&mut`\nLL |         *x += 1; //~ ERROR cannot assign to immutable\n   |         ^^^^^^^\n\n"}
[00:49:37] {"message":"cannot assign to data in a `&` reference","code":{"code":"E0594","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/rfc-2005-default-binding-mode/enum.rs","byte_start":783,"byte_end":790,"line_start":29,"line_end":29,"column_start":9,"column_end":16,"is_primary":true,"text":[{"text":"        *x += 1; //~ ERROR cannot assign to immutable","highlight_start":9,"highlight_end":16}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[{"message":"consider changing this to be a mutable reference: `&mut`","code":null,"level":"help","spans":[{"file_name":"/checkout/src/test/ui/rfc-2005-default-binding-mode/enum.rs","byte_start":759,"byte_end":760,"line_start":28,"line_end":28,"column_start":20,"column_end":21,"is_primary":true,"text":[{"text":"    while let Some(x) = &Some(3) {","highlight_start":20,"highlight_end":21}],"label":null,"suggested_replacement":"","expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0594]: cannot assign to data in a `&` reference\n  --> /checkout/src/test/ui/rfc-2005-default-binding-mode/enum.rs:29:9\n   |\nLL |     while let Some(x) = &Some(3) {\n   |                    - help: consider changing this to be a mutable reference: `&mut`\nLL |         *x += 1; //~ ERROR cannot assign to immutable\n   |         ^^^^^^^\n\n"}
[00:49:37] {"message":"aborting due to 3 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 3 previous errors\n\n"}
[00:49:37] {"message":"For more information about this error, try `rustc --explain E0594`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0594`.\n"}
[00:49:37]
[00:49:37] ------------------------------------------
[00:49:37]
[00:49:37] thread '[ui (nll)] ui/rfc-2005-default-binding-mode/enum.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:2919:9
[00:49:37]
[00:49:37] ---- [ui (nll)] ui/span/borrowck-call-is-borrow-issue-12224.rs stdout ----
[00:49:37]  diff of stderr:
[00:49:37]
[00:49:37] 24 LL |     f.f.call_mut(())
[00:49:37] 25    |     ^^^ cannot borrow as mutable
[00:49:37] 26    |
[00:49:37] -    = note: Value not mutable causing this error: `*f`
[00:49:37] +    = note: the value which is causing this path not to be mutable is...: `*f`
---
[00:49:37] /checkout/src/test/ui/update-references.sh '/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui' 'span/borrowck-call-is-borrow-issue-12224.rs'
[00:49:37]
[00:49:37] error: 1 errors occurred comparing output.
[00:49:37] status: exit code: 101
[00:49:37] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--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/span/borrowck-call-is-borrow-issue-12224.stage2-x86_64-unknown-linux-gnu" "-Znll" "-Zborrowck=mir" "-Ztwo-phase-borrows" "-Crpath" "-O" "-Zmiri" "-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/span/borrowck-call-is-borrow-issue-12224.stage2-x86_64-unknown-linux-gnu.aux" "-A" "unused"
---
[00:49:37] {"message":"cannot borrow `f` as mutable more than once at a time","code":{"code":"E0499","explanation":"\nA variable was borrowed as mutable more than once. Erroneous code example:\n\n```compile_fail,E0499\nlet mut i = 0;\nlet mut x = &mut i;\nlet mut a = &mut i;\n// error: cannot borrow `i` as mutable more than once at a time\n```\n\nPlease note that in rust, you can either have many immutable references, or one\nmutable reference. Take a look at\nhttps://doc.rust-lang.org/stable/book/references-and-borrowing.html for more\ninformation. Example:\n\n\n```\nlet mut i = 0;\nlet mut x = &mut i; // ok!\n\n// or:\nlet mut i = 0;\nlet a = &i; // ok!\nlet b = &i; // still ok!\nlet c = &i; // still ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs","byte_start":688,"byte_end":689,"line_start":22,"line_end":22,"column_start":5,"column_end":6,"is_primary":false,"text":[{"text":"    f(Box::new(|| {","highlight_start":5,"highlight_end":6}],"label":"first mutable borrow occurs here","suggested_replacement":null,"expansion":null},{"file_name":"/checkout/src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs","byte_start":699,"byte_end":701,"line_start":22,"line_end":22,"column_start":16,"column_end":18,"is_primary":true,"text":[{"text":"    f(Box::new(|| {","highlight_start":16,"highlight_end":18}],"label":"second mutable borrow occurs here","suggested_replacement":null,"expansion":null},{"file_name":"/checkout/src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs","byte_start":772,"byte_end":773,"line_start":24,"line_end":24,"column_start":9,"column_end":10,"is_primary":false,"text":[{"text":"        f((Box::new(|| {})))","highlight_start":9,"highlight_end":10}],"label":"borrow occurs due to use of `f` in closure","suggested_replacement":null,"expansion":null},{"file_name":"/checkout/src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs","byte_start":688,"byte_end":800,"line_start":22,"line_end":25,"column_start":5,"column_end":8,"is_primary":false,"text":[{"text":"    f(Box::new(|| {","highlight_start":5,"highlight_end":20},{"text":"    //~^ ERROR: cannot borrow `f` as mutable more than once","highlight_start":1,"highlight_end":60},{"text":"        f((Box::new(|| {})))","highlight_start":1,"highlight_end":29},{"text":"    }));","highlight_start":1,"highlight_end":8}],"label":"borrow later used here","suggested_replacement":null,"expansion":null}],"children":[],"rendered":"error[E0499]: cannot borrow `f` as mutable more than once at a time\n  --> /checkout/src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs:22:16\n   |\nLL |       f(Box::new(|| {\n   |       -          ^^ second mutable borrow occurs here\n   |       |\n   |  _____first mutable borrow occurs here\n   | |\nLL | |     //~^ ERROR: cannot borrow `f` as mutable more than once\nLL | |         f((Box::new(|| {})))\n   | |         - borrow occurs due to use of `f` in closure\nLL | |     }));\n   | |_______- borrow later used here\n\n"}
[00:49:37] {"message":"cannot borrow immutable item `*f` as mutable","code":{"code":"E0596","explanation":"\nThis error occurs because you tried to mutably borrow a non-mutable variable.\n\nExample of erroneous code:\n\n```compile_fail,E0596\nlet x = 1;\nlet y = &mut x; // error: cannot borrow mutably\n```\n\nIn here, `x` isn't mutable, so when we try to mutably borrow it in `y`, it\nfails. To fix this error, you need to make `x` mutable:\n\n```\nlet mut x = 1;\nlet y = &mut x; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs","byte_start":914,"byte_end":918,"line_start":35,"line_end":35,"column_start":5,"column_end":9,"is_primary":true,"text":[{"text":"    (*f)();","highlight_start":5,"highlight_end":9}],"label":"cannot borrow as mutable","suggested_replacement":null,"expansion":null}],"children":[],"rendered":"error[E0596]: cannot borrow immutable item `*f` as mutable\n  --> /checkout/src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs:35:5\n   |\nLL |     (*f)();\n   |     ^^^^ cannot borrow as mutable\n\n"}
[00:49:37] {"message":"cannot borrow immutable item `*f.f` as mutable","code":{"code":"E0596","explanation":"\nThis error occurs because you tried to mutably borrow a non-mutable variable.\n\nExample of erroneous code:\n\n```compile_fail,E0596\nlet x = 1;\nlet y = &mut x; // error: cannot borrow mutably\n```\n\nIn here, `x` isn't mutable, so when we try to mutably borrow it in `y`, it\nfails. To fix this error, you need to make `x` mutable:\n\n```\nlet mut x = 1;\nlet y = &mut x; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs","byte_start":1079,"byte_end":1082,"line_start":44,"line_end":44,"column_start":5,"column_end":8,"is_primary":true,"text":[{"text":"    f.f.call_mut(())","highlight_start":5,"highlight_end":8}],"label":"cannot borrow as mutable","suggested_replacement":null,"expansion":null}],"children":[{"message":"the value which is causing this path not to be mutable is...: `*f`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0596]: cannot borrow immutable item `*f.f` as mutable\n  --> /checkout/src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs:44:5\n   |\nLL |     f.f.call_mut(())\n   |     ^^^ cannot borrow as mutable\n   |\n   = note: the value which is causing this path not to be mutable is...: `*f`\n\n"}
[00:49:37] {"message":"cannot move out of borrowed content","code":{"code":"E0507","explanation":"\nYou tried to move out of a value which was borrowed. Erroneous code example:\n\n```compile_fail,E0507\nuse std::cell::RefCell;\n\nstruct TheDarkKnight;\n\nimpl TheDarkKnight {\n    fn nothing_is_true(self) {}\n}\n\nfn main() {\n    let x = RefCell::new(TheDarkKnight);\n\n    x.borrow().nothing_is_true(); // error: cannot move out of borrowed content\n}\n```\n\nHere, the `nothing_is_true` method takes the ownership of `self`. However,\n`self` cannot be moved because `.borrow()` only provides an `&TheDarkKnight`,\nwhich is a borrow of the content owned by the `RefCell`. To fix this error,\nyou have three choices:\n\n* Try to avoid moving the variable.\n* Somehow reclaim the ownership.\n* Implement the `Copy` trait on the type.\n\nExamples:\n\n```\nuse std::cell::RefCell;\n\nstruct TheDarkKnight;\n\nimpl TheDarkKnight {\n    fn nothing_is_true(&self) {} // First case, we don't take ownership\n}\n\nfn main() {\n    let x = RefCell::new(TheDarkKnight);\n\n    x.borrow().nothing_is_true(); // ok!\n}\n```\n\nOr:\n\n```\nuse std::cell::RefCell;\n\nstruct TheDarkKnight;\n\nimpl TheDarkKnight {\n    fn nothing_is_true(self) {}\n}\n\nfn main() {\n    let x = RefCell::new(TheDarkKnight);\n    let x = x.into_inner(); // we get back ownership\n\n    x.nothing_is_true(); // ok!\n}\n```\n\nOr:\n\n```\nuse std::cell::RefCell;\n\n#[derive(Clone, Copy)] // we implement the Copy trait\nstruct TheDarkKnight;\n\nimpl TheDarkKnight {\n    fn nothing_is_true(self) {}\n}\n\nfn main() {\n    let x = RefCell::new(TheDarkKnight);\n\n    x.borrow().nothing_is_true(); // ok!\n}\n```\n\nMoving a member out of a mutably borrowed struct will also cause E0507 error:\n\n```compile_fail,E0507\nstruct TheDarkKnight;\n\nimpl TheDarkKnight {\n    fn nothing_is_true(self) {}\n}\n\nstruct Batcave {\n    knight: TheDarkKnight\n}\n\nfn main() {\n    let mut cave = Batcave {\n        knight: TheDarkKnight\n    };\n    let borrowed = &mut cave;\n\n    borrowed.knight.nothing_is_true(); // E0507\n}\n```\n\nIt is fine only if you put something back. `mem::replace` can be used for that:\n\n```\n# struct TheDarkKnight;\n# impl TheDarkKnight { fn nothing_is_true(self) {} }\n# struct Batcave { knight: TheDarkKnight }\nuse std::mem;\n\nlet mut cave = Batcave {\n    knight: TheDarkKnight\n};\nlet borrowed = &mut cave;\n\nmem::replace(&mut borrowed.knight, TheDarkKnight).nothing_is_true(); // ok!\n```\n\nYou can find more information about borrowing in the rust-book:\nhttp://doc.rust-lang.org/book/first-edition/references-and-borrowing.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs","byte_start":1556,"byte_end":1557,"line_start":66,"line_end":66,"column_start":13,"column_end":14,"is_primary":true,"text":[{"text":"        foo(f);","highlight_start":13,"highlight_end":14}],"label":"cannot move out of borrowed content","suggested_replacement":null,"expansion":null}],"children":[],"rendered":"error[E0507]: cannot move out of borrowed content\n  --> /checkout/src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs:66:13\n   |\nLL |         foo(f);\n   |             ^ cannot move out of borrowed content\n\n"}
[00:49:37] {"message":"cannot move out of `f` because it is borrowed","code":{"code":"E0505","explanation":"\nA value was moved out while it was still borrowed.\n\nErroneous code example:\n\n```compile_fail,E0505\nstruct Value {}\n\nfn eat(val: Value) {}\n\nfn main() {\n    let x = Value{};\n    {\n        let _ref_to_val: &Value = &x;\n        eat(x);\n    }\n}\n```\n\nHere, the function `eat` takes the ownership of `x`. However,\n`x` cannot be moved because it was borrowed to `_ref_to_val`.\nTo fix that you can do few different things:\n\n* Try to avoid moving the variable.\n* Release borrow before move.\n* Implement the `Copy` trait on the type.\n\nExamples:\n\n```\nstruct Value {}\n\nfn eat(val: &Value) {}\n\nfn main() {\n    let x = Value{};\n    {\n        let _ref_to_val: &Value = &x;\n        eat(&x); // pass by reference, if it's possible\n    }\n}\n```\n\nOr:\n\n```\nstruct Value {}\n\nfn eat(val: Value) {}\n\nfn main() {\n    let x = Value{};\n    {\n        let _ref_to_val: &Value = &x;\n    }\n    eat(x); // release borrow and then move it.\n}\n```\n\nOr:\n\n```\n#[derive(Clone, Copy)] // implement Copy trait\nstruct Value {}\n\nfn eat(val: Value) {}\n\nfn main() {\n    let x = Value{};\n    {\n        let _ref_to_val: &Value = &x;\n        eat(x); // it will be copied here.\n    }\n}\n```\n\nYou can find more information about borrowing in the rust-book:\nhttp://doc.rust-lang.org/stable/book/references-and-borrowing.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs","byte_start":1527,"byte_end":1528,"line_start":65,"line_end":65,"column_start":5,"column_end":6,"is_primary":false,"text":[{"text":"    f(Box::new(|a| {","highlight_start":5,"highlight_end":6}],"label":"borrow of `f` occurs here","suggested_replacement":null,"expansion":null},{"file_name":"/checkout/src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs","byte_start":1538,"byte_end":1720,"line_start":65,"line_end":69,"column_start":16,"column_end":6,"is_primary":true,"text":[{"text":"    f(Box::new(|a| {","highlight_start":16,"highlight_end":21},{"text":"        foo(f);","highlight_start":1,"highlight_end":16},{"text":"        //~^ ERROR cannot move `f` into closure because it is borrowed","highlight_start":1,"highlight_end":71},{"text":"        //~| ERROR cannot move out of captured outer variable in an `FnMut` closure","highlight_start":1,"highlight_end":84},{"text":"    }), 3);","highlight_start":1,"highlight_end":6}],"label":"move out of `f` occurs here","suggested_replacement":null,"expansion":null},{"file_name":"/checkout/src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs","byte_start":1527,"byte_end":1725,"line_start":65,"line_end":69,"column_start":5,"column_end":11,"is_primary":false,"text":[{"text":"    f(Box::new(|a| {","highlight_start":5,"highlight_end":21},{"text":"        foo(f);","highlight_start":1,"highlight_end":16},{"text":"        //~^ ERROR cannot move `f` into closure because it is borrowed","highlight_start":1,"highlight_end":71},{"text":"        //~| ERROR cannot move out of captured outer variable in an `FnMut` closure","highlight_start":1,"highlight_end":84},{"text":"    }), 3);","highlight_start":1,"highlight_end":11}],"label":"borrow later used here","suggested_replacement":null,"expansion":null}],"children":[],"rendered":"error[E0505]: cannot move out of `f` because it is borrowed\n  --> /checkout/src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs:65:16\n   |\nLL |        f(Box::new(|a| {\n   |   _____-__________^\n   |  |     |\n   |  |_____borrow of `f` occurs here\n   | ||\nLL | ||         foo(f);\nLL | ||         //~^ ERROR cannot move `f` into closure because it is borrowed\nLL | ||         //~| ERROR cannot move out of captured outer variable in an `FnMut` closure\nLL | ||     }), 3);\n   | ||_____^____- borrow later used here\n   |  |_____|\n   |        move out of `f` occurs here\n\n"}
[00:49:37] {"message":"aborting due to 5 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 5 previous errors\n\n"}
[00:49:37] {"message":"Some errors occurred: E0499, E0505, E0507, E0596.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0499, E0505, E0507, E0596.\n"}
[00:49:37] {"message":"For more information about an error, try `rustc --explain E0499`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about an error, try `rustc --explain E0499`.\n"}
[00:49:37]
[00:49:37] ------------------------------------------
[00:49:37]
[00:49:37] thread '[ui (nll)] ui/span/borrowck-call-is-borrow-issue-12224.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:2919:9
[00:49:37]
[00:49:37] ---- [ui (nll)] ui/span/borrowck-object-mutability.rs stdout ----
[00:49:37]  diff of stderr:
[00:49:37]
[00:49:37] 10 LL |     x.borrowed_mut(); //~ ERROR cannot borrow
[00:49:37] 11    |     ^ cannot borrow as mutable
[00:49:37] 12    |
[00:49:37] -    = note: Value not mutable causing this error: `x`
[00:49:37] +    = note: the value which is causing this path not to be mutable is...: `x`
---
[00:49:37] /checkout/src/test/ui/update-references.sh '/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui' 'span/borrowck-object-mutability.rs'
[00:49:37]
[00:49:37] error: 1 errors occurred comparing output.
[00:49:37] status: exit code: 101
[00:49:37] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/span/borrowck-object-mutability.rs" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--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/span/borrowck-object-mutability.stage2-x86_64-unknown-linux-gnu" "-Znll" "-Zborrowck=mir" "-Ztwo-phase-borrows" "-Crpath" "-O" "-Zmiri" "-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/span/borrowck-object-mutability.stage2-x86_64-unknown-linux-gnu.aux" "-A" "unused"
---
[00:49:37] {"message":"cannot borrow immutable item `*x` as mutable","code":{"code":"E0596","explanation":"\nThis error occurs because you tried to mutably borrow a non-mutable variable.\n\nExample of erroneous code:\n\n```compile_fail,E0596\nlet x = 1;\nlet y = &mut x; // error: cannot borrow mutably\n```\n\nIn here, `x` isn't mutable, so when we try to mutably borrow it in `y`, it\nfails. To fix this error, you need to make `x` mutable:\n\n```\nlet mut x = 1;\nlet y = &mut x; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/span/borrowck-object-mutability.rs","byte_start":593,"byte_end":594,"line_start":19,"line_end":19,"column_start":5,"column_end":6,"is_primary":true,"text":[{"text":"    x.borrowed_mut(); //~ ERROR cannot borrow","highlight_start":5,"highlight_end":6}],"label":"cannot borrow as mutable","suggested_replacement":null,"expansion":null}],"children":[],"rendered":"error[E0596]: cannot borrow immutable item `*x` as mutable\n  --> /checkout/src/test/ui/span/borrowck-object-mutability.rs:19:5\n   |\nLL |     x.borrowed_mut(); //~ ERROR cannot borrow\n   |     ^ cannot borrow as mutable\n\n"}
[00:49:37] {"message":"cannot borrow immutable item `*x` as mutable","code":{"code":"E0596","explanation":"\nThis error occurs because you tried to mutably borrow a non-mutable variable.\n\nExample of erroneous code:\n\n```compile_fail,E0596\nlet x = 1;\nlet y = &mut x; // error: cannot borrow mutably\n```\n\nIn here, `x` isn't mutable, so when we try to mutably borrow it in `y`, it\nfails. To fix this error, you need to make `x` mutable:\n\n```\nlet mut x = 1;\nlet y = &mut x; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/span/borrowck-object-mutability.rs","byte_start":776,"byte_end":777,"line_start":29,"line_end":29,"column_start":5,"column_end":6,"is_primary":true,"text":[{"text":"    x.borrowed_mut(); //~ ERROR cannot borrow","highlight_start":5,"highlight_end":6}],"label":"cannot borrow as mutable","suggested_replacement":null,"expansion":null}],"children":[{"message":"the value which is causing this path not to be mutable is...: `x`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0596]: cannot borrow immutable item `*x` as mutable\n  --> /checkout/src/test/ui/span/borrowck-object-mutability.rs:29:5\n   |\nLL |     x.borrowed_mut(); //~ ERROR cannot borrow\n   |     ^ cannot borrow as mutable\n   |\n   = note: the value which is causing this path not to be mutable is...: `x`\n\n"}
[00:49:37] {"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 2 previous errors\n\n"}
[00:49:37] {"message":"For more information about this error, try `rustc --explain E0596`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0596`.\n"}
[00:49:37]
[00:49:37] ------------------------------------------
[00:49:37]
[00:49:37] thread '[ui (nll)] ui/span/borrowck-object-mutability.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:2919:9
[00:49:37]
[00:49:37]
[00:49:37] failures:
[00:49:37]     [ui (nll)] ui/borrowck/issue-45983.rs
[00:49:37]     [ui (nll)] ui/did_you_mean/issue-35937.rs
[00:49:37]     [ui (nll)] ui/did_you_mean/issue-38147-1.rs
[00:49:37]     [ui (nll)] ui/did_you_mean/issue-38147-4.rs
[00:49:37]     [ui (nll)] ui/did_you_mean/issue-39544.rs
[00:49:37]     [ui (nll)] ui/error-codes/E0389.rs
[00:49:37]     [ui (nll)] ui/issue-36400.rs
[00:49:37]     [ui (nll)] ui/rfc-2005-default-binding-mode/enum.rs
[00:49:37]     [ui (nll)] ui/rfc-2005-default-binding-mode/explicit-mut.rs
[00:49:37]     [ui (nll)] ui/span/borrowck-call-is-borrow-issue-12224.rs
[00:49:37]     [ui (nll)] ui/span/borrowck-object-mutability.rs
[00:49:37]
[00:49:37] test result: FAILED. 1309 passed; 11 failed; 4 ignored; 0 measured; 0 filtered out
[00:49:37]
[00:49:37]
[00:49:37]
[00:49:37] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-3.9/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zmiri -Zunstable-options " "--target-rustcflags" "-Crpath -O -Zmiri -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "3.9.1\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always" "--compare-mode" "nll"
[00:49:37] expected success, got: exit code: 101
[00:49:37]
[00:49:37]
[00:49:37] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:49:37] Build completed unsuccessfully in 0:04:13
[00:49:37] Makefile:58: recipe for target 'check' failed
[00:49:37] make: *** [check] Error 1
---
$ ls -lat $HOME/Library/Logs/DiagnosticReports/
ls: cannot access /home/travis/Library/Logs/DiagnosticReports/: No such file or directory
travis_time:end:05bef5e6:start=1523530600526174984,finish=1523530600533075003,duration=6900019
travis_fold:end:after_failure.2
travis_fold:start:after_failure.3
travis_time:start:03b0fe0f
$ find $HOME/Library/Logs/DiagnosticReports -type f -name '*.crash' -not -name '*.stage2-*.crash' -not -name 'com.apple.CoreSimulator.CoreSimulatorService-*.crash' -exec printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" {} \; -exec head -750 {} \; -exec echo travis_fold":"end:crashlog \; || true
find: `/home/travis/Library/Logs/DiagnosticReports': No such file or directory
travis_time:end:03b0fe0f:start=1523530600541165676,finish=1523530600548258803,duration=7093127
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0852a5b4
$ dmesg | grep -i kill
[   10.504007] init: failsafe main process (1092) killed by TERM signal

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)

@pnkfelix
Copy link
Member Author

(hmm, interesting; I had assumed that when I pushed the new commit, that would override the build associated with its parent commit and thus we wouldn't see any log for the build failure associated with that. Clearly that assumption was incorrect...)

@nikomatsakis
Copy link
Contributor

@pnkfelix I am a bit nervous about the effect on bors cycle time. NLL is not known to be especially fast right now, and we'll also be running the tests more often. @rust-lang/infra, can we test that somehow?

@kennytm
Copy link
Member

kennytm commented Apr 12, 2018

We could selectively enable this only on one fast image such as x86_64-gnu or x86_64-gnu-llvm-3.9. This means the NLL compare mode should be configurable.

@Mark-Simulacrum
Copy link
Member

If we're fine with the implementation let's just land it and we can go from there; I don't think there's a good way to analyze potential impact on cycle time before landing.

@pnkfelix
Copy link
Member Author

pnkfelix commented Apr 16, 2018

Hmm, I just realized that ui/span/dropck_vec_cycle_checked.rs is taking an inordinately long time when compiling under NLL. (I'm doing a run under time rustc now to get a precise measure of how long it actually takes. Hopefully this isn't an infinite loop.)

  • Update: I killed the rustc process after letting it run for 52 minutes. I'm going to try modifying the test to see if I can determine a correlation between some programming pattern and the NLL running time.

(I had gotten warnings in my prototyping saying that it was running for over 60 seconds, but I was silly and ignored them, thinking that it might be some issue with my local setup.)

I don't think I can land this until at least that is resolved.

@kennytm kennytm added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 16, 2018
@kennytm
Copy link
Member

kennytm commented Apr 16, 2018

Blocked by #49998.

@bors
Copy link
Contributor

bors commented Apr 18, 2018

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

E.g. when running with `--compare-mode=nll`, then each test line will
look like e.g.:

```
test [ui (nll)] ui/issue-10969.rs ... ok
```
…ating of cause map.

This seems to avoid poor scaling on src/test/ui/span/dropck_vec_cycle_checked.rs
…imal-causes` flag

This commit only applies the flag to the one test case,
ui/span/dropck_vec_cycle_checked.rs, that absolutely needs it. Without
the flag, that test takes an unknown amount of time (greater than 1
minute) to compile. But its possible that other tests would also
benefit from the flag, and we may want to make it the default (after
evaluating its impact on other tests).

In terms of its known impact on other tests, I have only evaluated the
ui tests, and the *only* ui test I have found that the flag impacts
(running under NLL mode, of course), is src/test/ui/nll/issue-31567.rs

In particular:

```
% ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc ../src/test/ui/nll/issue-31567.rs
error[E0597]: `*v.0` does not live long enough
  --> ../src/test/ui/nll/issue-31567.rs:22:26
   |
22 |     let s_inner: &'a S = &*v.0; //~ ERROR `*v.0` does not live long enough
   |                          ^^^^^ borrowed value does not live long enough
23 |     &s_inner.0
24 | }
   | - borrowed value only lives until here
   |
note: borrowed value must be valid for the lifetime 'a as defined on the function body at 21:1...
  --> ../src/test/ui/nll/issue-31567.rs:21:1
   |
21 | fn get_dangling<'a>(v: VecWrapper<'a>) -> &'a u32 {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0597`.
% ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc ../src/test/ui/nll/issue-31567.rs  -Z nll-subminimal-causes
error[E0597]: `*v.0` does not live long enough
  --> ../src/test/ui/nll/issue-31567.rs:22:26
   |
22 |     let s_inner: &'a S = &*v.0; //~ ERROR `*v.0` does not live long enough
   |                          ^^^^^ borrowed value does not live long enough
23 |     &s_inner.0
24 | }
   | -
   | |
   | borrowed value only lives until here
   | borrow later used here, when `v` is dropped

error: aborting due to previous error

For more information about this error, try `rustc --explain E0597`.
%
```
….nll.stderr`

This allows easy revision of the update-references.sh script (included
here) so that it can update the expected output for nll rather than
stderr. It also reminds the rustc developer via the filename that they
are looking at output generated under comapre-mode=nll.

One could argue that there is still a problem with the strategy encoded here:
if we reach a scenario where a change to the compiler brings the output
under AST and NLL modes back into sync, this code will continue to still
generate output to distinct `foo.stderr` and `foo.nll.stderr` files, and
will continue to copy those two files back to corresponding distinct
files in the source tree, even if the *content* of the two files is now the
same.

  * Arguably the "right thing" to do in that case is to remove the
    `foo.nll.stderr` file entirely.

  * However, I think the real answer is that we will probably want to
    double-check such cases by hand anyway. We should be regularly
    double-checking the diffs between `foo.stderr` and
    `foo.nll.stderr`, and if we see a zero-diff case, then we should
    evaluate whether that is correct, and if so, remove the file by
    hand.)

  * In any case, I think the default behavior encoded here (or at
    least *intended* to be encoded here) is superior to the
    alternative of *only* generating a `foo.nll.stderr` file if one
    already existed in the source tree at the time that `compiletest`
    was invoked (and otherwise unconditionally generating a
    `foo.stderr` file, as was the behavior prior to this commit),
    because that alternative is more likely to cause rustc developers
    to overwrite a `foo.stderr` file with the stderr output from a
    compare-mode=nll run, which will then break the *normal*
    `compiletest` run and probably be much more confusing for the
    average rustc developer.
@pnkfelix pnkfelix force-pushed the compare-mode-nll-followup-3 branch from cf84091 to 33bcb4e Compare April 18, 2018 13:48
@pnkfelix
Copy link
Member Author

@bors r=nikomatsakis p=10

@bors
Copy link
Contributor

bors commented Apr 19, 2018

📌 Commit 33bcb4e 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-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Apr 19, 2018
@pnkfelix
Copy link
Member Author

Thanks to commits a771b0f and 1a4326d, this is no longer blocked by #49998.

@pnkfelix
Copy link
Member Author

Also, to be clear: I am landing this based on earlier discussions with @nikomatsakis where he essentially said "if the infrastructure team is okay with us landing this, then we should do so, with high priority to avoid test rot", and my understanding from the infrastructure team is that we should go with a "attempt to land it, because there's no reasonable way for us to evaluate the performance impact without landing it."

@bors
Copy link
Contributor

bors commented Apr 19, 2018

⌛ Testing commit 33bcb4e with merge 8a28d94...

bors added a commit that referenced this pull request Apr 19, 2018
…tsakis

Add src/test/ui regression testing for NLL

This PR changes `x.py test` so that when you are running the `ui` test suite, it will also always run `compiletest` in the new `--compare-mode=nll`, which just double-checks that when running under the experimental NLL mode, the output matches the `<source-name>.nll.stderr` file, if present.

In order to reduce the chance of a developer revolt in response to this change, this PR also includes some changes to make the `--compare-mode=nll` more user-friendly:

 1. It now generates nll-specific .stamp files, and uses them (so that repeated runs can reuse previously cached results).
 2. Each line of terminal output distinguishes whether we are running under `--compare-mode=nll` by printing with the prefix `[ui (nll)]` instead of just the prefix `[ui]`.

Subtask of #48879
@bors
Copy link
Contributor

bors commented Apr 19, 2018

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

@bors bors merged commit 33bcb4e into rust-lang:master Apr 19, 2018
@ehuss
Copy link
Contributor

ehuss commented Apr 19, 2018

@pnkfelix I'm a little confused by something. This change made it so that stderr files are now written directly to src/test. Previously they were written to the build directory and you had to run update-references to copy it over. Was that intentional? The relevant lines are:

let expected_output_path = self.expected_output_path(kind);
let output_file = self.output_base_name().with_file_name(&expected_output_path);
match File::create(&output_file).and_then(|mut f| f.write_all(actual.as_bytes())) {

Both output_base_name and expected_output_path are absolute paths, so it just resets to expected_output_path.

If not, I can update it in #49812 if you'd like.

EDIT: Also, it doesn't seem to be working as expected for me. If I start with a test that has a difference with NLL (like augmented-assignments.rs), the first time you run it, it updates the base stderr file. The next time you run it, the NLL pass overwrites the stderr without the .nll portion, causing the base mode to fail again. These lines cause it to never create .nll files if they don't already exist:

if !path.exists() && self.config.compare_mode.is_some() {
// fallback!
path = expected_output_path(&self.testpaths, self.revision, &None, kind);

@pnkfelix
Copy link
Member Author

@ehuss you are correct, the fact that we are writing files to src/test was an error in my code. Filed as #50113.

I clearly got my logic wrong here. Will attempt to fix pronto.

@pnkfelix
Copy link
Member Author

(also, I recognize that I made matters much worse here because I didn't request a review of the newer changes I had made, which included the bug I injected here. I'm sorry and I will try to do better; regression testing a feature like NLL, while important, was certainly not worth breaking a critical piece of infrastructure.)

On the plus side, hopefully the problem injected by my bug won't cause too much trouble in the short term, since people should hopefully notice that their stderrs are getting overwritten.

@pnkfelix
Copy link
Member Author

pnkfelix commented Apr 20, 2018

@ehuss As for this other note you wrote in your comment:

Also, it doesn't seem to be working as expected for me. If I start with a test that has a difference with NLL (like augmented-assignments.rs), the first time you run it, it updates the base stderr file. The next time you run it, the NLL pass overwrites the stderr without the .nll portion, causing the base mode to fail again. These lines cause it to never create .nll files if they don't already exist:

I did not attempt to address this in PR #50117 (my fix for #50113). I know there were trade-offs I was considering when I wrote this (see discussion attached to commit 33bcb4e ), but I didn't realize I had gotten things quite that bad. (But obviously I didn't realize a lot of problems in what I had done.)

(That's my long-winded way of saying: "There probably is more work to do here." I won't be able to address it for at least a week. I won't be hurt if someone comes in and either fixes the code, or rips out my attempt to generate output to a special file under compare-mode=nll...)

@ehuss
Copy link
Contributor

ehuss commented Apr 20, 2018

I think that #49812 fixes both issues. It essentially always uses the fully-qualified filename (includes nll mode when running nll) when writing out the output (which is only written on failure). Assuming the regular mode runs before nll, it seems to do the right thing for me.

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.

8 participants