Skip to content

[embassy-rp] Enabling chrono feature while defmt feature is enabled yields a compilation error #5119

@Bluefinger

Description

@Bluefinger

Embassy RP version: 0.9

Currently, chrono doesn't support defmt yet, but I think when I had a project on v0.7, this had no issue. However, I upgraded and immediately noticed the compilation errors popping up.

The culprit is this line here: https://github.com/embassy-rs/embassy/blob/main/embassy-rp/src/rtc/filter.rs#L8

The DayOfWeek type is cfg'd to be either the internal or chrono type, so when you toggle on chrono, DateTimeFilter breaks because chrono's DayOfWeek version doesn't implement defmt::Format.

This is a bug, but to fix it means either removing the Format impl or adding a cfg_attr configuration that disables the impl if chrono feature is active. That might be a breaking change in either case, or a weird behaviour that could be surprising to end-users.

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