]> git.lizzy.rs Git - rust.git/commitdiff
doc/book: fix tests for non-x86 architectures, such as aarch64
authorXimin Luo <infinity0@pwned.gg>
Sun, 17 Jul 2016 19:00:24 +0000 (21:00 +0200)
committerXimin Luo <infinity0@pwned.gg>
Sun, 17 Jul 2016 19:00:24 +0000 (21:00 +0200)
`rustdoc --test` gets confused when "main" exists for some architectures but not others.

src/doc/book/inline-assembly.md

index a8340d9d31e79d2fe319794ef49f90da988b7721..62e196a7ccdf3a4772db6e8ba86c5808241a6e2f 100644 (file)
@@ -60,6 +60,8 @@ asm!("xor %eax, %eax"
     : "eax"
    );
 # } }
+# #[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
+# fn main() {}
 ```
 
 Whitespace also doesn't matter:
@@ -70,6 +72,8 @@ Whitespace also doesn't matter:
 # fn main() { unsafe {
 asm!("xor %eax, %eax" ::: "eax");
 # } }
+# #[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
+# fn main() {}
 ```
 
 ## Operands
@@ -129,6 +133,8 @@ stay valid.
 // Put the value 0x200 in eax
 asm!("mov $$0x200, %eax" : /* no outputs */ : /* no inputs */ : "eax");
 # } }
+# #[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
+# fn main() {}
 ```
 
 Input and output registers need not be listed since that information
@@ -164,6 +170,8 @@ unsafe {
 }
 println!("eax is currently {}", result);
 # }
+# #[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
+# fn main() {}
 ```
 
 ## More Information