Skip to content

Commit 73db760

Browse files
committed
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.
1 parent 16fefc5 commit 73db760

File tree

23 files changed

+135
-139
lines changed

23 files changed

+135
-139
lines changed

src/doc/book/choosing-your-guarantees.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ borrow checker. Generally we know that such mutations won't happen in a nested f
204204
to check.
205205

206206
For large, complicated programs, it becomes useful to put some things in `RefCell`s to make things
207-
simpler. For example, a lot of the maps in [the `ctxt` struct][ctxt] in the Rust compiler internals
207+
simpler. For example, a lot of the maps in the `ctxt` struct in the Rust compiler internals
208208
are inside this wrapper. These are only modified once (during creation, which is not right after
209209
initialization) or a couple of times in well-separated places. However, since this struct is
210210
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.
235235
[cell-mod]: ../std/cell/
236236
[cell]: ../std/cell/struct.Cell.html
237237
[refcell]: ../std/cell/struct.RefCell.html
238-
[ctxt]: ../rustc/middle/ty/struct.ctxt.html
239238

240239
# Synchronous types
241240

src/doc/book/compiler-plugins.md

Lines changed: 22 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ extend the compiler's behavior with new syntax extensions, lint checks, etc.
88
A plugin is a dynamic library crate with a designated *registrar* function that
99
registers extensions with `rustc`. Other crates can load these extensions using
1010
the crate attribute `#![plugin(...)]`. See the
11-
[`rustc_plugin`](../rustc_plugin/index.html) documentation for more about the
11+
`rustc_plugin` documentation for more about the
1212
mechanics of defining and loading a plugin.
1313

1414
If present, arguments passed as `#![plugin(foo(... args ...))]` are not
1515
interpreted by rustc itself. They are provided to the plugin through the
16-
`Registry`'s [`args` method](../rustc_plugin/registry/struct.Registry.html#method.args).
16+
`Registry`'s `args` method.
1717

1818
In the vast majority of cases, a plugin should *only* be used through
1919
`#![plugin]` and not through an `extern crate` item. Linking a plugin would
@@ -30,7 +30,7 @@ of a library.
3030
Plugins can extend Rust's syntax in various ways. One kind of syntax extension
3131
is the procedural macro. These are invoked the same way as [ordinary
3232
macros](macros.html), but the expansion is performed by arbitrary Rust
33-
code that manipulates [syntax trees](../syntax/ast/index.html) at
33+
code that manipulates syntax trees at
3434
compile time.
3535

3636
Let's write a plugin
@@ -120,19 +120,16 @@ The advantages over a simple `fn(&str) -> u32` are:
120120

