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

Remove pointer alignment checks redundant since Rust 1.78 #4170

Closed
wants to merge 1 commit into from

Conversation

timvisee
Copy link
Member

@timvisee timvisee commented May 3, 2024

We have some pointer alignment checks which are now redundant since the release of Rust 1.78.

Release notes: https://blog.rust-lang.org/2024/05/02/Rust-1.78.0.html#asserting-unsafe-preconditions

Same assertion shown in the standard library: https://doc.rust-lang.org/src/core/slice/raw.rs.html#95

All Submissions:

  • Contributions should target the dev branch. Did you create your branch from dev?
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Have you formatted your code locally using cargo +nightly fmt --all command prior to submission?
  3. Have you checked your code using cargo clippy --all --all-features command?

@timvisee timvisee requested review from agourlay and ffuugoo May 3, 2024 12:00
@ffuugoo
Copy link
Contributor

ffuugoo commented May 3, 2024

Our assertions are more informative, so I'd still leave them. But PR itself is LGTM.

@timvisee
Copy link
Member Author

timvisee commented May 3, 2024

Our assertions are more informative, so I'd still leave them. But PR itself is LGTM.

That's true, though I don't expect to hit them again. If we get a panic from this later we can easily point to it and add it back if desired.

I'm just not super happy about doing this check twice, also because it makes those functions twice as big.

Wdyt? Keep or remove?

@ffuugoo
Copy link
Contributor

ffuugoo commented May 3, 2024

Our assertions are more informative, so I'd still leave them. But PR itself is LGTM.

That's true, though I don't expect to hit them again. If we get a panic from this later we can easily point to it and add it back if desired.

I'm just not super happy about doing this check twice, also because it makes those functions twice as big.

Wdyt? Keep or remove?

Personally, I'd leave them. But I'm fine either way.

@timvisee
Copy link
Member Author

Two people I asked both preferred to leave the extra checks, so I'm closing this issue

@timvisee timvisee closed this May 21, 2024
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.

None yet

3 participants