Skip to content

Conversation

@robin-nitrokey
Copy link
Contributor

Currently, compiling typenum with the const-generics feature on 16-bit targets causes an error due to conflicting implementations of the ToUInt trait for Const<0> as the generated code assumes that the pointer width is at least 32. This patch adds support for 16-bit targets to the generated code.

The problem can be reproduced with:

RUSTFLAGS="-C target-cpu=atmega328p" cargo +nightly build -Z build-std=core --target=avr-none

Currently, compiling typenum with the const-generics feature on 16-bit
targets causes an error due to conflicting implementations of the ToUInt
trait for Const<0> as the generated code assumes that the pointer width
is at least 32.  This patch adds support for 16-bit targets to the
generated code.

The problem can be reproduced with:
    RUSTFLAGS="-C target-cpu=atmega328p" cargo +nightly build -Z build-std=core --target=avr-none
@paholg paholg merged commit e71d144 into paholg:main Jun 1, 2025
@robin-nitrokey robin-nitrokey deleted the 16bit branch June 2, 2025 08:11
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