We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
noalias
Copied over from here
See the discussion starting here: It is possible to trigger UB in safe code using owning-ref.
Specifically, the assertion in the following snippet by @comex fails, even though it should succeed:
extern crate owning_ref; // 0.4.0 use owning_ref::OwningRef; use std::cell::Cell; fn helper(owning_ref: OwningRef<Box<Cell<u8>>, Cell<u8>>) -> u8 { owning_ref.as_owner().set(10); owning_ref.set(20); owning_ref.as_owner().get() // should return 20 } fn main() { let val: Box<Cell<u8>> = Box::new(Cell::new(25)); let owning_ref = OwningRef::new(val); let res = helper(owning_ref); assert_eq!(res, 20); // assertion fails! }
The text was updated successfully, but these errors were encountered:
Currently on my computer, this piece of code runs correctly, but miri under stacked borrows and under tree borrows still errors.
Sorry, something went wrong.
I realized rust-lang/rfcs#3336 is now merged.
Minimal fixes to use maybe-dangling crate to address noamtashma#3
cc27f75
No branches or pull requests
Copied over from here
See the discussion starting here: It is possible to trigger UB in safe code using owning-ref.
Specifically, the assertion in the following snippet by @comex fails, even though it should succeed:
The text was updated successfully, but these errors were encountered: