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

lint internally mutable keys in maps #729

Closed
llogiq opened this issue Mar 1, 2016 · 2 comments
Closed

lint internally mutable keys in maps #729

llogiq opened this issue Mar 1, 2016 · 2 comments

Comments

@llogiq
Copy link
Contributor

llogiq commented Mar 1, 2016

I'm not sure if this is actually possible, but it is a logic error to change keys in hashmaps or btreemaps. So if we can identify common types with interior mutability, we could warn when finding those types as keys in a map.

@fhartwig
Copy link
Contributor

fhartwig commented Mar 2, 2016

It looks like the Cell types don't implement Ord or Hash, so it's probably quite difficult to accidentally use them in a key for any of the Map types.

@llogiq
Copy link
Contributor Author

llogiq commented Mar 2, 2016

Yeah, I think #732 will suffice to ensure this, and is more to the point. Closing this.

@llogiq llogiq closed this as completed Mar 2, 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

No branches or pull requests

2 participants