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

Rollup of 9 pull requests #57092

Closed
wants to merge 0 commits into from
Closed

Rollup of 9 pull requests #57092

wants to merge 0 commits into from

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Dec 24, 2018

Successful merges:

Failed merges:

r? @ghost

@Centril
Copy link
Contributor Author

Centril commented Dec 24, 2018

@bors r+ p=10

@bors
Copy link
Contributor

bors commented Dec 24, 2018

📌 Commit 4a5a34a3f36d81ee1161bd769c5e99e4065348ca has been approved by Centril

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Dec 24, 2018
@bors
Copy link
Contributor

bors commented Dec 24, 2018

⌛ Testing commit 4a5a34a3f36d81ee1161bd769c5e99e4065348ca with merge 899bb2fd1f9e95e53f47ab48d2ec43a5f8e737d8...

@bors
Copy link
Contributor

bors commented Dec 24, 2018

💔 Test failed - status-travis

@rust-highfive
Copy link
Collaborator

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

Click to expand the log.
[01:20:27] 1 error[E0507]: cannot move out of borrowed content
[01:20:27] -   --> $DIR/access-mode-in-closures.rs:19:15
[01:20:27] +   --> $DIR/access-mode-in-closures.rs:18:15
[01:20:27] 3    |
[01:20:27] - LL |         match *s { sty(v) => v } //~ ERROR cannot move out
[01:20:27] -    |               ^^       - data moved here
[01:20:27] + LL |         match *s { S(v) => v } //~ ERROR cannot move out
[01:20:27] +    |               ^^     - data moved here
[01:20:27] 7    |               cannot move out of borrowed content
[01:20:27] 7    |               cannot move out of borrowed content
[01:20:27] 8    |               help: consider removing the `*`: `s`
[01:20:27] 9    |
[01:20:27] 9    |
[01:20:27] 10 note: move occurs because `v` has type `std::vec::Vec<isize>`, which does not implement the `Copy` trait
[01:20:27] +   --> $DIR/access-mode-in-closures.rs:18:22
[01:20:27] 12    |
[01:20:27] 12    |
[01:20:27] - LL |         match *s { sty(v) => v } //~ ERROR cannot move out
[01:20:27] -    |                        ^
[01:20:27] + LL |         match *s { S(v) => v } //~ ERROR cannot move out
[01:20:27] 15 
[01:20:27] 16 error: aborting due to previous error
[01:20:27] 17 
[01:20:27] 
[01:20:27] 
[01:20:27] 
[01:20:27] The actual stderr differed from the expected stderr.
[01:20:27] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/access-mode-in-closures.nll/access-mode-in-closures.nll.stderr
[01:20:27] To update references, rerun the tests and pass the `--bless` flag
[01:20:27] To only update this specific test, also pass `--test-args access-mode-in-closures.rs`
[01:20:27] error: 1 errors occurred comparing output.
[01:20:27] status: exit code: 1
[01:20:27] status: exit code: 1
[01:20:27] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/access-mode-in-closures.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/access-mode-in-closures.nll/a" "-Zborrowck=migrate" "-Ztwo-phase-borrows" "-Crpath" "-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/access-mode-in-closures.nll/auxiliary" "-A" "unused"
[01:20:27] ------------------------------------------
[01:20:27] 
[01:20:27] ------------------------------------------
[01:20:27] stderr:
[01:20:27] stderr:
[01:20:27] ------------------------------------------
[01:20:27] {"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/access-mode-in-closures.rs","byte_start":647,"byte_end":649,"line_start":18,"line_end":18,"column_start":15,"column_end":17,"is_primary":true,"text":[{"text":"        match *s { S(v) => v } //~ ERROR cannot move out","highlight_start":15,"highlight_end":17}],"label":"cannot move out of borrowed content","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/access-mode-in-closures.rs","byte_start":654,"byte_end":655,"line_start":18,"line_end":18,"column_start":22,"column_end":23,"is_primary":false,"text":[{"text":"        match *s { S(v) => v } //~ ERROR cannot move out","highlight_start":22,"highlight_end":23}],"label":"data moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `v` has type `std::vec::Vec<isize>`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/access-mode-in-closures.rs","byte_start":654,"byte_end":655,"line_start":18,"line_end":18,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"        match *s { S(v) => v } //~ ERROR cannot move out","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"consider removing the `*`","code":null,"level":"help","spans":[{"file_name":"/checkout/src/test/ui/access-mode-in-closures.rs","byte_start":647,"byte_end":649,"line_start":18,"line_end":18,"column_start":15,"column_end":17,"is_primary":true,"text":[{"text":"        match *s { S(v) => v } //~ ERROR cannot move out","highlight_start":15,"highlight_end":17}],"label":null,"suggested_replacement":"s","suggestion_applicability":"Unspecified","expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0507]: cannot move out of borrowed content\n  --> /checkout/src/test/ui/access-mode-in-closures.rs:18:15\n   |\nLL |         match *s { S(v) => v } //~ ERROR cannot move out\n   |               ^^     - data moved here\n   |               |\n   |               cannot move out of borrowed content\n   |               help: consider removing the `*`: `s`\n   |\nnote: move occurs because `v` has type `std::vec::Vec<isize>`, which does not implement the `Copy` trait\n  --> /checkout/src/test/ui/access-mode-in-closures.rs:18:22\n   |\nLL |         match *s { S(v) => v } //~ ERROR cannot move out\n   |                      ^\n\n"}
[01:20:27] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[01:20:27] {"message":"For more information about this error, try `rustc --explain E0507`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0507`.\n"}
[01:20:27] ------------------------------------------
[01:20:27] 
[01:20:27] thread '[ui (nll)] ui/access-mode-in-closures.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3255:9
[01:20:27] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[01:20:27] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[01:20:27] 
[01:20:27] ---- [ui (nll)] ui/borrowck/borrowck-assign-comp.rs#ast stdout ----
[01:20:27] diff of stderr:
[01:20:27] 
[01:20:27] 15    |
[01:20:27] 16 LL |     let q = &p.y;
[01:20:27] 17    |             ---- borrow of `p` occurs here
[01:20:27] - LL |     p = point {x: 5, y: 7};//[ast]~ ERROR cannot assign to `p`
[01:20:27] + LL |     p = Point {x: 5, y: 7};//[ast]~ ERROR cannot assign to `p`
[01:20:27] 19    |     ^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `p` occurs here
[01:20:27] 20 ...
[01:20:27] 21 LL |     *q; // stretch loan
[01:20:27] 
[01:20:27] The actual stderr differed from the expected stderr.
[01:20:27] The actual stderr differed from the expected stderr.
[01:20:27] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/borrowck/borrowck-assign-comp.ast.nll/borrowck-assign-comp.ast.nll.stderr
[01:20:27] To update references, rerun the tests and pass the `--bless` flag
[01:20:27] To only update this specific test, also pass `--test-args borrowck/borrowck-assign-comp.rs`
[01:20:27] 
[01:20:27] error in revision `ast`: 1 errors occurred comparing output.
[01:20:27] status: exit code: 1
[01:20:27] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/borrowck/borrowck-assign-comp.rs" "--target=x86_64-unknown-linux-gnu" "--cfg" "ast" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/borrowck/borrowck-assign-comp.ast.nll/a" "-Zborrowck=migrate" "-Ztwo-phase-borrows" "-Crpath" "-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/borrowck-assign-comp.ast.nll/auxiliary" "-A" "unused"
[01:20:27] ------------------------------------------
[01:20:27] 
[01:20:27] ------------------------------------------
[01:20:27] stderr:
[01:20:27] stderr:
[01:20:27] ------------------------------------------
[01:20:27] {"message":"cannot assign to `p.x` because it is borrowed","code":{"code":"E0506","explanation":"\nThis error occurs when an attempt is made to assign to a borrowed value.\n\nExample of erroneous code:\n\n```compile_fail,E0506\nstruct FancyNum {\n    num: u8,\n}\n\nfn main() {\n    let mut fancy_num = FancyNum { num: 5 };\n    let fancy_ref = &fancy_num;\n    fancy_num = FancyNum { num: 6 };\n    // error: cannot assign to `fancy_num` because it is borrowed\n\n    println!(\"Num: {}, Ref: {}\", fancy_num.num, fancy_ref.num);\n}\n```\n\nBecause `fancy_ref` still holds a reference to `fancy_num`, `fancy_num` can't\nbe assigned to a new value as it would invalidate the reference.\n\nAlternatively, we can move out of `fancy_num` into a second `fancy_num`:\n\n```\nstruct FancyNum {\n    num: u8,\n}\n\nfn main() {\n    let mut fancy_num = FancyNum { num: 5 };\n    let moved_num = fancy_num;\n    fancy_num = FancyNum { num: 6 };\n\n    println!(\"Num: {}, Moved num: {}\", fancy_num.num, moved_num.num);\n}\n```\n\nIf the value has to be borrowed, try limiting the lifetime of the borrow using\na scoped block:\n\n```\nstruct FancyNum {\n    num: u8,\n}\n\nfn main() {\n    let mut fancy_num = FancyNum { num: 5 };\n\n    {\n        let fancy_ref = &fancy_num;\n        println!(\"Ref: {}\", fancy_ref.num);\n    }\n\n    // Works because `fancy_ref` is no longer in scope\n    fancy_num = FancyNum { num: 6 };\n    println!(\"Num: {}\", fancy_num.num);\n}\n```\n\nOr by moving the reference into a function:\n\n```\nstruct FancyNum {\n    num: u8,\n}\n\nfn main() {\n    let mut fancy_num = FancyNum { num: 5 };\n\n    print_fancy_ref(&fancy_num);\n\n    // Works because function borrow has ended\n    fancy_num = FancyNum { num: 6 };\n    println!(\"Num: {}\", fancy_num.num);\n}\n\nfn print_fancy_ref(fancy_ref: &FancyNum){\n    println!(\"Ref: {}\", fancy_ref.num);\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/borrowck/borrowck-assign-comp.rs","byte_start":622,"byte_end":624,"line_start":18,"line_end":18,"column_start":13,"column_end":15,"is_primary":false,"text":[{"text":"    let q = &p;","highlight_start":13,"highlight_end":15}],"label":"borrow of `p.x` occurs here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/borrowck-assign-comp.rs","byte_start":834,"byte_end":841,"line_start":23,"line_end":23,"column_start":5,"column_end":12,"is_primary":true,"text":[{"text":"    p.x = 5; //[ast]~ ERROR cannot assign to `p.x`","highlight_start":5,"highlight_end":12}],"label":"assignment to borrowed `p.x` occurs here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/borrowck-assign-comp.rs","byte_start":960,"byte_end":963,"line_start":25,"line_end":25,"column_start":5,"column_end":8,"is_primary":false,"text":[{"text":"    q.x;","highlight_start":5,"highlight_end":8}],"label":"borrow later used here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0506]: cannot assign to `p.x` because it is borrowed\n  --> /checkout/src/test/ui/borrowck/borrowck-assign-comp.rs:23:5\n   |\nLL |     let q = &p;\n   |             -- borrow of `p.x` occurs here\n...\nLL |     p.x = 5; //[ast]~ ERROR cannot assign to `p.x`\n   |     ^^^^^^^ assignment to borrowed `p.x` occurs here\nLL |              //[mir]~^ ERROR cannot assign to `p.x` because it is borrowed\nLL |     q.x;\n   |     --- borrow later used here\n\n"}
[01:20:27] {"message":"cannot assign to `p` because it is borrowed","code":{"code":"E0506","explanation":"\nThis error occurs when an attempt is made to assign to a borrowed value.\n\nExample of erroneous code:\n\n```compile_fail,E0506\nstruct FancyNum {\n    num: u8,\n}\n\nfn main() {\n    let mut fancy_num = FancyNum { num: 5 };\n    let fancy_ref = &fancy_num;\n    fancy_num = FancyNum { num: 6 };\n    // error: cannot assign to `fancy_num` because it is borrowed\n\n    println!(\"Num: {}, Ref: {}\", fancy_num.num, fancy_ref.num);\n}\n```\n\nBecause `fancy_ref` still holds a reference to `fancy_num`, `fancy_num` can't\nbe assigned to a new value as it would invalidate the reference.\n\nAlternatively, we can move out of `fancy_num` into a second `fancy_num`:\n\n```\nstruct FancyNum {\n    num: u8,\n}\n\nfn main() {\n    let mut fancy_num = FancyNum { num: 5 };\n    let moved_num = fancy_num;\n    fancy_num = FancyNum { num: 6 };\n\n    println!(\"Num: {}, Moved num: {}\", fancy_num.num, moved_num.num);\n}\n```\n\nIf the value has to be borrowed, try limiting the lifetime of the borrow using\na scoped block:\n\n```\nstruct FancyNum {\n    num: u8,\n}\n\nfn main() {\n    let mut fancy_num = FancyNum { num: 5 };\n\n    {\n        let fancy_ref = &fancy_num;\n        println!(\"Ref: {}\", fancy_ref.num);\n    }\n\n    // Works because `fancy_ref` is no longer in scope\n    fancy_num = FancyNum { num: 6 };\n    println!(\"Num: {}\", fancy_num.num);\n}\n```\n\nOr by moving the reference into a function:\n\n```\nstruct FancyNum {\n    num: u8,\n}\n\nfn main() {\n    let mut fancy_num = FancyNum { num: 5 };\n\n    print_fancy_ref(&fancy_num);\n\n    // Works because function borrow has ended\n    fancy_num = FancyNum { num: 6 };\n    println!(\"Num: {}\", fancy_num.num);\n}\n\nfn print_fancy_ref(fancy_ref: &FancyNum){\n    println!(\"Ref: {}\", fancy_ref.num);\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/borrowck/borrowck-assign-comp.rs","byte_start":1151,"byte_end":1155,"line_start":33,"line_end":33,"column_start":13,"column_end":17,"is_primary":false,"text":[{"text":"    let q = &p.y;","highlight_start":13,"highlight_end":17}],"label":"borrow of `p` occurs here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/borrowck-assign-comp.rs","byte_start":1161,"byte_end":1183,"line_start":34,"line_end":34,"column_start":5,"column_end":27,"is_primary":true,"text":[{"text":"    p = Point {x: 5, y: 7};//[ast]~ ERROR cannot assign to `p`","highlight_start":5,"highlight_end":27}],"label":"assignment to borrowed `p` occurs here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/borrowck-assign-comp.rs","byte_start":1339,"byte_end":1341,"line_start":37,"line_end":37,"column_start":5,"column_end":7,"is_primary":false,"text":[{"text":"    *q; // stretch loan","highlight_start":5,"highlight_end":7}],"label":"borrow later used here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0506]: cannot assign to `p` because it is borrowed\n  --> /checkout/src/test/ui/borrowck/borrowck-assign-comp.rs:34:5\n   |\nLL |     let q = &p.y;\n   |             ---- borrow of `p` occurs here\nLL |     p = Point {x: 5, y: 7};//[ast]~ ERROR cannot assign to `p`\n   |     ^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `p` occurs here\n...\nLL |     *q; // stretch loan\n   |     -- borrow later used here\n\n"}
[01:20:27] {"message":"cannot assign to `p.y` because it is borrowed","code":{"code":"E0506","explanation":"\nThis error occurs when an attempt is made to assign to a borrowed value.\n\nExample of erroneous code:\n\n```compile_fail,E0506\nstruct FancyNum {\n    num: u8,\n}\n\nfn main() {\n    let mut fancy_num = FancyNum { num: 5 };\n    let fancy_ref = &fancy_num;\n    fancy_num = FancyNum { num: 6 };\n    // error: cannot assign to `fancy_num` because it is borrowed\n\n    println!(\"Num: {}, Ref: {}\", fancy_num.num, fancy_ref.num);\n}\n```\n\nBecause `fancy_ref` still holds a reference to `fancy_num`, `fancy_num` can't\nbe assigned to a new value as it would invalidate the reference.\n\nAlternatively, we can move out of `fancy_num` into a second `fancy_num`:\n\n```\nstruct FancyNum {\n    num: u8,\n}\n\nfn main() {\n    let mut fancy_num = FancyNum { num: 5 };\n    let moved_num = fancy_num;\n    fancy_num = FancyNum { num: 6 };\n\n    println!(\"Num: {}, Moved num: {}\", fancy_num.num, moved_num.num);\n}\n```\n\nIf the value has to be borrowed, try limiting the lifetime of the borrow using\na scoped block:\n\n```\nstruct FancyNum {\n    num: u8,\n}\n\nfn main() {\n    let mut fancy_num = FancyNum { num: 5 };\n\n    {\n        let fancy_ref = &fancy_num;\n        println!(\"Ref: {}\", fancy_ref.num);\n    }\n\n    // Works because `fancy_ref` is no longer in scope\n    fancy_num = FancyNum { num: 6 };\n    println!(\"Num: {}\", fancy_num.num);\n}\n```\n\nOr by moving the reference into a function:\n\n```\nstruct FancyNum {\n    num: u8,\n}\n\nfn main() {\n    let mut fancy_num = FancyNum { num: 5 };\n\n    print_fancy_ref(&fancy_num);\n\n    // Works because function borrow has ended\n    fancy_num = FancyNum { num: 6 };\n    println!(\"Num: {}\", fancy_num.num);\n}\n\nfn print_fancy_ref(fancy_ref: &FancyNum){\n    println!(\"Ref: {}\", fancy_ref.num);\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/borrowck/borrowck-assign-comp.rs","byte_start":1558,"byte_end":1562,"line_start":45,"line_end":45,"column_start":13,"column_end":17,"is_primary":false,"text":[{"text":"    let q = &p.y;","highlight_start":13,"highlight_end":17}],"label":"borrow of `p.y` occurs here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/borrowck-assign-comp.rs","byte_start":1568,"byte_end":1575,"line_start":46,"line_end":46,"column_start":5,"column_end":12,"is_primary":true,"text":[{"text":"    p.y = 5; //[ast]~ ERROR cannot assign to `p.y`","highlight_start":5,"highlight_end":12}],"label":"assignment to borrowed `p.y` occurs here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/borrowck-assign-comp.rs","byte_start":1694,"byte_end":1696,"line_start":48,"line_end":48,"column_start":5,"column_end":7,"is_primary":false,"text":[{"text":"    *q;","highlight_start":5,"highlight_end":7}],"label":"borrow later used here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0506]: cannot assign to `p.y` because it is borrowed\n  --> /checkout/src/test/ui/borrowck/borrowck-assign-comp.rs:46:5\n   |\nLL |     let q = &p.y;\n   |             ---- borrow of `p.y` occurs here\nLL |     p.y = 5; //[ast]~ ERROR cannot assign to `p.y`\n   |     ^^^^^^^ assignment to borrowed `p.y` occurs here\nLL |              //[mir]~^ ERROR cannot assign to `p.y` because it is borrowed\nLL |     *q;\n   |     -- borrow later used here\n\n"}
[01:20:27] {"message":"aborting due to 3 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 3 previous errors\n\n"}
[01:20:27] {"message":"For more information about this error, try `rustc --explain E0506`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0506`.\n"}
[01:20:27] ------------------------------------------
[01:20:27] 
[01:20:27] thread '[ui (nll)] ui/borrowck/borrowck-assign-comp.rs#ast' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3255:9
[01:20:27] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:505:22
[01:20:27] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:505:22
[01:20:27] 
[01:20:27] ---- [ui (nll)] ui/borrowck/borrowck-borrowed-uniq-rvalue-2.rs stdout ----
[01:20:27] diff of stderr:
[01:20:27] make: *** [check] Error 1
[01:20:27] 
[01:20:27] 1 error[E0716]: temporary value dropped while borrowed
[01:20:27] +   --> $DIR/borrowck-borrowed-uniq-rvalue-2.rs:30:20
[01:20:27] 3    |
[01:20:27] 3    |
[01:20:27] - LL |     let x = defer(&vec!["Goodbye", "world!"]);
[01:20:27] + LL |     let x = defer(&vec!["Goodbye", "world!"]); //~ ERROR borrowed value does not live long enough
[01:20:27] 5    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^ - temporary value is freed at the end of this statement
[01:20:27] 6    |                    |
[01:20:27] 7    |                    creates a temporary which is freed while still in use
[01:20:27] 
[01:20:27] The actual stderr differed from the expected stderr.
[01:20:27] The actual stderr differed from the expected stderr.
[01:20:27] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/borrowck/borrowck-borrowed-uniq-rvalue-2.nll/borrowck-borrowed-uniq-rvalue-2.nll.stderr
[01:20:27] To update references, rerun the tests and pass the `--bless` flag
[01:20:27] To only update this specific test, also pass `--test-args borrowck/borrowck-borrowed-uniq-rvalue-2.rs`
[01:20:27] error: 1 errors occurred comparing output.
[01:20:27] status: exit code: 1
[01:20:27] status: exit code: 1
[01:20:27] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue-2.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/borrowck/borrowck-borrowed-uniq-rvalue-2.nll/a" "-Zborrowck=migrate" "-Ztwo-phase-borrows" "-Crpath" "-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/borrowck-borrowed-uniq-rvalue-2.nll/auxiliary" "-A" "unused"
[01:20:27] ------------------------------------------
[01:20:27] 
[01:20:27] ------------------------------------------
[01:20:27] stderr:
[01:20:27] stderr:
[01:20:27] ------------------------------------------
[01:20:27] {"message":"temporary value dropped while borrowed","code":{"code":"E0716","explanation":"\nThis error indicates that a temporary value is being dropped\nwhile a borrow is still in active use.\n\nErroneous code example:\n\n```compile_fail,E0716\n# #![feature(nll)]\nfn foo() -> i32 { 22 }\nfn bar(x: &i32) -> &i32 { x }\nlet p = bar(&foo());\n         // ------ creates a temporary\nlet q = *p;\n```\n\nHere, the expression `&foo()` is borrowing the expression\n`foo()`. As `foo()` is call to a function, and not the name of\na variable, this creates a **temporary** -- that temporary stores\nthe return value from `foo()` so that it can be borrowed.\nSo you might imagine that `let p = bar(&foo())` is equivalent\nto this:\n\n```compile_fail,E0597\n# fn foo() -> i32 { 22 }\n# fn bar(x: &i32) -> &i32 { x }\nlet p = {\n  let tmp = foo(); // the temporary\n  bar(&tmp)\n}; // <-- tmp is freed as we exit this block\nlet q = p;\n```\n\nWhenever a temporary is created, it is automatically dropped (freed)\naccording to fixed rules. Ordinarily, the temporary is dropped\nat the end of the enclosing statement -- in this case, after the `let`.\nThis is illustrated in the example above by showing that `tmp` would\nbe freed as we exit the block.\n\nTo fix this problem, you need to create a local variable\nto store the value in rather than relying on a temporary.\nFor example, you might change the original program to\nthe following:\n\n```\nfn foo() -> i32 { 22 }\nfn bar(x: &i32) -> &i32 { x }\nlet value = foo(); // dropped at the end of the enclosing block\nlet p = bar(&value);\nlet q = *p;\n```\n\nBy introducing the explicit `let value`, we allocate storage\nthat will last until the end of the enclosing block (when `value`\ngoes out of scope). When we borrow `&value`, we are borrowing a\nlocal variable that already exists, and hence no temporary is created.\n\nTemporaries are not always dropped at the end of the enclosing\nstatement. In simple cases where the `&` expression is immediately\nstored into a variable, the compiler will automatically extend\nthe lifetime of the temporary until the end of the enclosinb\nblock. Therefore, an alternative way to fix the original\nprogram is to write `let tmp = &foo()` and not `let tmp = foo()`:\n\n```\nfn foo() -> i32 { 22 }\nfn bar(x: &i32) -> &i32 { x }\nlet value = &foo();\nlet p = bar(value);\nlet q = *p;\n```\n\nHere, we are still borrowing `foo()`, but as the borrow is assigned\ndirectly into a variable, the temporary will not be dropped until\nthe end of the enclosing block. Similar rules apply when temporaries\nare stored into aggregate structures like a tuple or struct:\n\n```\n// Here, two temporaries are created, but\n// as they are stored directly into `value`,\n// they are not dropped until the end of the\n// enclosing block.\nfn foo() -> i32 { 22 }\nlet value = (&foo(), &foo());\n```\n"},"level":"error","spans":[{"file_name":"<::alloc::macros::vec macros>","byte_start":115,"byte_end":162,"line_start":3,"line_end":3,"column_start":1,"column_end":48,"is_primary":true,"text":[{"text":"< [ _ ] > :: into_vec ( box [ $ ( $ x ) , * ] ) ) ; ( $ ( $ x : expr , ) * )","highlight_start":1,"highlight_end":48}],"label":"creates a temporary which is freed while still in use","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue-2.rs","byte_start":751,"byte_end":776,"line_start":30,"line_end":30,"column_start":20,"column_end":45,"is_primary":false,"text":[{"text":"    let x = defer(&vec![\"Goodbye\", \"world!\"]); //~ ERROR borrowed value does not live long enough","highlight_start":20,"highlight_end":45}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"vec!","def_site_span":{"file_name":"<::alloc::macros::vec macros>","byte_start":0,"byte_end":222,"line_start":1,"line_end":4,"column_start":1,"column_end":31,"is_primary":false,"text":[{"text":"( $ elem : expr ; $ n : expr ) => (","highlight_start":1,"highlight_end":36},{"text":"$ crate :: vec :: from_elem ( $ elem , $ n ) ) ; ( $ ( $ x : expr ) , * ) => (","highlight_start":1,"highlight_end":79},{"text":"< [ _ ] > :: into_vec ( box [ $ ( $ x ) , * ] ) ) ; ( $ ( $ x : expr , ) * )","highlight_start":1,"highlight_end":77},{"text":"=> ( vec ! [ $ ( $ x ) , * ] )","highlight_start":1,"highlight_end":31}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},{"file_name":"/checkout/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue-2.rs","byte_start":777,"byte_end":778,"line_start":30,"line_end":30,"column_start":46,"column_end":47,"is_primary":false,"text":[{"text":"    let x = defer(&vec![\"Goodbye\", \"world!\"]); //~ ERROR borrowed value does not live long enough","highlight_start":46,"highlight_end":47}],"label":"temporary value is freed at the end of this statement","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue-2.rs","byte_start":834,"byte_end":840,"line_start":31,"line_end":31,"column_start":5,"column_end":11,"is_primary":false,"text":[{"text":"    x.x[0];","highlight_start":5,"highlight_end":11}],"label":"borrow later used here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider using a `let` binding to create a longer lived value","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0716]: temporary value dropped while borrowed\n  --> /checkout/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue-2.rs:30:20\n   |\nLL |     let x = defer(&vec![\"Goodbye\", \"world!\"]); //~ ERROR borrowed value does not live long enough\n   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^ - temporary value is freed at the end of this statement\n   |                    |\n   |                    creates a temporary which is freed while still in use\nLL |     x.x[0];\n   |     ------ borrow later used here\n   |\n   = note: consider using a `let` binding to create a longer lived value\n   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)\n\n"}
[01:20:27] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[01:20:27] {"message":"For more information about this error, try `rustc --explain E0716`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0716`.\n"}
[01:20:27] ------------------------------------------
[01:20:27] 
[01:20:27] thread '[ui (nll)] ui/borrowck/borrowck-borrowed-uniq-rvalue-2.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3255:9
[01:20:27] 
[01:20:27] 
[01:20:27] ---- [ui (nll)] ui/borrowck/borrowck-init-in-fru.rs#ast stdout ----
[01:20:27] diff of stderr:
[01:20:27] 
[01:20:27] 1 error[E0381]: use of possibly uninitialized variable: `origin`
[01:20:27] 3    |
[01:20:27] 3    |
[01:20:27] - LL |     origin = point {x: 10,.. origin};
[01:20:27] -    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of possibly uninitialized `origin.y`
[01:20:27] + LL |     origin = Point { x: 10, ..origin };
[01:20:27] +    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of possibly uninitialized `origin.y`
[01:20:27] 7 error: aborting due to previous error
[01:20:27] 8 
[01:20:27] 
[01:20:27] 
[01:20:27] 
[01:20:27] The actual stderr differed from the expected stderr.
[01:20:27] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/borrowck/borrowck-init-in-fru.ast.nll/borrowck-init-in-fru.ast.nll.stderr
[01:20:27] To update references, rerun the tests and pass the `--bless` flag
[01:20:27] To only update this specific test, also pass `--test-args borrowck/borrowck-init-in-fru.rs`
[01:20:27] 
[01:20:27] error in revision `ast`: 1 errors occurred comparing output.
[01:20:27] status: exit code: 1
[01:20:27] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/borrowck/borrowck-init-in-fru.rs" "--target=x86_64-unknown-linux-gnu" "--cfg" "ast" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/borrowck/borrowck-init-in-fru.ast.nll/a" "-Zborrowck=migrate" "-Ztwo-phase-borrows" "-Crpath" "-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/borrowck-init-in-fru.ast.nll/auxiliary" "-A" "unused"
[01:20:27] ------------------------------------------
[01:20:27] 
[01:20:27] ------------------------------------------
[01:20:27] stderr:
[01:20:27] stderr:
[01:20:27] ------------------------------------------
[01:20:27] {"message":"use of possibly uninitialized variable: `origin`","code":{"code":"E0381","explanation":"\nIt is not allowed to use or capture an uninitialized variable. For example:\n\n```compile_fail,E0381\nfn main() {\n    let x: i32;\n    let y = x; // error, use of possibly uninitialized variable\n}\n```\n\nTo fix this, ensure that any declared variables are initialized before being\nused. Example:\n\n```\nfn main() {\n    let x: i32 = 0;\n    let y = x; // ok!\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/borrowck/borrowck-init-in-fru.rs","byte_start":634,"byte_end":668,"line_start":22,"line_end":22,"column_start":5,"column_end":39,"is_primary":true,"text":[{"text":"    origin = Point { x: 10, ..origin };","highlight_start":5,"highlight_end":39}],"label":"use of possibly uninitialized `origin.y`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0381]: use of possibly uninitialized variable: `origin`\n  --> /checkout/src/test/ui/borrowck/borrowck-init-in-fru.rs:22:5\n   |\nLL |     origin = Point { x: 10, ..origin };\n   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of possibly uninitialized `origin.y`\n\n"}
[01:20:27] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[01:20:27] {"message":"For more information about this error, try `rustc --explain E0381`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0381`.\n"}
[01:20:27] ------------------------------------------
[01:20:27] 
[01:20:27] thread '[ui (nll)] ui/borrowck/borrowck-init-in-fru.rs#ast' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3255:9
[01:20:27] 
[01:20:27] 
[01:20:27] ---- [ui (nll)] ui/borrowck/borrowck-loan-in-overloaded-op.rs stdout ----
[01:20:27] diff of stderr:
[01:20:27] 
[01:20:27] 6    |               |
[01:20:27] 7    |               value moved here
[01:20:27] 8    |
[01:20:27] -    = note: move occurs because `x` has type `foo`, which does not implement the `Copy` trait
[01:20:27] +    = note: move occurs because `x` has type `Foo`, which does not implement the `Copy` trait
[01:20:27] 11 error: aborting due to previous error
[01:20:27] 12 
[01:20:27] 
[01:20:27] 
[01:20:27] 
[01:20:27] The actual stderr differed from the expected stderr.
[01:20:27] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/borrowck/borrowck-loan-in-overloaded-op.nll/borrowck-loan-in-overloaded-op.nll.stderr
[01:20:27] To update references, rerun the tests and pass the `--bless` flag
[01:20:27] To only update this specific test, also pass `--test-args borrowck/borrowck-loan-in-overloaded-op.rs`
[01:20:27] error: 1 errors occurred comparing output.
[01:20:27] status: exit code: 1
[01:20:27] status: exit code: 1
[01:20:27] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/borrowck/borrowck-loan-in-overloaded-op.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/borrowck/borrowck-loan-in-overloaded-op.nll/a" "-Zborrowck=migrate" "-Ztwo-phase-borrows" "-Crpath" "-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/borrowck-loan-in-overloaded-op.nll/auxiliary" "-A" "unused"
[01:20:27] ------------------------------------------
[01:20:27] 
[01:20:27] ------------------------------------------
[01:20:27] stderr:
[01:20:27] stderr:
[01:20:27] ------------------------------------------
[01:20:27] {"message":"borrow of moved value: `x`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a variable after its contents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = MyStruct{ s: 5u32 };\n    let y = x;\n    x.s = 6;\n    println!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\nof `x` when we set `y`. This is fundamental to Rust's ownership system: outside\nof workarounds like `Rc`, a value cannot be owned by more than one variable.\n\nSometimes we don't need to move the value. Using a reference, we can let another\nfunction borrow the value without changing its ownership. In the example below,\nwe don't actually have to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n```\nfn main() {\n    let s1 = String::from(\"hello\");\n\n    let len = calculate_length(&s1);\n\n    println!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> usize {\n    s.len()\n}\n```\n\nA mutable reference can be created with `&mut`.\n\nSometimes we don't want a reference, but a duplicate. All types marked `Clone`\ncan be duplicated by calling `.clone()`. Subsequent changes to a clone do not\naffect the original variable.\n\nMost types in the standard library are marked `Clone`. The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/borrowck/borrowck-loan-in-overloaded-op.rs","byte_start":800,"byte_end":801,"line_start":31,"line_end":31,"column_start":15,"column_end":16,"is_primary":false,"text":[{"text":"    let _y = {x} + x.clone(); // the `{x}` forces a move to occur","highlight_start":15,"highlight_end":16}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/borrowck-loan-in-overloaded-op.rs","byte_start":805,"byte_end":806,"line_start":31,"line_end":31,"column_start":20,"column_end":21,"is_primary":true,"text":[{"text":"    let _y = {x} + x.clone(); // the `{x}` forces a move to occur","highlight_start":20,"highlight_end":21}],"label":"value borrowed here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `x` has type `Foo`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: borrow of moved value: `x`\n  --> /checkout/src/test/ui/borrowck/borrowck-loan-in-overloaded-op.rs:31:20\n   |\nLL |     let _y = {x} + x.clone(); // the `{x}` forces a move to occur\n   |               -    ^ value borrowed here after move\n   |               |\n   |               value moved here\n   |\n   = note: move occurs because `x` has type `Foo`, which does not implement the `Copy` trait\n\n"}
[01:20:27] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[01:20:27] {"message":"For more information about this error, try `rustc --explain E0382`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0382`.\n"}
[01:20:27] ------------------------------------------
[01:20:27] 
[01:20:27] thread '[ui (nll)] ui/borrowck/borrowck-loan-in-overloaded-op.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3255:9
[01:20:27] 
[01:20:27] 
[01:20:27] ---- [ui (nll)] ui/borrowck/borrowck-loan-rcvr.rs stdout ----
[01:20:27] diff of stderr:
[01:20:27] 
[01:20:27] 1 error[E0502]: cannot borrow `p` as mutable because it is also borrowed as immutable
[01:20:27] -   --> $DIR/borrowck-loan-rcvr.rs:34:14
[01:20:27] +   --> $DIR/borrowck-loan-rcvr.rs:33:14
[01:20:27] 3    |
[01:20:27] 4 LL |     p.blockm(|| { //~ ERROR cannot borrow `p` as mutable
[01:20:27] 5    |     - ------ ^^ mutable borrow occurs here
[01:20:27] 
[01:20:27] 10    |         - second borrow occurs due to use of `p` in closure
[01:20:27] 12 error[E0502]: cannot borrow `p` as immutable because it is also borrowed as mutable
[01:20:27] -   --> $DIR/borrowck-loan-rcvr.rs:45:5
[01:20:27] +   --> $DIR/borrowck-loan-rcvr.rs:44:5
[01:20:27] 14    |
[01:20:27] 14    |
[01:20:27] 15 LL |     let l = &mut p;
[01:20:27] 16    |             ------ mutable borrow occurs here
[01:20:27] 
[01:20:27] The actual stderr differed from the expected stderr.
[01:20:27] The actual stderr differed from the expected stderr.
[01:20:27] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/borrowck/borrowck-loan-rcvr.nll/borrowck-loan-rcvr.nll.stderr
[01:20:27] To update references, rerun the tests and pass the `--bless` flag
[01:20:27] To only update this specific test, also pass `--test-args borrowck/borrowck-loan-rcvr.rs`
[01:20:27] error: 1 errors occurred comparing output.
[01:20:27] status: exit code: 1
[01:20:27] status: exit code: 1
[01:20:27] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/borrowck/borrowck-loan-rcvr.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/borrowck/borrowck-loan-rcvr.nll/a" "-Zborrowck=migrate" "-Ztwo-phase-borrows" "-Crpath" "-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/borrowck-loan-rcvr.nll/auxiliary" "-A" "unused"
[01:20:27] ------------------------------------------
[01:20:27] 
[01:20:27] ------------------------------------------
[01:20:27] stderr:
[01:20:27] stderr:
[01:20:27] ------------------------------------------
[01:20:27] {"message":"cannot borrow `p` as mutable because it is also borrowed as immutable","code":{"code":"E0502","explanation":"\nThis error indicates that you are trying to borrow a variable as mutable when it\nhas already been borrowed as immutable.\n\nExample of erroneous code:\n\n```compile_fail,E0502\nfn bar(x: &mut i32) {}\nfn foo(a: &mut i32) {\n    let ref y = a; // a is borrowed as immutable.\n    bar(a); // error: cannot borrow `*a` as mutable because `a` is also borrowed\n            //        as immutable\n}\n```\n\nTo fix this error, ensure that you don't have any other references to the\nvariable before trying to access it mutably:\n\n```\nfn bar(x: &mut i32) {}\nfn foo(a: &mut i32) {\n    bar(a);\n    let ref y = a; // ok!\n}\n```\n\nFor more information on the rust ownership system, take a look at\nhttps://doc.rust-lang.org/stable/book/references-and-borrowing.html.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/borrowck/borrowck-loan-rcvr.rs","byte_start":934,"byte_end":936,"line_start":33,"line_end":33,"column_start":14,"column_end":16,"is_primary":true,"text":[{"text":"    p.blockm(|| { //~ ERROR cannot borrow `p` as mutable","highlight_start":14,"highlight_end":16}],"label":"mutable borrow occurs here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/borrowck-loan-rcvr.rs","byte_start":925,"byte_end":926,"line_start":33,"line_end":33,"column_start":5,"column_end":6,"is_primary":false,"text":[{"text":"    p.blockm(|| { //~ ERROR cannot borrow `p` as mutable","highlight_start":5,"highlight_end":6}],"label":"immutable borrow occurs here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/borrowck-loan-rcvr.rs","byte_start":986,"byte_end":987,"line_start":34,"line_end":34,"column_start":9,"column_end":10,"is_primary":false,"text":[{"text":"        p.x = 10;","highlight_start":9,"highlight_end":10}],"label":"second borrow occurs due to use of `p` in closure","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/borrowck-loan-rcvr.rs","byte_start":927,"byte_end":933,"line_start":33,"line_end":33,"column_start":7,"column_end":13,"is_primary":false,"text":[{"text":"    p.blockm(|| { //~ ERROR cannot borrow `p` as mutable","highlight_start":7,"highlight_end":13}],"label":"immutable borrow later used by call","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0502]: cannot borrow `p` as mutable because it is also borrowed as immutable\n  --> /checkout/src/test/ui/borrowck/borrowck-loan-rcvr.rs:33:14\n   |\nLL |     p.blockm(|| { //~ ERROR cannot borrow `p` as mutable\n   |     - ------ ^^ mutable borrow occurs here\n   |     | |\n   |     | immutable borrow later used by call\n   |     immutable borrow occurs here\nLL |         p.x = 10;\n   |         - second borrow occurs due to use of `p` in closure\n\n"}
[01:20:27] {"message":"cannot borrow `p` as immutable because it is also borrowed as mutable","code":{"code":"E0502","explanation":"\nThis error indicates that you are trying to borrow a variable as mutable when it\nhas already been borrowed as immutable.\n\nExample of erroneous code:\n\n```compile_fail,E0502\nfn bar(x: &mut i32) {}\nfn foo(a: &mut i32) {\n    let ref y = a; // a is borrowed as immutable.\n    bar(a); // error: cannot borrow `*a` as mutable because `a` is also borrowed\n            //        as immutable\n}\n```\n\nTo fix this error, ensure that you don't have any other references to the\nvariable before trying to access it mutably:\n\n```\nfn bar(x: &mut i32) {}\nfn foo(a: &mut i32) {\n    bar(a);\n    let ref y = a; // ok!\n}\n```\n\nFor more information on the rust ownership system, take a look at\nhttps://doc.rust-lang.org/stable/book/references-and-borrowing.html.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/borrowck/borrowck-loan-rcvr.rs","byte_start":1151,"byte_end":1152,"line_start":44,"line_end":44,"column_start":5,"column_end":6,"is_primary":true,"text":[{"text":"    p.impurem(); //~ ERROR cannot borrow","highlight_start":5,"highlight_end":6}],"label":"immutable borrow occurs here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/borrowck-loan-rcvr.rs","byte_start":1139,"byte_end":1145,"line_start":43,"line_end":43,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let l = &mut p;","highlight_start":13,"highlight_end":19}],"label":"mutable borrow occurs here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/borrowck-loan-rcvr.rs","byte_start":1193,"byte_end":1201,"line_start":46,"line_end":46,"column_start":5,"column_end":13,"is_primary":false,"text":[{"text":"    l.x += 1;","highlight_start":5,"highlight_end":13}],"label":"mutable borrow later used here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0502]: cannot borrow `p` as immutable because it is also borrowed as mutable\n  --> /checkout/src/test/ui/borrowck/borrowck-loan-rcvr.rs:44:5\n   |\nLL |     let l = &mut p;\n   |             ------ mutable borrow occurs here\nLL |     p.impurem(); //~ ERROR cannot borrow\n   |     ^ immutable borrow occurs here\nLL | \nLL |     l.x += 1;\n   |     -------- mutable borrow later used here\n\n"}
[01:20:27] {"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 2 previous errors\n\n"}
[01:20:27] {"message":"For more information about this error, try `rustc --explain E0502`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0502`.\n"}
[01:20:27] ------------------------------------------
[01:20:27] 
[01:20:27] thread '[ui (nll)] ui/borrowck/borrowck-loan-rcvr.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3255:9
[01:20:27] 
[01:20:27] 
[01:20:27] ---- [ui (nll)] ui/borrowck/borrowck-no-cycle-in-exchange-heap.rs stdout ----
[01:20:27] diff of stderr:
[01:20:27] 
[01:20:27] 1 error[E0505]: cannot move out of `x` because it is borrowed
[01:20:27] 2   --> $DIR/borrowck-no-cycle-in-exchange-heap.rs:26:15
[01:20:27] 3    |
[01:20:27] - LL |       cycle::node(ref mut y) => {
[01:20:27] + LL |       Cycle::Node(ref mut y) => {
[01:20:27] 5    |                   --------- borrow of `x.0` occurs here
[01:20:27] 6 LL |         y.a = x; //~ ERROR cannot move out of
[01:20:27] 7    |         ---   ^ move out of `x` occurs here
[01:20:27] 
[01:20:27] The actual stderr differed from the expected stderr.
[01:20:27] The actual stderr differed from the expected stderr.
[01:20:27] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/borrowck/borrowck-no-cycle-in-exchange-heap.nll/borrowck-no-cycle-in-exchange-heap.nll.stderr
[01:20:27] To update references, rerun the tests and pass the `--bless` flag
[01:20:27] To only update this specific test, also pass `--test-args borrowck/borrowck-no-cycle-in-exchange-heap.rs`
[01:20:27] error: 1 errors occurred comparing output.
[01:20:27] status: exit code: 1
[01:20:27] status: exit code: 1
[01:20:27] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/borrowck/borrowck-no-cycle-in-exchange-heap.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/borrowck/borrowck-no-cycle-in-exchange-heap.nll/a" "-Zborrowck=migrate" "-Ztwo-phase-borrows" "-Crpath" "-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/borrowck-no-cycle-in-exchange-heap.nll/auxiliary" "-A" "unused"
[01:20:27] ------------------------------------------
[01:20:27] 
[01:20:27] ------------------------------------------
[01:20:27] stderr:
[01:20:27] stderr:
[01:20:27] ------------------------------------------
[01:20:27] {"message":"cannot move out of `x` 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/borrowck/borrowck-no-cycle-in-exchange-heap.rs","byte_start":709,"byte_end":718,"line_start":25,"line_end":25,"column_start":19,"column_end":28,"is_primary":false,"text":[{"text":"      Cycle::Node(ref mut y) => {","highlight_start":19,"highlight_end":28}],"label":"borrow of `x.0` occurs here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/borrowck-no-cycle-in-exchange-heap.rs","byte_start":739,"byte_end":740,"line_start":26,"line_end":26,"column_start":15,"column_end":16,"is_primary":true,"text":[{"text":"        y.a = x; //~ ERROR cannot move out of","highlight_start":15,"highlight_end":16}],"label":"move out of `x` occurs here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/borrowck-no-cycle-in-exchange-heap.rs","byte_start":733,"byte_end":736,"line_start":26,"line_end":26,"column_start":9,"column_end":12,"is_primary":false,"text":[{"text":"        y.a = x; //~ ERROR cannot move out of","highlight_start":9,"highlight_end":12}],"label":"borrow later used here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0505]: cannot move out of `x` because it is borrowed\n  --> /checkout/src/test/ui/borrowck/borrowck-no-cycle-in-exchange-heap.rs:26:15\n   |\nLL |       Cycle::Node(ref mut y) => {\n   |                   --------- borrow of `x.0` occurs here\nLL |         y.a = x; //~ ERROR cannot move out of\n   |         ---   ^ move out of `x` occurs here\n   |         |\n   |         borrow later used here\n\n"}
[01:20:27] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[01:20:27] {"message":"For more information about this error, try `rustc --explain E0505`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0505`.\n"}
[01:20:27] ------------------------------------------
[01:20:27] 
[01:20:27] thread '[ui (nll)] ui/borrowck/borrowck-no-cycle-in-exchange-heap.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3255:9
[01:20:27] 
[01:20:27] 
[01:20:27] ---- [ui (nll)] ui/issues/issue-2590.rs stdout ----
[01:20:27] diff of stderr:
[01:20:27] 
[01:20:27] 1 error[E0507]: cannot move out of borrowed content
[01:20:27] -   --> $DIR/issue-2590.rs:22:9
[01:20:27] +   --> $DIR/issue-2590.rs:21:9
[01:20:27] 3    |
[01:20:27] 4 LL |         self.tokens //~ ERROR cannot move out of borrowed content
[01:20:27] 5    |         ^^^^^^^^^^^ cannot move out of borrowed content
[01:20:27] 
[01:20:27] The actual stderr differed from the expected stderr.
[01:20:27] The actual stderr differed from the expected stderr.
[01:20:27] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-2590.nll/issue-2590.nll.stderr
[01:20:27] To update references, rerun the tests and pass the `--bless` flag
[01:20:27] To only update this specific test, also pass `--test-args issues/issue-2590.rs`
[01:20:27] error: 1 errors occurred comparing output.
[01:20:27] status: exit code: 1
[01:20:27] status: exit code: 1
[01:20:27] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-2590.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-2590.nll/a" "-Zborrowck=migrate" "-Ztwo-phase-borrows" "-Crpath" "-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/issues/issue-2590.nll/auxiliary" "-A" "unused"
[01:20:27] ------------------------------------------
[01:20:27] 
[01:20:27] ------------------------------------------
[01:20:27] stderr:
[01:20:27] stderr:
[01:20:27] ------------------------------------------
[01:20:27] {"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/issues/issue-2590.rs","byte_start":632,"byte_end":643,"line_start":21,"line_end":21,"column_start":9,"column_end":20,"is_primary":true,"text":[{"text":"        self.tokens //~ ERROR cannot move out of borrowed content","highlight_start":9,"highlight_end":20}],"label":"cannot move out of borrowed content","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0507]: cannot move out of borrowed content\n  --> /checkout/src/test/ui/issues/issue-2590.rs:21:9\n   |\nLL |         self.tokens //~ ERROR cannot move out of borrowed content\n   |         ^^^^^^^^^^^ cannot move out of borrowed content\n\n"}
[01:20:27] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[01:20:27] {"message":"For more information about this error, try `rustc --explain E0507`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0507`.\n"}
[01:20:27] ------------------------------------------
[01:20:27] 
[01:20:27] thread '[ui (nll)] ui/issues/issue-2590.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3255:9
[01:20:27] 
[01:20:27] 
[01:20:27] ---- [ui (nll)] ui/mut/mutable-class-fields.rs#ast stdout ----
[01:20:27] diff of stderr:
[01:20:27] 
[01:20:27] 1 error[E0594]: cannot assign to `nyan.how_hungry`, as `nyan` is not declared as mutable
[01:20:27] 3    |
[01:20:27] 3    |
[01:20:27] - LL |   let nyan : cat = cat(52, 99);
[01:20:27] + LL |   let nyan : Cat = cat(52, 99);
[01:20:27] 5    |       ---- help: consider changing this to be mutable: `mut nyan`
[01:20:27] 6 LL |   nyan.how_hungry = 0; //[ast]~ ERROR cannot assign
[01:20:27] 
[01:20:27] 
[01:20:27] The actual stderr differed from the expected stderr.
[01:20:27] The actual stderr differed from the expected stderr.
[01:20:27] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/mut/mutable-class-fields.ast.nll/mutable-class-fields.ast.nll.stderr
[01:20:27] To update references, rerun the tests and pass the `--bless` flag
[01:20:27] To only update this specific test, also pass `--test-args mut/mutable-class-fields.rs`
[01:20:27] 
[01:20:27] error in revision `ast`: 1 errors occurred comparing output.
[01:20:27] status: exit code: 1
[01:20:27] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/mut/mutable-class-fields.rs" "--target=x86_64-unknown-linux-gnu" "--cfg" "ast" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/mut/mutable-class-fields.ast.nll/a" "-Zborrowck=migrate" "-Ztwo-phase-borrows" "-Crpath" "-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/mut/mutable-class-fields.ast.nll/auxiliary" "-A" "unused"
[01:20:27] ------------------------------------------
[01:20:27] 
[01:20:27] ------------------------------------------
[01:20:27] stderr:
[01:20:27] stderr:
[01:20:27] ------------------------------------------
[01:20:27] {"message":"cannot assign to `nyan.how_hungry`, as `nyan` is not declared as mutable","code":{"code":"E0594","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/mut/mutable-class-fields.rs","byte_start":738,"byte_end":757,"line_start":28,"line_end":28,"column_start":3,"column_end":22,"is_primary":true,"text":[{"text":"  nyan.how_hungry = 0; //[ast]~ ERROR cannot assign","highlight_start":3,"highlight_end":22}],"label":"cannot assign","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider changing this to be mutable","code":null,"level":"help","spans":[{"file_name":"/checkout/src/test/ui/mut/mutable-class-fields.rs","byte_start":710,"byte_end":714,"line_start":27,"line_end":27,"column_start":7,"column_end":11,"is_primary":true,"text":[{"text":"  let nyan : Cat = cat(52, 99);","highlight_start":7,"highlight_end":11}],"label":null,"suggested_replacement":"mut nyan","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0594]: cannot assign to `nyan.how_hungry`, as `nyan` is not declared as mutable\n  --> /checkout/src/test/ui/mut/mutable-class-fields.rs:28:3\n   |\nLL |   let nyan : Cat = cat(52, 99);\n   |       ---- help: consider changing this to be mutable: `mut nyan`\nLL |   nyan.how_hungry = 0; //[ast]~ ERROR cannot assign\n   |   ^^^^^^^^^^^^^^^^^^^ cannot assign\n\n"}
[01:20:27] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[01:20:27] {"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"}
[01:20:27] ------------------------------------------
[01:20:27] 
[01:20:27] thread '[ui (nll)] ui/mut/mutable-class-fields.rs#ast' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3255:9
[01:20:27] 
[01:20:27] 
[01:20:27] ---- [ui (nll)] ui/regions/regions-creating-enums.rs stdout ----
[01:20:27] diff of stderr:
[01:20:27] 
[01:20:27] 1 error[E0515]: cannot return reference to temporary value
[01:20:27] 2   --> $DIR/regions-creating-enums.rs:33:16
[01:20:27] 3    |
[01:20:27] - LL |         return &ast::num((*f)(x)); //~ ERROR borrowed value does not live long enough
[01:20:27] + LL |         return &Ast::Num((*f)(x)); //~ ERROR borrowed value does not live long enough
[01:20:27] 5    |                ^-----------------
[01:20:27] 6    |                ||
[01:20:27] 7    |                |temporary value created here
[01:20:27] 10 error[E0515]: cannot return reference to temporary value
[01:20:27] 11   --> $DIR/regions-creating-enums.rs:38:16
[01:20:27] 12    |
[01:20:27] 12    |
[01:20:27] - LL |         return &ast::add(m_x, m_y);  //~ ERROR borrowed value does not live long enough
[01:20:27] + LL |         return &Ast::Add(m_x, m_y);  //~ ERROR borrowed value does not live long enough
[01:20:27] 14    |                ^------------------
[01:20:27] 15    |                ||
[01:20:27] 16    |                |temporary value created here
[01:20:27] 
[01:20:27] The actual stderr differed from the expected stderr.
[01:20:27] The actual stderr differed from the expected stderr.
[01:20:27] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/regions/regions-creating-enums.nll/regions-creating-enums.nll.stderr
[01:20:27] To update references, rerun the tests and pass the `--bless` flag
[01:20:27] To only update this specific test, also pass `--test-args regions/regions-creating-enums.rs`
[01:20:27] error: 1 errors occurred comparing output.
[01:20:27] status: exit code: 1
[01:20:27] status: exit code: 1
[01:20:27] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/regions/regions-creating-enums.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/regions/regions-creating-enums.nll/a" "-Zborrowck=migrate" "-Ztwo-phase-borrows" "-Crpath" "-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/regions/regions-creating-enums.nll/auxiliary" "-A" "unused"
[01:20:28] ------------------------------------------
[01:20:28] 
[01:20:28] ------------------------------------------
[01:20:28] stderr:
[01:20:28] stderr:
[01:20:28] ------------------------------------------
[01:20:28] {"message":"cannot return reference to temporary value","code":{"code":"E0515","explanation":"\nCannot return value that references local variable\n\nLocal variables, function parameters and temporaries are all dropped before the\nend of the function body. So a reference to them cannot be returned.\n\n```compile_fail,E0515\n#![feature(nll)]\nfn get_dangling_reference() -> &'static i32 {\n    let x = 0;\n    &x\n}\n```\n\n```compile_fail,E0515\n#![feature(nll)]\nuse std::slice::Iter;\nfn get_dangling_iterator<'a>() -> Iter<'a, i32> {\n    let v = vec![1, 2, 3];\n    v.iter()\n}\n```\n\nConsider returning an owned value instead:\n\n```\nuse std::vec::IntoIter;\n\nfn get_integer() -> i32 {\n    let x = 0;\n    x\n}\n\nfn get_owned_iterator() -> IntoIter<i32> {\n    let v = vec![1, 2, 3];\n    v.into_iter()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/regions/regions-creating-enums.rs","byte_start":925,"byte_end":943,"line_start":33,"line_end":33,"column_start":16,"column_end":34,"is_primary":true,"text":[{"text":"        return &Ast::Num((*f)(x)); //~ ERROR borrowed value does not live long enough","highlight_start":16,"highlight_end":34}],"label":"returns a reference to data owned by the current function","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/regions/regions-creating-enums.rs","byte_start":926,"byte_end":943,"line_start":33,"line_end":33,"column_start":17,"column_end":34,"is_primary":false,"text":[{"text":"        return &Ast::Num((*f)(x)); //~ ERROR borrowed value does not live long enough","highlight_start":17,"highlight_end":34}],"label":"temporary value created here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0515]: cannot return reference to temporary value\n  --> /checkout/src/test/ui/regions/regions-creating-enums.rs:33:16\n   |\nLL |         return &Ast::Num((*f)(x)); //~ ERROR borrowed value does not live long enough\n   |                ^-----------------\n   |                ||\n   |                |temporary value created here\n   |                returns a reference to data owned by the current function\n\n"}
[01:20:28] {"message":"cannot return reference to temporary value","code":{"code":"E0515","explanation":"\nCannot return value that references local variable\n\nLocal variables, function parameters and temporaries are all dropped before the\nend of the function body. So a reference to them cannot be returned.\n\n```compile_fail,E0515\n#![feature(nll)]\nfn get_dangling_reference() -> &'static i32 {\n    let x = 0;\n    &x\n}\n```\n\n```compile_fail,E0515\n#![feature(nll)]\nuse std::slice::Iter;\nfn get_dangling_iterator<'a>() -> Iter<'a, i32> {\n    let v = vec![1, 2, 3];\n    v.iter()\n}\n```\n\nConsider returning an owned value instead:\n\n```\nuse std::vec::IntoIter;\n\nfn get_integer() -> i32 {\n    let x = 0;\n    x\n}\n\nfn get_owned_iterator() -> IntoIter<i32> {\n    let v = vec![1, 2, 3];\n    v.into_iter()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/regions/regions-creating-enums.rs","byte_start":1113,"byte_end":1132,"line_start":38,"line_end":38,"column_start":16,"column_end":35,"is_primary":true,"text":[{"text":"        return &Ast::Add(m_x, m_y);  //~ ERROR borrowed value does not live long enough","highlight_start":16,"highlight_end":35}],"label":"returns a reference to data owned by the current function","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/regions/regions-creating-enums.rs","byte_start":1114,"byte_end":1132,"line_start":38,"line_end":38,"column_start":17,"column_end":35,"is_primary":false,"text":[{"text":"        return &Ast::Add(m_x, m_y);  //~ ERROR borrowed value does not live long enough","highlight_start":17,"highlight_end":35}],"label":"temporary value created here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0515]: cannot return reference to temporary value\n  --> /checkout/src/test/ui/regions/regions-creating-enums.rs:38:16\n   |\nLL |         return &Ast::Add(m_x, m_y);  //~ ERROR borrowed value does not live long enough\n   |                ^------------------\n   |                ||\n   |                |temporary value created here\n   |                returns a reference to data owned by the current function\n\n"}
[01:20:28] {"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 2 previous errors\n\n"}
[01:20:28] {"message":"For more information about this error, try `rustc --explain E0515`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0515`.\n"}
[01:20:28] ------------------------------------------
[01:20:28] 
[01:20:28] thread '[ui (nll)] ui/regions/regions-creating-enums.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3255:9
[01:20:28] 
[01:20:28] 
[01:20:28] ---- [ui (nll)] ui/regions/regions-infer-borrow-scope-too-big.rs stdout ----
[01:20:28] diff of stderr:
[01:20:28] 
[01:20:28] 1 error[E0515]: cannot return value referencing local data `*p`
[01:20:28] +   --> $DIR/regions-infer-borrow-scope-too-big.rs:23:12
[01:20:28] 3    |
[01:20:28] 3    |
[01:20:28] 4 LL |     let xc = x_coord(&*p); //~ ERROR `*p` does not live long enough
[01:20:28] 5    |                      --- `*p` is borrowed here
[01:20:28] 
[01:20:28] The actual stderr differed from the expected stderr.
[01:20:28] The actual stderr differed from the expected stderr.
[01:20:28] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/regions/regions-infer-borrow-scope-too-big.nll/regions-infer-borrow-scope-too-big.nll.stderr
[01:20:28] To update references, rerun the tests and pass the `--bless` flag
[01:20:28] To only update this specific test, also pass `--test-args regions/regions-infer-borrow-scope-too-big.rs`
[01:20:28] error: 1 errors occurred comparing output.
[01:20:28] status: exit code: 1
[01:20:28] status: exit code: 1
[01:20:28] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/regions/regions-infer-borrow-scope-too-big.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/regions/regions-infer-borrow-scope-too-big.nll/a" "-Zborrowck=migrate" "-Ztwo-phase-borrows" "-Crpath" "-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/regions/regions-infer-borrow-scope-too-big.nll/auxiliary" "-A" "unused"
[01:20:28] ------------------------------------------
[01:20:28] 
[01:20:28] ------------------------------------------
[01:20:28] stderr:
[01:20:28] stderr:
[01:20:28] ------------------------------------------
[01:20:28] {"message":"cannot return value referencing local data `*p`","code":{"code":"E0515","explanation":"\nCannot return value that references local variable\n\nLocal variables, function parameters and temporaries are all dropped before the\nend of the function body. So a reference to them cannot be returned.\n\n```compile_fail,E0515\n#![feature(nll)]\nfn get_dangling_reference() -> &'static i32 {\n    let x = 0;\n    &x\n}\n```\n\n```compile_fail,E0515\n#![feature(nll)]\nuse std::slice::Iter;\nfn get_dangling_iterator<'a>() -> Iter<'a, i32> {\n    let v = vec![1, 2, 3];\n    v.iter()\n}\n```\n\nConsider returning an owned value instead:\n\n```\nuse std::vec::IntoIter;\n\nfn get_integer() -> i32 {\n    let x = 0;\n    x\n}\n\nfn get_owned_iterator() -> IntoIter<i32> {\n    let v = vec![1, 2, 3];\n    v.into_iter()\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/regions/regions-infer-borrow-scope-too-big.rs","byte_start":721,"byte_end":723,"line_start":23,"line_end":23,"column_start":12,"column_end":14,"is_primary":true,"text":[{"text":"    return xc;","highlight_start":12,"highlight_end":14}],"label":"returns a value referencing data owned by the current function","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/regions/regions-infer-borrow-scope-too-big.rs","byte_start":639,"byte_end":642,"line_start":21,"line_end":21,"column_start":22,"column_end":25,"is_primary":false,"text":[{"text":"    let xc = x_coord(&*p); //~ ERROR `*p` does not live long enough","highlight_start":22,"highlight_end":25}],"label":"`*p` is borrowed here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0515]: cannot return value referencing local data `*p`\n  --> /checkout/src/test/ui/regions/regions-infer-borrow-scope-too-big.rs:23:12\n   |\nLL |     let xc = x_coord(&*p); //~ ERROR `*p` does not live long enough\n   |                      --- `*p` is borrowed here\nLL |     assert_eq!(*xc, 3);\nLL |     return xc;\n   |            ^^ returns a value referencing data owned by the current function\n\n"}
[01:20:28] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[01:20:28] {"message":"For more information about this error, try `rustc --explain E0515`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0515`.\n"}
[01:20:28] ------------------------------------------
[01:20:28] 
[01:20:28] thread '[ui (nll)] ui/regions/regions-infer-borrow-scope-too-big.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3255:9
[01:20:28] 
---
[01:20:28] test result: FAILED. 5100 passed; 11 failed; 88 ignored; 0 measured; 0 filtered out
[01:20:28] 
[01:20:28] 
[01:20:28] 
[01:20:28] 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" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--host-rustcflags" "-Crpath -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -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" "--llvm-version" "8.0.0svn\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always" "--compare-mode" "nll"
[01:20:28] 
[01:20:28] 
[01:20:28] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:20:28] Build completed unsuccessfully in 0:07:10
[01:20:28] Build completed unsuccessfully in 0:07:10
[01:20:28] Makefile:58: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:016603d8
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Mon Dec 24 11:59:27 UTC 2018
---
travis_time:end:09f4e63c:start=1545652769185968508,finish=1545652769193274223,duration=7305715
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:1d77a434
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:088ec352
travis_time:start:088ec352
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:01f74c90
$ dmesg | grep -i kill

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

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 24, 2018
@Centril
Copy link
Contributor Author

Centril commented Dec 24, 2018

Rollup failed due to #57088.

@bors
Copy link
Contributor

bors commented Dec 24, 2018

⌛ Testing commit 4a5a34a3f36d81ee1161bd769c5e99e4065348ca with merge 74678bfe35f0f391af45be4faa33fe960c44aaf4...

@Centril
Copy link
Contributor Author

Centril commented Dec 24, 2018

@bors r-

@Centril Centril added the rollup A PR which is a rollup label Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants