diff options
| author | bors <bors@rust-lang.org> | 2014-06-18 10:46:41 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-06-18 10:46:41 +0000 |
| commit | fe931c00cc9875393042f40c7dcd001edcb47b78 (patch) | |
| tree | 705491d9abe089a14b508ff21eb5ddb66cff7aae | |
| parent | af622a491a18c27764199608f927a408af2f317c (diff) | |
| parent | e710653a3b2f0c9f7555c0a4fc01d083c7a4ce91 (diff) | |
auto merge of #15000 : alexcrichton/rust/fix-rustdoc-tests, r=huonw
Commits have the descriptions.
| -rw-r--r-- | src/liballoc/owned.rs | 8 | ||||
| -rw-r--r-- | src/libcore/failure.rs | 4 | ||||
| -rw-r--r-- | src/librustdoc/test.rs | 6 | ||||
| -rw-r--r-- | src/libstd/fmt.rs | 2 | ||||
| -rw-r--r-- | src/libsync/deque.rs | 2 |
5 files changed, 15 insertions, 7 deletions
diff --git a/src/liballoc/owned.rs b/src/liballoc/owned.rs index 9377c968272..fa7a8df5035 100644 --- a/src/liballoc/owned.rs +++ b/src/liballoc/owned.rs @@ -25,8 +25,12 @@ use core::result::{Ok, Err, Result}; /// /// The following two examples are equivalent: /// -/// let foo = box(HEAP) Bar::new(...); -/// let foo = box Bar::new(...); +/// use std::owned::HEAP; +/// +/// # struct Bar; +/// # impl Bar { fn new(_a: int) { } } +/// let foo = box(HEAP) Bar::new(2); +/// let foo = box Bar::new(2); #[lang="exchange_heap"] pub static HEAP: () = (); diff --git a/src/libcore/failure.rs b/src/libcore/failure.rs index 763ca843c11..c64bd6201fa 100644 --- a/src/libcore/failure.rs +++ b/src/libcore/failure.rs @@ -15,7 +15,9 @@ //! useful an upstream crate must define failure for libcore to use. The current //! interface for failure is: //! -//! fn begin_unwind(fmt: &fmt::Arguments, file: &str, line: uint) -> !; +//! ```ignore +//! fn begin_unwind(fmt: &fmt::Arguments, file: &str, line: uint) -> !; +//! ``` //! //! This definition allows for failing with any general message, but it does not //! allow for failing with a `~Any` value. The reason for this is that libcore diff --git a/src/librustdoc/test.rs b/src/librustdoc/test.rs index 907d9fc7561..02890cb6d78 100644 --- a/src/librustdoc/test.rs +++ b/src/librustdoc/test.rs @@ -86,8 +86,8 @@ pub fn run(input: &str, let mut v = RustdocVisitor::new(&*ctx, None); v.visit(&ctx.krate); let krate = v.clean(); - let (krate, _) = passes::unindent_comments(krate); let (krate, _) = passes::collapse_docs(krate); + let (krate, _) = passes::unindent_comments(krate); let mut collector = Collector::new(krate.name.to_string(), libs, @@ -209,7 +209,9 @@ pub fn maketest(s: &str, cratename: Option<&str>, lints: bool) -> String { "); } - if !s.contains("extern crate") { + // Don't inject `extern crate std` because it's already injected by the + // compiler. + if !s.contains("extern crate") && cratename != Some("std") { match cratename { Some(cratename) => { if s.contains(cratename) { diff --git a/src/libstd/fmt.rs b/src/libstd/fmt.rs index af76defc8f6..7236b527831 100644 --- a/src/libstd/fmt.rs +++ b/src/libstd/fmt.rs @@ -420,7 +420,7 @@ use str; use string; use slice::Vector; -pub use core::fmt::{Formatter, Result, FormatWriter, Show, rt}; +pub use core::fmt::{Formatter, Result, FormatWriter, rt}; pub use core::fmt::{Show, Bool, Char, Signed, Unsigned, Octal, Binary}; pub use core::fmt::{LowerHex, UpperHex, String, Pointer}; pub use core::fmt::{Float, LowerExp, UpperExp}; diff --git a/src/libsync/deque.rs b/src/libsync/deque.rs index 36ccf2d5178..f0184dc8164 100644 --- a/src/libsync/deque.rs +++ b/src/libsync/deque.rs @@ -24,7 +24,7 @@ //! //! # Example //! -//! use std::rt::deque::BufferPool; +//! use std::sync::deque::BufferPool; //! //! let mut pool = BufferPool::new(); //! let (mut worker, mut stealer) = pool.deque(); |
