Skip to content

Commit 5deba22

Browse files
committed
Auto merge of #46278 - MaloJaffre:ci-compiler-docs, r=kennytm
Add compiler docs testing to CI. Fixes #47025. I don't know if `x86_64-gnu` is the right builder for this, but there seems to be time left on [Travis](https://travis-ci.org/rust-lang/rust/jobs/307488864). Remaining problems blocking this PR: - [x] broken links caused by rustdoc issues: - [x] `pub use self::Enum::...`: #46766 and #46767 (fixed by #47050, thanks @ollie27!) - [x] `impl Deref for DerefToStdType`: #32129 (ignored in linkchecker) - [x] `#[feature(decl_macro)]` and `use std::vec`: #47038 (ignored in linkchecker) - [x] `rustc_data_structures::sync::{Lrc, RwLock}` aliases `std` types: #32130 (ignored in linkchecker) - [x] markdown differences, in rust repository and in external crates, now failing the build with #46880 merged (all fixed) - [x] multiple crate updates needed: `rand`, `log`, `parking_lot_core`, `flate2` - [x] submodule updates needed to deduplicate dependencies: `rust-installer`, ~`cargo`~ (done by #47052) - [x] #44953 test broken by `log` update (removed, this can be controversial) - [x] Waiting `x86_64-gnu` build results ([done](https://travis-ci.org/rust-lang/rust/builds/323451069)) See individual commits for more details.
2 parents d5f2745 + 2449230 commit 5deba22

File tree

43 files changed

+255
-234
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+255
-234
lines changed

Diff for: src/Cargo.lock

+78-78
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: src/ci/docker/x86_64-gnu/Dockerfile

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1616
COPY scripts/sccache.sh /scripts/
1717
RUN sh /scripts/sccache.sh
1818

19-
ENV RUST_CONFIGURE_ARGS --build=x86_64-unknown-linux-gnu --enable-sanitizers --enable-profiler
19+
ENV RUST_CONFIGURE_ARGS \
20+
--build=x86_64-unknown-linux-gnu \
21+
--enable-sanitizers \
22+
--enable-profiler \
23+
--enable-compiler-docs
2024
ENV SCRIPT python2.7 ../x.py test

Diff for: src/libarena/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,11 @@ impl<T> TypedArena<T> {
148148
}
149149
}
150150

