about summary refs log tree commit diff
path: root/src/doc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-02-05 05:54:44 +0000
committerbors <bors@rust-lang.org>2017-02-05 05:54:44 +0000
commit696f5c1fc695494053709ae3b18b4c6a65b619a6 (patch)
tree885324aad755a824bad88cd4a6930ef30099a909 /src/doc
parentd7777ae682d498ff43e3d6b65a7a8d0b2361fa0b (diff)
parentec356bb1a7654f38bd784028b6c0aa69518dafee (diff)
downloadrust-696f5c1fc695494053709ae3b18b4c6a65b619a6.tar.gz
rust-696f5c1fc695494053709ae3b18b4c6a65b619a6.zip
Auto merge of #38161 - durka:rustdoc-crate-attrs, r=alexcrichton
rustdoc: fix doctests with non-feature crate attrs

Fixes #38129.

The book says that any top-level crate attributes at the beginning of a doctest are moved outside the generated `fn main`, but it was only checking for `#![feature`, not `#![`.

These attributes previously caused warnings but were then ignored, so in theory this could change the behavior of doctests in the wild.
Diffstat (limited to 'src/doc')
-rw-r--r--src/doc/book/documentation.md4
-rw-r--r--src/doc/book/using-rust-without-the-standard-library.md4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/doc/book/documentation.md b/src/doc/book/documentation.md
index dafcffc39c8..d2402ddb2e9 100644
--- a/src/doc/book/documentation.md
+++ b/src/doc/book/documentation.md
@@ -601,7 +601,7 @@ is documented, especially when you are working on a library. Rust allows you to
 to generate warnings or errors, when an item is missing documentation.
 To generate warnings you use `warn`:
 
-```rust
+```rust,ignore
 #![warn(missing_docs)]
 ```
 
@@ -631,7 +631,7 @@ struct Hidden;
 You can control a few aspects of the HTML that `rustdoc` generates through the
 `#![doc]` version of the attribute:
 
-```rust
+```rust,ignore
 #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
        html_favicon_url = "https://www.rust-lang.org/favicon.ico",
        html_root_url = "https://doc.rust-lang.org/")]
diff --git a/src/doc/book/using-rust-without-the-standard-library.md b/src/doc/book/using-rust-without-the-standard-library.md
index 69958dd3e68..e66e1d05fff 100644
--- a/src/doc/book/using-rust-without-the-standard-library.md
+++ b/src/doc/book/using-rust-without-the-standard-library.md
@@ -13,7 +13,7 @@ don’t want to use the standard library via an attribute: `#![no_std]`.
 
 To use `#![no_std]`, add it to your crate root:
 
-```rust
+```rust,ignore
 #![no_std]
 
 fn plus_one(x: i32) -> i32 {
@@ -29,7 +29,7 @@ use its features without an explicit import. By the same token, when using
 prelude](../core/prelude/v1/index.html). This means that a lot of code will Just
 Work:
 
-```rust
+```rust,ignore
 #![no_std]
 
 fn may_fail(failure: bool) -> Result<(), &'static str> {