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")]

0 commit comments

Comments
 (0)