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 6 pull requests #59715

Closed
wants to merge 23 commits into from
Closed

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Apr 5, 2019

Successful merges:

Failed merges:

r? @ghost

dtolnay and others added 23 commits April 3, 2019 14:10
Turns out we needed to exclude a number of math functions on the
`wasm32-unknown-wasi` target, and this was fixed in 0.1.9 of
compiler-builtins and this is pulling in the fix to libstd's own build.
LLVM 9 is adding support for a "pic" relocation model for wasm code,
which is quite different than the current model. In order to preserve
the mode of compilation that we have today default to "static" to ensure
that we don't accidentally start creating experimental relocatable
binaries.
…mertj

Unsized rvalues: implement boxed closure impls. (2nd try)

This is a rebase of S-blocked-closed PR rust-lang#55431 to current master. LLVM has moved forward since then, so maybe we can check whether the new LLVM 8.0 version unblocked this work.
std: Upgrade `compiler_builtins` to fix wasi linkage

Turns out we needed to exclude a number of math functions on the
`wasm32-unknown-wasi` target, and this was fixed in 0.1.9 of
compiler-builtins and this is pulling in the fix to libstd's own build.
Update cargo

20 commits in
63231f438a2b5b84ccf319a5de22343ee0316323..6f3e9c367abb497c64f360c3839dab5e74928d5c
2019-03-27 12:26:45 +0000 to 2019-04-04 14:11:33 +0000
- Fix Init for Fossil SCM project (rust-lang/cargo#6792)
- Fix member_manifest_version_error accessing the network (rust-lang/cargo#6799)
- Don't include email if it is empty (rust-lang/cargo#6802)
- Fix unused import warning (rust-lang/cargo#6807)
- Add some help and documentation for unstable flags (rust-lang/cargo#6791)
- Allow `cargo doc --open` with multiple packages (rust-lang/cargo#6803)
- Allow `cargo install --path P` to load config from P (rust-lang/cargo#6804)
- Add more suggestions on how to deal with excluding a package from a workspace (rust-lang/cargo#6805)
- Warn on version req with metadata (rust-lang/cargo#6806)
- cargo install: Be more restrictive about cli flags (rust-lang/cargo#6801)
- Support force-pushed repos with git-fetch-with-cli (rust-lang/cargo#6800)
- Cargo clippy (rust-lang/cargo#6759)
- Don't include metadata in wasm binary examples (rust-lang/cargo#6812)
- Update glossary for `feature` (rust-lang/cargo#6809)
- Include proc-macros in `build-override` (rust-lang/cargo#6811)
- Resolver: A dep is equivalent to one of the things it can resolve to (rust-lang/cargo#6776)
- Add some docs for `Downloads` (rust-lang/cargo#6815)
- Resolve: Be less strict while offline (rust-lang/cargo#6814)
- Accept trailing comma in test of impl Debug for PackageId (rust-lang/cargo#6818)
- Fix doc link (rust-lang/cargo#6820)

<br>

I specifically care about "Accept trailing comma in test of impl Debug for PackageId (rust-lang/cargo#6818)" to unblock rust-lang#59076.

Mentioning @ehuss.
Mark unix::ffi::OsStrExt methods as inline

This is a small change, but I found it surprising it's not inlined looking at the assembly.
Use declare_lint_pass! and impl_lint_pass! in more places

Fixes rust-lang#59683
…=eddyb

wasm32: Default to a "static" relocation model

LLVM 9 is adding support for a "pic" relocation model for wasm code,
which is quite different than the current model. In order to preserve
the mode of compilation that we have today default to "static" to ensure
that we don't accidentally start creating experimental relocatable
binaries.
@Centril
Copy link
Contributor Author

Centril commented Apr 5, 2019

@bors r+ p=6

@bors
Copy link
Contributor

bors commented Apr 5, 2019

📌 Commit c03fa7b 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 Apr 5, 2019
@bors
Copy link
Contributor

bors commented Apr 5, 2019

⌛ Testing commit c03fa7b with merge 9a0bccd29696a2e3476285e77c2c336a16cd9c73...

@bors
Copy link
Contributor

bors commented Apr 5, 2019

💔 Test failed - checks-travis

@bors bors removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Apr 5, 2019
@bors bors added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 5, 2019
@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:31:30] diff of stderr:
[01:31:30] 
[01:31:30] 11   --> $DIR/two-phase-nonrecv-autoref.rs:69:11
[01:31:30] 12    |
[01:31:30] 13 LL |     fn twice_ten_so<F: FnOnce(i32) -> i32>(f: Box<F>) {
[01:31:30] -    |                     - consider adding a `Copy` constraint to this type argument
[01:31:30] +    |                                            - move occurs because `f` has type `std::boxed::Box<F>`, which does not implement the `Copy` trait
[01:31:30] 15 LL |         f(f(10));
[01:31:30] 16    |         - ^ value used here after move
[01:31:30] 
[01:31:30] 18    |         value moved here
[01:31:30] -    |
[01:31:30] -    |
[01:31:30] -    = note: move occurs because `f` has type `std::boxed::Box<F>`, which does not implement the `Copy` trait
[01:31:30] 21 
[01:31:30] 22 error[E0499]: cannot borrow `*f` as mutable more than once at a time
[01:31:30] 
[01:31:30] 
[01:31:30] 31 error[E0382]: use of moved value: `f`
[01:31:30] 33    |
[01:31:30] 33    |
[01:31:30] + LL |     fn twice_ten_oo(f: Box<FnOnce(i32) -> i32>) {
[01:31:30] +    |                     - move occurs because `f` has type `std::boxed::Box<dyn std::ops::FnOnce(i32) -> i32>`, which does not implement the `Copy` trait
[01:31:30] 34 LL |         f(f(10));
[01:31:30] 35    |         - ^ value used here after move
[01:31:30] 
[01:31:30] 37    |         value moved here
[01:31:30] -    |
[01:31:30] -    |
[01:31:30] -    = note: move occurs because `f` has type `std::boxed::Box<dyn std::ops::FnOnce(i32) -> i32>`, which does not implement the `Copy` trait
[01:31:30] 40 
[01:31:30] 41 error[E0502]: cannot borrow `a` as immutable because it is also borrowed as mutable
[01:31:30] 
[01:31:30] 
[01:31:30] The actual stderr differed from the expected stderr.
[01:31:30] The actual stderr differed from the expected stderr.
[01:31:30] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/borrowck/two-phase-nonrecv-autoref.ast.nll/two-phase-nonrecv-autoref.ast.nll.stderr
[01:31:30] To update references, rerun the tests and pass the `--bless` flag
[01:31:30] To only update this specific test, also pass `--test-args borrowck/two-phase-nonrecv-autoref.rs`
[01:31:30] 
[01:31:30] error in revision `ast`: 1 errors occurred comparing output.
[01:31:30] status: exit code: 1
[01:31:30] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs" "-Zthreads=1" "--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/two-phase-nonrecv-autoref.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/two-phase-nonrecv-autoref.ast.nll/auxiliary" "-A" "unused"
[01:31:30] ------------------------------------------
[01:31:30] 
[01:31:30] ------------------------------------------
[01:31:30] stderr:
[01:31:30] stderr:
[01:31:30] ------------------------------------------
[01:31:30] {"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/book/ch04-02-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/borrowck/two-phase-nonrecv-autoref.rs","byte_start":2402,"byte_end":2403,"line_start":60,"line_end":60,"column_start":9,"column_end":10,"is_primary":false,"text":[{"text":"        f(f(10));","highlight_start":9,"highlight_end":10}],"label":"first mutable borrow occurs here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs","byte_start":2404,"byte_end":2405,"line_start":60,"line_end":60,"column_start":11,"column_end":12,"is_primary":true,"text":[{"text":"        f(f(10));","highlight_start":11,"highlight_end":12}],"label":"second mutable borrow occurs here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs","byte_start":2402,"byte_end":2403,"line_start":60,"line_end":60,"column_start":9,"column_end":10,"is_primary":false,"text":[{"text":"        f(f(10));","highlight_start":9,"highlight_end":10}],"label":"first borrow later used by call","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0499]: cannot borrow `*f` as mutable more than once at a time\n  --> /checkout/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs:60:11\n   |\nLL |         f(f(10));\n   |         - ^ second mutable borrow occurs here\n   |         |\n   |         first mutable borrow occurs here\n   |         first borrow later used by call\n\n"}
[01:31:30] {"message":"use of moved value: `f`","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/ch04-00-understanding-ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs","byte_start":2800,"byte_end":2801,"line_start":69,"line_end":69,"column_start":9,"column_end":10,"is_primary":false,"text":[{"text":"        f(f(10));","highlight_start":9,"highlight_end":10}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs","byte_start":2802,"byte_end":2803,"line_start":69,"line_end":69,"column_start":11,"column_end":12,"is_primary":true,"text":[{"text":"        f(f(10));","highlight_start":11,"highlight_end":12}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs","byte_start":2779,"byte_end":2780,"line_start":68,"line_end":68,"column_start":44,"column_end":45,"is_primary":false,"text":[{"text":"    fn twice_ten_so<F: FnOnce(i32) -> i32>(f: Box<F>) {","highlight_start":44,"highlight_end":45}],"label":"move occurs because `f` has type `std::boxed::Box<F>`, which does not implement the `Copy` trait","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0382]: use of moved value: `f`\n  --> /checkout/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs:69:11\n   |\nLL |     fn twice_ten_so<F: FnOnce(i32) -> i32>(f: Box<F>) {\n   |                                            - move occurs because `f` has type `std::boxed::Box<F>`, which does not implement the `Copy` trait\nLL |         f(f(10));\n   |         - ^ value used here after move\n   |         |\n   |         value moved here\n\n"}
[01:31:30] {"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/book/ch04-02-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/borrowck/two-phase-nonrecv-autoref.rs","byte_start":3024,"byte_end":3025,"line_start":76,"line_end":76,"column_start":9,"column_end":10,"is_primary":false,"text":[{"text":"        f(f(10));","highlight_start":9,"highlight_end":10}],"label":"first mutable borrow occurs here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs","byte_start":3026,"byte_end":3027,"line_start":76,"line_end":76,"column_start":11,"column_end":12,"is_primary":true,"text":[{"text":"        f(f(10));","highlight_start":11,"highlight_end":12}],"label":"second mutable borrow occurs here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs","byte_start":3024,"byte_end":3025,"line_start":76,"line_end":76,"column_start":9,"column_end":10,"is_primary":false,"text":[{"text":"        f(f(10));","highlight_start":9,"highlight_end":10}],"label":"first borrow later used by call","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0499]: cannot borrow `*f` as mutable more than once at a time\n  --> /checkout/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs:76:11\n   |\nLL |         f(f(10));\n   |         - ^ second mutable borrow occurs here\n   |         |\n   |         first mutable borrow occurs here\n   |         first borrow later used by call\n\n"}
[01:31:30] {"message":"use of moved value: `f`","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/ch04-00-understanding-ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs","byte_start":3411,"byte_end":3412,"line_start":85,"line_end":85,"column_start":9,"column_end":10,"is_primary":false,"text":[{"text":"        f(f(10));","highlight_start":9,"highlight_end":10}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs","byte_start":3413,"byte_end":3414,"line_start":85,"line_end":85,"column_start":11,"column_end":12,"is_primary":true,"text":[{"text":"        f(f(10));","highlight_start":11,"highlight_end":12}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs","byte_start":3373,"byte_end":3374,"line_start":84,"line_end":84,"column_start":21,"column_end":22,"is_primary":false,"text":[{"text":"    fn twice_ten_oo(f: Box<FnOnce(i32) -> i32>) {","highlight_start":21,"highlight_end":22}],"label":"move occurs because `f` has type `std::boxed::Box<dyn std::ops::FnOnce(i32) -> i32>`, which does not implement the `Copy` trait","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0382]: use of moved value: `f`\n  --> /checkout/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs:85:11\n   |\nLL |     fn twice_ten_oo(f: Box<FnOnce(i32) -> i32>) {\n   |                     - move occurs because `f` has type `std::boxed::Box<dyn std::ops::FnOnce(i32) -> i32>`, which does not implement the `Copy` trait\nLL |         f(f(10));\n   |         - ^ value used here after move\n   |         |\n   |         value moved here\n\n"}
[01:31:30] {"message":"cannot borrow `a` 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/book/ch04-02-references-and-borrowing.html.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs","byte_start":4255,"byte_end":4257,"line_start":125,"line_end":125,"column_start":27,"column_end":29,"is_primary":true,"text":[{"text":"    double_access(&mut a, &a);","highlight_start":27,"highlight_end":29}],"label":"immutable borrow occurs here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs","byte_start":4247,"byte_end":4253,"line_start":125,"line_end":125,"column_start":19,"column_end":25,"is_primary":false,"text":[{"text":"    double_access(&mut a, &a);","highlight_start":19,"highlight_end":25}],"label":"mutable borrow occurs here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs","byte_start":4233,"byte_end":4246,"line_start":125,"line_end":125,"column_start":5,"column_end":18,"is_primary":false,"text":[{"text":"    double_access(&mut a, &a);","highlight_start":5,"highlight_end":18}],"label":"mutable borrow later used by call","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0502]: cannot borrow `a` as immutable because it is also borrowed as mutable\n  --> /checkout/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs:125:27\n   |\nLL |     double_access(&mut a, &a);\n   |     ------------- ------  ^^ immutable borrow occurs here\n   |     |             |\n   |     |             mutable borrow occurs here\n   |     mutable borrow later used by call\n\n"}
[01:31:30] {"message":"cannot borrow `i` 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/book/ch04-02-references-and-borrowing.html.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs","byte_start":5050,"byte_end":5051,"line_start":153,"line_end":153,"column_start":7,"column_end":8,"is_primary":true,"text":[{"text":"    i[i[3]] = 4;","highlight_start":7,"highlight_end":8}],"label":"immutable borrow occurs here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs","byte_start":5048,"byte_end":5049,"line_start":153,"line_end":153,"column_start":5,"column_end":6,"is_primary":false,"text":[{"text":"    i[i[3]] = 4;","highlight_start":5,"highlight_end":6}],"label":"mutable borrow occurs here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs","byte_start":5048,"byte_end":5055,"line_start":153,"line_end":153,"column_start":5,"column_end":12,"is_primary":false,"text":[{"text":"    i[i[3]] = 4;","highlight_start":5,"highlight_end":12}],"label":"mutable borrow later used here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable\n  --> /checkout/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs:153:7\n   |\nLL |     i[i[3]] = 4;\n   |     --^----\n   |     | |\n   |     | immutable borrow occurs here\n   |     mutable borrow occurs here\n   |     mutable borrow later used here\n\n"}
[01:31:30] {"message":"cannot borrow `i` 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/book/ch04-02-references-and-borrowing.html.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs","byte_start":5284,"byte_end":5285,"line_start":159,"line_end":159,"column_start":7,"column_end":8,"is_primary":true,"text":[{"text":"    i[i[3]] = i[4];","highlight_start":7,"highlight_end":8}],"label":"immutable borrow occurs here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs","byte_start":5282,"byte_end":5283,"line_start":159,"line_end":159,"column_start":5,"column_end":6,"is_primary":false,"text":[{"text":"    i[i[3]] = i[4];","highlight_start":5,"highlight_end":6}],"label":"mutable borrow occurs here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs","byte_start":5282,"byte_end":5289,"line_start":159,"line_end":159,"column_start":5,"column_end":12,"is_primary":false,"text":[{"text":"    i[i[3]] = i[4];","highlight_start":5,"highlight_end":12}],"label":"mutable borrow later used here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable\n  --> /checkout/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs:159:7\n   |\nLL |     i[i[3]] = i[4];\n   |     --^----\n   |     | |\n   |     | immutable borrow occurs here\n   |     mutable borrow occurs here\n   |     mutable borrow later used here\n\n"}
[01:31:30] {"message":"aborting due to 7 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 7 previous errors\n\n"}
[01:31:30] {"message":"Some errors occurred: E0382, E0499, E0502.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0382, E0499, E0502.\n"}
[01:31:30] 
[01:31:30] ------------------------------------------
[01:31:30] 
[01:31:30] thread '[ui (nll)] ui/borrowck/two-phase-nonrecv-autoref.rs#ast' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3425:9
---
[01:31:30] 
[01:31:30] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:516:22
[01:31:30] 
[01:31:30] 
[01:31:30] 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.0-rust-1.35.0-dev\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:31:30] 
[01:31:30] 
[01:31:30] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:31:30] Build completed unsuccessfully in 0:08:45
[01:31:30] Build completed unsuccessfully in 0:08:45
[01:31:30] Makefile:48: recipe for target 'check' failed
[01:31:30] make: *** [check] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:009f8872
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Fri Apr  5 02:31:28 UTC 2019
---
travis_time:end:09d92ff4:start=1554431490325654067,finish=1554431490341937118,duration=16283051
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:13242bff
$ 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:1bc95958
travis_time:start:1bc95958
$ 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:2bfb856c
$ 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)

@crlf0710
Copy link
Member

crlf0710 commented Apr 5, 2019

Sorry, there was a test failure in nll-compare-mode. I've fixed it.

@Centril Centril closed this Apr 5, 2019
@Centril Centril deleted the rollup-qllcsxi branch April 5, 2019 10:44
@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.

9 participants