-
Notifications
You must be signed in to change notification settings - Fork 386
Remove -Zunique-is-unique #4307
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
Remove -Zunique-is-unique #4307
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I tend to agree -- it is clear that a viable model for Unique
requires a permission that completely degenerates when the protector is over, i.e., a very different kind of uniquenss than what we have for &mut
. We have rust-lang/unsafe-code-guidelines#384 to track whether we want to do anything here in the future, and to record the outcome of this experiment.
There is an interesting discussion to be had whether we want this for all references -- this is tracked at rust-lang/unsafe-code-guidelines#450.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test doesn't make much sense any more in the form that you left it in, with all the comments stripped. I think the test can just be removed now (maybe double-check that we have an existing "pass" test equivalent to raw_children_of_refmut_can_alias
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the file and moved the test to the general tree_borrows.rs
test file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this an almost exact duplicate of two_raw
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yes. But we could also make the test here stronger and also do reads directly to/from the reference, which two_raw
does not do since it was originally taken from SB where this is not allowed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's already pretty much covered by local_addr_of_mut
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, then we can simply remove the test
This looks great, thanks! Please squash the commits, then we can land this. Please use the @rustbot author |
Reminder, once the PR becomes ready for a review, use |
85d8304
to
8cbe805
Compare
@rustbot ready PS: |
Thanks for testing it. :) I'll add it to my standard message then. |
I propose we declare this experiment a failure and clean up the code a bit. I don't know who is using it, I fear no one is.