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

Conversation

Projects
None yet
4 participants
@phansch
Copy link
Contributor

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

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Jan 30, 2019

r? @zackmdavis

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

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Jan 30, 2019

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

This comment has been minimized.

Copy link
Member

zackmdavis commented Jan 30, 2019

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

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`.

@phansch phansch force-pushed the phansch:improve_check_ty_error branch from a66a7f1 to 037fdb8 Jan 30, 2019

@phansch

This comment has been minimized.

Copy link
Contributor Author

phansch commented Jan 30, 2019

@bors r=zackmdavis

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 30, 2019

@phansch: 🔑 Insufficient privileges: Not in reviewers

@zackmdavis

This comment has been minimized.

Copy link
Member

zackmdavis commented Jan 30, 2019

@bors r+ rollup

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 30, 2019

📌 Commit 037fdb8 has been approved by zackmdavis

Centril added a commit to Centril/rust that referenced this pull request Jan 30, 2019

Rollup merge of rust-lang#57984 - phansch:improve_check_ty_error, r=z…
…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

Rollup merge of rust-lang#57984 - phansch:improve_check_ty_error, r=z…
…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 30, 2019

Auto merge of #58014 - Centril:rollup, r=Centril
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)
 - #57987 (Fix some AArch64 typos)
 - #57999 (Add MOVBE x86 CPU feature)
 - #58000 (Fixes and cleanups)
 - #58007 (Don't panic when accessing enum variant ctor using `Self` in match)
 - #58008 (Pass correct arguments to places_conflict)

Failed merges:

r? @ghost

Centril added a commit to Centril/rust that referenced this pull request Jan 31, 2019

Rollup merge of rust-lang#57984 - phansch:improve_check_ty_error, r=z…
…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

Auto merge of #58016 - Centril:rollup, r=Centril
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 phansch:improve_check_ty_error branch Jan 31, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.