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

Lower constant patterns with ascribed types. #58161

Merged
merged 1 commit into from Feb 8, 2019

Conversation

Projects
None yet
7 participants
@davidtwco
Copy link
Member

davidtwco commented Feb 4, 2019

Fixes #57960.

This PR fixes a bug introduced by #55937 which started checking user
type annotations for associated type patterns. Where lowering a
associated constant expression would previously return a
PatternKind::Constant, it now returns a PatternKind::AscribeUserType
with a PatternKind::Constant inside, this PR unwraps that to
access the constant pattern inside and behaves as before.

r? @pnkfelix

@arielb1

This comment has been minimized.

Copy link
Contributor

arielb1 commented Feb 6, 2019

r=me with comment in place

Lower constant patterns with ascribed types.
This commit fixes a bug introduced by #55937 which started checking user
type annotations for associated type patterns. Where lowering a
associated constant expression would previously return a
`PatternKind::Constant`, it now returns a `PatternKind::AscribeUserType`
with a `PatternKind::Constant` inside, this commit unwraps that to
access the constant pattern inside and behaves as before.

@davidtwco davidtwco force-pushed the davidtwco:issue-57960 branch from 789112f to 6717727 Feb 6, 2019

@arielb1

This comment has been minimized.

Copy link
Contributor

arielb1 commented Feb 6, 2019

So @matthewjasper had complained that the AscribeUserType was getting dropped. Could you add it back, along with a mir-opt test?

r=me with that

@arielb1

This comment has been minimized.

Copy link
Contributor

arielb1 commented Feb 8, 2019

It appears that fixing the AscribeUserType problem is more complicated than it appears at first glance - I have split it into #58299 - but we need to fix this PR for beta.

@bors r+ p=1

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 8, 2019

📌 Commit 6717727 has been approved by arielb1

@arielb1

This comment has been minimized.

Copy link
Contributor

arielb1 commented Feb 8, 2019

beta-nominating because this fixes a regression in beta.

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 8, 2019

⌛️ Testing commit 6717727 with merge 7fcc7a2...

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

Auto merge of #58161 - davidtwco:issue-57960, r=arielb1
Lower constant patterns with ascribed types.

Fixes #57960.

This PR fixes a bug introduced by #55937 which started checking user
type annotations for associated type patterns. Where lowering a
associated constant expression would previously return a
`PatternKind::Constant`, it now returns a `PatternKind::AscribeUserType`
with a `PatternKind::Constant` inside, this PR unwraps that to
access the constant pattern inside and behaves as before.

r? @pnkfelix
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 8, 2019

💔 Test failed - checks-travis

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Feb 8, 2019

The job dist-x86_64-apple 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.
[00:01:34]    Compiling serde_derive v1.0.81
[00:01:37]    Compiling toml v0.4.10
[00:01:37]    Compiling serde_json v1.0.33
[00:01:47]    Compiling bootstrap v0.0.0 (/Users/travis/build/rust-lang/rust/src/bootstrap)
No output has been received in the last 30m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received
The build has been terminated

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)

@arielb1

This comment has been minimized.

Copy link
Contributor

arielb1 commented Feb 8, 2019

No output has been received in the last 30m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received
The build has been terminated

@bors retry

@arielb1

This comment has been minimized.

Copy link
Contributor

arielb1 commented Feb 8, 2019

cc @kennytm looks spurious

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

Auto merge of #58161 - davidtwco:issue-57960, r=arielb1
Lower constant patterns with ascribed types.

Fixes #57960.

This PR fixes a bug introduced by #55937 which started checking user
type annotations for associated type patterns. Where lowering a
associated constant expression would previously return a
`PatternKind::Constant`, it now returns a `PatternKind::AscribeUserType`
with a `PatternKind::Constant` inside, this PR unwraps that to
access the constant pattern inside and behaves as before.

r? @pnkfelix
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 8, 2019

⌛️ Testing commit 6717727 with merge a2ec156...

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 8, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: arielb1
Pushing a2ec156 to master...

@bors bors added the merged-by-bors label Feb 8, 2019

@bors bors merged commit 6717727 into rust-lang:master Feb 8, 2019

1 check passed

homu Test successful
Details

h-michael added a commit to h-michael/rust that referenced this pull request Feb 9, 2019

Auto merge of rust-lang#58161 - davidtwco:issue-57960, r=arielb1
Lower constant patterns with ascribed types.

Fixes rust-lang#57960.

This PR fixes a bug introduced by rust-lang#55937 which started checking user
type annotations for associated type patterns. Where lowering a
associated constant expression would previously return a
`PatternKind::Constant`, it now returns a `PatternKind::AscribeUserType`
with a `PatternKind::Constant` inside, this PR unwraps that to
access the constant pattern inside and behaves as before.

r? @pnkfelix

@davidtwco davidtwco deleted the davidtwco:issue-57960 branch Feb 10, 2019

davidtwco added a commit to davidtwco/rust that referenced this pull request Feb 11, 2019

Check user type annotations for range patterns.
This commit builds on the fix from rust-lang#58161 (which fixed miscompilation
caused by the introduction of `AscribeUserType` patterns for associated
constants) to start checking these patterns are well-formed for ranges
(previous fix just ignored them so that miscompilation wouldn't occur).

davidtwco added a commit to davidtwco/rust that referenced this pull request Feb 11, 2019

Check user type annotations for range patterns.
This commit builds on the fix from rust-lang#58161 (which fixed miscompilation
caused by the introduction of `AscribeUserType` patterns for associated
constants) to start checking these patterns are well-formed for ranges
(previous fix just ignored them so that miscompilation wouldn't occur).

davidtwco added a commit to davidtwco/rust that referenced this pull request Feb 11, 2019

Check user type annotations for range patterns.
This commit builds on the fix from rust-lang#58161 (which fixed miscompilation
caused by the introduction of `AscribeUserType` patterns for associated
constants) to start checking these patterns are well-formed for ranges
(previous fix just ignored them so that miscompilation wouldn't occur).

davidtwco added a commit to davidtwco/rust that referenced this pull request Feb 12, 2019

Check user type annotations for range patterns.
This commit builds on the fix from rust-lang#58161 (which fixed miscompilation
caused by the introduction of `AscribeUserType` patterns for associated
constants) to start checking these patterns are well-formed for ranges
(previous fix just ignored them so that miscompilation wouldn't occur).

davidtwco added a commit to davidtwco/rust that referenced this pull request Feb 12, 2019

Check user type annotations for range patterns.
This commit builds on the fix from rust-lang#58161 (which fixed miscompilation
caused by the introduction of `AscribeUserType` patterns for associated
constants) to start checking these patterns are well-formed for ranges
(previous fix just ignored them so that miscompilation wouldn't occur).

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

Rollup merge of rust-lang#58371 - davidtwco:issue-58299, r=arielb1
Check user type annotations for range patterns.

Fixes rust-lang#58299.

This PR builds on the fix from rust-lang#58161 (which fixed miscompilation
caused by the introduction of `AscribeUserType` patterns for associated
constants) to start checking these patterns are well-formed for ranges
(previous fix just ignored them so that miscompilation wouldn't occur).

r? @arielb1
@pnkfelix

This comment has been minimized.

Copy link
Member

pnkfelix commented Feb 14, 2019

triage, beta-accepted.

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

Auto merge of #58537 - pietroalbini:beta-backports, r=pietroalbini
[beta] Rollup backports

Cherry-picked:

* #58207: Make `intern_lazy_const` actually intern its argument.
* #58161: Lower constant patterns with ascribed types.
* #57908: resolve: Fix span arithmetics in the import conflict error
* #57835: typeck: remove leaky nested probe during trait object method resolution
* #57885: Avoid committing to autoderef in object method probing
* #57646: Fixes text becoming invisible when element targetted

Rolled up:

* #58522: [BETA] Update cargo

r? @ghost

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

Auto merge of #58537 - pietroalbini:beta-backports, r=pietroalbini
[beta] Rollup backports

Cherry-picked:

* #58207: Make `intern_lazy_const` actually intern its argument.
* #58161: Lower constant patterns with ascribed types.
* #57908: resolve: Fix span arithmetics in the import conflict error
* #57835: typeck: remove leaky nested probe during trait object method resolution
* #57885: Avoid committing to autoderef in object method probing
* #57646: Fixes text becoming invisible when element targetted

Rolled up:

* #58522: [BETA] Update cargo

r? @ghost

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

Auto merge of #58537 - pietroalbini:beta-backports, r=pietroalbini
[beta] Rollup backports

Cherry-picked:

* #58207: Make `intern_lazy_const` actually intern its argument.
* #58161: Lower constant patterns with ascribed types.
* #57908: resolve: Fix span arithmetics in the import conflict error
* #57835: typeck: remove leaky nested probe during trait object method resolution
* #57885: Avoid committing to autoderef in object method probing
* #57646: Fixes text becoming invisible when element targetted

Rolled up:

* #58522: [BETA] Update cargo

r? @ghost

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

Auto merge of #58537 - pietroalbini:beta-backports, r=pietroalbini
[beta] Rollup backports

Cherry-picked:

* #58207: Make `intern_lazy_const` actually intern its argument.
* #58161: Lower constant patterns with ascribed types.
* #57908: resolve: Fix span arithmetics in the import conflict error
* #57835: typeck: remove leaky nested probe during trait object method resolution
* #57885: Avoid committing to autoderef in object method probing
* #57646: Fixes text becoming invisible when element targetted

Rolled up:

* #58522: [BETA] Update cargo

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