Auto merge of #24177 - alexcrichton:rustdoc, r=aturon

This commit series starts out with more official test harness support for rustdoc tests, and then each commit afterwards adds a test (where appropriate). Each commit should also test and finish independently of all others (they're all pretty separable).

I've uploaded a [copy of the documentation](http://people.mozilla.org/~acrichton/doc/std/) generated after all these commits were applied, and a double check on issues being closed would be greatly appreciated! I'll also browse the docs a bit and make sure nothing regressed too horribly.
This commit is contained in:
bors
2015-04-10 16:18:44 +00:00
126 changed files with 2118 additions and 902 deletions

View File

@@ -139,6 +139,7 @@ pub fn from_digit(num: u32, radix: u32) -> Option<char> {
// NB: the stabilization and documentation for this trait is in
// unicode/char.rs, not here
#[allow(missing_docs)] // docs in libunicode/u_char.rs
#[doc(hidden)]
pub trait CharExt {
fn is_digit(self, radix: u32) -> bool;
fn to_digit(self, radix: u32) -> Option<u32>;

View File

@@ -229,7 +229,6 @@ macro_rules! writeln {
/// Iterators:
///
/// ```
/// # #![feature(core)]
/// fn divide_by_three(x: u32) -> u32 { // one of the poorest implementations of x/3
/// for i in 0.. {
/// if 3*i < i { panic!("u32 overflow"); }

View File

@@ -2490,6 +2490,7 @@ pub enum FpCategory {
// `unused_self`. Removing it requires #8888 to be fixed.
#[unstable(feature = "core",
reason = "distribution of methods between core/std is unclear")]
#[doc(hidden)]
pub trait Float
: Copy + Clone
+ NumCast

View File

@@ -89,6 +89,7 @@
//! of unsafe pointers in Rust.
#![stable(feature = "rust1", since = "1.0.0")]
#![doc(primitive = "pointer")]
use mem;
use clone::Clone;

View File

@@ -63,6 +63,7 @@ use raw::Slice as RawSlice;
/// Extension methods for slices.
#[allow(missing_docs)] // docs in libcollections
#[doc(hidden)]
pub trait SliceExt {
type Item;

View File

@@ -1496,6 +1496,7 @@ impl<'a, S: ?Sized> Str for &'a S where S: Str {
/// Methods for string slices
#[allow(missing_docs)]
#[doc(hidden)]
pub trait StrExt {
// NB there are no docs here are they're all located on the StrExt trait in
// libcollections, not here.