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

Make the actual read happen in UB tests #102

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ mod tests {
uninit.write(String::from("nonononono"));

// Read invalidated reference to trigger UB
let _ = *x;
let _read = &*x;
}

#[test]
Expand All @@ -909,7 +909,7 @@ mod tests {
uninit.as_mut_slice()[0].write(String::from("nonononono"));

// Read invalidated reference to trigger UB
let _ = *x;
let _read = &*x;
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GnomedDev x here is unsized, which is why the & was necessary

}

#[test]
Expand Down
Loading