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 14 pull requests #54944

Closed
wants to merge 35 commits into from
Closed

Conversation

pietroalbini
Copy link
Member

Successful merges:

Failed merges:

r? @ghost

lucasloisp and others added 30 commits October 2, 2018 13:31
Clarification of the use of `ptr::eq` to test equality of references
via address by pointer coercion
This commit enhances `LaterUseKind` detection to identify when a borrow
is captured by a trait object which helps explain why there is a borrow
error.
This commit updates the captured trait object search logic to look for
unsized casts to boxed types rather than for functions that returned
trait objects.
This commit adds suggestions to change the definitions of fields in
struct definitions from immutable references to mutable references.
This commit changes the label to a maybe incorrect suggestion for better
integration with RLS.
and to briefly touch on the theory of debugging rustc versus the
practice of such.
…ss-eq, r=QuietMisdreavus

Documents reference equality by address (rust-lang#54197)

Clarification of the use of `ptr::eq` to test equality of references via address by pointer coercion,  regarding issue rust-lang#54197 .

The same example as in `ptr::eq` docs is shown here to clarify that
`PartialEq` compares values pointed-to instead of via address (which can be desired in some cases)
…trap-default-for-optimize-from-debug-setting, r=nikomatsakis

During rustc bootstrap, make default for `optimize` independent of `debug`

It may have taken me three and a half years, but I'm following through on my ["threat"](rust-lang#24840 (comment))

Fix rust-lang#24840
…suggestion, r=nikomatsakis

NLL is missing struct field suggestion

Part of rust-lang#52663.

This commit adds suggestions to change the definitions of fields in
struct definitions from immutable references to mutable references.

r? @nikomatsakis
cc @pnkfelix
… r=nikomatsakis

Better Diagnostic for Trait Object Capture

Part of rust-lang#52663.

This commit enhances `LaterUseKind` detection to identify when a borrow
is captured by a trait object which helps explain why there is a borrow
error.

r? @nikomatsakis
cc @pnkfelix
…m-macro, r=nikomatsakis

Fix rust-lang#54707 - parse_trait_item_ now handles interpolated blocks as function body decls

Fix rust-lang#54707 - parse_trait_item_ now handles interpolated blocks as function body decls

Previously parsing trait items only handled opening brace token and semicolon, I added a branch to the match statement that will also handle interpolated blocks.
Add doc comments about safest way to initialize a vector of zeros

This adds more information about the vec! macro as discussed in rust-lang#54628. I think this is a good starting point, but I think additional detail is needed so that we can explain why vec! is safer than the alternatives.
Fix tracking issue for Once::is_completed

rust-lang#53027 was merged without a tracking issue. I just filed rust-lang#54890. CC @matklad
Fix internal compiler error on malformed match arm pattern.

Issue: rust-lang#54379
…, r=Centril

Stabilize the `Option::replace` method

This PR stabilize the `Option::replace` method propose in rust-lang#51998.
doc fix: it's auto traits that make for automatic implementations

Being a marker trait is not good enough (that just means "no items in the trait").

r? @alexcrichton who [originally wrote these docs](RalfJung@0a13f1a).
Unused result warning: "X which must" ↦ "X that must"

Address a little grammatical faux pas in the unused result warning.
Fix handling of #[must_use] on unit and uninhabited types

Fixes rust-lang#54828.
impl Eq+Hash for TyLayout

As proposed by @eddyb at rust-lang#53671 (review).

I have an upcoming PR that would also significantly benefit from this.
@pietroalbini
Copy link
Member Author

@bors r+ p=14

@bors
Copy link
Contributor

bors commented Oct 9, 2018

📌 Commit ec1b889 has been approved by pietroalbini

@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 Oct 9, 2018
@rust-highfive
Copy link
Collaborator

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

Click to expand the log.
[00:44:57] .................................................................................................... 2500/4581
[00:45:02] .................................................................................................... 2600/4581
[00:45:05] .................................................................................................... 2700/4581
[00:45:08] .................................................................................................... 2800/4581
[00:45:11] ......................................................................F............................. 2900/4581
[00:45:17] .................................................................................................... 3100/4581
[00:45:20] i.i..ii............................................................................................. 3200/4581
[00:45:24] .................................................................................................... 3300/4581
[00:45:26] ...................................................i................................................ 3400/4581
---
[00:46:03] 
[00:46:03] ---- [ui] ui/lint/must_use-unit.rs stdout ----
[00:46:03] diff of stderr:
[00:46:03] 
[00:46:03] - error: unused return value of `foo` which must be used
[00:46:03] + error: unused return value of `foo` that must be used
[00:46:03] 3    |
[00:46:03] 3    |
[00:46:03] 4 LL |     foo(); //~ unused return value of `foo`
[00:46:03] 
[00:46:03] 10 LL | #![deny(unused_must_use)]
[00:46:03] 12 
[00:46:03] 12 
[00:46:03] - error: unused return value of `bar` which must be used
[00:46:03] + error: unused return value of `bar` that must be used
[00:46:03] checkout/src/test/ui/lint/must_use-unit.rs:16:5\n   |\nLL |     bar(); //~ unused return value of `bar`\n   |     ^^^^^^\n\n"}
[00:46:03] {"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 2 previous errors\n\n"}
[00:46:03] ------------------------------------------
[00:46:03] 
[00:46:03] thread '[ui] ui/lint/must_use-unit.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:46:03] note: Run with `RUST_BACKTRACE=1` for a backtrace.
---
[00:46:03] 
[00:46:03] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:499:22
[00:46:03] 
[00:46:03] 
[00:46:03] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-5.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options rc/libcompiler_builtins
35584 ./.git/modules/src/libcompiler_builtins/modules
35088 ./.git/modules/src/libcompiler_builtins/modules/compiler-rt
34916 ./obj/build/x86_64-unknown-linux-gnu/native/jemalloc/src
34632 ./.git/modules/src/libcompiler_builtins/modules/compiler-rt/objects
---
travis_time:end:03142bdf:start=1539127637536084621,finish=1539127637539851731,duration=3767110
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:1442caa7
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!check

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

@bors
Copy link
Contributor

bors commented Oct 10, 2018

⌛ Testing commit ec1b889 with merge c8a9342382541e4daff3970f57a79120be79f4ae...

@bors
Copy link
Contributor

bors commented Oct 10, 2018

💔 Test failed - status-travis

@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 Oct 10, 2018
@rust-highfive
Copy link
Collaborator

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

Click to expand the log.
[00:48:46] 
[00:48:46] ---- [ui] ui/lint/must_use-unit.rs stdout ----
[00:48:46] diff of stderr:
[00:48:46] 
[00:48:46] - error: unused return value of `foo` which must be used
[00:48:46] + error: unused return value of `foo` that must be used
[00:48:46] 3    |
[00:48:46] 3    |
[00:48:46] 4 LL |     foo(); //~ unused return value of `foo`
[00:48:46] 
[00:48:46] 10 LL | #![deny(unused_must_use)]
[00:48:46] 12 
[00:48:46] 12 
[00:48:46] - error: unused return value of `bar` which must be used
[00:48:46] + error: unused return value of `bar` that must be used
[00:48:46] 15    |
[00:48:46] 15    |
[00:48:46] 16 LL |     bar(); //~ unused return value of `bar`
[00:48:46] 
[00:48:46] The actual stderr differed from the expected stderr.
[00:48:46] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lint/must_use-unit/must_use-unit.stderr
[00:48:46] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lint/must_use-unit/must_use-unit.stderr
[00:48:46] To update references, rerun the tests and pass the `--bless` flag
[00:48:46] To only update this specific test, also pass `--test-args lint/must_use-unit.rs`
[00:48:46] error: 1 errors occurred comparing output.
[00:48:46] status: exit code: 1
[00:48:46] status: exit code: 1
[00:48:46] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/lint/must_use-unit.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/lint/must_use-unit/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lint/must_use-unit/auxiliary" "-A" "unused"
[00:48:46] ------------------------------------------
[00:48:46] 
[00:48:46] ------------------------------------------
[00:48:46] stderr:
[00:48:46] stderr:
[00:48:46] ------------------------------------------
[00:48:46] {"message":"unused return value of `foo` that must be used","code":{"code":"unused_must_use","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/lint/must_use-unit.rs","byte_start":145,"byte_end":151,"line_start":14,"line_end":14,"column_start":5,"column_end":11,"is_primary":true,"text":[{"text":"    foo(); //~ unused return value of `foo`","highlight_start":5,"highlight_end":11}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"lint level defined here","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/lint/must_use-unit.rs","byte_start":33,"byte_end":48,"line_start":3,"line_end":3,"column_start":9,"column_end":24,"is_primary":true,"text":[{"text":"#![deny(unused_must_use)]","highlight_start":9,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error: unused return value of `foo` that must be used\n  --> /checkout/src/test/ui/lint/must_use-unit.rs:14:5\n   |\nLL |     foo(); //~ unused return value of `foo`\n   |     ^^^^^^\n   |\nnote: lint level defined here\n  --> /checkout/src/test/ui/lint/must_use-unit.rs:3:9\n   |\nLL | #![deny(unused_must_use)]\n   |         ^^^^^^^^^^^^^^^\n\n"}
[00:48:46] {"message":"unused return value of `bar` that must be used","code":{"code":"unused_must_use","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/lint/must_use-unit.rs","byte_start":190,"byte_end":196,"line_start":16,"line_end":16,"column_start":5,"column_end":11,"is_primary":true,"text":[{"text":"    bar(); //~ unused return value of `bar`","highlight_start":5,"highlight_end":11}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: unused return value of `bar` that must be used\n  --> /checkout/src/test/ui/lint/must_use-unit.rs:16:5\n   |\nLL |     bar(); //~ unused return value of `bar`\n   |     ^^^^^^\n\n"}
[00:48:46] {"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 2 previous errors\n\n"}
[00:48:46] ------------------------------------------
[00:48:46] 
[00:48:46] thread '[ui] ui/lint/must_use-unit.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3267:9
[00:48:46] note: Run with `RUST_BACKTRACE=1` for a backtrace.
---
[00:48:46] 
[00:48:46] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:499:22
[00:48:46] 
[00:48:46] 
[00:48:46] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-5.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options " "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--llvm-version" "5.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[00:48:46] 
[00:48:46] 
[00:48:46] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:48:46] Build completed unsuccessfully in 0:03:31
[00:48:46] Build completed unsuccessfully in 0:03:31
[00:48:46] make: *** [check] Error 1
[00:48:46] Makefile:58: recipe for target 'check' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:1cce3363
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:2b062634:start=1539137280271758836,finish=1539137280279800976,duration=8042140
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:129957a2
$ 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:292704d5
travis_time:start:292704d5
$ 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:00bff821
$ 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)

@pietroalbini pietroalbini deleted the rollup branch October 10, 2018 06:58
@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.

Creating a trait function with a macro using block designator: error: expected ; or {, found { ... }