Skip to content

conflicting implementation in crate embedded_hal #232

@little-arhat

Description

@little-arhat

Hello,

I updated nightly and got this error trying to compile some code:

rustc 1.46.0-nightly (2753fab7c 2020-07-05)

417:"checksum embedded-hal 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "fa998ce59ec9765d15216393af37a58961ddcefb14c753b4816ba2191d865fcb"

error[E0119]: conflicting implementations of trait `embedded_hal::digital::v2::toggleable::Default` for type `gpio::PF10<_, gpio::Output<_, _>>`:
   --> /Users/r/.cargo/registry/src/github.com-1ecc6299db9ec823/alt-stm32f30x-hal-0.22.1/src/gpio.rs:515:13
    |
515 | /             impl<PT: PullType, OT:OutputType, OS:OutputSpeed> v2::toggleable::Default
516 | |                 for $PXi<PT, Output<OT, OS>> {}
    | |_______________________________________________^
...
648 | / gpio!(GPIOF, Gpiof, gpiof, iopfen, iopfrst, F, PFx, [
649 | |     PF0: (pf0, 0, afrl),
650 | |     PF1: (pf1, 1, afrl),
651 | |     PF2: (pf2, 2, afrl),
...   |
655 | |     PF10: (pf10, 10, afrh),
656 | | ]);
    | |___- in this macro invocation
    |
    = note: conflicting implementation in crate `embedded_hal`:
            - impl<T> embedded_hal::digital::v2::toggleable::Default for T
              where T: embedded_hal::digital::v1::toggleable::Default;
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

Is this regression in compiler/embedded-hal or is it expected change and implementors (alt-stm32f30x-hal in this case) should fix their libraries?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions