Skip to content

thumbv6m-none-eabi inline asm clobber_abi("C") fails with register 'LR' allocated for constraint '{r14}' does not match required type #163173

Description

@kevinmehall

The following minimized example fails to compile on the latest nightly, but works on stable and the previous nightly:

#![no_std]

#[no_mangle]
pub fn test() {
    unsafe { core::arch::asm!("nop", clobber_abi("C")) }
}

#[panic_handler]
fn panic(_: &core::panic::PanicInfo) -> ! {
    loop {}
}

Current nightly:

❯ rustc +nightly-2026-09-22 --version
rustc 1.100.0-nightly (1303417c4 2026-09-21)
                                                                                                                                                                                      
❯ rustc +nightly-2026-09-22 --target thumbv6m-none-eabi --crate-type staticlib -o repro.a repro.rs
error: register 'LR' allocated for constraint '{r14}' does not match required type
 --> repro.rs:6:32
  |
6 |     unsafe { core::arch::asm!("nop", clobber_abi("C")) }
  |                                ^^^

error: aborting due to 1 previous error

Prior nightly:

❯ rustc +nightly-2026-09-21 --version                                                             
rustc 1.100.0-nightly (bba531001 2026-09-20)

❯ rustc +nightly-2026-09-21 --target thumbv6m-none-eabi --crate-type staticlib -o repro.a repro.rs

Stable:

❯ rustc +stable --version                                                             
rustc 1.98.1 (48a229cea 2026-09-01)
                                                                                                                                                                                          
❯ rustc +stable --target thumbv6m-none-eabi --crate-type staticlib -o repro.a repro.rs

This can also be reproduced with the examples of embassy-rp and zeptos, and likely anything that calls into the RP2040 boot ROM for flash operations.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions