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 or surpress several warnings on rust beta #865

Merged
merged 4 commits into from
Oct 19, 2024

Conversation

jannic
Copy link
Member

@jannic jannic commented Oct 17, 2024

No description provided.

@@ -42,3 +42,6 @@ static_cell = "2.1.0"

[target.'cfg( target_arch = "arm" )'.dependencies]
embassy-executor = {version = "0.5", features = ["arch-cortex-m", "executor-thread"]}

[lints.clippy]
too_long_first_doc_paragraph = "allow"
Copy link
Member

Choose a reason for hiding this comment

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

I'd much rather fix these I think...

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure! I didn't want to spend too much time on these right now, as I think they are rather unimportant. Note that I only disabled that lint for the example crates. And I doubt many people will look at the rustdocs for the examples anyway.

In fact, I wonder if most of the doc comments the lint complains about should be changed to normal (non-doc) comments. Eg.:

/// The linker will place this boot block at the start of our program image. We
/// need this to help the ROM bootloader get our code up and running.
/// Note: This boot block is not necessary when using a rp-hal based BSP
/// as the BSPs already perform this step.
#[link_section = ".boot2"]
#[used]
pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_GENERIC_03H;

That comment explains why BOOT2 is there, which is of course useful in the source code. But does it belong into the documentation?

Copy link
Member

Choose a reason for hiding this comment

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

Fair

@thejpster
Copy link
Member

Excellent work here. I thought I was going to be annoyed but I think the compiler is making us make our source code better.

@jannic
Copy link
Member Author

jannic commented Oct 18, 2024

The static mut LED_AND_ALARM: Mutex<...> was embarrassing. Unnecessary mut making all uses unsafe. And nobody noticed without the compiler warning.

@thejpster thejpster merged commit 379530d into rp-rs:main Oct 19, 2024
49 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.

2 participants