Skip to content

Commit fe931c0

Browse files
committed
auto merge of #15000 : alexcrichton/rust/fix-rustdoc-tests, r=huonw
Commits have the descriptions.
2 parents af622a4 + e710653 commit fe931c0

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

src/liballoc/owned.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,12 @@ use core::result::{Ok, Err, Result};
2525
///
2626
/// The following two examples are equivalent:
2727
///
28-
/// let foo = box(HEAP) Bar::new(...);
29-
/// let foo = box Bar::new(...);
28+
/// use std::owned::HEAP;
29+
///
30+
/// # struct Bar;
31+
/// # impl Bar { fn new(_a: int) { } }
32+
/// let foo = box(HEAP) Bar::new(2);
33+
/// let foo = box Bar::new(2);
3034
#[lang="exchange_heap"]
3135
pub static HEAP: () = ();
3236

src/libcore/failure.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
//! useful an upstream crate must define failure for libcore to use. The current
1616
//! interface for failure is:
1717
//!
18-
//! fn begin_unwind(fmt: &fmt::Arguments, file: &str, line: uint) -> !;
18+
//! ```ignore
19+
//! fn begin_unwind(fmt: &fmt::Arguments, file: &str, line: uint) -> !;
20+
//! ```
1921
//!
2022
//! This definition allows for failing with any general message, but it does not
2123
//! allow for failing with a `~Any` value. The reason for this is that libcore

src/librustdoc/test.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ pub fn run(input: &str,
8686
let mut v = RustdocVisitor::new(&*ctx, None);
8787
v.visit(&ctx.krate);
8888
let krate = v.clean();
89-
let (krate, _) = passes::unindent_comments(krate);
9089
let (krate, _) = passes::collapse_docs(krate);
90+
let (krate, _) = passes::unindent_comments(krate);
9191

9292
let mut collector = Collector::new(krate.name.to_string(),
9393
libs,
@@ -209,7 +209,9 @@ pub fn maketest(s: &str, cratename: Option<&str>, lints: bool) -> String {
209209
");
210210
}
211211

212-
if !s.contains("extern crate") {
212+
// Don't inject `extern crate std` because it's already injected by the
213+
// compiler.
214+
if !s.contains("extern crate") && cratename != Some("std") {
213215
match cratename {
214216
Some(cratename) => {
215217
if s.contains(cratename) {

src/libstd/fmt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ use str;
420420
use string;
421421
use slice::Vector;
422422

423-
pub use core::fmt::{Formatter, Result, FormatWriter, Show, rt};
423+
pub use core::fmt::{Formatter, Result, FormatWriter, rt};
424424
pub use core::fmt::{Show, Bool, Char, Signed, Unsigned, Octal, Binary};
425425
pub use core::fmt::{LowerHex, UpperHex, String, Pointer};
426426
pub use core::fmt::{Float, LowerExp, UpperExp};

src/libsync/deque.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
//!
2525
//! # Example
2626
//!
27-
//! use std::rt::deque::BufferPool;
27+
//! use std::sync::deque::BufferPool;
2828
//!
2929
//! let mut pool = BufferPool::new();
3030
//! let (mut worker, mut stealer) = pool.deque();

0 commit comments

Comments
 (0)