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

typeck: note other end-point when checking range pats #67287

Merged
merged 1 commit into from Dec 30, 2019

Conversation

@Centril
Copy link
Member

Centril commented Dec 13, 2019

Fixes #57389, alternative to #67214 that should be less invasive to type checking logic.

r? @estebank

| ----------------------- this match expression has type `std::ops::Range<{integer}>`
LL | [..9, 99..100, _] => {},
| -- ^^^ expected struct `std::ops::Range`, found integer
| |

This comment has been minimized.

Copy link
@estebank

estebank Dec 13, 2019

Contributor

I still don't understand what's happening here

This comment has been minimized.

Copy link
@Centril

Centril Dec 13, 2019

Author Member

The first error above is for 99 and the other one is for 100. They now occur twice because the spans are different and so there's no de-duplication. The type error happens because 99..105 is at type Range<{integer}> whereas 99..100 is a range pattern at type {integer}.

This comment has been minimized.

Copy link
@kevgrasso

kevgrasso Dec 13, 2019

Contributor

In my version I tried changing "this match expression has" to "this match expression requires" in an attempt to clarify these errors

This comment has been minimized.

Copy link
@Centril

Centril Dec 13, 2019

Author Member

It's fine to change that, but that can be in a different PR than this (e.g. yours).

This comment has been minimized.

Copy link
@estebank

estebank Dec 14, 2019

Contributor

The problem I have with this wording is "expected struct std::ops::Range, found integer", but now I see that the thing being matched is [5..4, 99..105, 43..44] and not [5, 99, 43], which accounts for the weirdness.

This comment has been minimized.

Copy link
@Centril

Centril Dec 14, 2019

Author Member

Right, and that part hasn't changed as you can see from the diff. :)

@bors

This comment was marked as resolved.

Copy link
Contributor

bors commented Dec 23, 2019

