Skip to content

Commit b7f68be

Browse files
committed
Fix test failure on macOS with link_section
rust-lang/rust#155065 recently added validation for link_section on macOS. I'm working around it here by just limiting this test to linux. Alternatives: - Show different syntaxes for different targets (but I would prefer to keep the example as plain as possible). - Mark it as `ignore` (want to avoid this if at all possible). Fixes rust-lang#2245
1 parent 581920f commit b7f68be

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/abi.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,11 @@ The `link_section` attribute uses the [MetaNameValueStr] syntax to specify the s
9898

9999
<!-- no_run: don't link. The format of the section name is platform-specific. -->
100100
```rust,no_run
101+
# #[cfg(target_os = "linux")] {
101102
#[unsafe(no_mangle)]
102103
#[unsafe(link_section = ".example_section")]
103104
pub static VAR1: u32 = 1;
105+
# }
104106
```
105107

106108
r[abi.link_section.unsafe]

0 commit comments

Comments
 (0)