diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8552bcc6974a9..f214dcacb7ca0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,7 @@ If you're just reporting a bug, please see: -http://static.rust-lang.org/doc/master/complement-bugreport.html +http://doc.rust-lang.org/complement-bugreport.html ## Pull request procedure diff --git a/README.md b/README.md index 680dfddbe969c..2f846725cd72d 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ documentation. > [getting started][wiki-start] notes on the wiki. [installer]: http://www.rust-lang.org/install.html -[tutorial]: http://static.rust-lang.org/doc/tutorial.html +[tutorial]: http://doc.rust-lang.org/tutorial.html [wiki-start]: https://github.com/mozilla/rust/wiki/Note-getting-started-developing-Rust [win-wiki]: https://github.com/mozilla/rust/wiki/Using-Rust-on-Windows @@ -60,7 +60,7 @@ documentation. [repo]: https://github.com/mozilla/rust [tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz -[tutorial]: http://static.rust-lang.org/doc/master/tutorial.html +[tutorial]: http://doc.rust-lang.org/tutorial.html ## Notes diff --git a/mk/docs.mk b/mk/docs.mk index 4d00223fca880..b02cb548ad506 100644 --- a/mk/docs.mk +++ b/mk/docs.mk @@ -156,7 +156,7 @@ doc/footer.tex: $(D)/footer.inc | doc/ # HTML (rustdoc) DOC_TARGETS += doc/not_found.html doc/not_found.html: $(D)/not_found.md $(HTML_DEPS) | doc/ - $(RUSTDOC) $(RUSTDOC_HTML_OPTS_NO_CSS) --markdown-css http://static.rust-lang.org/doc/master/rust.css $< + $(RUSTDOC) $(RUSTDOC_HTML_OPTS_NO_CSS) --markdown-css http://doc.rust-lang.org/rust.css $< define DEF_DOC diff --git a/src/doc/complement-cheatsheet.md b/src/doc/complement-cheatsheet.md index 4670a2922cf8c..211703642f77b 100644 --- a/src/doc/complement-cheatsheet.md +++ b/src/doc/complement-cheatsheet.md @@ -4,7 +4,7 @@ **Int to string** -Use [`ToStr`](http://static.rust-lang.org/doc/master/std/to_str/trait.ToStr.html). +Use [`ToStr`](../std/to_str/trait.ToStr.html). ~~~ let x: int = 42; @@ -13,7 +13,8 @@ let y: StrBuf = x.to_str().to_strbuf(); **String to int** -Use [`FromStr`](http://static.rust-lang.org/doc/master/std/from_str/trait.FromStr.html), and its helper function, [`from_str`](http://static.rust-lang.org/doc/master/std/from_str/fn.from_str.html). +Use [`FromStr`](../std/from_str/trait.FromStr.html), and its helper function, +[`from_str`](../std/from_str/fn.from_str.html). ~~~ let x: Option = from_str("42"); @@ -34,7 +35,8 @@ let y: StrBuf = format_strbuf!("{:X}", x); // uppercase hexadecimal **String to int, in non-base-10** -Use [`FromStrRadix`](http://static.rust-lang.org/doc/master/std/num/trait.FromStrRadix.html), and its helper function, [`from_str_radix`](http://static.rust-lang.org/doc/master/std/num/fn.from_str_radix.html). +Use [`FromStrRadix`](../std/num/trait.FromStrRadix.html), and its helper +function, [`from_str_radix`](../std/num/fn.from_str_radix.html). ~~~ use std::num; @@ -45,7 +47,8 @@ let y: i64 = x.unwrap(); **Vector of Bytes to String** -To return a Borrowed String Slice (&str) use the str helper function [`from_utf8`](http://static.rust-lang.org/doc/master/std/str/fn.from_utf8.html). +To return a Borrowed String Slice (&str) use the str helper function +[`from_utf8`](../std/str/fn.from_utf8.html). ~~~ use std::str; @@ -55,7 +58,8 @@ let x: Option<&str> = str::from_utf8(bytes); let y: &str = x.unwrap(); ~~~ -To return an Owned String (StrBuf) use the str helper function [`from_utf8_owned`](http://static.rust-lang.org/doc/master/std/str/fn.from_utf8_owned.html). +To return an Owned String (StrBuf) use the str helper function +[`from_utf8_owned`](../std/str/fn.from_utf8_owned.html). ~~~ use std::str; @@ -65,7 +69,10 @@ let x: Result = let y: StrBuf = x.unwrap(); ~~~ -To return a [`MaybeOwned`](http://static.rust-lang.org/doc/master/std/str/enum.MaybeOwned.html) use the str helper function [`from_utf8_lossy`](http://static.rust-lang.org/doc/master/std/str/fn.from_utf8_owned.html). This function also replaces non-valid utf-8 sequences with U+FFFD replacement character. +To return a [`MaybeOwned`](../std/str/enum.MaybeOwned.html) use the str helper +function [`from_utf8_lossy`](../std/str/fn.from_utf8_owned.html). +This function also replaces non-valid utf-8 sequences with U+FFFD replacement +character. ~~~ use std::str; @@ -78,7 +85,13 @@ let y = str::from_utf8_lossy(x); ## How do I read from a file? -Use [`File::open`](http://static.rust-lang.org/doc/master/std/io/fs/struct.File.html#method.open) to create a [`File`](http://static.rust-lang.org/doc/master/std/io/fs/struct.File.html) struct, which implements the [`Reader`](http://static.rust-lang.org/doc/master/std/io/trait.Reader.html) trait. +Use +[`File::open`](../std/io/fs/struct.File.html#method.open) +to create a +[`File`](../std/io/fs/struct.File.html) +struct, which implements the +[`Reader`](../std/io/trait.Reader.html) +trait. ~~~ {.ignore} use std::path::Path; @@ -91,7 +104,7 @@ let reader : File = File::open(&path).unwrap_or_else(on_error); ## How do I iterate over the lines in a file? -Use the [`lines`](http://static.rust-lang.org/doc/master/std/io/trait.Buffer.html#method.lines) method on a [`BufferedReader`](http://static.rust-lang.org/doc/master/std/io/buffered/struct.BufferedReader.html). +Use the [`lines`](../std/io/trait.Buffer.html#method.lines) method on a [`BufferedReader`](../std/io/buffered/struct.BufferedReader.html). ~~~ use std::io::BufferedReader; @@ -109,7 +122,7 @@ for line in reader.lines() { ## How do I search for a substring? -Use the [`find_str`](http://static.rust-lang.org/doc/master/std/str/trait.StrSlice.html#tymethod.find_str) method. +Use the [`find_str`](../std/str/trait.StrSlice.html#tymethod.find_str) method. ~~~ let str = "Hello, this is some random string"; @@ -120,7 +133,7 @@ let index: Option = str.find_str("rand"); ## How do I get the length of a vector? -The [`Container`](http://static.rust-lang.org/doc/master/std/container/trait.Container.html) trait provides the `len` method. +The [`Container`](../std/container/trait.Container.html) trait provides the `len` method. ~~~ let u: ~[u32] = ~[0, 1, 2]; @@ -132,7 +145,7 @@ println!("u: {}, v: {}, w: {}", u.len(), v.len(), w.len()); // 3, 4, 5 ## How do I iterate over a vector? -Use the [`iter`](http://static.rust-lang.org/doc/master/std/vec/trait.ImmutableVector.html#tymethod.iter) method. +Use the [`iter`](../std/vec/trait.ImmutableVector.html#tymethod.iter) method. ~~~ let values: ~[int] = ~[1, 2, 3, 4, 5]; @@ -141,7 +154,10 @@ for value in values.iter() { // value: &int } ~~~ -(See also [`mut_iter`](http://static.rust-lang.org/doc/master/std/vec/trait.MutableVector.html#tymethod.mut_iter) which yields `&mut int` and [`move_iter`](http://static.rust-lang.org/doc/master/std/vec/trait.OwnedVector.html#tymethod.move_iter) which yields `int` while consuming the `values` vector.) +(See also [`mut_iter`](../std/vec/trait.MutableVector.html#tymethod.mut_iter) +which yields `&mut int` and +[`move_iter`](../std/vec/trait.OwnedVector.html#tymethod.move_iter) which yields +`int` while consuming the `values` vector.) # Type system diff --git a/src/doc/guide-unsafe.md b/src/doc/guide-unsafe.md index 3ff05ef3fd064..717902e01d5d5 100644 --- a/src/doc/guide-unsafe.md +++ b/src/doc/guide-unsafe.md @@ -89,11 +89,11 @@ Raw pointers have much fewer guarantees than other pointer types offered by the Rust language and libraries. For example, they - are not guaranteed to point to valid memory and are not even - guaranteed to be non-null (unlike both `~` and `&`); -- do not have any automatic clean-up, unlike `~`, and so require + guaranteed to be non-null (unlike both `Box` and `&`); +- do not have any automatic clean-up, unlike `Box`, and so require manual resource management; - are plain-old-data, that is, they don't move ownership, again unlike - `~`, hence the Rust compiler cannot protect against bugs like + `Box`, hence the Rust compiler cannot protect against bugs like use-after-free; - are considered sendable (if their contents is considered sendable), so the compiler offers no assistance with ensuring their use is @@ -189,7 +189,7 @@ code: As an example, we give a reimplementation of owned boxes by wrapping `malloc` and `free`. Rust's move semantics and lifetimes mean this -reimplementation is as safe as the built-in `~` type. +reimplementation is as safe as the `Box` type. ``` extern crate libc; @@ -198,13 +198,14 @@ use std::mem; use std::ptr; // Define a wrapper around the handle returned by the foreign code. -// Unique has the same semantics as ~T +// Unique has the same semantics as Box pub struct Unique { // It contains a single raw, mutable pointer to the object in question. ptr: *mut T } // Implement methods for creating and using the values in the box. + // NB: For simplicity and correctness, we require that T has kind Send // (owned boxes relax this restriction, and can contain managed (GC) boxes). // This is because, as implemented, the garbage collector would not know @@ -215,23 +216,26 @@ impl Unique { let ptr = malloc(std::mem::size_of::() as size_t) as *mut T; // we *need* valid pointer. assert!(!ptr.is_null()); - // `*ptr` is uninitialized, and `*ptr = value` would attempt to destroy it - // `overwrite` moves a value into this memory without - // attempting to drop the original value. + // `*ptr` is uninitialized, and `*ptr = value` would + // attempt to destroy it `overwrite` moves a value into + // this memory without attempting to drop the original + // value. mem::overwrite(&mut *ptr, value); Unique{ptr: ptr} } } - // the 'r lifetime results in the same semantics as `&*x` with ~T + // the 'r lifetime results in the same semantics as `&*x` with + // Box pub fn borrow<'r>(&'r self) -> &'r T { // By construction, self.ptr is valid unsafe { &*self.ptr } } - // the 'r lifetime results in the same semantics as `&mut *x` with ~T + // the 'r lifetime results in the same semantics as `&mut *x` with + // Box pub fn borrow_mut<'r>(&'r mut self) -> &'r mut T { - unsafe { &mut*self.ptr } + unsafe { &mut *self.ptr } } } @@ -246,7 +250,6 @@ impl Unique { impl Drop for Unique { fn drop(&mut self) { unsafe { - // Copy the object out from the pointer onto the stack, // where it is covered by normal Rust destructor semantics // and cleans itself up, if necessary @@ -428,11 +431,9 @@ this is undesirable, and can be avoided with the `#![no_std]` attribute attached to the crate. ```ignore -# // FIXME #12903: linking failures due to no_std -// the minimal library +// a minimal library #![crate_type="lib"] #![no_std] - # // fn main() {} tricked you, rustdoc! ``` @@ -444,20 +445,23 @@ default shim for the C `main` function with your own. The function marked `#[start]` is passed the command line parameters in the same format as a C: -```ignore -# // FIXME #12903: linking failures due to no_std +``` #![no_std] -extern "rust-intrinsic" { fn abort() -> !; } -#[no_mangle] pub extern fn rust_stack_exhausted() { - unsafe { abort() } -} +// Pull in the system libc library for what crt0.o likely requires +extern crate libc; +// Entry point for this program #[start] fn start(_argc: int, _argv: **u8) -> int { 0 } +// These functions are invoked by the compiler, but not +// for a bare-bones hello world. These are normally +// provided by libstd. +#[lang = "stack_exhausted"] extern fn stack_exhausted() {} +#[lang = "eh_personality"] extern fn eh_personality() {} # // fn main() {} tricked you, rustdoc! ``` @@ -467,29 +471,115 @@ correct ABI and the correct name, which requires overriding the compiler's name mangling too: ```ignore -# // FIXME #12903: linking failures due to no_std #![no_std] #![no_main] -extern "rust-intrinsic" { fn abort() -> !; } -#[no_mangle] pub extern fn rust_stack_exhausted() { - unsafe { abort() } -} +extern crate libc; #[no_mangle] // ensure that this symbol is called `main` in the output -extern "C" fn main(_argc: int, _argv: **u8) -> int { +pub extern fn main(argc: int, argv: **u8) -> int { 0 } +#[lang = "stack_exhausted"] extern fn stack_exhausted() {} +#[lang = "eh_personality"] extern fn eh_personality() {} # // fn main() {} tricked you, rustdoc! ``` -Unfortunately the Rust compiler assumes that symbols with certain -names exist; and these have to be defined (or linked in). This is the -purpose of the `rust_stack_exhausted`: it is called when a function -detects that it will overflow its stack. The example above uses the -`abort` intrinsic which ensures that execution halts. +The compiler currently makes a few assumptions about symbols which are available +in the executable to call. Normally these functions are provided by the standard +library, but without it you must define your own. + +The first of these two functions, `stack_exhausted`, is invoked whenever stack +overflow is detected. This function has a number of restrictions about how it +can be called and what it must do, but if the stack limit register is not being +maintained then a task always has an "infinite stack" and this function +shouldn't get triggered. + +The second of these two functions, `eh_personality`, is used by the failure +mechanisms of the compiler. This is often mapped to GCC's personality function +(see the [libstd implementation](../std/rt/unwind/) for more information), but +crates which do not trigger failure can be assured that this function is never +called. + +## Using libcore + +> **Note**: the core library's structure is unstable, and it is recommended to +> use the standard library instead wherever possible. + +With the above techniques, we've got a bare-metal executable running some Rust +code. There is a good deal of functionality provided by the standard library, +however, that is necessary to be productive in Rust. If the standard library is +not sufficient, then [libcore](../core/) is designed to be used instead. + +The core library has very few dependencies and is much more portable than the +standard library itself. Additionally, the core library has most of the +necessary functionality for writing idiomatic and effective Rust code. + +As an example, here is a program that will calculate the dot product of two +vectors provided from C, using idiomatic Rust practices. + +``` +#![no_std] + +# extern crate libc; +extern crate core; + +use core::prelude::*; + +use core::mem; +use core::raw::Slice; + +#[no_mangle] +pub extern fn dot_product(a: *u32, a_len: u32, + b: *u32, b_len: u32) -> u32 { + // Convert the provided arrays into Rust slices. + // The core::raw module guarantees that the Slice + // structure has the same memory layout as a &[T] + // slice. + // + // This is an unsafe operation because the compiler + // cannot tell the pointers are valid. + let (a_slice, b_slice): (&[u32], &[u32]) = unsafe { + mem::transmute(( + Slice { data: a, len: a_len as uint }, + Slice { data: b, len: b_len as uint }, + )) + }; + + // Iterate over the slices, collecting the result + let mut ret = 0; + for (i, j) in a_slice.iter().zip(b_slice.iter()) { + ret += (*i) * (*j); + } + return ret; +} + +#[lang = "begin_unwind"] +extern fn begin_unwind(args: &core::fmt::Arguments, + file: &str, + line: uint) -> ! { + loop {} +} + +#[lang = "stack_exhausted"] extern fn stack_exhausted() {} +#[lang = "eh_personality"] extern fn eh_personality() {} +# #[start] fn start(argc: int, argv: **u8) -> int { 0 } +# fn main() {} +``` + +Note that there is one extra lang item here which differs from the examples +above, `begin_unwind`. This must be defined by consumers of libcore because the +core library declares failure, but it does not define it. The `begin_unwind` +lang item is this crate's definition of failure, and it must be guaranteed to +never return. + +As can be seen in this example, the core library is intended to provide the +power of Rust in all circumstances, regardless of platform requirements. Further +libraries, such as liballoc, add functionality to libcore which make other +platform-specific assumptions, but continue to be more portable than the +standard library itself. # Interacting with the compiler internals @@ -512,6 +602,10 @@ libraries to interact directly with the compiler and vice versa: ## Intrinsics +> **Note**: intrinsics will forever have an unstable interface, it is +> recommended to use the stable interfaces of libcore rather than intrinsics +> directly. + These are imported as if they were FFI functions, with the special `rust-intrinsic` ABI. For example, if one was in a freestanding context, but wished to be able to `transmute` between types, and @@ -530,6 +624,10 @@ As with any other FFI functions, these are always `unsafe` to call. ## Lang items +> **Note**: lang items are often provided by crates in the Rust distribution, +> and lang items themselves have an unstable interface. It is recommended to use +> officially distributed crates instead of defining your own lang items. + The `rustc` compiler has certain pluggable operations, that is, functionality that isn't hard-coded into the language, but is implemented in libraries, with a special marker to tell the compiler @@ -537,29 +635,22 @@ it exists. The marker is the attribute `#[lang="..."]` and there are various different values of `...`, i.e. various different "lang items". -For example, `~` pointers require two lang items, one for allocation -and one for deallocation. A freestanding program that uses the `~` +For example, `Box` pointers require two lang items, one for allocation +and one for deallocation. A freestanding program that uses the `Box` sugar for dynamic allocations via `malloc` and `free`: -```ignore -# // FIXME #12903: linking failures due to no_std +``` #![no_std] -#[allow(ctypes)] // `uint` == `size_t` on Rust's platforms -extern { - fn malloc(size: uint) -> *mut u8; - fn free(ptr: *mut u8); +extern crate libc; +extern { fn abort() -> !; } -#[no_mangle] pub extern fn rust_stack_exhausted() { - unsafe { abort() } -} - #[lang="exchange_malloc"] -unsafe fn allocate(size: uint) -> *mut u8 { - let p = malloc(size); +unsafe fn allocate(size: uint, _align: uint) -> *mut u8 { + let p = libc::malloc(size as libc::size_t) as *mut u8; // malloc failed if p as uint == 0 { @@ -569,18 +660,19 @@ unsafe fn allocate(size: uint) -> *mut u8 { p } #[lang="exchange_free"] -unsafe fn deallocate(ptr: *mut u8) { - free(ptr) +unsafe fn deallocate(ptr: *mut u8, _size: uint, _align: uint) { + libc::free(ptr as *mut libc::c_void) } #[start] -fn main(_argc: int, _argv: **u8) -> int { - let _x = ~1; +fn main(argc: int, argv: **u8) -> int { + let x = box 1; 0 } -# // fn main() {} tricked you, rustdoc! +#[lang = "stack_exhausted"] extern fn stack_exhausted() {} +#[lang = "eh_personality"] extern fn eh_personality() {} ``` Note the use of `abort`: the `exchange_malloc` lang item is assumed to @@ -602,6 +694,6 @@ Other features provided by lang items include: `contravariant_lifetime`, `no_share_bound`, etc. Lang items are loaded lazily by the compiler; e.g. if one never uses -`~` then there is no need to define functions for `exchange_malloc` +`Box` then there is no need to define functions for `exchange_malloc` and `exchange_free`. `rustc` will emit an error when an item is needed but not found in the current crate or any that it depends on. diff --git a/src/doc/not_found.md b/src/doc/not_found.md index a19418ff66793..a9df94d813858 100644 --- a/src/doc/not_found.md +++ b/src/doc/not_found.md @@ -13,8 +13,7 @@ Some things that might be helpful to you though: ## Reference * [The Rust official site](http://rust-lang.org) -* [The Rust reference manual](http://static.rust-lang.org/doc/master/rust.html) (* [PDF](http://static.rust-lang.org/doc/master/rust.pdf)) +* [The Rust reference manual](http://doc.rust-lang.org/rust.html) (* [PDF](http://doc.rust-lang.org/rust.pdf)) ## Docs -* [The standard library (stable)](http://doc.rust-lang.org/doc/0.10/std/index.html) -* [The standard library (master)](http://doc.rust-lang.org/doc/master/std/index.html) +* [The standard library](http://doc.rust-lang.org/std/) diff --git a/src/doc/rustdoc.md b/src/doc/rustdoc.md index 3b7f4e1bf5013..d6cb782bd83bb 100644 --- a/src/doc/rustdoc.md +++ b/src/doc/rustdoc.md @@ -67,7 +67,7 @@ documentation: ~~~ #[doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")]; + html_root_url = "http://doc.rust-lang.org/")]; ~~~ The `html_root_url` is the prefix that rustdoc will apply to any references to diff --git a/src/doc/tutorial.md b/src/doc/tutorial.md index 0b076dcde5db1..7a0a166274282 100644 --- a/src/doc/tutorial.md +++ b/src/doc/tutorial.md @@ -382,7 +382,7 @@ let y: uint = x as uint; assert!(y == 4u); ~~~~ -[transmute]: http://static.rust-lang.org/doc/master/std/cast/fn.transmute.html +[transmute]: http://doc.rust-lang.org/std/mem/fn.transmute.html ## Syntax extensions @@ -409,7 +409,7 @@ println!("what is this thing: {:?}", mystery_object); ~~~~ [pf]: http://en.cppreference.com/w/cpp/io/c/fprintf -[fmt]: http://static.rust-lang.org/doc/master/std/fmt/index.html +[fmt]: http://doc.rust-lang.org/std/fmt/ You can define your own syntax extensions with the macro system. For details, see the [macro tutorial][macros]. Note that macro definition is currently @@ -959,8 +959,8 @@ that are `Send`, but non-`Send` types can still *contain* types with custom destructors. Example of types which are not `Send` are [`Gc`][gc] and [`Rc`][rc], the shared-ownership types. -[gc]: http://static.rust-lang.org/doc/master/std/gc/struct.Gc.html -[rc]: http://static.rust-lang.org/doc/master/std/rc/struct.Rc.html +[gc]: http://doc.rust-lang.org/std/gc/struct.Gc.html +[rc]: http://doc.rust-lang.org/std/rc/struct.Rc.html # Implementing a linked list @@ -1486,7 +1486,7 @@ let mut x = 5; # x = 3; ~~~~ -[refcell]: http://static.rust-lang.org/doc/master/std/cell/struct.RefCell.html +[refcell]: http://doc.rust-lang.org/std/cell/struct.RefCell.html # Dereferencing pointers diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index 1a6d7bfaed0e0..bf870e101eb86 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -65,7 +65,7 @@ #![crate_type = "rlib"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![no_std] #![feature(phase)] diff --git a/src/libarena/lib.rs b/src/libarena/lib.rs index 3c93cdac8bbc9..00ac70ccc16af 100644 --- a/src/libarena/lib.rs +++ b/src/libarena/lib.rs @@ -25,7 +25,7 @@ #![license = "MIT/ASL2"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![allow(missing_doc)] extern crate collections; diff --git a/src/libcollections/lib.rs b/src/libcollections/lib.rs index d45308bf193f4..4c5f55e53763c 100644 --- a/src/libcollections/lib.rs +++ b/src/libcollections/lib.rs @@ -18,7 +18,7 @@ #![license = "MIT/ASL2"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![feature(macro_rules, managed_boxes, default_type_params, phase)] diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index da1462a704758..178ba9fa5b8fb 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -59,7 +59,7 @@ This `for` loop syntax can be applied to any iterator over any type. ## Iteration protocol and more More detailed information about iterators can be found in the [container -guide](http://static.rust-lang.org/doc/master/guide-container.html) with +guide](http://doc.rust-lang.org/guide-container.html) with the rest of the rust manuals. */ diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index ffb9b676e7d47..6de7e8bcacac5 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -50,7 +50,7 @@ #![crate_type = "rlib"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![no_std] #![feature(globs, macro_rules, managed_boxes, phase)] diff --git a/src/libflate/lib.rs b/src/libflate/lib.rs index 76d803cdacced..54f147dead8b6 100644 --- a/src/libflate/lib.rs +++ b/src/libflate/lib.rs @@ -24,7 +24,7 @@ Simple [DEFLATE][def]-based compression. This is a wrapper around the #![license = "MIT/ASL2"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![feature(phase)] #![deny(deprecated_owned_vector)] diff --git a/src/libfourcc/lib.rs b/src/libfourcc/lib.rs index 93aa978add5c1..194de7b2f4aee 100644 --- a/src/libfourcc/lib.rs +++ b/src/libfourcc/lib.rs @@ -45,7 +45,7 @@ fn main() { #![license = "MIT/ASL2"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![deny(deprecated_owned_vector)] #![feature(macro_registrar, managed_boxes)] diff --git a/src/libgetopts/lib.rs b/src/libgetopts/lib.rs index ba30e1a2e986b..5d0b8c8a7e578 100644 --- a/src/libgetopts/lib.rs +++ b/src/libgetopts/lib.rs @@ -84,7 +84,7 @@ #![license = "MIT/ASL2"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![feature(globs, phase)] #![deny(missing_doc)] #![deny(deprecated_owned_vector)] diff --git a/src/libglob/lib.rs b/src/libglob/lib.rs index 7b9260c7eb9dc..6b9bdf7c748c5 100644 --- a/src/libglob/lib.rs +++ b/src/libglob/lib.rs @@ -29,7 +29,7 @@ #![license = "MIT/ASL2"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![deny(deprecated_owned_vector)] diff --git a/src/libgraphviz/lib.rs b/src/libgraphviz/lib.rs index a87bb1e6752fd..4d86ab530f29d 100644 --- a/src/libgraphviz/lib.rs +++ b/src/libgraphviz/lib.rs @@ -272,7 +272,7 @@ pub fn main() { #![license = "MIT/ASL2"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![experimental] diff --git a/src/libgreen/lib.rs b/src/libgreen/lib.rs index eec413635a50a..05ac0e8ebb705 100644 --- a/src/libgreen/lib.rs +++ b/src/libgreen/lib.rs @@ -203,7 +203,7 @@ #![crate_type = "dylib"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] // NB this does *not* include globs, please keep it that way. #![feature(macro_rules, phase)] diff --git a/src/libhexfloat/lib.rs b/src/libhexfloat/lib.rs index dda14fb10af02..1ab130ee6c925 100644 --- a/src/libhexfloat/lib.rs +++ b/src/libhexfloat/lib.rs @@ -42,7 +42,7 @@ fn main() { #![license = "MIT/ASL2"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![deny(deprecated_owned_vector)] #![feature(macro_registrar, managed_boxes)] diff --git a/src/liblog/lib.rs b/src/liblog/lib.rs index 5981f87b4f2b6..c126eca24ba28 100644 --- a/src/liblog/lib.rs +++ b/src/liblog/lib.rs @@ -111,7 +111,7 @@ if logging is disabled, none of the components of the log will be executed. #![crate_type = "dylib"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![feature(macro_rules)] #![deny(missing_doc, deprecated_owned_vector)] diff --git a/src/libnative/lib.rs b/src/libnative/lib.rs index 8ba0613336924..0a0e19e750d9c 100644 --- a/src/libnative/lib.rs +++ b/src/libnative/lib.rs @@ -47,7 +47,7 @@ #![crate_type = "dylib"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![deny(unused_result, unused_must_use)] #![allow(non_camel_case_types)] #![feature(macro_rules)] diff --git a/src/libnum/lib.rs b/src/libnum/lib.rs index 85967d4d942be..d42c197cab798 100644 --- a/src/libnum/lib.rs +++ b/src/libnum/lib.rs @@ -50,7 +50,7 @@ #![license = "MIT/ASL2"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![deny(deprecated_owned_vector)] diff --git a/src/librand/lib.rs b/src/librand/lib.rs index c7a29ff728577..1c4132b961c4e 100644 --- a/src/librand/lib.rs +++ b/src/librand/lib.rs @@ -75,7 +75,7 @@ println!("{:?}", tuple_ptr) #![crate_type = "rlib"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![feature(macro_rules, managed_boxes, phase)] #![deny(deprecated_owned_vector)] diff --git a/src/libregex/lib.rs b/src/libregex/lib.rs index 93254c773ffac..4cb51361f27fb 100644 --- a/src/libregex/lib.rs +++ b/src/libregex/lib.rs @@ -359,7 +359,7 @@ #![license = "MIT/ASL2"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![feature(macro_rules, phase)] #![deny(missing_doc, deprecated_owned_vector)] diff --git a/src/libregex_macros/lib.rs b/src/libregex_macros/lib.rs index b85a1592eff02..08b41ff2ac64f 100644 --- a/src/libregex_macros/lib.rs +++ b/src/libregex_macros/lib.rs @@ -17,7 +17,7 @@ #![license = "MIT/ASL2"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![feature(macro_registrar, managed_boxes, quote)] diff --git a/src/librlibc/lib.rs b/src/librlibc/lib.rs index 904fbe9be9b27..8c804d4d254e1 100644 --- a/src/librlibc/lib.rs +++ b/src/librlibc/lib.rs @@ -25,7 +25,7 @@ #![crate_type = "rlib"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![no_std] #![experimental] diff --git a/src/librustc/driver/mod.rs b/src/librustc/driver/mod.rs index c4c145f5bd66d..f911c24294a5b 100644 --- a/src/librustc/driver/mod.rs +++ b/src/librustc/driver/mod.rs @@ -42,7 +42,7 @@ pub fn main_args(args: &[StrBuf]) -> int { } static BUG_REPORT_URL: &'static str = - "http://static.rust-lang.org/doc/master/complement-bugreport.html"; + "http://doc.rust-lang.org/complement-bugreport.html"; fn run_compiler(args: &[StrBuf]) { let matches = match handle_options(Vec::from_slice(args)) { diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index 5f13ed4942edd..350dec7676801 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -25,7 +25,7 @@ This API is completely unstable and subject to change. #![crate_type = "rlib"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![allow(deprecated)] #![feature(macro_rules, globs, struct_variant, managed_boxes, quote, diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index 517be1bde2f3a..3e2417f71b054 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -220,10 +220,10 @@ pub enum AutoRef { /// Convert from T to &T AutoPtr(Region, ast::Mutability), - /// Convert from ~[]/&[] to &[] (or str) + /// Convert from ~[]/&[] to &[] or str AutoBorrowVec(Region, ast::Mutability), - /// Convert from ~[]/&[] to &&[] (or str) + /// Convert from ~[]/&[] to &&[] or str AutoBorrowVecRef(Region, ast::Mutability), /// Convert from T to *T diff --git a/src/libsemver/lib.rs b/src/libsemver/lib.rs index 2f1d59b23a280..57a2ffee03a5b 100644 --- a/src/libsemver/lib.rs +++ b/src/libsemver/lib.rs @@ -34,7 +34,7 @@ #![license = "MIT/ASL2"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![deny(deprecated_owned_vector)] use std::char; diff --git a/src/libserialize/lib.rs b/src/libserialize/lib.rs index 209a1439dda56..ce1d49406fbe5 100644 --- a/src/libserialize/lib.rs +++ b/src/libserialize/lib.rs @@ -20,7 +20,7 @@ Core encoding and decoding interfaces. #![license = "MIT/ASL2"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![feature(macro_rules, managed_boxes, default_type_params, phase)] // test harness access diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index a9ec9c1ddc5ac..8a4b7eb3a63a0 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -32,7 +32,7 @@ //! //! ## Pervasive types //! -//! The [`option`](option/index.html) and [`result`](result/index.html) +//! The [`option`](option/index.html) and [`result`](../core/result/index.html) //! modules define optional and error-handling types, `Option` and `Result`. //! [`iter`](../core/iter/index.html) defines Rust's iterator protocol //! along with a wide variety of iterators. @@ -102,7 +102,7 @@ #![crate_type = "dylib"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![feature(macro_rules, globs, asm, managed_boxes, thread_local, link_args, simd, linkage, default_type_params, phase, concat_idents, quad_precision_float)] diff --git a/src/libsync/lib.rs b/src/libsync/lib.rs index 3396425928e7d..e0cc57a4967fe 100644 --- a/src/libsync/lib.rs +++ b/src/libsync/lib.rs @@ -18,7 +18,7 @@ #![license = "MIT/ASL2"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![feature(phase)] #![deny(deprecated_owned_vector)] diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index cf5163af7170f..304b5c19d51dc 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -336,7 +336,7 @@ pub fn test_cfg> no_cfgs || some_cfg_matches } -/// Represents the #[deprecated="foo"] (etc) attributes. +/// Represents the #[deprecated="foo"] and friends attributes. pub struct Stability { pub level: StabilityLevel, pub text: Option diff --git a/src/libsyntax/ext/fmt.rs b/src/libsyntax/ext/fmt.rs index 0907541eee0e0..4185458bfbe61 100644 --- a/src/libsyntax/ext/fmt.rs +++ b/src/libsyntax/ext/fmt.rs @@ -22,7 +22,7 @@ pub fn expand_syntax_ext(ecx: &mut base::ExtCtxt, -> Box { ecx.span_err(sp, "`fmt!` is deprecated, use `format!` instead"); ecx.parse_sess.span_diagnostic.span_note(sp, - "see http://static.rust-lang.org/doc/master/std/fmt/index.html \ + "see http://doc.rust-lang.org/std/fmt/ \ for documentation"); base::MacExpr::new(ecx.expr_uint(sp, 2)) diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 1086295d427c9..52612bb4decd3 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -24,7 +24,7 @@ This API is completely unstable and subject to change. #![crate_type = "rlib"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![feature(macro_rules, globs, managed_boxes, default_type_params, phase, quote)] diff --git a/src/libterm/lib.rs b/src/libterm/lib.rs index 622bc025ced81..d454ad08e4f0f 100644 --- a/src/libterm/lib.rs +++ b/src/libterm/lib.rs @@ -45,7 +45,7 @@ #![crate_type = "dylib"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![feature(macro_rules, phase)] diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index dc3a18b809510..65aef8eef5122 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -30,7 +30,7 @@ #![crate_type = "dylib"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![feature(asm, macro_rules, phase)] #![deny(deprecated_owned_vector)] diff --git a/src/libtime/lib.rs b/src/libtime/lib.rs index 0e67076dc08e3..d45781d73d94e 100644 --- a/src/libtime/lib.rs +++ b/src/libtime/lib.rs @@ -17,7 +17,7 @@ #![license = "MIT/ASL2"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![feature(phase)] #![deny(deprecated_owned_vector)] diff --git a/src/liburl/lib.rs b/src/liburl/lib.rs index 5fc567f06d38d..71b6cf07de705 100644 --- a/src/liburl/lib.rs +++ b/src/liburl/lib.rs @@ -16,7 +16,7 @@ #![license = "MIT/ASL2"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![feature(default_type_params)] extern crate collections; diff --git a/src/libuuid/lib.rs b/src/libuuid/lib.rs index d2032b9d49281..571bd37dc03b9 100644 --- a/src/libuuid/lib.rs +++ b/src/libuuid/lib.rs @@ -60,7 +60,7 @@ Examples of string representations: #![license = "MIT/ASL2"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![feature(default_type_params)] diff --git a/src/libworkcache/lib.rs b/src/libworkcache/lib.rs index 5ac45d75156b4..01f7ce9794fcb 100644 --- a/src/libworkcache/lib.rs +++ b/src/libworkcache/lib.rs @@ -80,7 +80,7 @@ #![license = "MIT/ASL2"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")] + html_root_url = "http://doc.rust-lang.org/")] #![feature(phase)] #![allow(visible_private_types)] #![deny(deprecated_owned_vector)]