Skip to content

cortex_m_rt::exception is no longer hygenic in 0.7 #414

@cbiffle

Description

@cbiffle

Previously, one could apply #[cortex_m_rt::exception] fully qualified, as shown here.

With the release of 0.7.1, this has stopped working. For the macro to work, one must now use cortex_m_rt::exception and then use #[exception]. The error message is not great, but suggests that it's a problem with the macro referring to itself by an unqualified name internally:

error[E0433]: failed to resolve: use of undeclared crate or module `exception`
   --> src/time.rs:102:1
    |
102 | #[cortex_m_rt::exception]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared crate or module `exception`
    |
    = note: this error originates in the attribute macro `cortex_m_rt::exception` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0433`.

(That message sent me on a bit of a goose chase figuring out why exception was not defined in cortex_m_rt, until I worked it out.)

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