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

Update Rust Nightly Oct 2024 #4193

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Update Rust Nightly Oct 2024 #4193

wants to merge 2 commits into from

Conversation

bradjc
Copy link
Contributor

@bradjc bradjc commented Oct 9, 2024

Pull Request Overview

Update to a new nightly.

The changes to use Self are to fix warnings like these:

warning: elided lifetime has a name
  --> capsules/extra/src/ambient_light.rs:57:10
   |
53 | impl<'a> AmbientLight<'a> {
   |      -- lifetime `'a` declared here
...
57 |     ) -> AmbientLight {
   |          ^^^^^^^^^^^^ this elided lifetime gets resolved as `'a`

Testing Strategy

travis

TODO or Help Wanted

This adds a bunch of warnings like:

warning: `raspberry_pi_pico` (bin "raspberry_pi_pico") generated 1 warning
warning: creating a shared reference to mutable static is discouraged
   --> chips/sam4l/src/dma.rs:223:17
    |
223 |                 NUM_ENABLED.fetch_add(1, atomic::Ordering::Relaxed);
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
    |
    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
    = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
    = note: `#[warn(static_mut_refs)]` on by default

so...we need to do something about that.

Documentation Updated

  • Updated the relevant files in /docs, or no updates are required.

Ran the update script.

Formatting

  • Ran make prepush.

Extra unsafe block, elided lifetimes, and unnecessary feature.
@github-actions github-actions bot added kernel sam4l Change pertains to the SAM4L MCU. tock-libraries This affects libraries supported by the Tock project stm32 Change pertains to the stm32 family of MCUSs component WG-Network In the purview of the Network working group. labels Oct 9, 2024
Comment on lines +144 to +153
let kernel_addresses = process_console::KernelAddresses {
stack_start: core::ptr::addr_of!(_sstack),
stack_end: core::ptr::addr_of!(_estack),
text_start: core::ptr::addr_of!(_stext),
text_end: core::ptr::addr_of!(_etext),
read_only_data_start: core::ptr::addr_of!(_srodata),
relocations_start: core::ptr::addr_of!(_srelocate),
relocations_end: core::ptr::addr_of!(_erelocate),
bss_start: core::ptr::addr_of!(_szero),
bss_end: core::ptr::addr_of!(_ezero),
Copy link
Contributor

Choose a reason for hiding this comment

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

Huh. I guess if this is no longer unsafe, then the comment above should have the "SAFETY:" removed. The reset of the commend can probably stay, but let's not signal it as an unsafe block if it's not.

@brghena brghena added the blocked Waiting on something, like a different PR or a dependency. label Oct 11, 2024
@brghena
Copy link
Contributor

brghena commented Oct 11, 2024

Shouldn't merge this until we deal with the warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Waiting on something, like a different PR or a dependency. component kernel sam4l Change pertains to the SAM4L MCU. stm32 Change pertains to the stm32 family of MCUSs tock-libraries This affects libraries supported by the Tock project WG-Network In the purview of the Network working group.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants