Skip to content

Don't stop evaluating due to errors before borrow checking - #60125

Merged
bors merged 3 commits into
rust-lang:masterfrom
estebank:continue-evaluating
Apr 23, 2019
Merged

Don't stop evaluating due to errors before borrow checking#60125
bors merged 3 commits into
rust-lang:masterfrom
estebank:continue-evaluating

Conversation

@estebank

Copy link
Copy Markdown
Contributor

r? @oli-obk

Fix#60005. Follow up to #59903. Blocked on #53708, fixing the ICE in src/test/ui/consts/match_ice.rs.

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 19, 2019
@estebankestebank changed the title Never stop due to errors before borrow checkingDon't stop evaluating due to errors before borrow checkingApr 19, 2019
@rust-highfive

This comment has been minimized.

@estebank
estebankforce-pushed the continue-evaluating branch from c3725fe to 595a151CompareApril 20, 2019 01:27
Comment threadsrc/librustc_mir/hair/pattern/mod.rs Outdated
Comment threadsrc/test/ui/error-codes/E0007.stderr Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this span isn't quite right. I think it should point to op_string

Comment threadsrc/test/ui/error-codes/E0301.stderr Outdated
Comment threadsrc/test/ui/error-codes/E0302.stderr Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this diagnostic is actually better than the first one.

@bors

This comment has been minimized.

@estebank
estebankforce-pushed the continue-evaluating branch from 595a151 to 87ef96dCompareApril 22, 2019 20:14
@estebank

Copy link
Copy Markdown
ContributorAuthor

@oli-obk It seems to me that with the change made in this PR, we can safely disable everything in check_match and no currently compiling code will stop compiling, and a subset of currently rejected code would now be accepted (as tested locally), which seems like it could be problematic because people could write code that compiles in latest stable but wouldn't compile in older rustc.

Enum::A(_) if { x = Enum::B(false); false } => 1,
//~^ ERROR cannot assign in a pattern guard
//~| WARN cannot assign `x` in match guard
//~| WARN this error has been downgraded to a warning for backwards compatibility

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as a next step we should make this a deny-by-default lint.

@oli-obk

Copy link
Copy Markdown
Contributor

a subset of currently rejected code would now be accepted (as tested locally)
which seems like it could be problematic because people could write code that compiles in latest stable but wouldn't compile in older rustc.

That's fine. We do this all the time. I mean, every new syntactical feature is basically that.

we can safely disable everything in check_match

There's also code for the exhaustiveness checks in match checking, we can't remove that.

Let's merge this PR and then have a look at what effect killing the match borrow check duplication has (in a new PR)

@bors r+

@bors

bors commented Apr 23, 2019

Copy link
Copy Markdown
Collaborator

📌 Commit 87ef96d has been approved by oli-obk

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 23, 2019
@bors

bors commented Apr 23, 2019

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 87ef96d with merge 31f5d69...

bors added a commit that referenced this pull request Apr 23, 2019
Don't stop evaluating due to errors before borrow checking
r? @oli-obkFix#60005. Follow up to #59903. Blocked on #53708, fixing the ICE in `src/test/ui/consts/match_ice.rs`.
@bors

bors commented Apr 23, 2019

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-travis, status-appveyor
Approved by: oli-obk
Pushing 31f5d69 to master...

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

Labels

merged-by-borsThis PR was explicitly merged by bors.S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove abort_if_errors before borrow checking

4 participants

@estebank@rust-highfive@bors@oli-obk