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

resolve: record pattern def when resolve_pattern returns Err(true) #33967

Merged
merged 1 commit into from
Jun 1, 2016

Conversation

dsprenkels
Copy link
Contributor

@dsprenkels dsprenkels commented May 30, 2016

I propose a fix for issue #33293.

In 1a374b8, (pr #33046) fixed the error reporting of a specific case, but the change that was introduced did not make sure that record_def was called in all cases, which lead to an ICE in [1].
This change restores the original else case, but keeps the changes that were committed in 1a374b8.

[1] rustc::middle::mem_categorization::MemCategorizationContext::cat_pattern_

…h` returns `Err(true)`

In 1a374b8, (pr rust-lang#33046) fixed the error reporting of a specific
case, but the change that was introduced did not make sure that
`record_def` was called in all cases, which lead to an ICE in [1].
This change restores the original `else` case, but keeps the changes
that were committed in 1a374b8.

This commit fixes issue rust-lang#33293.

[1] `rustc::middle::mem_categorization::MemCategorizationContext::cat_pattern_`
@rust-highfive
Copy link
Collaborator

r? @jroesch

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

@dsprenkels
Copy link
Contributor Author

dsprenkels commented May 30, 2016

N.b. I think that a test case should be added to this PR. This gist shows a suitable piece of code.
But I don't know how to tell the test system that this test case should report

failed to resolve. Use of undeclared type or module `aaa` [E0433]

and the the same time not report:

internal compiler error: ../src/librustc/middle/mem_categorization.rs:1271: enum pattern didn't resolve to enum or struct None

@dsprenkels dsprenkels changed the title librustc_resolve: record pattern def when resolve_pattern returns Err(true) resolve: record pattern def when resolve_pattern returns Err(true) May 30, 2016
@dsprenkels
Copy link
Contributor Author

r? @Manishearth

@rust-highfive rust-highfive assigned Manishearth and unassigned jroesch May 31, 2016
@petrochenkov
Copy link
Contributor

LGTM.
(I'm doing some larger changes in this area, which include this change, but it's ok to land this in the meantime)

@Manishearth
Copy link
Member

@bors r=petrochenkov

@bors
Copy link
Contributor

bors commented Jun 1, 2016

📌 Commit cde0f94 has been approved by petrochenkov

Manishearth added a commit to Manishearth/rust that referenced this pull request Jun 1, 2016
…, r=petrochenkov

resolve: record pattern def when `resolve_pattern` returns `Err(true)`

I propose a fix for issue rust-lang#33293.

In 1a374b8, (pr rust-lang#33046) fixed the error reporting of a specific case, but the change that was introduced did not make sure that `record_def` was called in all cases, which lead to an ICE in [1].
This change restores the original `else` case, but keeps the changes that were committed in 1a374b8.

[1] `rustc::middle::mem_categorization::MemCategorizationContext::cat_pattern_`
bors added a commit that referenced this pull request Jun 1, 2016
Rollup of 11 pull requests

- Successful merges: #33385, #33606, #33841, #33892, #33896, #33915, #33921, #33967, #33970, #33973, #33977
- Failed merges:
@bors bors merged commit cde0f94 into rust-lang:master Jun 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants