about summary refs log tree commit diff
path: root/src/doc
diff options
context:
space:
mode:
authorEric Huss <eric@huss.org>2021-02-04 09:41:15 -0800
committerEric Huss <eric@huss.org>2021-02-04 09:41:15 -0800
commit900648cfd68c246ab7774bee1126b770955e3e6b (patch)
tree08470564fcc7c23b24a120ca2e1186132f8af3db /src/doc
parentdc7746f3343429924531daa6d692eba94b414e55 (diff)
downloadrust-900648cfd68c246ab7774bee1126b770955e3e6b.tar.gz
rust-900648cfd68c246ab7774bee1126b770955e3e6b.zip
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.
Diffstat (limited to 'src/doc')
-rw-r--r--src/doc/unstable-book/src/library-features/global-asm.md8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/doc/unstable-book/src/library-features/global-asm.md b/src/doc/unstable-book/src/library-features/global-asm.md
index c5ff68ec7d3..ce1155a977c 100644
--- a/src/doc/unstable-book/src/library-features/global-asm.md
+++ b/src/doc/unstable-book/src/library-features/global-asm.md
@@ -25,7 +25,7 @@ conventions of the assembler in your toolchain.
 A simple usage looks like this:
 
 ```rust,ignore (requires-external-file)
-# #![feature(global_asm)]
+#![feature(global_asm)]
 # // you also need relevant target_arch cfgs
 global_asm!(include_str!("something_neato.s"));
 ```
@@ -33,8 +33,9 @@ global_asm!(include_str!("something_neato.s"));
 And a more complicated usage looks like this:
 
 ```rust,no_run
-# #![feature(global_asm)]
-# #![cfg(any(target_arch = "x86", target_arch = "x86_64"))]
+#![feature(global_asm)]
+# #[cfg(any(target_arch="x86", target_arch="x86_64"))]
+# mod x86 {
 
 pub mod sally {
     global_asm!(r#"
@@ -64,6 +65,7 @@ pub mod harry {
     #[no_mangle]
     pub unsafe extern "C" fn quux() {}
 }
+# }
 ```
 
 You may use `global_asm!` multiple times, anywhere in your crate, in