Skip to content

Commit 0939281

Browse files
bors[bot]adamgreig
andauthored
Merge #416
416: Fix #414, use fully qualified path for `exception` enum in `#[exception]` macro r=thalesfragoso a=adamgreig Partially reverts rust-embedded/cortex-m-rt#224 to continue to use a fully-qualified path to `exception`. Co-authored-by: Adam Greig <[email protected]>
2 parents 0811180 + 06dc05c commit 0939281

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

cortex-m-rt/CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
## Fixes
11+
12+
- Fix `cortex_m_rt::exception` macro no longer being usable fully-qualified ([#414])
13+
14+
[#414]: https://github.com/rust-embedded/cortex-m/issues/414
15+
16+
## Notes
17+
18+
- From this release onwards, cortex-m-rt lives in the cortex-m repository;
19+
issue numbers refer there.
20+
1021
## [v0.7.1]
1122

1223
## Fixes

cortex-m-rt/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ repository = "https://github.com/rust-embedded/cortex-m"
1515
version = "0.7.1"
1616
autoexamples = true
1717
links = "cortex-m-rt" # Prevent multiple versions of cortex-m-rt being linked
18+
edition = "2018"
1819

1920
[dependencies]
2021
cortex-m-rt-macros = { path = "macros", version = "=0.7.0" }

cortex-m-rt/macros/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ pub fn exception(args: TokenStream, input: TokenStream) -> TokenStream {
174174
Exception::Other => {
175175
quote! {
176176
const _: () = {
177-
let _ = cortex_m_rt::Exception::#ident;
177+
let _ = ::cortex_m_rt::Exception::#ident;
178178
};
179179
}
180180
}
@@ -328,7 +328,7 @@ pub fn exception(args: TokenStream, input: TokenStream) -> TokenStream {
328328
f.block.stmts = iter::once(
329329
syn::parse2(quote! {{
330330
// check that this exception actually exists
331-
exception::#ident;
331+
::cortex_m_rt::exception::#ident;
332332
}})
333333
.unwrap(),
334334
)

0 commit comments

Comments
 (0)