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

LazyCell::fill probably violates stacked borrows #98

Closed
matklad opened this issue Aug 31, 2019 · 1 comment · Fixed by #99
Closed

LazyCell::fill probably violates stacked borrows #98

matklad opened this issue Aug 31, 2019 · 1 comment · Fixed by #99

Comments

@matklad
Copy link
Contributor

matklad commented Aug 31, 2019

See matklad/once_cell#33, I believe this crate has the same issue.

indiv0 added a commit that referenced this issue Sep 1, 2019
Fix unsound aliasing of the inner `Option<T>`. Per the discussion in
matklad/once_cell#33, it is possible to obtain a
unique reference to the inner `Option<T>` despite it being potentially
aliased by a previous `.borrow()`. Kudos to @danielhenrymantilla for
spotting this issue in `matklad/once_cell` and to @matklad for pointing out that
it also applies to `LazyCell::fill`.

Closes #98.
@indiv0
Copy link
Owner

indiv0 commented Sep 1, 2019

Thank you very much for notice! I've opened #99 to fix this.

EDIT: I just noticed you're also the primary contributor to intellij-rust. Thank you so much for your outstanding contributions to open source :)

@indiv0 indiv0 closed this as completed in #99 Sep 1, 2019
indiv0 added a commit that referenced this issue Sep 1, 2019
Fix unsound aliasing of the inner `Option<T>`. Per the discussion in
matklad/once_cell#33, it is possible to obtain a
unique reference to the inner `Option<T>` despite it being potentially
aliased by a previous `.borrow()`. Kudos to @danielhenrymantilla for
spotting this issue in `matklad/once_cell` and to @matklad for pointing out that
it also applies to `LazyCell::fill`.

Closes #98.
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

Successfully merging a pull request may close this issue.

2 participants