Skip to content

singleton! in 0.7.8 requires a critical-section impl — link failure in existing dependents #683

Description

@QuartzShard

0.7.8 changed singleton! from $crate::interrupt::free to $crate::_export::critical_section::with. The macro expands in dependent crates, so any published crate using singleton! now needs a critical-section 1.x implementation linked into the final binary. Graphs that never enable critical-section-single-core (or another provider) fail with:

rust-lld: error: undefined symbol: _critical_section_1_0_acquire

Since cortex-m = "0.7" dependents pick up patch releases automatically, this breaks already-published libraries at link time. Observed breaking atsamd-rs CI (Tier 2 boards on atsamd-hal 0.14, singleton! in the USB stack). Repro:
cd boards/trinket_m0 && cargo update && cargo build --examples --all-features --target thumbv6m-none-eabi on atsamd-rs/atsamd master; passes with cargo update -p cortex-m --precise 0.7.7.

Suggest reverting singleton! to interrupt::free in a 0.7.9 and keeping the critical-section-based form for 0.8+, where it's a documented requirement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions