diff options
author | 2022-01-26 22:32:04 +0000 | |
---|---|---|
committer | 2022-01-26 22:32:04 +0000 | |
commit | 06dc05cce2e9dd4a71105eaa3a0f00d2fdad8799 (patch) | |
tree | 2f743155831af2aeae0abc5887b3ba3ac30ef3ba | |
parent | 966b99da5135b788a0fdacf328f3935ea0c679b3 (diff) | |
download | cortex-m-06dc05cce2e9dd4a71105eaa3a0f00d2fdad8799.tar.gz cortex-m-06dc05cce2e9dd4a71105eaa3a0f00d2fdad8799.tar.zst cortex-m-06dc05cce2e9dd4a71105eaa3a0f00d2fdad8799.zip |
c-m-rt: fix macro hygiene, set to edition 2018
-rw-r--r-- | cortex-m-rt/Cargo.toml | 1 | ||||
-rw-r--r-- | cortex-m-rt/macros/src/lib.rs | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/cortex-m-rt/Cargo.toml b/cortex-m-rt/Cargo.toml index 33a08eb..5289057 100644 --- a/cortex-m-rt/Cargo.toml +++ b/cortex-m-rt/Cargo.toml @@ -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" } diff --git a/cortex-m-rt/macros/src/lib.rs b/cortex-m-rt/macros/src/lib.rs index 4383d06..fbcf4fa 100644 --- a/cortex-m-rt/macros/src/lib.rs +++ b/cortex-m-rt/macros/src/lib.rs @@ -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; }; } } @@ -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 - cortex_m_rt::exception::#ident; + ::cortex_m_rt::exception::#ident; }}) .unwrap(), ) |