Skip to content

Commit 8b0f86f

Browse files
Merge pull request #369 from rust-embedded/riscv-macros
`riscv-macros`: use fully qualified paths
2 parents 86531a7 + 3e71ae3 commit 8b0f86f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

riscv-macros/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1313

1414
### Changed
1515

16+
- Use fully qualified paths in generated code (i.e., `::riscv` instead of `riscv`)
1617
- Moved from `riscv/macros/` to `riscv-macros/`
1718
- Now, `riscv::pac_enum` macro only includes trap-related code if `rt` or `rt-v-trap` features are enabled.
1819

riscv-macros/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ core::arch::global_asm!("
339339

340340
// Push the trait implementation
341341
res.push(quote! {
342-
unsafe impl riscv::#trait_name for #name {
342+
unsafe impl ::riscv::#trait_name for #name {
343343
const #const_name: usize = #max_discriminant;
344344

345345
#[inline]
@@ -348,17 +348,17 @@ core::arch::global_asm!("
348348
}
349349

350350
#[inline]
351-
fn from_number(number: usize) -> riscv::result::Result<Self> {
351+
fn from_number(number: usize) -> ::riscv::result::Result<Self> {
352352
match number {
353353
#(#valid_matches,)*
354-
_ => Err(riscv::result::Error::InvalidVariant(number)),
354+
_ => Err(::riscv::result::Error::InvalidVariant(number)),
355355
}
356356
}
357357
}
358358
});
359359

360360
if let Some(marker_trait_name) = attr.marker_trait_name() {
361-
res.push(quote! { unsafe impl riscv::#marker_trait_name for #name {} });
361+
res.push(quote! { unsafe impl ::riscv::#marker_trait_name for #name {} });
362362
}
363363

364364
#[cfg(feature = "rt")]

0 commit comments

Comments
 (0)