Skip to content

Fix #414, use fully qualified path for exception enum in #[exception] macro #416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions cortex-m-rt/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## Fixes

- Fix `cortex_m_rt::exception` macro no longer being usable fully-qualified ([#414])

[#414]: https://github.com/rust-embedded/cortex-m/issues/414

## Notes

- From this release onwards, cortex-m-rt lives in the cortex-m repository;
issue numbers refer there.

## [v0.7.1]

## Fixes
Expand Down
1 change: 1 addition & 0 deletions cortex-m-rt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ repository = "https://github.com/rust-embedded/cortex-m"
version = "0.7.1"
autoexamples = true
links = "cortex-m-rt" # Prevent multiple versions of cortex-m-rt being linked
edition = "2018"

[dependencies]
cortex-m-rt-macros = { path = "macros", version = "=0.7.0" }
Expand Down
4 changes: 2 additions & 2 deletions cortex-m-rt/macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ pub fn exception(args: TokenStream, input: TokenStream) -> TokenStream {
Exception::Other => {
quote! {
const _: () = {
let _ = cortex_m_rt::Exception::#ident;
let _ = ::cortex_m_rt::Exception::#ident;
};
}
}
Expand Down Expand Up @@ -328,7 +328,7 @@ pub fn exception(args: TokenStream, input: TokenStream) -> TokenStream {
f.block.stmts = iter::once(
syn::parse2(quote! {{
// check that this exception actually exists
exception::#ident;
::cortex_m_rt::exception::#ident;
}})
.unwrap(),
)
Expand Down