121121
In addition to procedural macros, you can define new
122122
[`derive`](../reference.html#derive)-like attributes and other kinds of
123-
extensions. See
124-
[`Registry::register_syntax_extension`](../rustc_plugin/registry/struct.Registry.html#method.register_syntax_extension)
125-
and the [`SyntaxExtension`
126-
enum](https://doc.rust-lang.org/syntax/ext/base/enum.SyntaxExtension.html). For
127-
a more involved macro example, see
123+
extensions. See `Registry::register_syntax_extension` and the `SyntaxExtension`
124+
enum. For a more involved macro example, see
128125
[`regex_macros`](https://github.com/rust-lang/regex/blob/master/regex_macros/src/lib.rs).
129126

130127

131128
## Tips and tricks
132129

133130
Some of the [macro debugging tips](macros.html#debugging-macro-code) are applicable.
134131

135-
You can use [`syntax::parse`](../syntax/parse/index.html) to turn token trees into
132+
You can use `syntax::parse` to turn token trees into
136133
higher-level syntax elements like expressions:
137134

138135
```ignore
@@ -148,30 +145,21 @@ Looking through [`libsyntax` parser
148145
code](https://github.com/rust-lang/rust/blob/master/src/libsyntax/parse/parser.rs)
149146
will give you a feel for how the parsing infrastructure works.
150147

151-
Keep the [`Span`s](../syntax/codemap/struct.Span.html) of
152-
everything you parse, for better error reporting. You can wrap
153-
[`Spanned`](../syntax/codemap/struct.Spanned.html) around
154-
your custom data structures.
155-
156-
Calling
157-
[`ExtCtxt::span_fatal`](../syntax/ext/base/struct.ExtCtxt.html#method.span_fatal)
158-
will immediately abort compilation. It's better to instead call
159-
[`ExtCtxt::span_err`](../syntax/ext/base/struct.ExtCtxt.html#method.span_err)
160-
and return
161-
[`DummyResult`](../syntax/ext/base/struct.DummyResult.html),
162-
so that the compiler can continue and find further errors.
163-
164-
To print syntax fragments for debugging, you can use
165-
[`span_note`](../syntax/ext/base/struct.ExtCtxt.html#method.span_note) together
166-
with
167-
[`syntax::print::pprust::*_to_string`](https://doc.rust-lang.org/syntax/print/pprust/index.html#functions).
168-
169-
The example above produced an integer literal using
170-
[`AstBuilder::expr_usize`](../syntax/ext/build/trait.AstBuilder.html#tymethod.expr_usize).
148+
Keep the `Span`s of everything you parse, for better error reporting. You can
149+
wrap `Spanned` around your custom data structures.
150+
151+
Calling `ExtCtxt::span_fatal` will immediately abort compilation. It's better to
152+
instead call `ExtCtxt::span_err` and return `DummyResult` so that the compiler
153+
can continue and find further errors.
154+
155+
To print syntax fragments for debugging, you can use `span_note` together with
156+
`syntax::print::pprust::*_to_string`.
157+
158+
The example above produced an integer literal using `AstBuilder::expr_usize`.
171159
As an alternative to the `AstBuilder` trait, `libsyntax` provides a set of
172-
[quasiquote macros](../syntax/ext/quote/index.html). They are undocumented and
173-
very rough around the edges. However, the implementation may be a good
174-
starting point for an improved quasiquote as an ordinary plugin library.
160+
quasiquote macros. They are undocumented and very rough around the edges.
161+
However, the implementation may be a good starting point for an improved
162+
quasiquote as an ordinary plugin library.
175163

176164

177165
# Lint plugins
@@ -239,12 +227,11 @@ foo.rs:4 fn lintme() { }
239227

240228
The components of a lint plugin are:
241229

242-
* one or more `declare_lint!` invocations, which define static
243-
[`Lint`](../rustc/lint/struct.Lint.html) structs;
230+
* one or more `declare_lint!` invocations, which define static `Lint` structs;
244231

245232
* a struct holding any state needed by the lint pass (here, none);
246233

247-
* a [`LintPass`](../rustc/lint/trait.LintPass.html)
234+
* a `LintPass`
248235
implementation defining how to check each syntax element. A single
249236
`LintPass` may call `span_lint` for several different `Lint`s, but should
250237
register them all through the `get_lints` method.

src/doc/guide-plugins.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
% The (old) Rust Compiler Plugins Guide
22

33
This content has moved into
4-
[the Rust Programming Language book](book/plugins.html).
4+
[the Rust Programming Language book](book/compiler-plugins.html).

src/doc/style/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ This document is broken into four parts:
5353
cross-cutting topic, starting with
5454
[Ownership and resources](ownership/README.md).
5555

56-
* **[APIs for a changing Rust](changing/README.md)**
56+
* **APIs for a changing Rust**
5757
discusses the forward-compatibility hazards, especially those that interact
5858
with the pre-1.0 library stabilization process.
5959

src/doc/style/features/functions-and-methods/input.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ needs to make about its arguments.
7676
On the other hand, generics can make it more difficult to read and understand a
7777
function's signature. Aim for "natural" parameter types that a neither overly
7878
concrete nor overly abstract. See the discussion on
79-
[traits](../../traits/README.md) for more guidance.
79+
[traits](../traits/README.md) for more guidance.
8080

8181

8282
#### Minimizing ownership assumptions:

src/doc/style/style/naming/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ The convention for a field `foo: T` is:
101101
here may take `&T` or some other type, depending on the context.)
102102

103103
Note that this convention is about getters/setters on ordinary data types, *not*
104-
on [builder objects](../ownership/builders.html).
104+
on [builder objects](../../ownership/builders.html).
105105

106106
### Escape hatches [FIXME]
107107

src/libcollections/btree/set.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ use Bound;
3434
/// to any other item, as determined by the [`Ord`] trait, changes while it is in the set. This is
3535
/// normally only possible through [`Cell`], [`RefCell`], global state, I/O, or unsafe code.
3636
///
37-
/// [`BTreeMap`]: ../struct.BTreeMap.html
38-
/// [`Ord`]: ../../core/cmp/trait.Ord.html
37+
/// [`BTreeMap`]: struct.BTreeMap.html
38+
/// [`Ord`]: ../../std/cmp/trait.Ord.html
3939
/// [`Cell`]: ../../std/cell/struct.Cell.html
4040
/// [`RefCell`]: ../../std/cell/struct.RefCell.html
4141
#[derive(Clone, Hash, PartialEq, Eq, Ord, PartialOrd)]

src/libcollections/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,21 @@ extern crate std;
7171
#[cfg(test)]
7272
extern crate test;
7373

74+
#[doc(no_inline)]
7475
pub use binary_heap::BinaryHeap;
76+
#[doc(no_inline)]
7577
pub use btree_map::BTreeMap;
78+
#[doc(no_inline)]
7679
pub use btree_set::BTreeSet;
80+
#[doc(no_inline)]
7781
pub use linked_list::LinkedList;
82+
#[doc(no_inline)]
7883
pub use enum_set::EnumSet;
84+
#[doc(no_inline)]
7985
pub use vec_deque::VecDeque;
86+
#[doc(no_inline)]
8087
pub use string::String;
88+
#[doc(no_inline)]
8189
pub use vec::Vec;
8290

8391
// Needed for the vec! macro

src/libcollections/slice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
//! * Further methods that return iterators are `.split()`, `.splitn()`,
7979
//! `.chunks()`, `.windows()` and more.
8080
//!
81-
//! *[See also the slice primitive type](../primitive.slice.html).*
81+
//! *[See also the slice primitive type](../../std/primitive.slice.html).*
8282
#![stable(feature = "rust1", since = "1.0.0")]
8383

8484
// Many of the usings in this module are only used in the test configuration.

src/libcollections/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
//! Unicode string slices.
1212
//!
13-
//! *[See also the `str` primitive type](../primitive.str.html).*
13+
//! *[See also the `str` primitive type](../../std/primitive.str.html).*
1414
1515

1616
#![stable(feature = "rust1", since = "1.0.0")]

src/libcollections/string.rs

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ use boxed::Box;
7979
/// contents of the string. It has a close relationship with its borrowed
8080
/// counterpart, the primitive [`str`].
8181
///
82-
/// [`str`]: ../primitive.str.html
82+
/// [`str`]: ../../std/primitive.str.html
8383
///
8484
/// # Examples
8585
///
@@ -99,7 +99,7 @@ use boxed::Box;
9999
/// hello.push_str("orld!");
100100
/// ```
101101
///
102-
/// [`char`]: ../primitive.char.html
102+
/// [`char`]: ../../std/primitive.char.html
103103
/// [`push()`]: #method.push
104104
/// [`push_str()`]: #method.push_str
105105
///
@@ -131,7 +131,7 @@ use boxed::Box;
131131
/// println!("The first letter of s is {}", s[0]); // ERROR!!!
132132
/// ```
133133
///
134-
/// [`OsString`]: ../ffi/struct.OsString.html
134+
/// [`OsString`]: ../../std/ffi/struct.OsString.html
135135
///
136136
/// Indexing is intended to be a constant-time operation, but UTF-8 encoding
137137
/// does not allow us to do this. Furtheremore, it's not clear what sort of
@@ -156,8 +156,8 @@ use boxed::Box;
156156
/// takes_str(&s);
157157
/// ```
158158
///
159-
/// [`&str`]: ../primitive.str.html
160-
/// [`Deref`]: ../ops/trait.Deref.html
159+
/// [`&str`]: ../../std/primitive.str.html
160+
/// [`Deref`]: ../../std/ops/trait.Deref.html
161161
///
162162
/// This will create a [`&str`] from the `String` and pass it in. This
163163
/// conversion is very inexpensive, and so generally, functions will accept
@@ -280,10 +280,10 @@ pub struct String {
280280
/// an analogue to `FromUtf8Error`, and you can get one from a `FromUtf8Error`
281281
/// through the [`utf8_error()`] method.
282282
///
283-
/// [`Utf8Error`]: ../str/struct.Utf8Error.html
284-
/// [`std::str`]: ../str/index.html
285-
/// [`u8`]: ../primitive.u8.html
286-
/// [`&str`]: ../primitive.str.html
283+
/// [`Utf8Error`]: ../../std/str/struct.Utf8Error.html
284+
/// [`std::str`]: ../../std/str/index.html
285+
/// [`u8`]: ../../std/primitive.u8.html
286+
/// [`&str`]: ../../std/primitive.str.html
287287
/// [`utf8_error()`]: #method.utf8_error
288288
///
289289
/// # Examples
@@ -414,9 +414,9 @@ impl String {
414414
/// requires that it is valid UTF-8. `from_utf8()` checks to ensure that
415415
/// the bytes are valid UTF-8, and then does the conversion.
416416
///
417-
/// [`&str`]: ../primitive.str.html
418-
/// [`u8`]: ../primitive.u8.html
419-
/// [`Vec<u8>`]: ../vec/struct.Vec.html
417+
/// [`&str`]: ../../std/primitive.str.html
418+
/// [`u8`]: ../../std/primitive.u8.html
419+
/// [`Vec<u8>`]: ../../std/vec/struct.Vec.html
420420
///
421421
/// If you are sure that the byte slice is valid UTF-8, and you don't want
422422
/// to incur the overhead of the validity check, there is an unsafe version
@@ -431,7 +431,7 @@ impl String {
431431
/// If you need a `&str` instead of a `String`, consider
432432
/// [`str::from_utf8()`].
433433
///
434-
/// [`str::from_utf8()`]: ../str/fn.from_utf8.html
434+
/// [`str::from_utf8()`]: ../../std/str/fn.from_utf8.html
435435
///
436436
/// # Errors
437437
///
@@ -488,8 +488,8 @@ impl String {
488488
/// `from_utf8_lossy()` will replace any invalid UTF-8 sequences with
489489
/// `U+FFFD REPLACEMENT CHARACTER`, which looks like this: �
490490
///
491-
/// [`u8`]: ../primitive.u8.html
492-
/// [byteslice]: ../primitive.slice.html
491+
/// [`u8`]: ../../std/primitive.u8.html
492+
/// [byteslice]: ../../std/primitive.slice.html
493493
///
494494
/// If you are sure that the byte slice is valid UTF-8, and you don't want
495495
/// to incur the overhead of the conversion, there is an unsafe version
@@ -504,7 +504,7 @@ impl String {
504504
/// it's already valid UTF-8, we don't need a new allocation. This return
505505
/// type allows us to handle both cases.
506506
///
507-
/// [`Cow<'a, str>`]: ../borrow/enum.Cow.html
507+
/// [`Cow<'a, str>`]: ../../std/borrow/enum.Cow.html
508508
///
509509
/// # Examples
510510
///
@@ -1014,7 +1014,7 @@ impl String {
10141014
/// Panics if `new_len` > current length, or if `new_len` does not lie on a
10151015
/// [`char`] boundary.
10161016
///
1017-
/// [`char`]: ../primitive.char.html
1017+
/// [`char`]: ../../std/primitive.char.html
10181018
///
10191019
/// # Examples
10201020
///
@@ -1076,7 +1076,7 @@ impl String {
10761076
/// Panics if `idx` is larger than or equal to the `String`'s length,
10771077
/// or if it does not lie on a [`char`] boundary.
10781078
///
1079-
/// [`char`]: ../primitive.char.html
1079+
/// [`char`]: ../../std/primitive.char.html
10801080
///
10811081
/// # Examples
10821082
///
@@ -1116,7 +1116,7 @@ impl String {
11161116
/// Panics if `idx` is larger than the `String`'s length, or if it does not
11171117
/// lie on a [`char`] boundary.
11181118
///
1119-
/// [`char`]: ../primitive.char.html
1119+
/// [`char`]: ../../std/primitive.char.html
11201120
///
11211121
/// # Examples
11221122
///
@@ -1255,7 +1255,7 @@ impl String {
12551255
/// Panics if the starting point or end point do not lie on a [`char`]
12561256
/// boundary, or if they're out of bounds.
12571257
///
1258-
/// [`char`]: ../primitive.char.html
1258+
/// [`char`]: ../../std/primitive.char.html
12591259
///
12601260
/// # Examples
12611261
///
@@ -1353,10 +1353,10 @@ impl FromUtf8Error {
13531353
/// an analogue to `FromUtf8Error`. See its documentation for more details
13541354
/// on using it.
13551355
///
1356-
/// [`Utf8Error`]: ../str/struct.Utf8Error.html
1357-
/// [`std::str`]: ../str/index.html
1358-
/// [`u8`]: ../primitive.u8.html
1359-
/// [`&str`]: ../primitive.str.html
1356+
/// [`Utf8Error`]: ../../std/str/struct.Utf8Error.html
1357+
/// [`std::str`]: ../../std/str/index.html
1358+
/// [`u8`]: ../../std/primitive.u8.html
1359+
/// [`&str`]: ../../std/primitive.str.html
13601360
///
13611361
/// # Examples
13621362
///
@@ -1695,9 +1695,9 @@ impl ops::DerefMut for String {
16951695
/// [`String`] without error, this type will never actually be returned. As
16961696
/// such, it is only here to satisfy said signature, and is useless otherwise.
16971697
///
1698-
/// [`FromStr`]: ../str/trait.FromStr.html
1698+
/// [`FromStr`]: ../../std/str/trait.FromStr.html
16991699
/// [`String`]: struct.String.html
1700-
/// [`from_str()`]: ../str/trait.FromStr.html#tymethod.from_str
1700+
/// [`from_str()`]: ../../std/str/trait.FromStr.html#tymethod.from_str
17011701
#[stable(feature = "str_parse_error", since = "1.5.0")]
17021702
#[derive(Copy)]
17031703
pub enum ParseError {}
@@ -1749,7 +1749,7 @@ impl Eq for ParseError {}
17491749
/// [`Display`] should be implemented instead, and you get the `ToString`
17501750
/// implementation for free.
17511751
///
1752-
/// [`Display`]: ../fmt/trait.Display.html
1752+
/// [`Display`]: ../../std/fmt/trait.Display.html
17531753
#[stable(feature = "rust1", since = "1.0.0")]
17541754
pub trait ToString {
17551755
/// Converts the given value to a `String`.

src/libcore/any.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
//! Note that &Any is limited to testing whether a value is of a specified
2323
//! concrete type, and cannot be used to test whether a type implements a trait.
2424
//!
25-
//! [`Box`]: ../boxed/struct.Box.html
25+
//! [`Box`]: ../../std/boxed/struct.Box.html
2626
//!
2727
//! # Examples
2828
//!

0 commit comments

Comments
 (0)