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

Borrow checker is unsound in the presence of mutable fields #5397

Closed
nikomatsakis opened this issue Mar 15, 2013 · 1 comment
Closed

Borrow checker is unsound in the presence of mutable fields #5397

nikomatsakis opened this issue Mar 15, 2013 · 1 comment
Labels
A-lifetimes Area: Lifetimes / regions A-typesystem Area: The type system E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot.

Comments

@nikomatsakis
Copy link
Contributor

The current rules are not really sound. It will permit e.g. an &mut pointer to be created for a mut field found in an &T, which is aliasable. This is bad because the &mut pointer may not be the only pointer to that data.

The rewritten version I am trying to land as part of #5074 includes a fix but it's commented out because it causes compile errors in io.rs. Fixing those errors requires cleaning up object types and converting things to &mut self and I didn't want to block #5074 on those changes. (Hence this follow-on bug)

@nikomatsakis
Copy link
Contributor Author

Since mutable fields have been removed, this is a moot point.

bors added a commit to rust-lang-ci/rust that referenced this issue May 2, 2020
Avoid single_match lint in macro rules

changelog: none
fixes rust-lang#5359
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lifetimes Area: Lifetimes / regions A-typesystem Area: The type system E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot.
Projects
None yet
Development

No branches or pull requests

1 participant