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 10 pull requests #57075

Closed
wants to merge 30 commits into from
Closed

Rollup of 10 pull requests #57075

wants to merge 30 commits into from

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Dec 23, 2018

Successful merges:

Failed merges:

r? @ghost

sinkuu and others added 20 commits December 17, 2018 22:16
This is done by adding a new `IsJoint` field to `TokenStream::Tree`,
which simplifies a lot of `match` statements. And likewise for
`CursorKind`.

The commit also adds a new method `TokenTree:stream()` which can replace
a choice between `.into()` and `.joint()`.
We need to reduce the alignment with the used offset. If the offset
isn't known, we need to reduce with the element size to support
arbitrary offsets.
Weirdly, we were deciding between a help note and a structured
suggestion based on whether the import candidate span was a dummy—but
we weren't using that span in any case! The dummy-ness of the span
(which appears to be a matter of this-crate vs. other-crate
definition) isn't the right criterion by which we should decide
whether it's germane to mention that "there is an enum variant";
instead, let's use the someness of `def` (which is used as the
`has_unexpected_resolution` argument to `error_code`).

Since `import_candidate_to_paths` has no other callers, we are free to
stop returning the span and rename the function. By using
`span_suggestions_`, we leverage the max-suggestions output limit
already built in to the emitter, thus resolving rust-lang#56028.

In the matter of message wording, "you can" is redundant (and perhaps
too informal); prefer the imperative.
The present author regrets not thinking of a more eloquent way to do
this.
@Centril
Copy link
Contributor Author

Centril commented Dec 23, 2018

@bors r+ p=10

@bors
Copy link
Contributor

bors commented Dec 23, 2018

📌 Commit 35fa309 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 23, 2018
@bors
Copy link
Contributor

bors commented Dec 23, 2018

⌛ Testing commit 35fa309 with merge 02eb9a5...

bors added a commit that referenced this pull request Dec 23, 2018
Rollup of 10 pull requests

Successful merges:

 - #56188 (enum type instead of variant suggestion unification )
 - #56916 (Fix mutable references in `static mut`)
 - #56917 (Simplify MIR generation for logical operations)
 - #56953 (Mark tuple structs as live if their constructors are used)
 - #56964 (Remove `TokenStream::JointTree`.)
 - #56966 (Correct strings for raw pointer deref and array access suggestions)
 - #56999 (AST/HIR: Introduce `ExprKind::Err` for better error recovery in the front-end)
 - #57020 (Point to cause of `fn` expected return type)
 - #57032 (fix deprecation warnings in liballoc benches)
 - #57053 (Fix alignment for array indexing)

Failed merges:

r? @ghost
@bors
Copy link
Contributor

bors commented Dec 23, 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 Dec 23, 2018
@rust-highfive
Copy link
Collaborator

