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

Avoid mut_key on types of unknown layout #5056

Merged
merged 1 commit into from
Jan 19, 2020
Merged

Avoid mut_key on types of unknown layout #5056

merged 1 commit into from
Jan 19, 2020

Conversation

llogiq
Copy link
Contributor

@llogiq llogiq commented Jan 17, 2020

This fixes #5020 by requiring a known layout for the key type before linting. Edit: This fixes #5043, too.

changelog: none

@llogiq llogiq force-pushed the dissasociate-mut-key branch from 9ebd0d5 to f7c83c1 Compare January 17, 2020 07:27
@llogiq
Copy link
Contributor Author

llogiq commented Jan 17, 2020

r? @flip1995

@flip1995
Copy link
Member

flip1995 commented Jan 17, 2020

Does this also fix #5043 by any chance?

@llogiq
Copy link
Contributor Author

llogiq commented Jan 17, 2020

I believe it does. I should probably add a test for this, too. Gimme a sec...

@llogiq llogiq force-pushed the dissasociate-mut-key branch from f7c83c1 to da5663e Compare January 17, 2020 08:49
@llogiq
Copy link
Contributor Author

llogiq commented Jan 17, 2020

Added the missing test case.

@llogiq
Copy link
Contributor Author

llogiq commented Jan 17, 2020

Yep, it does indeed fix both. r?

@flip1995
Copy link
Member

Citing from the issue:

false positive when a hashmap has a key that consists of a tuple [...] Changing the key to be either T or U (not a tuple) removes the error

See also Playground:

Playground

Can you modify the test case, so that it uses a tuple?

@llogiq llogiq force-pushed the dissasociate-mut-key branch from da5663e to 0ad5c9a Compare January 19, 2020 12:09
Copy link
Member

@flip1995 flip1995 left a comment

Choose a reason for hiding this comment

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

Thanks!

./util/dev fmt r=me with formatting.

@llogiq llogiq force-pushed the dissasociate-mut-key branch from 0ad5c9a to 59fd637 Compare January 19, 2020 13:49
@flip1995
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jan 19, 2020

📌 Commit 59fd637 has been approved by flip1995

bors added a commit that referenced this pull request Jan 19, 2020
Avoid mut_key on types of unknown layout

This fixes #5020 by requiring a known layout for the key type before linting. Edit: This fixes #5043, too.

changelog: none
@bors
Copy link
Contributor

bors commented Jan 19, 2020

⌛ Testing commit 59fd637 with merge f7b3e4f...

@bors
Copy link
Contributor

bors commented Jan 19, 2020

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

@bors bors merged commit 59fd637 into master Jan 19, 2020
@llogiq llogiq deleted the dissasociate-mut-key branch January 19, 2020 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants