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

Allow logically reborrowing through derefs of ghost and indexing things #852

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

xldenis
Copy link
Collaborator

@xldenis xldenis commented Aug 9, 2023

This more correctly implements #836 but the code is suspicious enough that I don't want to merge this yet.

In particular, given x : &mut Ghost<Vec<T>> the expression let y : &mut T = &mut x[0] is expands to: &mut index_logic (* deref (& * x)). The real problem is the insertion of that extra & inside.
My current implementation detects and correctly handles this case for obvious scenarios by 'skipping over it', but is that really what we want to do in general?

@xldenis xldenis force-pushed the logical-reborrow-index branch 4 times, most recently from d34c61c to 9da7dde Compare December 12, 2023 12:08
@xldenis
Copy link
Collaborator Author

xldenis commented Dec 12, 2023

Rewritten since our discussion yesterday @jhjourdan, this turns * Ghost::deref(& _) into a single Ghost::inner(_)

@xldenis xldenis force-pushed the logical-reborrow-index branch from 9da7dde to 0d677db Compare December 12, 2023 13:55
@xldenis xldenis merged commit 2d6f396 into master Dec 12, 2023
4 checks passed
@xldenis xldenis deleted the logical-reborrow-index branch December 12, 2023 16:28
@jhjourdan jhjourdan mentioned this pull request Dec 13, 2023
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 this pull request may close these issues.

1 participant