Skip to content
Open
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
1 change: 1 addition & 0 deletions riscv-macros/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Changed

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

Expand Down
8 changes: 4 additions & 4 deletions riscv-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ core::arch::global_asm!("

// Push the trait implementation
res.push(quote! {
unsafe impl riscv::#trait_name for #name {
unsafe impl ::riscv::#trait_name for #name {
const #const_name: usize = #max_discriminant;

#[inline]
Expand All @@ -348,17 +348,17 @@ core::arch::global_asm!("
}

#[inline]
fn from_number(number: usize) -> riscv::result::Result<Self> {
fn from_number(number: usize) -> ::riscv::result::Result<Self> {
match number {
#(#valid_matches,)*
_ => Err(riscv::result::Error::InvalidVariant(number)),
_ => Err(::riscv::result::Error::InvalidVariant(number)),
}
}
}
});

if let Some(marker_trait_name) = attr.marker_trait_name() {
res.push(quote! { unsafe impl riscv::#marker_trait_name for #name {} });
res.push(quote! { unsafe impl ::riscv::#marker_trait_name for #name {} });
}

#[cfg(feature = "rt")]
Expand Down