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

Fix compilation error in spi.rs for rust Version 1.73+ #170

Merged
merged 6 commits into from
Dec 12, 2023

Conversation

JanekGraff
Copy link
Contributor

@JanekGraff JanekGraff commented Nov 24, 2023

With rust version 1.73.0 the invalid_reference_casting lint was set to deny by default. (See PR#112431. This causes the build process of this crate to fail to build spi.rs (only when building the crate with its examples, when adding it as a dependency works fine from what i can see).

This change fixes the compilation by adding the [allow(invalid_reference_casting)] attribute to the relevant parts.

This also fixes a unused doc comment compilation warning in rcc.rs

NOTE

I have not tested this on hardware, just added the attribute to fix the compilation.

@adamgreig
Copy link
Member

See also stm32-rs/stm32f7xx-hal#207 and stm32-rs/stm32f3xx-hal#346 which had the same problem and a couple other options for fixing it.

@therealprof
Copy link
Member

@JanekGraff Thanks for trying to fix this. Would you mind changing to core::ptr::addr_of! instead of squelching the warning?

Unrelated nit: Could you please remove the added newlines between the links in the CHANGELOG.md?

@JanekGraff
Copy link
Contributor Author

JanekGraff commented Dec 9, 2023

@JanekGraff Thanks for trying to fix this. Would you mind changing to core::ptr::addr_of! instead of squelching the warning?

Unrelated nit: Could you please remove the added newlines between the links in the CHANGELOG.md?

Sure thing, done.

Copy link
Member

@therealprof therealprof left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@therealprof therealprof merged commit 73b81e6 into stm32-rs:master Dec 12, 2023
6 checks passed
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.

3 participants