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

Do not emit E0277 on incorrect tuple destructured binding #53371

Merged
merged 4 commits into from
Sep 14, 2018

Conversation

estebank
Copy link
Contributor

Fix #50333.

@rust-highfive
Copy link
Collaborator

r? @eddyb

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 14, 2018
@rust-highfive

This comment has been minimized.

for (_, elem) in elements.iter().enumerate_and_adjust(max_len, ddpos) {
self.check_pat_walk(elem, &tcx.types.err, def_bm, true);
}
tcx.mk_ty(ty::TyTuple(element_tys))
Copy link
Member

Choose a reason for hiding this comment

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

Can this use tcx.mk_tup or something instead? It seems a bit too complex.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair enough. Will change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm just not sure how extensive the effects of enumerate_and_adjust and check_pat_walk are.

I'll try to get a compile with simplified logic, but will keep it as a separate commit in case it causes uncaught regressions.

let region_bound = relation.with_cause(
Cause::ExistentialRegionBound,
|relation| relation.relate_with_variance(ty::Contravariant, a_region, b_region),
)?;
Copy link
Member

Choose a reason for hiding this comment

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

Is this just a drive-by formatting change? I'd prefer if it wasn't included, it feels confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. If I recall correctly I was looking if I needed to modify that file while exploring for a solution and left that small cleanup in because it was small enough, but I can revert it.

@rust-highfive

This comment has been minimized.

@estebank

This comment has been minimized.

@pietroalbini

This comment has been minimized.

@TimNN
Copy link
Contributor

TimNN commented Sep 4, 2018

Ping from triage @eddyb / @rust-lang/compiler: This PR requires your review.

@eddyb
Copy link
Member

eddyb commented Sep 8, 2018

Please do not assign me diagnostics PRs. r? @nikomatsakis

Copy link
Contributor

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

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

r=me with a comment

src/librustc_typeck/check/_match.rs Outdated Show resolved Hide resolved
@estebank
Copy link
Contributor Author

@bors r=nikomatsakis rollup

@bors
Copy link
Contributor

bors commented Sep 12, 2018

📌 Commit 63cd81c has been approved by nikomatsakis

@bors bors 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 Sep 12, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Sep 13, 2018
Do not emit E0277 on incorrect tuple destructured binding

Fix rust-lang#50333.
bors added a commit that referenced this pull request Sep 13, 2018
Rollup of 11 pull requests

Successful merges:

 - #53371 (Do not emit E0277 on incorrect tuple destructured binding)
 - #53829 (Add rustc SHA to released DWARF debuginfo)
 - #53950 (Allow for opting out of ThinLTO and clean up LTO related cli flag handling.)
 - #53976 (Replace unwrap calls in example by expect)
 - #54070 (Add Error::description soft-deprecation to RELEASES)
 - #54076 (miri loop detector hashing)
 - #54119 (Add some unit tests for find_best_match_for_name)
 - #54147 (Add a test that tries to modify static memory at compile-time)
 - #54150 (Updated 1.29 release notes with --document-private-items flag)
 - #54163 (Update stage 0 to latest beta)
 - #54170 (COMPILER_TESTS.md has been moved)
@bors bors merged commit 63cd81c into rust-lang:master Sep 14, 2018
@estebank estebank deleted the tuple branch November 9, 2023 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: 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.

8 participants