The job dist-x86_64-musl 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:53:18] 
[00:53:18] ---- [ui] ui/panic-runtime/runtime-depend-on-needs-runtime.rs stdout ----
[00:53:18] diff of stderr:
[00:53:18] 
[00:53:18] 1 error: the crate `depends` cannot depend on a crate that needs a panic runtime, but it depends on `needs_panic_runtime`
[00:53:18] - error: aborting due to previous error
[00:53:18] - error: aborting due to previous error
[00:53:18] + error: language item required, but not found: `eh_personality`
[00:53:18] + error: aborting due to 2 previous errors
[00:53:18] 4 
[00:53:18] 5 
[00:53:18] 
[00:53:18] 
[00:53:18] 
[00:53:18] The actual stderr differed from the expected stderr.
[00:53:18] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/runtime-depend-on-needs-runtime/runtime-depend-on-needs-runtime.stderr
[00:53:18] To update references, rerun the tests and pass the `--bless` flag
[00:53:18] To only update this specific test, also pass `--test-args panic-runtime/runtime-depend-on-needs-runtime.rs`
[00:53:18] error: 1 errors occurred comparing output.
[00:53:18] status: exit code: 1
[00:53:18] status: exit code: 1
[00:53:18] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/panic-runtime/runtime-depend-on-needs-runtime.rs" "--target=x86_64-unknown-linux-musl" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/runtime-depend-on-needs-runtime/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-musl/native/rust-test-helpers" "-Clinker=/musl-x86_64/bin/musl-gcc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panic-runtime/runtime-depend-on-needs-runtime/auxiliary" "-A" "unused"
[00:53:18] ------------------------------------------
[00:53:18] 
[00:53:18] ------------------------------------------
[00:53:18] stderr:
[00:53:18] stderr:
[00:53:18] ------------------------------------------
[00:53:18] {"message":"the crate `depends` cannot depend on a crate that needs a panic runtime, but it depends on `needs_panic_runtime`","code":null,"level":"error","spans":[],"children":[],"rendered":"error: the crate `depends` cannot depend on a crate that needs a panic runtime, but it depends on `needs_panic_runtime`\n\n"}
[00:53:18] {"message":"language item required, but not found: `eh_personality`","code":null,"level":"error","spans":[],"children":[],"rendered":"error: language item required, but not found: `eh_personality`\n\n"}
[00:53:18] {"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 2 previous errors\n\n"}
[00:53:18] ------------------------------------------
[00:53:18] 
[00:53:18] thread '[ui] ui/panic-runtime/runtime-depend-on-needs-runtime.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3255:9
[00:53:18] 
---
[00:53:18] 
[00:53:18] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:505:22
[00:53:18] 
[00:53:18] 
[00:53:18] 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-musl/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-musl" "--mode" "ui" "--target" "x86_64-unknown-linux-musl" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--linker" "/musl-x86_64/bin/musl-gcc" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-musl/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"
[00:53:18] 
[00:53:18] 
[00:53:18] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --target x86_64-unknown-linux-musl
[00:53:18] Build completed unsuccessfully in 0:49:58
---
travis_time:end:11069a71:start=1545571893828299660,finish=1545571893839466558,duration=11166898
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:2f1c178d
$ 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:2e3756c1
travis_time:start:2e3756c1
$ 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:1b155d9a
$ 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)

…dtwco

enum type instead of variant suggestion unification

Fixes rust-lang#56028.

Weirdly, we were deciding between a help note and a structured suggestion based on whether the import candidate span was a dummy—but we weren't using that span in any case! The dummy-ness of the span (which appears to be a matter of this-crate vs. other-crate definition) isn't the right criterion by which we should decide whether it's germane to mention that "there is an enum variant"; instead, let's use the someness of `def` (which is used as the `has_unexpected_resolution` argument to `error_code`).

Since `import_candidate_to_paths` has no other callers, we are free to stop returning the span and rename the function. By using `span_suggestions_`, we leverage the max-suggestions output limit already built in to the emitter, thus resolving rust-lang#56028.

In the matter of message wording, "you can" is redundant (and perhaps too informal); prefer the imperative.

In a second commit, we do some unprincipled special-casing to correct and beautify suggestions for `Option` and `Result` (where the existing code was being confused by their being reexported in the prelude).

r? @davidtwco
… r=davidtwco

Fix mutable references in `static mut`

fixes rust-lang#56903
Simplify MIR generation for logical operations

Reduces one block and one branch from MIR generated for a logical operator.
Mark tuple structs as live if their constructors are used

fixes rust-lang#56281
…petrochenkov

Remove `TokenStream::JointTree`.

This is done by adding a new `IsJoint` field to `TokenStream::Tree`,
which simplifies a lot of `match` statements. And likewise for
`CursorKind`.

The commit also adds a new method `TokenTree:stream()` which can replace
a choice between `.into()` and `.joint()`.
…zackmdavis

Correct strings for raw pointer deref and array access suggestions

Fixes rust-lang#56714.
Fixes rust-lang#56963.

r? @zackmdavis
…r=Centril

fix deprecation warnings in liballoc benches
Fix alignment for array indexing

We need to reduce the alignment with the used offset. If the offset isn't known, use the element size, as this will yield the minimum possible alignment.

This handles both direct array indexing, and array repeat expressions.

Fixes rust-lang#56927.

r? @nagisa
…fn, r=oli-obk

Stabilize min_const_unsafe_fn in 1.33

Fixes rust-lang#55607

r? @oli-obk
@Centril Centril closed this Dec 23, 2018
@Centril Centril deleted the rollup branch December 23, 2018 13:46
@rust-highfive
Copy link
Collaborator

Your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.

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)

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.