diff --git a/src/libextra/arc.rs b/src/libextra/arc.rs index e73b49044d4..1de2003aa99 100644 --- a/src/libextra/arc.rs +++ b/src/libextra/arc.rs @@ -37,6 +37,8 @@ * ~~~ */ +#[allow(missing_doc)]; + use core::prelude::*; use sync; diff --git a/src/libextra/arena.rs b/src/libextra/arena.rs index 690993e7bf9..7cd63cd03b1 100644 --- a/src/libextra/arena.rs +++ b/src/libextra/arena.rs @@ -32,6 +32,8 @@ // overhead when initializing plain-old-data and means we don't need // to waste time running the destructors of POD. +#[allow(missing_doc)]; + use core::prelude::*; use list::{MutList, MutCons, MutNil}; diff --git a/src/libextra/base64.rs b/src/libextra/base64.rs index 373bebeec71..b8f3a267d2d 100644 --- a/src/libextra/base64.rs +++ b/src/libextra/base64.rs @@ -15,7 +15,10 @@ use core::prelude::*; use core::str; use core::vec; +/// A trait for converting a value to base64 encoding. pub trait ToBase64 { + /// Converts the value of `self` to a base64 value, returning the owned + /// string fn to_base64(&self) -> ~str; } @@ -112,6 +115,7 @@ impl<'self> ToBase64 for &'self str { } } +#[allow(missing_doc)] pub trait FromBase64 { fn from_base64(&self) -> ~[u8]; } diff --git a/src/libextra/bitv.rs b/src/libextra/bitv.rs index afd82d42589..672a61b1ad8 100644 --- a/src/libextra/bitv.rs +++ b/src/libextra/bitv.rs @@ -211,9 +211,11 @@ enum BitvVariant { Big(~BigBitv), Small(~SmallBitv) } enum Op {Union, Intersect, Assign, Difference} -// The bitvector type +/// The bitvector type pub struct Bitv { + /// Internal representation of the bit vector (small or large) rep: BitvVariant, + /// The number of valid bits in the internal representation nbits: uint } diff --git a/src/libextra/dbg.rs b/src/libextra/dbg.rs index 4b2d2a60a68..cbd7cb5e3c0 100644 --- a/src/libextra/dbg.rs +++ b/src/libextra/dbg.rs @@ -10,6 +10,8 @@ //! Unsafe debugging functions for inspecting values. +#[allow(missing_doc)]; + use core::cast::transmute; use core::sys; diff --git a/src/libextra/deque.rs b/src/libextra/deque.rs index ccb52fa038c..08dc2436c93 100644 --- a/src/libextra/deque.rs +++ b/src/libextra/deque.rs @@ -18,6 +18,7 @@ use core::vec; static initial_capacity: uint = 32u; // 2^5 +#[allow(missing_doc)] pub struct Deque { priv nelts: uint, priv lo: uint, diff --git a/src/libextra/dlist.rs b/src/libextra/dlist.rs index fc6cdb102a0..5581c6d5ac9 100644 --- a/src/libextra/dlist.rs +++ b/src/libextra/dlist.rs @@ -26,6 +26,7 @@ use core::vec; pub type DListLink = Option<@mut DListNode>; +#[allow(missing_doc)] pub struct DListNode { data: T, linked: bool, // for assertions @@ -33,6 +34,7 @@ pub struct DListNode { next: DListLink, } +#[allow(missing_doc)] pub struct DList { size: uint, hd: DListLink, @@ -106,6 +108,7 @@ pub fn from_elem(data: T) -> @mut DList { list } +/// Creates a new dlist from a vector of elements, maintaining the same order pub fn from_vec(vec: &[T]) -> @mut DList { do vec::foldl(DList(), vec) |list,data| { list.push(*data); // Iterating left-to-right -- add newly to the tail. diff --git a/src/libextra/ebml.rs b/src/libextra/ebml.rs index 762328a2e0f..70beaa58d07 100644 --- a/src/libextra/ebml.rs +++ b/src/libextra/ebml.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(missing_doc)]; + use core::prelude::*; // Simple Extensible Binary Markup Language (ebml) reader and writer on a diff --git a/src/libextra/fileinput.rs b/src/libextra/fileinput.rs index e6f3fba6b15..5cc0875cb51 100644 --- a/src/libextra/fileinput.rs +++ b/src/libextra/fileinput.rs @@ -94,6 +94,8 @@ total line count). } */ +#[allow(missing_doc)]; + use core::prelude::*; use core::io::ReaderUtil; diff --git a/src/libextra/flate.rs b/src/libextra/flate.rs index e24c80b4463..076126e0432 100644 --- a/src/libextra/flate.rs +++ b/src/libextra/flate.rs @@ -14,6 +14,8 @@ Simple compression */ +#[allow(missing_doc)]; + use core::prelude::*; use core::libc::{c_void, size_t, c_int}; diff --git a/src/libextra/flatpipes.rs b/src/libextra/flatpipes.rs index 955da13c7b3..2f5a43d8e84 100644 --- a/src/libextra/flatpipes.rs +++ b/src/libextra/flatpipes.rs @@ -47,6 +47,8 @@ block the scheduler thread, so will their pipes. */ +#[allow(missing_doc)]; + use core::prelude::*; // The basic send/recv interface FlatChan and PortChan will implement diff --git a/src/libextra/future.rs b/src/libextra/future.rs index 38df0c6a208..4d3a757e80e 100644 --- a/src/libextra/future.rs +++ b/src/libextra/future.rs @@ -23,6 +23,8 @@ * ~~~ */ +#[allow(missing_doc)]; + use core::prelude::*; use core::cast; diff --git a/src/libextra/getopts.rs b/src/libextra/getopts.rs index 3c223fe05d4..294b8fec042 100644 --- a/src/libextra/getopts.rs +++ b/src/libextra/getopts.rs @@ -78,6 +78,8 @@ * ``` */ +#[allow(missing_doc)]; + use core::prelude::*; use core::cmp::Eq; diff --git a/src/libextra/io_util.rs b/src/libextra/io_util.rs index 7d43663cc80..91424ae3ba2 100644 --- a/src/libextra/io_util.rs +++ b/src/libextra/io_util.rs @@ -11,12 +11,16 @@ use core::io::{Reader, BytesReader}; use core::io; +/// An implementation of the io::Reader interface which reads a buffer of bytes pub struct BufReader { + /// The buffer of bytes to read buf: ~[u8], + /// The current position in the buffer of bytes pos: @mut uint } -pub impl BufReader { +impl BufReader { + /// Creates a new buffer reader for the specified buffer pub fn new(v: ~[u8]) -> BufReader { BufReader { buf: v, @@ -24,7 +28,7 @@ pub impl BufReader { } } - priv fn as_bytes_reader(&self, f: &fn(&BytesReader) -> A) -> A { + fn as_bytes_reader(&self, f: &fn(&BytesReader) -> A) -> A { // Recreating the BytesReader state every call since // I can't get the borrowing to work correctly let bytes_reader = BytesReader { diff --git a/src/libextra/json.rs b/src/libextra/json.rs index c3ef346dba3..48a3288f809 100644 --- a/src/libextra/json.rs +++ b/src/libextra/json.rs @@ -43,9 +43,14 @@ pub type List = ~[Json]; pub type Object = HashMap<~str, Json>; #[deriving(Eq)] +/// If an error occurs while parsing some JSON, this is the structure which is +/// returned pub struct Error { + /// The line number at which the error occurred line: uint, + /// The column number at which the error occurred col: uint, + /// A message describing the type of the error msg: @~str, } @@ -75,10 +80,13 @@ fn spaces(n: uint) -> ~str { return ss; } +/// A structure for implementing serialization to JSON. pub struct Encoder { priv wr: @io::Writer, } +/// Creates a new JSON encoder whose output will be written to the writer +/// specified. pub fn Encoder(wr: @io::Writer) -> Encoder { Encoder { wr: wr @@ -228,11 +236,14 @@ impl serialize::Encoder for Encoder { } } +/// Another encoder for JSON, but prints out human-readable JSON instead of +/// compact data pub struct PrettyEncoder { priv wr: @io::Writer, priv indent: uint, } +/// Creates a new encoder whose output will be written to the specified writer pub fn PrettyEncoder(wr: @io::Writer) -> PrettyEncoder { PrettyEncoder { wr: wr, @@ -468,6 +479,7 @@ pub fn to_pretty_str(json: &Json) -> ~str { io::with_str_writer(|wr| to_pretty_writer(wr, json)) } +#[allow(missing_doc)] pub struct Parser { priv rdr: @io::Reader, priv ch: char, @@ -846,10 +858,12 @@ pub fn from_str(s: &str) -> Result { } } +/// A structure to decode JSON to values in rust. pub struct Decoder { priv stack: ~[Json], } +/// Creates a new decoder instance for decoding the specified JSON value. pub fn Decoder(json: Json) -> Decoder { Decoder { stack: ~[json] @@ -1200,7 +1214,11 @@ impl Ord for Json { fn gt(&self, other: &Json) -> bool { (*other).lt(&(*self)) } } -trait ToJson { fn to_json(&self) -> Json; } +/// A trait for converting values to JSON +trait ToJson { + /// Converts the value of `self` to an instance of JSON + fn to_json(&self) -> Json; +} impl ToJson for Json { fn to_json(&self) -> Json { copy *self } diff --git a/src/libextra/md4.rs b/src/libextra/md4.rs index 9873d7fcd8e..0f05e50ea70 100644 --- a/src/libextra/md4.rs +++ b/src/libextra/md4.rs @@ -21,6 +21,8 @@ struct Quad { d: u32 } +/// Calculates the md4 hash of the given slice of bytes, returning the 128-bit +/// result as a quad of u32's pub fn md4(msg: &[u8]) -> Quad { // subtle: if orig_len is merely uint, then the code below // which performs shifts by 32 bits or more has undefined @@ -105,6 +107,8 @@ pub fn md4(msg: &[u8]) -> Quad { return Quad {a: a, b: b, c: c, d: d}; } +/// Calculates the md4 hash of a slice of bytes, returning the hex-encoded +/// version of the hash pub fn md4_str(msg: &[u8]) -> ~str { let Quad {a, b, c, d} = md4(msg); fn app(a: u32, b: u32, c: u32, d: u32, f: &fn(u32)) { @@ -123,6 +127,8 @@ pub fn md4_str(msg: &[u8]) -> ~str { result } +/// Calculates the md4 hash of a string, returning the hex-encoded version of +/// the hash pub fn md4_text(msg: &str) -> ~str { md4_str(str::to_bytes(msg)) } #[test] diff --git a/src/libextra/net_ip.rs b/src/libextra/net_ip.rs index a9c8540a83c..e92523726df 100644 --- a/src/libextra/net_ip.rs +++ b/src/libextra/net_ip.rs @@ -10,6 +10,8 @@ //! Types/fns concerning Internet Protocol (IP), versions 4 & 6 +#[allow(missing_doc)]; + use core::prelude::*; use core::libc; diff --git a/src/libextra/net_tcp.rs b/src/libextra/net_tcp.rs index 8dff9b330a5..c3a0463c2fc 100644 --- a/src/libextra/net_tcp.rs +++ b/src/libextra/net_tcp.rs @@ -11,6 +11,8 @@ //! High-level interface to libuv's TCP functionality // FIXME #4425: Need FFI fixes +#[allow(missing_doc)]; + use core::prelude::*; use future; diff --git a/src/libextra/net_url.rs b/src/libextra/net_url.rs index 3b7c808c596..fa7295923a0 100644 --- a/src/libextra/net_url.rs +++ b/src/libextra/net_url.rs @@ -10,6 +10,8 @@ //! Types/fns concerning URLs (see RFC 3986) +#[allow(missing_doc)]; + use core::prelude::*; use core::cmp::Eq; diff --git a/src/libextra/num/bigint.rs b/src/libextra/num/bigint.rs index 263618ed56f..adbaf89e16c 100644 --- a/src/libextra/num/bigint.rs +++ b/src/libextra/num/bigint.rs @@ -597,6 +597,8 @@ impl BigUint { } + /// Converts this big integer into a uint, returning the uint::max_value if + /// it's too large to fit in a uint. pub fn to_uint(&self) -> uint { match self.data.len() { 0 => 0, diff --git a/src/libextra/num/complex.rs b/src/libextra/num/complex.rs index 09bd66232eb..10bfe9409da 100644 --- a/src/libextra/num/complex.rs +++ b/src/libextra/num/complex.rs @@ -25,7 +25,9 @@ use core::num::{Zero,One,ToStrRadix}; /// A complex number in Cartesian form. #[deriving(Eq,Clone)] pub struct Cmplx { + /// Real portion of the complex number re: T, + /// Imaginary portion of the complex number im: T } diff --git a/src/libextra/num/rational.rs b/src/libextra/num/rational.rs index b33d113161c..1a8ab75b3dd 100644 --- a/src/libextra/num/rational.rs +++ b/src/libextra/num/rational.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - //! Rational numbers use core::prelude::*; @@ -22,6 +21,7 @@ use super::bigint::BigInt; /// Represents the ratio between 2 numbers. #[deriving(Clone)] +#[allow(missing_doc)] pub struct Ratio { numer: T, denom: T @@ -49,7 +49,7 @@ impl Ratio { numer: numer, denom: denom } } - // Create a new Ratio. Fails if `denom == 0`. + /// Create a new Ratio. Fails if `denom == 0`. #[inline(always)] pub fn new(numer: T, denom: T) -> Ratio { if denom == Zero::zero() { diff --git a/src/libextra/priority_queue.rs b/src/libextra/priority_queue.rs index 9345c246750..49fbf06406f 100644 --- a/src/libextra/priority_queue.rs +++ b/src/libextra/priority_queue.rs @@ -17,6 +17,7 @@ use core::unstable::intrinsics::{move_val_init, init}; use core::util::{replace, swap}; use core::vec; +#[allow(missing_doc)] pub struct PriorityQueue { priv data: ~[T], } diff --git a/src/libextra/rc.rs b/src/libextra/rc.rs index 73f98a3b19c..381b8ac05ba 100644 --- a/src/libextra/rc.rs +++ b/src/libextra/rc.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(missing_doc)]; + /** Task-local reference counted smart pointers Task-local reference counted smart pointers are an alternative to managed boxes with deterministic diff --git a/src/libextra/rope.rs b/src/libextra/rope.rs index 566bbfd6df6..413a498a20e 100644 --- a/src/libextra/rope.rs +++ b/src/libextra/rope.rs @@ -33,6 +33,8 @@ * * access to a character by index is logarithmic (linear in strings); */ +#[allow(missing_doc)]; + use core::prelude::*; use core::str; diff --git a/src/libextra/semver.rs b/src/libextra/semver.rs index 0b078867726..494f0c8ea81 100644 --- a/src/libextra/semver.rs +++ b/src/libextra/semver.rs @@ -10,6 +10,8 @@ //! Semver parsing and logic +#[allow(missing_doc)]; + use core::prelude::*; use core::char; diff --git a/src/libextra/serialize.rs b/src/libextra/serialize.rs index d20aed69240..4d2b8d0b50a 100644 --- a/src/libextra/serialize.rs +++ b/src/libextra/serialize.rs @@ -14,6 +14,7 @@ Core encoding and decoding interfaces. */ +#[allow(missing_doc)]; #[forbid(non_camel_case_types)]; use core::prelude::*; diff --git a/src/libextra/smallintmap.rs b/src/libextra/smallintmap.rs index a85f113b68f..98392fc41e1 100644 --- a/src/libextra/smallintmap.rs +++ b/src/libextra/smallintmap.rs @@ -23,6 +23,7 @@ use core::uint; use core::util::replace; use core::vec; +#[allow(missing_doc)] pub struct SmallIntMap { priv v: ~[Option], } @@ -186,6 +187,9 @@ pub impl SmallIntMap { } } +/// A set implemented on top of the SmallIntMap type. This set is always a set +/// of integers, and the space requirements are on the order of the highest +/// valued integer in the set. pub struct SmallIntSet { priv map: SmallIntMap<()> } diff --git a/src/libextra/sort.rs b/src/libextra/sort.rs index b3118dd37e1..420c63efab5 100644 --- a/src/libextra/sort.rs +++ b/src/libextra/sort.rs @@ -167,6 +167,7 @@ pub fn quick_sort3(arr: &mut [T]) { qsort3(arr, 0, (len - 1) as int); } +#[allow(missing_doc)] pub trait Sort { fn qsort(self); } @@ -179,6 +180,7 @@ static MIN_MERGE: uint = 64; static MIN_GALLOP: uint = 7; static INITIAL_TMP_STORAGE: uint = 128; +#[allow(missing_doc)] pub fn tim_sort(array: &mut [T]) { let size = array.len(); if size < 2 { diff --git a/src/libextra/stats.rs b/src/libextra/stats.rs index 504930a884e..d224777ded7 100644 --- a/src/libextra/stats.rs +++ b/src/libextra/stats.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(missing_doc)]; + use core::prelude::*; use core::vec; diff --git a/src/libextra/std.rc b/src/libextra/std.rc index 8c03701f513..a81ab3005f6 100644 --- a/src/libextra/std.rc +++ b/src/libextra/std.rc @@ -27,8 +27,12 @@ not required in or otherwise suitable for the core library. #[crate_type = "lib"]; #[deny(non_camel_case_types)]; +#[deny(missing_doc)]; + +// NOTE: remove these two attributes after the next snapshot +#[no_core]; // for stage0 +#[allow(unrecognized_lint)]; // otherwise stage0 is seriously ugly -#[no_core]; #[no_std]; extern mod core(name = "std", vers = "0.7-pre"); diff --git a/src/libextra/task_pool.rs b/src/libextra/task_pool.rs index eba4f0d1b75..06bc3167040 100644 --- a/src/libextra/task_pool.rs +++ b/src/libextra/task_pool.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(missing_doc)]; + /// A task pool abstraction. Useful for achieving predictable CPU /// parallelism. diff --git a/src/libextra/tempfile.rs b/src/libextra/tempfile.rs index c514631e787..6d0bd888195 100644 --- a/src/libextra/tempfile.rs +++ b/src/libextra/tempfile.rs @@ -16,6 +16,8 @@ use core::os; use core::rand::RngUtil; use core::rand; +/// Attempts to make a temporary directory inside of `tmpdir` whose name will +/// have the suffix `suffix`. If no directory can be created, None is returned. pub fn mkdtemp(tmpdir: &Path, suffix: &str) -> Option { let mut r = rand::rng(); for 1000.times { diff --git a/src/libextra/term.rs b/src/libextra/term.rs index 7dace57a1b5..a76852dc661 100644 --- a/src/libextra/term.rs +++ b/src/libextra/term.rs @@ -10,6 +10,8 @@ //! Simple ANSI color library +#[allow(missing_doc)]; + use core::prelude::*; use core::io; diff --git a/src/libextra/time.rs b/src/libextra/time.rs index 93fbf6a4054..8603d0f814a 100644 --- a/src/libextra/time.rs +++ b/src/libextra/time.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(missing_doc)]; + use core::prelude::*; use core::i32; diff --git a/src/libextra/treemap.rs b/src/libextra/treemap.rs index a05c532c92f..e6db84e855c 100644 --- a/src/libextra/treemap.rs +++ b/src/libextra/treemap.rs @@ -34,6 +34,7 @@ use core::util::{swap, replace}; // * union: | // These would be convenient since the methods work like `each` +#[allow(missing_doc)] pub struct TreeMap { priv root: Option<~TreeNode>, priv length: uint @@ -242,6 +243,9 @@ impl<'self, T> Iterator<&'self T> for TreeSetIterator<'self, T> { } } +/// A implementation of the `Set` trait on top of the `TreeMap` container. The +/// only requirement is that the type of the elements contained ascribes to the +/// `TotalOrd` trait. pub struct TreeSet { priv map: TreeMap } diff --git a/src/libextra/unicode.rs b/src/libextra/unicode.rs index 77996de6d83..3bd05a41534 100644 --- a/src/libextra/unicode.rs +++ b/src/libextra/unicode.rs @@ -9,6 +9,7 @@ // except according to those terms. #[forbid(deprecated_mode)]; +#[allow(missing_doc)]; pub mod icu { pub type UBool = u8; diff --git a/src/libextra/uv_iotask.rs b/src/libextra/uv_iotask.rs index 6cf753b8016..817dfa28aee 100644 --- a/src/libextra/uv_iotask.rs +++ b/src/libextra/uv_iotask.rs @@ -15,6 +15,8 @@ * `interact` function you can execute code in a uv callback. */ +#[allow(missing_doc)]; + use core::prelude::*; use ll = uv_ll; diff --git a/src/libextra/uv_ll.rs b/src/libextra/uv_ll.rs index d5f7cb12e4f..2cb2eea8828 100644 --- a/src/libextra/uv_ll.rs +++ b/src/libextra/uv_ll.rs @@ -31,6 +31,7 @@ */ #[allow(non_camel_case_types)]; // C types +#[allow(missing_doc)]; use core::prelude::*; diff --git a/src/libextra/workcache.rs b/src/libextra/workcache.rs index 798cf1ba55d..19913fb92f4 100644 --- a/src/libextra/workcache.rs +++ b/src/libextra/workcache.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(missing_doc)]; + use core::prelude::*; use json; diff --git a/src/libstd/run.rs b/src/libstd/run.rs index 7c73aca3af9..de1148e431b 100644 --- a/src/libstd/run.rs +++ b/src/libstd/run.rs @@ -10,6 +10,8 @@ //! Process spawning. +#[allow(missing_doc)]; + use cast; use comm::{stream, SharedChan, GenericChan, GenericPort}; use int;