151-
/// Allocates a slice of objects that are copy into the `TypedArena`, returning a mutable
151+
/// Allocates a slice of objects that are copied into the `TypedArena`, returning a mutable
152152
/// reference to it. Will panic if passed a zero-sized types.
153153
///
154154
/// Panics:
155+
///
155156
/// - Zero-sized types
156157
/// - Zero-length slices
157158
#[inline]
@@ -369,6 +370,7 @@ impl DroplessArena {
369370
/// reference to it. Will panic if passed a zero-sized type.
370371
///
371372
/// Panics:
373+
///
372374
/// - Zero-sized types
373375
/// - Zero-length slices
374376
#[inline]

Diff for: src/libgraphviz/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ pub enum LabelText<'a> {
306306
LabelStr(Cow<'a, str>),
307307

308308
/// This kind of label uses the graphviz label escString type:
309-
/// http://www.graphviz.org/content/attrs#kescString
309+
/// <http://www.graphviz.org/content/attrs#kescString>
310310
///
311311
/// Occurrences of backslashes (`\`) are not escaped; instead they
312312
/// are interpreted as initiating an escString escape sequence.
@@ -326,7 +326,7 @@ pub enum LabelText<'a> {
326326
}
327327

328328
/// The style for a node or edge.
329-
/// See http://www.graphviz.org/doc/info/attrs.html#k:style for descriptions.
329+
/// See <http://www.graphviz.org/doc/info/attrs.html#k:style> for descriptions.
330330
/// Note that some of these are not valid for edges.
331331
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
332332
pub enum Style {

Diff for: src/librustc/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ byteorder = { version = "1.1", features = ["i128"]}
5454
# tl;dr; this is not needed to get `rustc` to compile, but if you remove it then
5555
# later crate stop compiling. If you can remove this and everything
5656
# compiles, then please feel free to do so!
57-
flate2 = "0.2"
57+
flate2 = "1.0"

Diff for: src/librustc/dep_graph/dep_tracking_map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl<M: DepTrackingMapConfig> MemoizationMap for RefCell<DepTrackingMap<M>> {
5656
/// map; and `CurrentTask` represents the current task when
5757
/// `memoize` is invoked.
5858
///
59-
/// **Important:* when `op` is invoked, the current task will be
59+
/// **Important:** when `op` is invoked, the current task will be
6060
/// switched to `Map(key)`. Therefore, if `op` makes use of any
6161
/// HIR nodes or shared state accessed through its closure
6262
/// environment, it must explicitly register a read of that

Diff for: src/librustc/dep_graph/graph.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ impl DepGraph {
158158
/// what state they have access to. In particular, we want to
159159
/// prevent implicit 'leaks' of tracked state into the task (which
160160
/// could then be read without generating correct edges in the
161-
/// dep-graph -- see the [README] for more details on the
162-
/// dep-graph). To this end, the task function gets exactly two
161+
/// dep-graph -- see the module-level [README] for more details on
162+
/// the dep-graph). To this end, the task function gets exactly two
163163
/// pieces of state: the context `cx` and an argument `arg`. Both
164164
/// of these bits of state must be of some type that implements
165165
/// `DepGraphSafe` and hence does not leak.
@@ -178,7 +178,7 @@ impl DepGraph {
178178
/// - If you need 3+ arguments, use a tuple for the
179179
/// `arg` parameter.
180180
///
181-
/// [README]: README.md
181+
/// [README]: https://github.com/rust-lang/rust/blob/master/src/librustc/dep_graph/README.md
182182
pub fn with_task<C, A, R, HCX>(&self,
183183
key: DepNode,
184184
cx: C,

Diff for: src/librustc/hir/def.rs

+9-6
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,16 @@ pub enum Def {
7171
/// `base_def` is definition of resolved part of the
7272
/// path, `unresolved_segments` is the number of unresolved
7373
/// segments.
74-
/// module::Type::AssocX::AssocY::MethodOrAssocType
75-
/// ^~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
76-
/// base_def unresolved_segments = 3
7774
///
78-
/// <T as Trait>::AssocX::AssocY::MethodOrAssocType
79-
/// ^~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~
80-
/// base_def unresolved_segments = 2
75+
/// ```text
76+
/// module::Type::AssocX::AssocY::MethodOrAssocType
77+
/// ^~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
78+
/// base_def unresolved_segments = 3
79+
///
80+
/// <T as Trait>::AssocX::AssocY::MethodOrAssocType
81+
/// ^~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~
82+
/// base_def unresolved_segments = 2
83+
/// ```
8184
#[derive(Copy, Clone, Debug)]
8285
pub struct PathResolution {
8386
base_def: Def,

Diff for: src/librustc/hir/map/blocks.rs

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ use syntax_pos::Span;
3333
/// and a body (as well as a NodeId, a span, etc).
3434
///
3535
/// More specifically, it is one of either:
36+
///
3637
/// - A function item,
3738
/// - A closure expr (i.e. an ExprClosure), or
3839
/// - The default implementation for a trait method.

Diff for: src/librustc/hir/mod.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,9 @@ pub type CrateConfig = HirVec<P<MetaItem>>;
588588
/// The top-level data structure that stores the entire contents of
589589
/// the crate currently being compiled.
590590
///
591-
/// For more details, see [the module-level README](README.md).
591+
/// For more details, see the module-level [README].
592+
///
593+
/// [README]: https://github.com/rust-lang/rust/blob/master/src/librustc/hir/README.md.
592594
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Debug)]
593595
pub struct Crate {
594596
pub module: Mod,

Diff for: src/librustc/infer/anon_types/mod.rs

+31-17
Original file line numberDiff line numberDiff line change
@@ -147,21 +147,25 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
147147
/// Let's work through an example to explain how it works. Assume
148148
/// the current function is as follows:
149149
///
150-
/// fn foo<'a, 'b>(..) -> (impl Bar<'a>, impl Bar<'b>)
150+
/// ```text
151+
/// fn foo<'a, 'b>(..) -> (impl Bar<'a>, impl Bar<'b>)
152+
/// ```
151153
///
152154
/// Here, we have two `impl Trait` types whose values are being
153155
/// inferred (the `impl Bar<'a>` and the `impl
154156
/// Bar<'b>`). Conceptually, this is sugar for a setup where we
155157
/// define underlying abstract types (`Foo1`, `Foo2`) and then, in
156158
/// the return type of `foo`, we *reference* those definitions:
157159
///
158-
/// abstract type Foo1<'x>: Bar<'x>;
159-
/// abstract type Foo2<'x>: Bar<'x>;
160-
/// fn foo<'a, 'b>(..) -> (Foo1<'a>, Foo2<'b>) { .. }
161-
/// // ^^^^ ^^
162-
/// // | |
163-
/// // | substs
164-
/// // def_id
160+
/// ```text
161+
/// abstract type Foo1<'x>: Bar<'x>;
162+
/// abstract type Foo2<'x>: Bar<'x>;
163+
/// fn foo<'a, 'b>(..) -> (Foo1<'a>, Foo2<'b>) { .. }
164+
/// // ^^^^ ^^
165+
/// // | |
166+
/// // | substs
167+
/// // def_id
168+
/// ```
165169
///
166170
/// As indicating in the comments above, each of those references
167171
/// is (in the compiler) basically a substitution (`substs`)
@@ -175,8 +179,10 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
175179
/// `Foo2`. That is, this gives rise to higher-order (pattern) unification
176180
/// constraints like:
177181
///
178-
/// for<'a> (Foo1<'a> = C1)
179-
/// for<'b> (Foo1<'b> = C2)
182+
/// ```text
183+
/// for<'a> (Foo1<'a> = C1)
184+
/// for<'b> (Foo1<'b> = C2)
185+
/// ```
180186
///
181187
/// For these equation to be satisfiable, the types `C1` and `C2`
182188
/// can only refer to a limited set of regions. For example, `C1`
@@ -189,15 +195,19 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
189195
/// regions. In fact, it is fairly likely that they do! Consider
190196
/// this possible definition of `foo`:
191197
///
192-
/// fn foo<'a, 'b>(x: &'a i32, y: &'b i32) -> (impl Bar<'a>, impl Bar<'b>) {
198+
/// ```text
199+
/// fn foo<'a, 'b>(x: &'a i32, y: &'b i32) -> (impl Bar<'a>, impl Bar<'b>) {
193200
/// (&*x, &*y)
194201
/// }
202+
/// ```
195203
///
196204
/// Here, the values for the concrete types of the two impl
197205
/// traits will include inference variables:
198206
///
199-
/// &'0 i32
200-
/// &'1 i32
207+
/// ```text
208+
/// &'0 i32
209+
/// &'1 i32
210+
/// ```
201211
///
202212
/// Ordinarily, the subtyping rules would ensure that these are
203213
/// sufficiently large. But since `impl Bar<'a>` isn't a specific
@@ -207,7 +217,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
207217
/// inferred type are regions that could validly appear.
208218
///
209219
/// This is actually a bit of a tricky constraint in general. We
210-
/// want to say that each variable (e.g., `'0``) can only take on
220+
/// want to say that each variable (e.g., `'0`) can only take on
211221
/// values that were supplied as arguments to the abstract type
212222
/// (e.g., `'a` for `Foo1<'a>`) or `'static`, which is always in
213223
/// scope. We don't have a constraint quite of this kind in the current
@@ -225,7 +235,9 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
225235
///
226236
/// In some cases, there is no minimum. Consider this example:
227237
///
228-
/// fn baz<'a, 'b>() -> impl Trait<'a, 'b> { ... }
238+
/// ```text
239+
/// fn baz<'a, 'b>() -> impl Trait<'a, 'b> { ... }
240+
/// ```
229241
///
230242
/// Here we would report an error, because `'a` and `'b` have no
231243
/// relation to one another.
@@ -245,8 +257,10 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
245257
/// which is the current function. It also means that we can
246258
/// take "implied bounds" into account in some cases:
247259
///
248-
/// trait SomeTrait<'a, 'b> { }
249-
/// fn foo<'a, 'b>(_: &'a &'b u32) -> impl SomeTrait<'a, 'b> { .. }
260+
/// ```text
261+
/// trait SomeTrait<'a, 'b> { }
262+
/// fn foo<'a, 'b>(_: &'a &'b u32) -> impl SomeTrait<'a, 'b> { .. }
263+
/// ```
250264
///
251265
/// Here, the fact that `'b: 'a` is known only because of the
252266
/// implied bounds from the `&'a &'b u32` parameter, and is not

Diff for: src/librustc/middle/region.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher,
5353
/// expression for the indexed statement, until the end of the block.
5454
///
5555
/// So: the following code can be broken down into the scopes beneath:
56-
/// ```
56+
///
57+
/// ```text
5758
/// let a = f().g( 'b: { let x = d(); let y = d(); x.h(y) } ) ;
58-
/// ```
5959
///
6060
/// +-+ (D12.)
6161
/// +-+ (D11.)
@@ -82,6 +82,7 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher,
8282
/// (R10.): Remainder scope for block `'b:`, stmt 1 (let y = ...).
8383
/// (D11.): DestructionScope for temporaries and bindings from block `'b:`.
8484
/// (D12.): DestructionScope for temporaries created during M1 (e.g. f()).
85+
/// ```
8586
///
8687
/// Note that while the above picture shows the destruction scopes
8788
/// as following their corresponding node scopes, in the internal

Diff for: src/librustc/mir/mod.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! MIR datatypes and passes. See [the README](README.md) for details.
11+
//! MIR datatypes and passes. See the module-level [README] for details.
12+
//!
13+
//! [README]: https://github.com/rust-lang/rust/blob/master/src/librustc/mir/README.md
1214
1315
use graphviz::IntoCow;
1416
use middle::const_val::ConstVal;
@@ -495,6 +497,7 @@ pub struct LocalDecl<'tcx> {
495497
///
496498
/// That's it, if we have a let-statement like the one in this
497499
/// function:
500+
///
498501
/// ```
499502
/// fn foo(x: &str) {
500503
/// #[allow(unused_mut)]
@@ -538,6 +541,7 @@ pub struct LocalDecl<'tcx> {
538541
///
539542
/// The end result looks like this:
540543
///
544+
/// ```text
541545
/// ROOT SCOPE
542546
/// │{ argument x: &str }
543547
/// │
@@ -557,6 +561,7 @@ pub struct LocalDecl<'tcx> {
557561
/// │ │{ let x: u32 }
558562
/// │ │← x.source_info.scope
559563
/// │ │← `drop(x)` // this accesses `x: u32`
564+
/// ```
560565
pub syntactic_scope: VisibilityScope,
561566
}
562567

Diff for: src/librustc/traits/select.rs

+1
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
906906
/// For defaulted traits, we use a co-inductive strategy to solve, so
907907
/// that recursion is ok. This routine returns true if the top of the
908908
/// stack (`cycle[0]`):
909+
///
909910
/// - is a defaulted trait, and
910911
/// - it also appears in the backtrace at some position `X`; and,
911912
/// - all the predicates at positions `X..` between `X` an the top are

Diff for: src/librustc/ty/adjustment.rs

+26-26
Original file line numberDiff line numberDiff line change
@@ -22,38 +22,38 @@ use ty::subst::Substs;
2222
/// Here are some common scenarios:
2323
///
2424
/// 1. The simplest cases are where a pointer is not adjusted fat vs thin.
25-
/// Here the pointer will be dereferenced N times (where a dereference can
26-
/// happen to raw or borrowed pointers or any smart pointer which implements
27-
/// Deref, including Box<_>). The types of dereferences is given by
28-
/// `autoderefs`. It can then be auto-referenced zero or one times, indicated
29-
/// by `autoref`, to either a raw or borrowed pointer. In these cases unsize is
30-
/// `false`.
25+
/// Here the pointer will be dereferenced N times (where a dereference can
26+
/// happen to raw or borrowed pointers or any smart pointer which implements
27+
/// Deref, including Box<_>). The types of dereferences is given by
28+
/// `autoderefs`. It can then be auto-referenced zero or one times, indicated
29+
/// by `autoref`, to either a raw or borrowed pointer. In these cases unsize is
30+
/// `false`.
3131
///
3232
/// 2. A thin-to-fat coercion involves unsizing the underlying data. We start
33-
/// with a thin pointer, deref a number of times, unsize the underlying data,
34-
/// then autoref. The 'unsize' phase may change a fixed length array to a
35-
/// dynamically sized one, a concrete object to a trait object, or statically
36-
/// sized struct to a dynamically sized one. E.g., &[i32; 4] -> &[i32] is
37-
/// represented by:
33+
/// with a thin pointer, deref a number of times, unsize the underlying data,
34+
/// then autoref. The 'unsize' phase may change a fixed length array to a
35+
/// dynamically sized one, a concrete object to a trait object, or statically
36+
/// sized struct to a dynamically sized one. E.g., &[i32; 4] -> &[i32] is
37+
/// represented by:
3838
///
39-
/// ```
40-
/// Deref(None) -> [i32; 4],
41-
/// Borrow(AutoBorrow::Ref) -> &[i32; 4],
42-
/// Unsize -> &[i32],
43-
/// ```
39+
/// ```
40+
/// Deref(None) -> [i32; 4],
41+
/// Borrow(AutoBorrow::Ref) -> &[i32; 4],
42+
/// Unsize -> &[i32],
43+
/// ```
4444
///
45-
/// Note that for a struct, the 'deep' unsizing of the struct is not recorded.
46-
/// E.g., `struct Foo<T> { x: T }` we can coerce &Foo<[i32; 4]> to &Foo<[i32]>
47-
/// The autoderef and -ref are the same as in the above example, but the type
48-
/// stored in `unsize` is `Foo<[i32]>`, we don't store any further detail about
49-
/// the underlying conversions from `[i32; 4]` to `[i32]`.
45+
/// Note that for a struct, the 'deep' unsizing of the struct is not recorded.
46+
/// E.g., `struct Foo<T> { x: T }` we can coerce &Foo<[i32; 4]> to &Foo<[i32]>
47+
/// The autoderef and -ref are the same as in the above example, but the type
48+
/// stored in `unsize` is `Foo<[i32]>`, we don't store any further detail about
49+
/// the underlying conversions from `[i32; 4]` to `[i32]`.
5050
///
5151
/// 3. Coercing a `Box<T>` to `Box<Trait>` is an interesting special case. In
52-
/// that case, we have the pointer we need coming in, so there are no
53-
/// autoderefs, and no autoref. Instead we just do the `Unsize` transformation.
54-
/// At some point, of course, `Box` should move out of the compiler, in which
55-
/// case this is analogous to transforming a struct. E.g., Box<[i32; 4]> ->
56-
/// Box<[i32]> is an `Adjust::Unsize` with the target `Box<[i32]>`.
52+
/// that case, we have the pointer we need coming in, so there are no
53+
/// autoderefs, and no autoref. Instead we just do the `Unsize` transformation.
54+
/// At some point, of course, `Box` should move out of the compiler, in which
55+
/// case this is analogous to transforming a struct. E.g., Box<[i32; 4]> ->
56+
/// Box<[i32]> is an `Adjust::Unsize` with the target `Box<[i32]>`.
5757
#[derive(Clone, RustcEncodable, RustcDecodable)]
5858
pub struct Adjustment<'tcx> {
5959
pub kind: Adjust<'tcx>,

Diff for: src/librustc/ty/context.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -778,8 +778,10 @@ impl<'tcx> CommonTypes<'tcx> {
778778

779779
/// The central data structure of the compiler. It stores references
780780
/// to the various **arenas** and also houses the results of the
781-
/// various **compiler queries** that have been performed. See [the
782-
/// README](README.md) for more deatils.
781+
/// various **compiler queries** that have been performed. See the
782+
/// module-level [README] for more details.
783+
///
784+
/// [README]: https://github.com/rust-lang/rust/blob/master/src/librustc/ty/README.md
783785
#[derive(Copy, Clone)]
784786
pub struct TyCtxt<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
785787
gcx: &'a GlobalCtxt<'gcx>,

Diff for: src/librustc/ty/instance.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub enum InstanceDef<'tcx> {
2828
Item(DefId),
2929
Intrinsic(DefId),
3030

31-
/// <fn() as FnTrait>::call_*
31+
/// \<fn() as FnTrait>::call_*
3232
/// def-id is FnTrait::call_*
3333
FnPtrShim(DefId, Ty<'tcx>),
3434

0 commit comments

Comments
 (0)