Skip to content

Commit 900648c

Browse files
committed
Adjust global_asm doc test to work on all platforms.
The cfg isn't actually necessary, since `--emit=metadata` does not actually do enough validation for it to fail on any platform. However, I feel a little more comfortable leaving it in. Unhide the feature flag, since I think that is important to display.
1 parent dc7746f commit 900648c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/doc/unstable-book/src/library-features/global-asm.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,17 @@ conventions of the assembler in your toolchain.
2525
A simple usage looks like this:
2626

2727
```rust,ignore (requires-external-file)
28-
# #![feature(global_asm)]
28+
#![feature(global_asm)]
2929
# // you also need relevant target_arch cfgs
3030
global_asm!(include_str!("something_neato.s"));
3131
```
3232

3333
And a more complicated usage looks like this:
3434

3535
```rust,no_run
36-
# #![feature(global_asm)]
37-
# #![cfg(any(target_arch = "x86", target_arch = "x86_64"))]
36+
#![feature(global_asm)]
37+
# #[cfg(any(target_arch="x86", target_arch="x86_64"))]
38+
# mod x86 {
3839
3940
pub mod sally {
4041
global_asm!(r#"
@@ -64,6 +65,7 @@ pub mod harry {
6465
#[no_mangle]
6566
pub unsafe extern "C" fn quux() {}
6667
}
68+
# }
6769
```
6870

6971
You may use `global_asm!` multiple times, anywhere in your crate, in

0 commit comments

Comments
 (0)