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

Improve bug message in check_ty #57984

Merged
merged 1 commit into from
Jan 31, 2019
Merged

Conversation

phansch
Copy link
Member

@phansch phansch commented Jan 30, 2019

This branch was hit in Clippy and I think it would be nice to
show the thing that was unexpected in the bug message.

It's also in line with the other bug! messages in check_ty.

@rust-highfive
Copy link
Collaborator

r? @zackmdavis

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 30, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.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.
travis_time:end:177fae9c:start=1548830098382928281,finish=1548830099255908321,duration=872980040
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
[00:14:03]    Compiling rustc_typeck v0.0.0 (/checkout/src/librustc_typeck)
[00:14:14] error[E0507]: cannot move out of borrowed content
[00:14:14]     --> src/librustc_typeck/collect.rs:1306:44
[00:14:14]      |
[00:14:14] 1306 |         Node::GenericParam(param) => match param.kind {
[00:14:14]      |                                            |
[00:14:14]      |                                            cannot move out of borrowed content
[00:14:14]      |                                            cannot move out of borrowed content
[00:14:14]      |                                            help: consider borrowing here: `&param.kind`
[00:14:14] ...
[00:14:14] 1311 |             x => bug!("unexpected non-type Node::GenericParam: {:?}", x),
[00:14:14]      |             - data moved here
[00:14:14]      |
[00:14:14] note: move occurs because `x` has type `rustc::hir::GenericParamKind`, which does not implement the `Copy` trait
[00:14:14]     --> src/librustc_typeck/collect.rs:1311:13
[00:14:14]      |
[00:14:14] 1311 |             x => bug!("unexpected non-type Node::GenericParam: {:?}", x),
[00:14:14] 
[00:14:14] error: aborting due to previous error
[00:14:14] 
[00:14:14] For more information about this error, try `rustc --explain E0507`.
---
156148 ./src/llvm-project/clang
154512 ./obj/build/bootstrap/debug/incremental
141396 ./obj/build/x86_64-unknown-linux-gnu/stage0-rustc
139748 ./obj/build/bootstrap/debug/incremental/bootstrap-2ahv8almm435e
139744 ./obj/build/bootstrap/debug/incremental/bootstrap-2ahv8almm435e/s-f90isrud82-167y8w1-211f56mf0fscc
108528 ./src/llvm-project/lldb
104288 ./obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu
104284 ./obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release
101784 ./obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps
---
travis_time:end:032694e0:start=1548831189545321365,finish=1548831189549414861,duration=4093496
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:1560be22
$ 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:232b8b2c
travis_time:start:232b8b2c
$ 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/cla

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)

@zackmdavis
Copy link
Member

Thanks! You have a borrowcheck error, but r=me after fixing that

This branch was hit in Clippy and I think it would be nice to
show the thing that was unexpected in the bug message.

It's also in line with the other `bug!` messages in `check_ty`.
@phansch
Copy link
Member Author

phansch commented Jan 30, 2019

@bors r=zackmdavis

@bors
Copy link
Contributor

bors commented Jan 30, 2019

@phansch: 🔑 Insufficient privileges: Not in reviewers

@zackmdavis
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jan 30, 2019

📌 Commit 037fdb8 has been approved by zackmdavis

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 30, 2019
Centril added a commit to Centril/rust that referenced this pull request Jan 30, 2019
…ackmdavis

Improve bug message in check_ty

This branch was hit in Clippy and I think it would be nice to
show the thing that was unexpected in the bug message.

It's also in line with the other `bug!` messages in `check_ty`.
Centril added a commit to Centril/rust that referenced this pull request Jan 30, 2019
…ackmdavis

Improve bug message in check_ty

This branch was hit in Clippy and I think it would be nice to
show the thing that was unexpected in the bug message.

It's also in line with the other `bug!` messages in `check_ty`.
Centril added a commit to Centril/rust that referenced this pull request Jan 31, 2019
…ackmdavis

Improve bug message in check_ty

This branch was hit in Clippy and I think it would be nice to
show the thing that was unexpected in the bug message.

It's also in line with the other `bug!` messages in `check_ty`.
bors added a commit that referenced this pull request Jan 31, 2019
Rollup of 12 pull requests

Successful merges:

 - #57008 (suggest `|` when `,` founds in invalid match value)
 - #57106 (Mark str::trim.* functions as #[must_use].)
 - #57920 (use `SOURCE_DATE_EPOCH` for man page time if set)
 - #57934 (Introduce into_raw_non_null on Rc and Arc)
 - #57971 (SGX target: improve panic & exit handling)
 - #57980 (Add the edition guide to the bookshelf)
 - #57984 (Improve bug message in check_ty)
 - #57999 (Add MOVBE x86 CPU feature)
 - #58000 (Fixes and cleanups)
 - #58005 (update docs for fix_start/end_matches)
 - #58007 (Don't panic when accessing enum variant ctor using `Self` in match)
 - #58008 (Pass correct arguments to places_conflict)

Failed merges:

r? @ghost
@bors bors merged commit 037fdb8 into rust-lang:master Jan 31, 2019
@phansch phansch deleted the improve_check_ty_error branch January 31, 2019 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants