Skip to content

Commit c93735c

Browse files
authored
Merge pull request hermit-os#67 from fogti/rust2024-part2
fix(note): also fix the other macro for Rust Edition 2024
2 parents 645147a + 47edd40 commit c93735c

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

examples/macros.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//! This file tests if the macros defined by the hermit-entry crate,
2+
//! which affect linker .note entries, can actually be used.
3+
4+
#[cfg(feature = "kernel")]
5+
hermit_entry::define_abi_tag!();
6+
7+
#[cfg(feature = "kernel")]
8+
hermit_entry::define_entry_version!();
9+
10+
fn main() {}

src/note.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ struct Nhdr32 {
5353
macro_rules! define_abi_tag {
5454
() => {
5555
#[used]
56-
#[link_section = ".note.ABI-tag"]
56+
#[unsafe(link_section = ".note.ABI-tag")]
5757
static ABI_TAG: $crate::_AbiTag = $crate::_AbiTag::new($crate::HermitVersion {
5858
major: $crate::_parse_u128(::core::env!("CARGO_PKG_VERSION_MAJOR")) as u32,
5959
minor: $crate::_parse_u128(::core::env!("CARGO_PKG_VERSION_MINOR")) as u32,

0 commit comments

Comments
 (0)