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

Tweak "incompatible match arms" error #58267

Merged
merged 3 commits into from Feb 14, 2019

Conversation

Projects
None yet
4 participants
@estebank
Copy link
Contributor

estebank commented Feb 7, 2019

  • Point at the body expression of the match arm with the type error.
  • Point at the prior match arms explicitly stating the evaluated type.
  • Point at the entire match expr in a secondary span, instead of primary.
  • For type errors in the first match arm, the cause is outside of the
    match, treat as implicit block error to give a more appropriate error.

Fix #46776, fix #57206.
CC #24157, #38234.

Reweork incompatible match arms error
- Point at the body expression of the match arm with the type error.
- Point at the prior match arms explicitely stating the evaluated type.
- Point at the entire match expr in a secondary span, instead of primary.
- For type errors in the first match arm, the cause is outside of the
  match, treat as implicit block error to give a more appropriate error.
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Feb 7, 2019

r? @matthewjasper

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

@matthewjasper

This comment has been minimized.

Copy link
Contributor

matthewjasper commented Feb 8, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 8, 2019

📌 Commit 7eb6a2a has been approved by matthewjasper

@matthewjasper

This comment has been minimized.

Copy link
Contributor

matthewjasper commented Feb 8, 2019

@bors r-

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

rust-highfive commented Feb 8, 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:009477d0:start=1549633578972159783,finish=1549633733264170075,duration=154292010292
$ 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:04:17] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:04:17] tidy error: /checkout/src/librustc/infer/error_reporting/mod.rs:528: line longer than 100 chars
[00:04:19] some tidy checks failed
[00:04:19] 
[00:04:19] 
[00:04:19] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:04:19] 
[00:04:19] 
[00:04:19] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:04:19] Build completed unsuccessfully in 0:00:46
[00:04:19] Build completed unsuccessfully in 0:00:46
[00:04:19] Makefile:68: recipe for target 'tidy' failed
[00:04:19] make: *** [tidy] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:012dbbe8
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Fri Feb  8 13:53:23 UTC 2019
---
travis_time:end:001b3aa4:start=1549634004729324104,finish=1549634004734338560,duration=5014456
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:01ba956d
$ 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:0a1b2ef4
travis_time:start:0a1b2ef4
$ 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:09d34aaf
$ 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)

@estebank estebank force-pushed the estebank:match-arms branch from 7408fff to 802c897 Feb 8, 2019

@matthewjasper

This comment has been minimized.

Copy link
Contributor

matthewjasper commented Feb 8, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 8, 2019

📌 Commit 802c897 has been approved by matthewjasper

Centril added a commit to Centril/rust that referenced this pull request Feb 14, 2019

Rollup merge of rust-lang#58267 - estebank:match-arms, r=matthewjasper
Tweak "incompatible match arms" error

- Point at the body expression of the match arm with the type error.
- Point at the prior match arms explicitly stating the evaluated type.
- Point at the entire match expr in a secondary span, instead of primary.
- For type errors in the first match arm, the cause is outside of the
  match, treat as implicit block error to give a more appropriate error.

Fix rust-lang#46776, fix rust-lang#57206.
CC rust-lang#24157, rust-lang#38234.

Centril added a commit to Centril/rust that referenced this pull request Feb 14, 2019

Rollup merge of rust-lang#58267 - estebank:match-arms, r=matthewjasper
Tweak "incompatible match arms" error

- Point at the body expression of the match arm with the type error.
- Point at the prior match arms explicitly stating the evaluated type.
- Point at the entire match expr in a secondary span, instead of primary.
- For type errors in the first match arm, the cause is outside of the
  match, treat as implicit block error to give a more appropriate error.

Fix rust-lang#46776, fix rust-lang#57206.
CC rust-lang#24157, rust-lang#38234.

bors added a commit that referenced this pull request Feb 14, 2019

Auto merge of #58446 - Centril:rollup, r=Centril
Rollup of 8 pull requests

Successful merges:

 - #57451 (suggestion-diagnostics: as_ref improve snippet)
 - #57856 (Convert old first edition links to current edition one)
 - #57992 (Update the future/task API)
 - #58258 (Reduce the size of `hir::Expr`.)
 - #58267 (Tweak "incompatible match arms" error)
 - #58296 (Hidden suggestion support)
 - #58301 (Enable comparing fat pointers)
 - #58308 (Extract block to insert an intrinsic into its own function)

Failed merges:

r? @ghost

@bors bors merged commit 802c897 into rust-lang:master Feb 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment