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

Typecheck patterns of all match arms first, so we get types for bindings #55819

Merged
merged 1 commit into from Nov 11, 2018

Conversation

Projects
None yet
8 participants
@pnkfelix
Member

pnkfelix commented Nov 9, 2018

Fix eventually (after backport to beta) the issue #55810

@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Nov 9, 2018

r? @estebank

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

@Robbepop

This comment has been minimized.

Contributor

Robbepop commented Nov 9, 2018

Might this PR fix this issue? #55820

@oli-obk

This comment has been minimized.

Contributor

oli-obk commented Nov 9, 2018

@bors r+

@bors

This comment has been minimized.

Contributor

bors commented Nov 9, 2018

📌 Commit 5f91373 has been approved by oli-obk

@estebank

This comment has been minimized.

Contributor

estebank commented Nov 9, 2018

Accepting for backport.

pietroalbini added a commit to pietroalbini/rust that referenced this pull request Nov 10, 2018

Rollup merge of rust-lang#55819 - pnkfelix:issue-55810-must-typeck-pa…
…ts-eagerly, r=oli-obk

Typecheck patterns of all match arms first, so we get types for bindings

Fix eventually (after backport to beta) the issue rust-lang#55810

bors added a commit that referenced this pull request Nov 10, 2018

Auto merge of #55854 - pietroalbini:rollup, r=pietroalbini
Rollup of 14 pull requests

Successful merges:

 - #55745 (Convert `outlives_components`' return value to a `SmallVec` outparam.)
 - #55764 (Fix Rc/Arc allocation layout)
 - #55792 (Prevent ICE in const-prop array oob check)
 - #55799 (Removed unneeded instance of `// revisions` from a lint test)
 - #55800 (Fix ICE in `return_type_impl_trait`)
 - #55801 (NLL: Update box insensitivity test)
 - #55802 (Don't inline virtual calls (take 2))
 - #55805 (Move `static_assert!` into librustc_data_structures)
 - #55816 (Use `SmallVec` to avoid allocations in `from_decimal_string`.)
 - #55819 (Typecheck patterns of all match arms first, so we get types for bindings)
 - #55822 (ICE with #![feature(nll)] and elided lifetimes)
 - #55828 (Add missing `rustc_promotable` attribute to unsigned `min_value` and `max_value`)
 - #55839 (Fix docstring spelling mistakes)
 - #55844 (Fix documentation typos.)

Failed merges:

r? @ghost

pietroalbini added a commit to pietroalbini/rust that referenced this pull request Nov 10, 2018

Rollup merge of rust-lang#55819 - pnkfelix:issue-55810-must-typeck-pa…
…ts-eagerly, r=oli-obk

Typecheck patterns of all match arms first, so we get types for bindings

Fix eventually (after backport to beta) the issue rust-lang#55810

bors added a commit that referenced this pull request Nov 11, 2018

Auto merge of #55859 - pietroalbini:rollup, r=pietroalbini
Rollup of 14 pull requests

Successful merges:

 - #55687 (Take supertraits into account when calculating associated types)
 - #55745 (Convert `outlives_components`' return value to a `SmallVec` outparam.)
 - #55764 (Fix Rc/Arc allocation layout)
 - #55792 (Prevent ICE in const-prop array oob check)
 - #55799 (Removed unneeded instance of `// revisions` from a lint test)
 - #55800 (Fix ICE in `return_type_impl_trait`)
 - #55801 (NLL: Update box insensitivity test)
 - #55802 (Don't inline virtual calls (take 2))
 - #55816 (Use `SmallVec` to avoid allocations in `from_decimal_string`.)
 - #55819 (Typecheck patterns of all match arms first, so we get types for bindings)
 - #55822 (ICE with #![feature(nll)] and elided lifetimes)
 - #55828 (Add missing `rustc_promotable` attribute to unsigned `min_value` and `max_value`)
 - #55839 (Fix docstring spelling mistakes)
 - #55844 (Fix documentation typos.)

Failed merges:

r? @ghost

bors added a commit that referenced this pull request Nov 11, 2018

Auto merge of #55859 - pietroalbini:rollup, r=kennytm
Rollup of 17 pull requests

Successful merges:

 - #55630 (resolve: Filter away macro prelude in modules with `#[no_implicit_prelude]` on 2018 edition)
 - #55687 (Take supertraits into account when calculating associated types)
 - #55745 (Convert `outlives_components`' return value to a `SmallVec` outparam.)
 - #55764 (Fix Rc/Arc allocation layout)
 - #55792 (Prevent ICE in const-prop array oob check)
 - #55799 (Removed unneeded instance of `// revisions` from a lint test)
 - #55800 (Fix ICE in `return_type_impl_trait`)
 - #55801 (NLL: Update box insensitivity test)
 - #55802 (Don't inline virtual calls (take 2))
 - #55816 (Use `SmallVec` to avoid allocations in `from_decimal_string`.)
 - #55819 (Typecheck patterns of all match arms first, so we get types for bindings)
 - #55822 (ICE with #![feature(nll)] and elided lifetimes)
 - #55828 (Add missing `rustc_promotable` attribute to unsigned `min_value` and `max_value`)
 - #55839 (Fix docstring spelling mistakes)
 - #55844 (Fix documentation typos.)
 - #55845 (Set BINARYEN_TRAP_MODE=clamp)
 - #55856 (rustdoc: refactor: move all static-file include!s into a single module)
@bors

This comment has been minimized.

Contributor

bors commented Nov 11, 2018

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

@bors bors merged commit 5f91373 into rust-lang:master Nov 11, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

bors added a commit that referenced this pull request Nov 12, 2018

Auto merge of #55893 - pnkfelix:issue-55810-beta-backport-of-pr-55819…
…, r=estebank

[beta] backport rollup (typeck match arms eagerly; add rustc_promotable to unsigneds)

Backport of 5f91373 from (beta-accepted) PR #55819

Fix #55810
Fix #55806
// bindings.
let all_arm_pats_diverge = arms.iter().map(|arm| {
// rust-lang/rust#55810: Typecheck patterns first (via eager
// collection into `Vec`), so we get types for all bindings.

This comment has been minimized.

@eddyb

eddyb Nov 14, 2018

Member

Ahh, had I seen this PR, I would've suggested adding a note that the map below has side-effects in terms of type inference (unifying the types of all the arms together), and that's why it has to fully complete first.

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