☔️ The latest upstream changes (presumably #67540) made this pull request unmergeable. Please resolve the merge conflicts.

@Centril Centril force-pushed the Centril:mismatch-range-improve-diag branch from bec6b77 to 196c27d Dec 23, 2019
@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

rust-highfive commented Dec 23, 2019

The job mingw-check of your PR failed (pretty log, 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.
2019-12-23T11:08:50.4388480Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-12-23T11:08:50.4405093Z ##[command]git config gc.auto 0
2019-12-23T11:08:50.4408280Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-12-23T11:08:50.4410914Z ##[command]git config --get-all http.proxy
2019-12-23T11:08:50.4415886Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/67287/merge:refs/remotes/pull/67287/merge
---
2019-12-23T11:17:11.4020763Z     Checking rustc_typeck v0.0.0 (/checkout/src/librustc_typeck)
2019-12-23T11:17:12.0446574Z error[E0425]: cannot find value `begin` in this scope
2019-12-23T11:17:12.0447882Z    --> src/librustc_typeck/check/pat.rs:358:43
2019-12-23T11:17:12.0448348Z     |
2019-12-23T11:17:12.0448910Z 358 |             self.emit_err_pat_range(span, begin.span, end.span, lhs_fail, rhs_fail, lhs_ty, rhs_ty);
2019-12-23T11:17:12.0454168Z 
2019-12-23T11:17:12.0492519Z error[E0425]: cannot find value `end` in this scope
2019-12-23T11:17:12.0493474Z    --> src/librustc_typeck/check/pat.rs:358:55
2019-12-23T11:17:12.0494560Z     |
2019-12-23T11:17:12.0494560Z     |
2019-12-23T11:17:12.0495151Z 358 |             self.emit_err_pat_range(span, begin.span, end.span, lhs_fail, rhs_fail, lhs_ty, rhs_ty);
2019-12-23T11:17:12.0498894Z 
2019-12-23T11:17:17.0819886Z     Checking rustc_traits v0.0.0 (/checkout/src/librustc_traits)
2019-12-23T11:17:18.1172685Z     Checking rustc_mir v0.0.0 (/checkout/src/librustc_mir)
2019-12-23T11:17:20.6786468Z error: aborting due to 2 previous errors
2019-12-23T11:17:20.6786468Z error: aborting due to 2 previous errors
2019-12-23T11:17:20.6787433Z 
2019-12-23T11:17:20.6794801Z For more information about this error, try `rustc --explain E0425`.
2019-12-23T11:17:20.6872803Z error: could not compile `rustc_typeck`.
2019-12-23T11:17:20.6876495Z warning: build failed, waiting for other jobs to finish...
2019-12-23T11:17:41.7232724Z error: build failed
2019-12-23T11:17:41.7273570Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "check" "-Zconfig-profile" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "2" "--release" "--color" "always" "--features" " llvm" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json-render-diagnostics"
2019-12-23T11:17:41.7299565Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap check
2019-12-23T11:17:41.7300200Z Build completed unsuccessfully in 0:05:43
2019-12-23T11:17:41.7353306Z == clock drift check ==
2019-12-23T11:17:41.7370594Z   local time: Mon Dec 23 11:17:41 UTC 2019
2019-12-23T11:17:41.7370594Z   local time: Mon Dec 23 11:17:41 UTC 2019
2019-12-23T11:17:41.9176299Z   network time: Mon, 23 Dec 2019 11:17:41 GMT
2019-12-23T11:17:41.9180644Z == end clock drift check ==
2019-12-23T11:17:43.0621238Z 
2019-12-23T11:17:43.0725420Z ##[error]Bash exited with code '1'.
2019-12-23T11:17:43.0752094Z ##[section]Starting: Checkout
2019-12-23T11:17:43.0753616Z ==============================================================================
2019-12-23T11:17:43.0753665Z Task         : Get sources
2019-12-23T11:17:43.0753707Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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)

@Centril Centril force-pushed the Centril:mismatch-range-improve-diag branch from 196c27d to 01599fc Dec 23, 2019
@estebank

This comment has been minimized.

Copy link
Contributor

estebank commented Dec 26, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 26, 2019

📌 Commit 01599fc has been approved by estebank

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 26, 2019

⌛️ Testing commit 01599fc with merge 85fcf56...

bors added a commit that referenced this pull request Dec 26, 2019
typeck: note other end-point when checking range pats

Fixes #57389, alternative to #67214 that should be less invasive to type checking logic.

r? @estebank
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Dec 26, 2019
…, r=estebank

typeck: note other end-point when checking range pats

Fixes rust-lang#57389, alternative to rust-lang#67214 that should be less invasive to type checking logic.

r? @estebank
@Mark-Simulacrum

This comment was marked as outdated.

Copy link
Member

Mark-Simulacrum commented Dec 26, 2019

@bors retry ceding to rollup (including this PR)

bors added a commit that referenced this pull request Dec 26, 2019
Rollup of 13 pull requests

Successful merges:

 - #67287 (typeck: note other end-point when checking range pats)
 - #67576 (reuse `capacity` variable in slice::repeat)
 - #67595 (Suggest adding a lifetime constraint for opaque type)
 - #67598 (Fix ICE / miscompilation when inlining simd shuffle intrinsic in MIR.)
 - #67604 (Add Scalar::to_(u|i)16 methods)
 - #67605 (tidy: change msdn links to newer locations)
 - #67614 (Set callbacks globally)
 - #67617 (Remove `compiler_builtins_lib` documentation)
 - #67629 (Remove redundant link texts)
 - #67631 (Work around a resolve bug in const prop)
 - #67632 (Convert collapsed to shortcut reference links)
 - #67633 (Update .mailmap)
 - #67635 (Document safety of Path casting)

Failed merges:

r? @ghost
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Dec 26, 2019
…, r=estebank

typeck: note other end-point when checking range pats

Fixes rust-lang#57389, alternative to rust-lang#67214 that should be less invasive to type checking logic.

r? @estebank
bors added a commit that referenced this pull request Dec 26, 2019
Rollup of 12 pull requests

Successful merges:

 - #67112 (Refactor expression parsing thoroughly)
 - #67192 (Various const eval and pattern matching ICE fixes)
 - #67287 (typeck: note other end-point when checking range pats)
 - #67459 (prune ill-conceived BTreeMap iter_mut assertion and test its mutability)
 - #67576 (reuse `capacity` variable in slice::repeat)
 - #67602 (Use issue = "none" instead of "0" in intrinsics)
 - #67614 (Set callbacks globally)
 - #67617 (Remove `compiler_builtins_lib` documentation)
 - #67629 (Remove redundant link texts)
 - #67632 (Convert collapsed to shortcut reference links)
 - #67633 (Update .mailmap)
 - #67635 (Document safety of Path casting)

Failed merges:

r? @ghost
@bors

This comment was marked as resolved.

Copy link
Contributor

bors commented Dec 27, 2019

☔️ The latest upstream changes (presumably #66936) made this pull request unmergeable. Please resolve the merge conflicts.

@Centril Centril force-pushed the Centril:mismatch-range-improve-diag branch from 01599fc to c4b6de2 Dec 30, 2019
@Centril

This comment has been minimized.

Copy link
Member Author

Centril commented Dec 30, 2019

@bors r=estebank

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 30, 2019

📌 Commit c4b6de2 has been approved by estebank

JohnTitor added a commit to JohnTitor/rust that referenced this pull request Dec 30, 2019
…, r=estebank

typeck: note other end-point when checking range pats

Fixes rust-lang#57389, alternative to rust-lang#67214 that should be less invasive to type checking logic.

r? @estebank
bors added a commit that referenced this pull request Dec 30, 2019
Rollup of 10 pull requests

Successful merges:

 - #64273 (Stabilize attribute macros on inline modules)
 - #67287 (typeck: note other end-point when checking range pats)
 - #67564 (docs: Iterator adapters have unspecified results after a panic)
 - #67622 (Some keyword documentation.)
 - #67657 (Clean up const-hack PRs now that const if / match exist.)
 - #67677 (resolve: Minor cleanup of duplicate macro reexports)
 - #67687 (Do not ICE on lifetime error involving closures)
 - #67698 (Move reachable_set and diagnostic_items to librustc_passes.)
 - #67701 (tidy: Enforce formatting rather than just check it if `--bless` is specified)
 - #67715 (Typo fix)

Failed merges:

r? @ghost
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 30, 2019

⌛️ Testing commit c4b6de2 with merge d297b19...

@bors bors merged commit c4b6de2 into rust-lang:master Dec 30, 2019
4 of 5 checks passed
4 of 5 checks passed
homu Testing commit c4b6de2d6a67440e3718512b21f37157c9e1cd3e with merge d297b1966391e3f9990b9400b8c81408a6594cbd...
Details
pr Build #20191230.4 succeeded
Details
pr (Linux mingw-check) Linux mingw-check succeeded
Details
pr (Linux x86_64-gnu-llvm-7) Linux x86_64-gnu-llvm-7 succeeded
Details
pr (Linux x86_64-gnu-tools) Linux x86_64-gnu-tools succeeded
Details
@Centril Centril deleted the Centril:mismatch-range-improve-diag branch Dec 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.