From 73db76015e39d18950d654d3a32ba9053261242f Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 7 Mar 2016 23:55:52 -0800 Subject: [PATCH] doc: Fix a bunch of broken links A few categories: * Links into compiler docs were just all removed as we're not generating compiler docs. * Move up one more level to forcibly go to std docs to fix inlined documentation across the facade crates. --- src/doc/book/choosing-your-guarantees.md | 3 +- src/doc/book/compiler-plugins.md | 57 +++++++------------ src/doc/guide-plugins.md | 2 +- src/doc/style/README.md | 2 +- .../features/functions-and-methods/input.md | 2 +- src/doc/style/style/naming/README.md | 2 +- src/libcollections/btree/set.rs | 4 +- src/libcollections/lib.rs | 8 +++ src/libcollections/slice.rs | 2 +- src/libcollections/str.rs | 2 +- src/libcollections/string.rs | 54 +++++++++--------- src/libcore/any.rs | 2 +- src/libcore/char.rs | 18 +++--- src/libcore/iter.rs | 18 +++--- src/libcore/macros.rs | 8 +-- src/libcore/num/mod.rs | 6 +- src/libcore/slice.rs | 1 + src/libcore/str/mod.rs | 36 ++++++------ src/librand/lib.rs | 1 + src/librustc_unicode/char.rs | 12 ++-- src/libstd/num/f32.rs | 2 +- src/libstd/num/f64.rs | 2 +- src/libstd/primitive_docs.rs | 30 +++++----- 23 files changed, 135 insertions(+), 139 deletions(-) diff --git a/src/doc/book/choosing-your-guarantees.md b/src/doc/book/choosing-your-guarantees.md index f2b92e6dec4dd..50350213074bf 100644 --- a/src/doc/book/choosing-your-guarantees.md +++ b/src/doc/book/choosing-your-guarantees.md @@ -204,7 +204,7 @@ borrow checker. Generally we know that such mutations won't happen in a nested f to check. For large, complicated programs, it becomes useful to put some things in `RefCell`s to make things -simpler. For example, a lot of the maps in [the `ctxt` struct][ctxt] in the Rust compiler internals +simpler. For example, a lot of the maps in the `ctxt` struct in the Rust compiler internals are inside this wrapper. These are only modified once (during creation, which is not right after initialization) or a couple of times in well-separated places. However, since this struct is pervasively used everywhere, juggling mutable and immutable pointers would be hard (perhaps @@ -235,7 +235,6 @@ At runtime each borrow causes a modification/check of the refcount. [cell-mod]: ../std/cell/ [cell]: ../std/cell/struct.Cell.html [refcell]: ../std/cell/struct.RefCell.html -[ctxt]: ../rustc/middle/ty/struct.ctxt.html # Synchronous types diff --git a/src/doc/book/compiler-plugins.md b/src/doc/book/compiler-plugins.md index 800be13a243fb..1af05bfea19a2 100644 --- a/src/doc/book/compiler-plugins.md +++ b/src/doc/book/compiler-plugins.md @@ -8,12 +8,12 @@ extend the compiler's behavior with new syntax extensions, lint checks, etc. A plugin is a dynamic library crate with a designated *registrar* function that registers extensions with `rustc`. Other crates can load these extensions using the crate attribute `#![plugin(...)]`. See the -[`rustc_plugin`](../rustc_plugin/index.html) documentation for more about the +`rustc_plugin` documentation for more about the mechanics of defining and loading a plugin. If present, arguments passed as `#![plugin(foo(... args ...))]` are not interpreted by rustc itself. They are provided to the plugin through the -`Registry`'s [`args` method](../rustc_plugin/registry/struct.Registry.html#method.args). +`Registry`'s `args` method. In the vast majority of cases, a plugin should *only* be used through `#![plugin]` and not through an `extern crate` item. Linking a plugin would @@ -30,7 +30,7 @@ of a library. Plugins can extend Rust's syntax in various ways. One kind of syntax extension is the procedural macro. These are invoked the same way as [ordinary macros](macros.html), but the expansion is performed by arbitrary Rust -code that manipulates [syntax trees](../syntax/ast/index.html) at +code that manipulates syntax trees at compile time. Let's write a plugin @@ -120,11 +120,8 @@ The advantages over a simple `fn(&str) -> u32` are: In addition to procedural macros, you can define new [`derive`](../reference.html#derive)-like attributes and other kinds of -extensions. See -[`Registry::register_syntax_extension`](../rustc_plugin/registry/struct.Registry.html#method.register_syntax_extension) -and the [`SyntaxExtension` -enum](https://doc.rust-lang.org/syntax/ext/base/enum.SyntaxExtension.html). For -a more involved macro example, see +extensions. See `Registry::register_syntax_extension` and the `SyntaxExtension` +enum. For a more involved macro example, see [`regex_macros`](https://github.com/rust-lang/regex/blob/master/regex_macros/src/lib.rs). @@ -132,7 +129,7 @@ a more involved macro example, see Some of the [macro debugging tips](macros.html#debugging-macro-code) are applicable. -You can use [`syntax::parse`](../syntax/parse/index.html) to turn token trees into +You can use `syntax::parse` to turn token trees into higher-level syntax elements like expressions: ```ignore @@ -148,30 +145,21 @@ Looking through [`libsyntax` parser code](https://github.com/rust-lang/rust/blob/master/src/libsyntax/parse/parser.rs) will give you a feel for how the parsing infrastructure works. -Keep the [`Span`s](../syntax/codemap/struct.Span.html) of -everything you parse, for better error reporting. You can wrap -[`Spanned`](../syntax/codemap/struct.Spanned.html) around -your custom data structures. - -Calling -[`ExtCtxt::span_fatal`](../syntax/ext/base/struct.ExtCtxt.html#method.span_fatal) -will immediately abort compilation. It's better to instead call -[`ExtCtxt::span_err`](../syntax/ext/base/struct.ExtCtxt.html#method.span_err) -and return -[`DummyResult`](../syntax/ext/base/struct.DummyResult.html), -so that the compiler can continue and find further errors. - -To print syntax fragments for debugging, you can use -[`span_note`](../syntax/ext/base/struct.ExtCtxt.html#method.span_note) together -with -[`syntax::print::pprust::*_to_string`](https://doc.rust-lang.org/syntax/print/pprust/index.html#functions). - -The example above produced an integer literal using -[`AstBuilder::expr_usize`](../syntax/ext/build/trait.AstBuilder.html#tymethod.expr_usize). +Keep the `Span`s of everything you parse, for better error reporting. You can +wrap `Spanned` around your custom data structures. + +Calling `ExtCtxt::span_fatal` will immediately abort compilation. It's better to +instead call `ExtCtxt::span_err` and return `DummyResult` so that the compiler +can continue and find further errors. + +To print syntax fragments for debugging, you can use `span_note` together with +`syntax::print::pprust::*_to_string`. + +The example above produced an integer literal using `AstBuilder::expr_usize`. As an alternative to the `AstBuilder` trait, `libsyntax` provides a set of -[quasiquote macros](../syntax/ext/quote/index.html). They are undocumented and -very rough around the edges. However, the implementation may be a good -starting point for an improved quasiquote as an ordinary plugin library. +quasiquote macros. They are undocumented and very rough around the edges. +However, the implementation may be a good starting point for an improved +quasiquote as an ordinary plugin library. # Lint plugins @@ -239,12 +227,11 @@ foo.rs:4 fn lintme() { } The components of a lint plugin are: -* one or more `declare_lint!` invocations, which define static - [`Lint`](../rustc/lint/struct.Lint.html) structs; +* one or more `declare_lint!` invocations, which define static `Lint` structs; * a struct holding any state needed by the lint pass (here, none); -* a [`LintPass`](../rustc/lint/trait.LintPass.html) +* a `LintPass` implementation defining how to check each syntax element. A single `LintPass` may call `span_lint` for several different `Lint`s, but should register them all through the `get_lints` method. diff --git a/src/doc/guide-plugins.md b/src/doc/guide-plugins.md index d6495d02e1189..742433b99ac5f 100644 --- a/src/doc/guide-plugins.md +++ b/src/doc/guide-plugins.md @@ -1,4 +1,4 @@ % The (old) Rust Compiler Plugins Guide This content has moved into -[the Rust Programming Language book](book/plugins.html). +[the Rust Programming Language book](book/compiler-plugins.html). diff --git a/src/doc/style/README.md b/src/doc/style/README.md index 5ab1a1d9c10f4..8d837d1a1a916 100644 --- a/src/doc/style/README.md +++ b/src/doc/style/README.md @@ -53,7 +53,7 @@ This document is broken into four parts: cross-cutting topic, starting with [Ownership and resources](ownership/README.md). -* **[APIs for a changing Rust](changing/README.md)** +* **APIs for a changing Rust** discusses the forward-compatibility hazards, especially those that interact with the pre-1.0 library stabilization process. diff --git a/src/doc/style/features/functions-and-methods/input.md b/src/doc/style/features/functions-and-methods/input.md index 9ea1d21816191..9b243bc72ef71 100644 --- a/src/doc/style/features/functions-and-methods/input.md +++ b/src/doc/style/features/functions-and-methods/input.md @@ -76,7 +76,7 @@ needs to make about its arguments. On the other hand, generics can make it more difficult to read and understand a function's signature. Aim for "natural" parameter types that a neither overly concrete nor overly abstract. See the discussion on -[traits](../../traits/README.md) for more guidance. +[traits](../traits/README.md) for more guidance. #### Minimizing ownership assumptions: diff --git a/src/doc/style/style/naming/README.md b/src/doc/style/style/naming/README.md index 9d78721ad3644..2106f32fafade 100644 --- a/src/doc/style/style/naming/README.md +++ b/src/doc/style/style/naming/README.md @@ -101,7 +101,7 @@ The convention for a field `foo: T` is: here may take `&T` or some other type, depending on the context.) Note that this convention is about getters/setters on ordinary data types, *not* -on [builder objects](../ownership/builders.html). +on [builder objects](../../ownership/builders.html). ### Escape hatches [FIXME] diff --git a/src/libcollections/btree/set.rs b/src/libcollections/btree/set.rs index 1cd50c2dcbe9e..a2ad58afc7f9d 100644 --- a/src/libcollections/btree/set.rs +++ b/src/libcollections/btree/set.rs @@ -34,8 +34,8 @@ use Bound; /// to any other item, as determined by the [`Ord`] trait, changes while it is in the set. This is /// normally only possible through [`Cell`], [`RefCell`], global state, I/O, or unsafe code. /// -/// [`BTreeMap`]: ../struct.BTreeMap.html -/// [`Ord`]: ../../core/cmp/trait.Ord.html +/// [`BTreeMap`]: struct.BTreeMap.html +/// [`Ord`]: ../../std/cmp/trait.Ord.html /// [`Cell`]: ../../std/cell/struct.Cell.html /// [`RefCell`]: ../../std/cell/struct.RefCell.html #[derive(Clone, Hash, PartialEq, Eq, Ord, PartialOrd)] diff --git a/src/libcollections/lib.rs b/src/libcollections/lib.rs index 922e1b0fc5d6d..cef6edf68ee8d 100644 --- a/src/libcollections/lib.rs +++ b/src/libcollections/lib.rs @@ -71,13 +71,21 @@ extern crate std; #[cfg(test)] extern crate test; +#[doc(no_inline)] pub use binary_heap::BinaryHeap; +#[doc(no_inline)] pub use btree_map::BTreeMap; +#[doc(no_inline)] pub use btree_set::BTreeSet; +#[doc(no_inline)] pub use linked_list::LinkedList; +#[doc(no_inline)] pub use enum_set::EnumSet; +#[doc(no_inline)] pub use vec_deque::VecDeque; +#[doc(no_inline)] pub use string::String; +#[doc(no_inline)] pub use vec::Vec; // Needed for the vec! macro diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs index 1446d00b9ea6b..69a9899d82bc6 100644 --- a/src/libcollections/slice.rs +++ b/src/libcollections/slice.rs @@ -78,7 +78,7 @@ //! * Further methods that return iterators are `.split()`, `.splitn()`, //! `.chunks()`, `.windows()` and more. //! -//! *[See also the slice primitive type](../primitive.slice.html).* +//! *[See also the slice primitive type](../../std/primitive.slice.html).* #![stable(feature = "rust1", since = "1.0.0")] // Many of the usings in this module are only used in the test configuration. diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs index 5789cd8edfc09..9798e323a6140 100644 --- a/src/libcollections/str.rs +++ b/src/libcollections/str.rs @@ -10,7 +10,7 @@ //! Unicode string slices. //! -//! *[See also the `str` primitive type](../primitive.str.html).* +//! *[See also the `str` primitive type](../../std/primitive.str.html).* #![stable(feature = "rust1", since = "1.0.0")] diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index cae6520bdb286..02190d11b421f 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -79,7 +79,7 @@ use boxed::Box; /// contents of the string. It has a close relationship with its borrowed /// counterpart, the primitive [`str`]. /// -/// [`str`]: ../primitive.str.html +/// [`str`]: ../../std/primitive.str.html /// /// # Examples /// @@ -99,7 +99,7 @@ use boxed::Box; /// hello.push_str("orld!"); /// ``` /// -/// [`char`]: ../primitive.char.html +/// [`char`]: ../../std/primitive.char.html /// [`push()`]: #method.push /// [`push_str()`]: #method.push_str /// @@ -131,7 +131,7 @@ use boxed::Box; /// println!("The first letter of s is {}", s[0]); // ERROR!!! /// ``` /// -/// [`OsString`]: ../ffi/struct.OsString.html +/// [`OsString`]: ../../std/ffi/struct.OsString.html /// /// Indexing is intended to be a constant-time operation, but UTF-8 encoding /// does not allow us to do this. Furtheremore, it's not clear what sort of @@ -156,8 +156,8 @@ use boxed::Box; /// takes_str(&s); /// ``` /// -/// [`&str`]: ../primitive.str.html -/// [`Deref`]: ../ops/trait.Deref.html +/// [`&str`]: ../../std/primitive.str.html +/// [`Deref`]: ../../std/ops/trait.Deref.html /// /// This will create a [`&str`] from the `String` and pass it in. This /// conversion is very inexpensive, and so generally, functions will accept @@ -280,10 +280,10 @@ pub struct String { /// an analogue to `FromUtf8Error`, and you can get one from a `FromUtf8Error` /// through the [`utf8_error()`] method. /// -/// [`Utf8Error`]: ../str/struct.Utf8Error.html -/// [`std::str`]: ../str/index.html -/// [`u8`]: ../primitive.u8.html -/// [`&str`]: ../primitive.str.html +/// [`Utf8Error`]: ../../std/str/struct.Utf8Error.html +/// [`std::str`]: ../../std/str/index.html +/// [`u8`]: ../../std/primitive.u8.html +/// [`&str`]: ../../std/primitive.str.html /// [`utf8_error()`]: #method.utf8_error /// /// # Examples @@ -414,9 +414,9 @@ impl String { /// requires that it is valid UTF-8. `from_utf8()` checks to ensure that /// the bytes are valid UTF-8, and then does the conversion. /// - /// [`&str`]: ../primitive.str.html - /// [`u8`]: ../primitive.u8.html - /// [`Vec`]: ../vec/struct.Vec.html + /// [`&str`]: ../../std/primitive.str.html + /// [`u8`]: ../../std/primitive.u8.html + /// [`Vec`]: ../../std/vec/struct.Vec.html /// /// If you are sure that the byte slice is valid UTF-8, and you don't want /// to incur the overhead of the validity check, there is an unsafe version @@ -431,7 +431,7 @@ impl String { /// If you need a `&str` instead of a `String`, consider /// [`str::from_utf8()`]. /// - /// [`str::from_utf8()`]: ../str/fn.from_utf8.html + /// [`str::from_utf8()`]: ../../std/str/fn.from_utf8.html /// /// # Errors /// @@ -488,8 +488,8 @@ impl String { /// `from_utf8_lossy()` will replace any invalid UTF-8 sequences with /// `U+FFFD REPLACEMENT CHARACTER`, which looks like this: � /// - /// [`u8`]: ../primitive.u8.html - /// [byteslice]: ../primitive.slice.html + /// [`u8`]: ../../std/primitive.u8.html + /// [byteslice]: ../../std/primitive.slice.html /// /// If you are sure that the byte slice is valid UTF-8, and you don't want /// to incur the overhead of the conversion, there is an unsafe version @@ -504,7 +504,7 @@ impl String { /// it's already valid UTF-8, we don't need a new allocation. This return /// type allows us to handle both cases. /// - /// [`Cow<'a, str>`]: ../borrow/enum.Cow.html + /// [`Cow<'a, str>`]: ../../std/borrow/enum.Cow.html /// /// # Examples /// @@ -1014,7 +1014,7 @@ impl String { /// Panics if `new_len` > current length, or if `new_len` does not lie on a /// [`char`] boundary. /// - /// [`char`]: ../primitive.char.html + /// [`char`]: ../../std/primitive.char.html /// /// # Examples /// @@ -1076,7 +1076,7 @@ impl String { /// Panics if `idx` is larger than or equal to the `String`'s length, /// or if it does not lie on a [`char`] boundary. /// - /// [`char`]: ../primitive.char.html + /// [`char`]: ../../std/primitive.char.html /// /// # Examples /// @@ -1116,7 +1116,7 @@ impl String { /// Panics if `idx` is larger than the `String`'s length, or if it does not /// lie on a [`char`] boundary. /// - /// [`char`]: ../primitive.char.html + /// [`char`]: ../../std/primitive.char.html /// /// # Examples /// @@ -1255,7 +1255,7 @@ impl String { /// Panics if the starting point or end point do not lie on a [`char`] /// boundary, or if they're out of bounds. /// - /// [`char`]: ../primitive.char.html + /// [`char`]: ../../std/primitive.char.html /// /// # Examples /// @@ -1353,10 +1353,10 @@ impl FromUtf8Error { /// an analogue to `FromUtf8Error`. See its documentation for more details /// on using it. /// - /// [`Utf8Error`]: ../str/struct.Utf8Error.html - /// [`std::str`]: ../str/index.html - /// [`u8`]: ../primitive.u8.html - /// [`&str`]: ../primitive.str.html + /// [`Utf8Error`]: ../../std/str/struct.Utf8Error.html + /// [`std::str`]: ../../std/str/index.html + /// [`u8`]: ../../std/primitive.u8.html + /// [`&str`]: ../../std/primitive.str.html /// /// # Examples /// @@ -1695,9 +1695,9 @@ impl ops::DerefMut for String { /// [`String`] without error, this type will never actually be returned. As /// such, it is only here to satisfy said signature, and is useless otherwise. /// -/// [`FromStr`]: ../str/trait.FromStr.html +/// [`FromStr`]: ../../std/str/trait.FromStr.html /// [`String`]: struct.String.html -/// [`from_str()`]: ../str/trait.FromStr.html#tymethod.from_str +/// [`from_str()`]: ../../std/str/trait.FromStr.html#tymethod.from_str #[stable(feature = "str_parse_error", since = "1.5.0")] #[derive(Copy)] pub enum ParseError {} @@ -1749,7 +1749,7 @@ impl Eq for ParseError {} /// [`Display`] should be implemented instead, and you get the `ToString` /// implementation for free. /// -/// [`Display`]: ../fmt/trait.Display.html +/// [`Display`]: ../../std/fmt/trait.Display.html #[stable(feature = "rust1", since = "1.0.0")] pub trait ToString { /// Converts the given value to a `String`. diff --git a/src/libcore/any.rs b/src/libcore/any.rs index cb9bf935cdb58..dfd2ba9154d53 100644 --- a/src/libcore/any.rs +++ b/src/libcore/any.rs @@ -22,7 +22,7 @@ //! Note that &Any is limited to testing whether a value is of a specified //! concrete type, and cannot be used to test whether a type implements a trait. //! -//! [`Box`]: ../boxed/struct.Box.html +//! [`Box`]: ../../std/boxed/struct.Box.html //! //! # Examples //! diff --git a/src/libcore/char.rs b/src/libcore/char.rs index 0c3807d8ca0b5..a23b303f4bab1 100644 --- a/src/libcore/char.rs +++ b/src/libcore/char.rs @@ -69,7 +69,7 @@ const MAX_THREE_B: u32 = 0x10000; /// Point], but only ones within a certain range. `MAX` is the highest valid /// code point that's a valid [Unicode Scalar Value]. /// -/// [`char`]: ../primitive.char.html +/// [`char`]: ../../std/primitive.char.html /// [Unicode Scalar Value]: http://www.unicode.org/glossary/#unicode_scalar_value /// [Code Point]: http://www.unicode.org/glossary/#code_point #[stable(feature = "rust1", since = "1.0.0")] @@ -91,8 +91,8 @@ pub const MAX: char = '\u{10ffff}'; /// [`char`]s. `from_u32()` will return `None` if the input is not a valid value /// for a [`char`]. /// -/// [`char`]: ../primitive.char.html -/// [`u32`]: ../primitive.u32.html +/// [`char`]: ../../std/primitive.char.html +/// [`u32`]: ../../std/primitive.u32.html /// [`as`]: ../../book/casting-between-types.html#as /// /// For an unsafe version of this function which ignores these checks, see @@ -148,8 +148,8 @@ pub fn from_u32(i: u32) -> Option { /// [`char`]s. `from_u32_unchecked()` will ignore this, and blindly cast to /// [`char`], possibly creating an invalid one. /// -/// [`char`]: ../primitive.char.html -/// [`u32`]: ../primitive.u32.html +/// [`char`]: ../../std/primitive.char.html +/// [`u32`]: ../../std/primitive.u32.html /// [`as`]: ../../book/casting-between-types.html#as /// /// # Safety @@ -414,8 +414,8 @@ pub fn encode_utf16_raw(mut ch: u32, dst: &mut [u16]) -> Option { /// This `struct` is created by the [`escape_unicode()`] method on [`char`]. See /// its documentation for more. /// -/// [`escape_unicode()`]: ../primitive.char.html#method.escape_unicode -/// [`char`]: ../primitive.char.html +/// [`escape_unicode()`]: ../../std/primitive.char.html#method.escape_unicode +/// [`char`]: ../../std/primitive.char.html #[derive(Clone)] #[stable(feature = "rust1", since = "1.0.0")] pub struct EscapeUnicode { @@ -494,8 +494,8 @@ impl Iterator for EscapeUnicode { /// This `struct` is created by the [`escape_default()`] method on [`char`]. See /// its documentation for more. /// -/// [`escape_default()`]: ../primitive.char.html#method.escape_default -/// [`char`]: ../primitive.char.html +/// [`escape_default()`]: ../../std/primitive.char.html#method.escape_default +/// [`char`]: ../../std/primitive.char.html #[derive(Clone)] #[stable(feature = "rust1", since = "1.0.0")] pub struct EscapeDefault { diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index fb8eda820f52c..06821ff94f712 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -65,7 +65,7 @@ //! //! [`Iterator`]: trait.Iterator.html //! [`next()`]: trait.Iterator.html#tymethod.next -//! [`Option`]: ../option/enum.Option.html +//! [`Option`]: ../../std/option/enum.Option.html //! //! # The three forms of iteration //! @@ -804,7 +804,7 @@ pub trait Iterator { /// closure returns `None`, it will try again, and call the closure on the /// next element, seeing if it will return `Some`. /// - /// [`Option`]: ../option/enum.Option.html + /// [`Option`]: ../../std/option/enum.Option.html /// /// Why `filter_map()` and not just [`filter()`].[`map()`]? The key is in this /// part: @@ -866,7 +866,7 @@ pub trait Iterator { /// different sized integer, the [`zip()`] function provides similar /// functionality. /// - /// [`usize`]: ../primitive.usize.html + /// [`usize`]: ../../std/primitive.usize.html /// [`zip()`]: #method.zip /// /// # Overflow Behavior @@ -875,7 +875,7 @@ pub trait Iterator { /// [`usize::MAX`] elements either produces the wrong result or panics. If /// debug assertions are enabled, a panic is guaranteed. /// - /// [`usize::MAX`]: ../usize/constant.MAX.html + /// [`usize::MAX`]: ../../std/usize/constant.MAX.html /// /// # Panics /// @@ -1151,7 +1151,7 @@ pub trait Iterator { /// iterator and the return value from the closure, an [`Option`], is /// yielded by the iterator. /// - /// [`Option`]: ../option/enum.Option.html + /// [`Option`]: ../../std/option/enum.Option.html /// /// # Examples /// @@ -1385,9 +1385,9 @@ pub trait Iterator { /// be thought of as single `Result, E>`. See the examples /// below for more. /// - /// [`String`]: ../string/struct.String.html - /// [`Result`]: ../result/enum.Result.html - /// [`char`]: ../primitive.char.html + /// [`String`]: ../../std/string/struct.String.html + /// [`Result`]: ../../std/result/enum.Result.html + /// [`char`]: ../../std/primitive.char.html /// /// Because `collect()` is so general, it can cause problems with type /// inference. As such, `collect()` is one of the few times you'll see @@ -1412,7 +1412,7 @@ pub trait Iterator { /// Note that we needed the `: Vec` on the left-hand side. This is because /// we could collect into, for example, a [`VecDeque`] instead: /// - /// [`VecDeque`]: ../collections/struct.VecDeque.html + /// [`VecDeque`]: ../../std/collections/struct.VecDeque.html /// /// ``` /// use std::collections::VecDeque; diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs index 154ca30c62dd1..f923668688b8c 100644 --- a/src/libcore/macros.rs +++ b/src/libcore/macros.rs @@ -206,8 +206,8 @@ macro_rules! try { /// /// See [`std::fmt`][fmt] for more information on format syntax. /// -/// [fmt]: fmt/index.html -/// [write]: io/trait.Write.html +/// [fmt]: ../std/fmt/index.html +/// [write]: ../std/io/trait.Write.html /// /// # Examples /// @@ -232,8 +232,8 @@ macro_rules! write { /// /// See [`std::fmt`][fmt] for more information on format syntax. /// -/// [fmt]: fmt/index.html -/// [write]: io/trait.Write.html +/// [fmt]: ../std/fmt/index.html +/// [write]: ../std/io/trait.Write.html /// /// # Examples /// diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index ed370bb91648f..0b306c810b195 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -2179,8 +2179,8 @@ impl usize { /// This `enum` is used as the return type for [`f32::classify()`] and [`f64::classify()`]. See /// their documentation for more. /// -/// [`f32::classify()`]: ../primitive.f32.html#method.classify -/// [`f64::classify()`]: ../primitive.f64.html#method.classify +/// [`f32::classify()`]: ../../std/primitive.f32.html#method.classify +/// [`f64::classify()`]: ../../std/primitive.f64.html#method.classify #[derive(Copy, Clone, PartialEq, Debug)] #[stable(feature = "rust1", since = "1.0.0")] pub enum FpCategory { @@ -2411,7 +2411,7 @@ fn from_str_radix(src: &str, radix: u32) /// This error is used as the error type for the `from_str_radix()` functions /// on the primitive integer types, such as [`i8::from_str_radix()`]. /// -/// [`i8::from_str_radix()`]: ../std/primitive.i8.html#method.from_str_radix +/// [`i8::from_str_radix()`]: ../../std/primitive.i8.html#method.from_str_radix #[derive(Debug, Clone, PartialEq)] #[stable(feature = "rust1", since = "1.0.0")] pub struct ParseIntError { kind: IntErrorKind } diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs index 8acd0c8f2cf06..e59e8567d5b62 100644 --- a/src/libcore/slice.rs +++ b/src/libcore/slice.rs @@ -908,6 +908,7 @@ impl<'a, T> ExactSizeIterator for IterMut<'a, T> {} /// An internal abstraction over the splitting iterators, so that /// splitn, splitn_mut etc can be implemented once. +#[doc(hidden)] trait SplitIter: DoubleEndedIterator { /// Mark the underlying iterator as complete, extracting the remaining /// portion of the slice. diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index 79f925aaab0ae..4480e7095e4e6 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -42,8 +42,8 @@ pub mod pattern; /// [`str`]'s [`parse()`] method. See [`parse()`]'s documentation for examples. /// /// [`from_str()`]: #tymethod.from_str -/// [`str`]: ../primitive.str.html -/// [`parse()`]: ../primitive.str.html#method.parse +/// [`str`]: ../../std/primitive.str.html +/// [`parse()`]: ../../std/primitive.str.html#method.parse #[stable(feature = "rust1", since = "1.0.0")] pub trait FromStr: Sized { /// The associated error which can be returned from parsing. @@ -60,7 +60,7 @@ pub trait FromStr: Sized { /// /// Basic usage with [`i32`][ithirtytwo], a type that implements `FromStr`: /// - /// [ithirtytwo]: ../primitive.i32.html + /// [ithirtytwo]: ../../std/primitive.i32.html /// /// ``` /// use std::str::FromStr; @@ -182,7 +182,7 @@ impl Utf8Error { /// If you need a `String` instead of a `&str`, consider /// [`String::from_utf8()`][string]. /// -/// [string]: ../string/struct.String.html#method.from_utf8 +/// [string]: ../../std/string/struct.String.html#method.from_utf8 /// /// Because you can stack-allocate a `[u8; N]`, and you can take a `&[u8]` of /// it, this function is one way to have a stack-allocated string. There is @@ -322,7 +322,7 @@ Section: Iterators /// /// Created with the method [`chars()`]. /// -/// [`chars()`]: ../primitive.str.html#method.chars +/// [`chars()`]: ../../std/primitive.str.html#method.chars #[derive(Clone)] #[stable(feature = "rust1", since = "1.0.0")] pub struct Chars<'a> { @@ -531,7 +531,7 @@ impl<'a> CharIndices<'a> { /// /// Created with the method [`bytes()`]. /// -/// [`bytes()`]: ../primitive.str.html#method.bytes +/// [`bytes()`]: ../../std/primitive.str.html#method.bytes #[stable(feature = "rust1", since = "1.0.0")] #[derive(Clone)] pub struct Bytes<'a>(Cloned>); @@ -816,12 +816,12 @@ generate_pattern_iterators! { forward: /// Created with the method [`split()`]. /// - /// [`split()`]: ../primitive.str.html#method.split + /// [`split()`]: ../../std/primitive.str.html#method.split struct Split; reverse: /// Created with the method [`rsplit()`]. /// - /// [`rsplit()`]: ../primitive.str.html#method.rsplit + /// [`rsplit()`]: ../../std/primitive.str.html#method.rsplit struct RSplit; stability: #[stable(feature = "rust1", since = "1.0.0")] @@ -834,12 +834,12 @@ generate_pattern_iterators! { forward: /// Created with the method [`split_terminator()`]. /// - /// [`split_terminator()`]: ../primitive.str.html#method.split_terminator + /// [`split_terminator()`]: ../../std/primitive.str.html#method.split_terminator struct SplitTerminator; reverse: /// Created with the method [`rsplit_terminator()`]. /// - /// [`rsplit_terminator()`]: ../primitive.str.html#method.rsplit_terminator + /// [`rsplit_terminator()`]: ../../std/primitive.str.html#method.rsplit_terminator struct RSplitTerminator; stability: #[stable(feature = "rust1", since = "1.0.0")] @@ -884,12 +884,12 @@ generate_pattern_iterators! { forward: /// Created with the method [`splitn()`]. /// - /// [`splitn()`]: ../primitive.str.html#method.splitn + /// [`splitn()`]: ../../std/primitive.str.html#method.splitn struct SplitN; reverse: /// Created with the method [`rsplitn()`]. /// - /// [`rsplitn()`]: ../primitive.str.html#method.rsplitn + /// [`rsplitn()`]: ../../std/primitive.str.html#method.rsplitn struct RSplitN; stability: #[stable(feature = "rust1", since = "1.0.0")] @@ -926,12 +926,12 @@ generate_pattern_iterators! { forward: /// Created with the method [`match_indices()`]. /// - /// [`match_indices()`]: ../primitive.str.html#method.match_indices + /// [`match_indices()`]: ../../std/primitive.str.html#method.match_indices struct MatchIndices; reverse: /// Created with the method [`rmatch_indices()`]. /// - /// [`rmatch_indices()`]: ../primitive.str.html#method.rmatch_indices + /// [`rmatch_indices()`]: ../../std/primitive.str.html#method.rmatch_indices struct RMatchIndices; stability: #[stable(feature = "str_match_indices", since = "1.5.0")] @@ -970,12 +970,12 @@ generate_pattern_iterators! { forward: /// Created with the method [`matches()`]. /// - /// [`matches()`]: ../primitive.str.html#method.matches + /// [`matches()`]: ../../std/primitive.str.html#method.matches struct Matches; reverse: /// Created with the method [`rmatches()`]. /// - /// [`rmatches()`]: ../primitive.str.html#method.rmatches + /// [`rmatches()`]: ../../std/primitive.str.html#method.rmatches struct RMatches; stability: #[stable(feature = "str_matches", since = "1.2.0")] @@ -986,7 +986,7 @@ generate_pattern_iterators! { /// Created with the method [`lines()`]. /// -/// [`lines()`]: ../primitive.str.html#method.lines +/// [`lines()`]: ../../std/primitive.str.html#method.lines #[stable(feature = "rust1", since = "1.0.0")] #[derive(Clone)] pub struct Lines<'a>(Map, LinesAnyMap>); @@ -1016,7 +1016,7 @@ impl<'a> DoubleEndedIterator for Lines<'a> { /// Created with the method [`lines_any()`]. /// -/// [`lines_any()`]: ../primitive.str.html#method.lines_any +/// [`lines_any()`]: ../../std/primitive.str.html#method.lines_any #[stable(feature = "rust1", since = "1.0.0")] #[rustc_deprecated(since = "1.4.0", reason = "use lines()/Lines instead now")] #[derive(Clone)] diff --git a/src/librand/lib.rs b/src/librand/lib.rs index 531be63b7bb73..f6b81a5dad37b 100644 --- a/src/librand/lib.rs +++ b/src/librand/lib.rs @@ -70,6 +70,7 @@ mod rand_impls; // needed by librand; this is necessary because librand doesn't // depend on libstd. This will go away when librand is integrated // into libstd. +#[doc(hidden)] trait FloatMath : Sized { fn exp(self) -> Self; fn ln(self) -> Self; diff --git a/src/librustc_unicode/char.rs b/src/librustc_unicode/char.rs index 115002867555d..5bc5c78616093 100644 --- a/src/librustc_unicode/char.rs +++ b/src/librustc_unicode/char.rs @@ -19,7 +19,7 @@ //! [Unicode code point]: http://www.unicode.org/glossary/#code_point //! //! This module exists for technical reasons, the primary documentation for -//! `char` is directly on [the `char` primitive type](../primitive.char.html) +//! `char` is directly on [the `char` primitive type](../../std/primitive.char.html) //! itself. //! //! This module is the home of the iterator implementations for the iterators @@ -46,8 +46,8 @@ pub use tables::UNICODE_VERSION; /// This `struct` is created by the [`to_lowercase()`] method on [`char`]. See /// its documentation for more. /// -/// [`to_lowercase()`]: ../primitive.char.html#method.to_lowercase -/// [`char`]: ../primitive.char.html +/// [`to_lowercase()`]: ../../std/primitive.char.html#method.to_lowercase +/// [`char`]: ../../std/primitive.char.html #[stable(feature = "rust1", since = "1.0.0")] pub struct ToLowercase(CaseMappingIter); @@ -64,8 +64,8 @@ impl Iterator for ToLowercase { /// This `struct` is created by the [`to_uppercase()`] method on [`char`]. See /// its documentation for more. /// -/// [`to_uppercase()`]: ../primitive.char.html#method.to_uppercase -/// [`char`]: ../primitive.char.html +/// [`to_uppercase()`]: ../../std/primitive.char.html#method.to_uppercase +/// [`char`]: ../../std/primitive.char.html #[stable(feature = "rust1", since = "1.0.0")] pub struct ToUppercase(CaseMappingIter); @@ -968,6 +968,6 @@ impl> Iterator for DecodeUtf16 { /// `U+FFFD REPLACEMENT CHARACTER` (�) is used in Unicode to represent a decoding error. /// It can occur, for example, when giving ill-formed UTF-8 bytes to -/// [`String::from_utf8_lossy`](../string/struct.String.html#method.from_utf8_lossy). +/// [`String::from_utf8_lossy`](../../std/string/struct.String.html#method.from_utf8_lossy). #[unstable(feature = "decode_utf16", reason = "recently added", issue = "27830")] pub const REPLACEMENT_CHARACTER: char = '\u{FFFD}'; diff --git a/src/libstd/num/f32.rs b/src/libstd/num/f32.rs index 7f57d6dc650ba..3705302592432 100644 --- a/src/libstd/num/f32.rs +++ b/src/libstd/num/f32.rs @@ -262,7 +262,7 @@ impl f32 { /// /// assert!(abs_difference <= f32::EPSILON); /// ``` - /// [floating-point]: ../../../../../reference.html#machine-types + /// [floating-point]: ../reference.html#machine-types #[unstable(feature = "float_extras", reason = "signature is undecided", issue = "27752")] #[inline] diff --git a/src/libstd/num/f64.rs b/src/libstd/num/f64.rs index a39311f7d108d..446e22a20ad7d 100644 --- a/src/libstd/num/f64.rs +++ b/src/libstd/num/f64.rs @@ -206,7 +206,7 @@ impl f64 { /// /// assert!(abs_difference < 1e-10); /// ``` - /// [floating-point]: ../../../../../reference.html#machine-types + /// [floating-point]: ../reference.html#machine-types #[unstable(feature = "float_extras", reason = "signature is undecided", issue = "27752")] #[inline] diff --git a/src/libstd/primitive_docs.rs b/src/libstd/primitive_docs.rs index 24e35b87bf284..65ed879c4ada4 100644 --- a/src/libstd/primitive_docs.rs +++ b/src/libstd/primitive_docs.rs @@ -27,11 +27,11 @@ /// assert!(!bool_val); /// ``` /// -/// [`assert!`]: std/macro.assert!.html -/// [`if` conditionals]: ../../book/if.html -/// [`BitAnd`]: ../ops/trait.BitAnd.html -/// [`BitOr`]: ../ops/trait.BitOr.html -/// [`Not`]: ../ops/trait.Not.html +/// [`assert!`]: macro.assert!.html +/// [`if` conditionals]: ../book/if.html +/// [`BitAnd`]: ops/trait.BitAnd.html +/// [`BitOr`]: ops/trait.BitOr.html +/// [`Not`]: ops/trait.Not.html /// /// # Examples /// @@ -54,7 +54,7 @@ /// } /// ``` /// -/// Also, since `bool` implements the [`Copy`](../marker/trait.Copy.html) trait, we don't +/// Also, since `bool` implements the [`Copy`](marker/trait.Copy.html) trait, we don't /// have to worry about the move semantics (just like the integer and float primitives). mod prim_bool { } @@ -421,7 +421,7 @@ mod prim_str { } /// assert_eq!(tuple.2, 'c'); /// ``` /// -/// For more about tuples, see [the book](../../book/primitive-types.html#tuples). +/// For more about tuples, see [the book](../book/primitive-types.html#tuples). /// /// # Trait implementations /// @@ -437,14 +437,14 @@ mod prim_str { } /// * [`Default`] /// * [`Hash`] /// -/// [`Clone`]: ../clone/trait.Clone.html -/// [`PartialEq`]: ../cmp/trait.PartialEq.html -/// [`Eq`]: ../cmp/trait.Eq.html -/// [`PartialOrd`]: ../cmp/trait.PartialOrd.html -/// [`Ord`]: ../cmp/trait.Ord.html -/// [`Debug`]: ../fmt/trait.Debug.html -/// [`Default`]: ../default/trait.Default.html -/// [`Hash`]: ../hash/trait.Hash.html +/// [`Clone`]: clone/trait.Clone.html +/// [`PartialEq`]: cmp/trait.PartialEq.html +/// [`Eq`]: cmp/trait.Eq.html +/// [`PartialOrd`]: cmp/trait.PartialOrd.html +/// [`Ord`]: cmp/trait.Ord.html +/// [`Debug`]: fmt/trait.Debug.html +/// [`Default`]: default/trait.Default.html +/// [`Hash`]: hash/trait.Hash.html /// /// Due to a temporary restriction in Rust's type system, these traits are only /// implemented on tuples of arity 32 or less. In the future, this may change.