Skip to content

Commit 1db1144

Browse files
committed
Auto merge of #45046 - kennytm:rollup, r=kennytm
Rollup of 9 pull requests - Successful merges: #44664, #44935, #44972, #44980, #44987, #44997, #45006, #45017, #45024 - Failed merges:
2 parents abef7e1 + 5440733 commit 1db1144

File tree

12 files changed

+74
-24
lines changed

12 files changed

+74
-24
lines changed

CONTRIBUTING.md

+31-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Contributing to Rust
2+
[contributing-to-rust]: #contributing-to-rust
23

34
Thank you for your interest in contributing to Rust! There are many ways to
45
contribute, and we appreciate all of them. This document is a bit long, so here's
@@ -18,18 +19,20 @@ hop on [#rust-internals][pound-rust-internals].
1819

1920
As a reminder, all contributors are expected to follow our [Code of Conduct][coc].
2021

21-
[pound-rust-internals]: http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-internals
22+
[pound-rust-internals]: https://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-internals
2223
[internals]: https://internals.rust-lang.org
2324
[coc]: https://www.rust-lang.org/conduct.html
2425

2526
## Feature Requests
27+
[feature-requests]: #feature-requests
2628

2729
To request a change to the way that the Rust language works, please open an
2830
issue in the [RFCs repository](https://github.com/rust-lang/rfcs/issues/new)
2931
rather than this one. New features and other significant language changes
3032
must go through the RFC process.
3133

3234
## Bug Reports
35+
[bug-reports]: #bug-reports
3336

3437
While bugs are unfortunate, they're a reality in software. We can't fix what we
3538
don't know about, so please report liberally. If you're not sure if something
@@ -80,6 +83,7 @@ $ RUST_BACKTRACE=1 rustc ...
8083
```
8184

8285
## The Build System
86+
[the-build-system]: #the-build-system
8387

8488
Rust's build system allows you to bootstrap the compiler, run tests &
8589
benchmarks, generate documentation, install a fresh build of Rust, and more.
@@ -94,6 +98,7 @@ system internals, try asking in [`#rust-internals`][pound-rust-internals].
9498
[bootstrap]: https://github.com/rust-lang/rust/tree/master/src/bootstrap/
9599

96100
### Configuration
101+
[configuration]: #configuration
97102

98103
Before you can start building the compiler you need to configure the build for
99104
your system. In most cases, that will just mean using the defaults provided
@@ -125,6 +130,11 @@ file. If you still have a `config.mk` file in your directory - from
125130
`./configure` - you may need to delete it for `config.toml` to work.
126131

127132
### Building
133+
[building]: #building
134+
135+
Dependencies
136+
- [build dependencies](README.md#building-from-source)
137+
- `gdb` 6.2.0 minimum, 7.1 or later recommended for test builds
128138

129139
The build system uses the `x.py` script to control the build process. This script
130140
is used to build, test, and document various parts of the compiler. You can
@@ -194,6 +204,7 @@ Note: Previously `./configure` and `make` were used to build this project.
194204
They are still available, but `x.py` is the recommended build system.
195205

196206
### Useful commands
207+
[useful-commands]: #useful-commands
197208

198209
Some common invocations of `x.py` are:
199210

@@ -234,6 +245,7 @@ Some common invocations of `x.py` are:
234245
code.
235246

236247
### Using your local build
248+
[using-local-build]: #using-local-build
237249

238250
If you use Rustup to manage your rust install, it has a feature called ["custom
239251
toolchains"][toolchain-link] that you can use to access your newly-built compiler
@@ -262,6 +274,7 @@ stage 1. `python x.py build --stage 1 src/libstd src/tools/rustdoc` will build
262274
rustdoc and libstd, which will allow rustdoc to be run with that toolchain.)
263275

264276
## Pull Requests
277+
[pull-requests]: #pull-requests
265278

266279
Pull requests are the primary mechanism we use to change Rust. GitHub itself
267280
has some [great documentation][pull-requests] on using the Pull Request feature.
@@ -326,20 +339,32 @@ it can be found
326339
[here](https://github.com/rust-lang/rust-wiki-backup/blob/master/Note-testsuite.md).
327340

328341
### External Dependencies
342+
[external-dependencies]: #external-dependencies
329343

330344
Currently building Rust will also build the following external projects:
331345

332346
* [clippy](https://github.com/rust-lang-nursery/rust-clippy)
333347
* [miri](https://github.com/solson/miri)
334348

335349
If your changes break one of these projects, you need to fix them by opening
336-
a pull request against the broken project. When you have opened a pull request,
337-
you can disable the tool via `src/tools/toolstate.toml`.
350+
a pull request against the broken project asking to put the fix on a branch.
351+
Then you can disable the tool building via `src/tools/toolstate.toml`.
352+
Once the branch containing your fix is likely to be merged, you can point
353+
the affected submodule at this branch.
354+
355+
Don't forget to also add your changes with
356+
357+
```
358+
git add path/to/submodule
359+
```
360+
361+
outside the submodule.
338362

339363
It can also be more convenient during development to set `submodules = false`
340364
in the `config.toml` to prevent `x.py` from resetting to the original branch.
341365

342366
## Writing Documentation
367+
[writing-documentation]: #writing-documentation
343368

344369
Documentation improvements are very welcome. The source of `doc.rust-lang.org`
345370
is located in `src/doc` in the tree, and standard API documentation is generated
@@ -370,6 +395,7 @@ reference to `doc/reference.html`. The CSS might be messed up, but you can
370395
verify that the HTML is right.
371396

372397
## Issue Triage
398+
[issue-triage]: #issue-triage
373399

374400
Sometimes, an issue will stay open, even though the bug has been fixed. And
375401
sometimes, the original bug may go stale because something has changed in the
@@ -437,6 +463,7 @@ If you're looking for somewhere to start, check out the [E-easy][eeasy] tag.
437463
[rfcbot]: https://github.com/dikaiosune/rust-dashboard/blob/master/RFCBOT.md
438464

439465
## Out-of-tree Contributions
466+
[out-of-tree-contributions]: #out-of-tree-contributions
440467

441468
There are a number of other ways to contribute to Rust that don't deal with
442469
this repository.
@@ -456,6 +483,7 @@ valuable!
456483
[community-library]: https://github.com/rust-lang/rfcs/labels/A-community-library
457484

458485
## Helpful Links and Information
486+
[helpful-info]: #helpful-info
459487

460488
For people new to Rust, and just starting to contribute, or even for
461489
more seasoned developers, some useful places to look for information

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ standard library, and documentation.
66
[Rust]: https://www.rust-lang.org
77

88
## Quick Start
9+
[quick-start]: #quick-start
910

1011
Read ["Installation"] from [The Book].
1112

1213
["Installation"]: https://doc.rust-lang.org/book/second-edition/ch01-01-installation.html
1314
[The Book]: https://doc.rust-lang.org/book/index.html
1415

1516
## Building from Source
17+
[building-from-source]: #building-from-source
1618

1719
1. Make sure you have installed the dependencies:
1820

@@ -52,6 +54,7 @@ Read ["Installation"] from [The Book].
5254
[Cargo]: https://github.com/rust-lang/cargo
5355
5456
### Building on Windows
57+
[building-on-windows]: #building-on-windows
5558
5659
There are two prominent ABIs in use on Windows: the native (MSVC) ABI used by
5760
Visual Studio, and the GNU ABI used by the GCC toolchain. Which version of Rust
@@ -61,6 +64,7 @@ for interop with GNU software built using the MinGW/MSYS2 toolchain use the GNU
6164
build.
6265
6366
#### MinGW
67+
[windows-mingw]: #windows-mingw
6468
6569
[MSYS2][msys2] can be used to easily build Rust on Windows:
6670
@@ -101,6 +105,7 @@ build.
101105
```
102106

103107
#### MSVC
108+
[windows-msvc]: #windows-msvc
104109

105110
MSVC builds of Rust additionally require an installation of Visual Studio 2013
106111
(or later) so `rustc` can use its linker. Make sure to check the “C++ tools”
@@ -124,6 +129,7 @@ python x.py build
124129
```
125130

126131
#### Specifying an ABI
132+
[specifying-an-abi]: #specifying-an-abi
127133

128134
Each specific ABI can also be used from either environment (for example, using
129135
the GNU ABI in powershell) by using an explicit build triple. The available
@@ -141,6 +147,7 @@ in Building From Source), and modifying the `build` option under the `[build]`
141147
section.
142148

143149
### Configure and Make
150+
[configure-and-make]: #configure-and-make
144151

145152
While it's not the recommended build system, this project also provides a
146153
configure script and makefile (the latter of which just invokes `x.py`).
@@ -155,6 +162,7 @@ When using the configure script, the generated `config.mk` file may override the
155162
`config.mk` file.
156163

157164
## Building Documentation
165+
[building-documentation]: #building-documentation
158166

159167
If you’d like to build the documentation, it’s almost the same:
160168

@@ -167,6 +175,7 @@ the ABI used. I.e., if the ABI was `x86_64-pc-windows-msvc`, the directory will
167175
`build\x86_64-pc-windows-msvc\doc`.
168176

169177
## Notes
178+
[notes]: #notes
170179

171180
Since the Rust compiler is written in Rust, it must be built by a
172181
precompiled "snapshot" version of itself (made in an earlier state of
@@ -192,6 +201,7 @@ There is more advice about hacking on Rust in [CONTRIBUTING.md].
192201
[CONTRIBUTING.md]: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md
193202

194203
## Getting Help
204+
[getting-help]: #getting-help
195205

196206
The Rust community congregates in a few places:
197207

@@ -204,6 +214,7 @@ The Rust community congregates in a few places:
204214
[users.rust-lang.org]: https://users.rust-lang.org/
205215

206216
## Contributing
217+
[contributing]: #contributing
207218

208219
To contribute to Rust, please see [CONTRIBUTING](CONTRIBUTING.md).
209220

@@ -217,6 +228,7 @@ Rust. And a good place to ask for help would be [#rust-beginners].
217228
[#rust-beginners]: irc://irc.mozilla.org/rust-beginners
218229

219230
## License
231+
[license]: #license
220232

221233
Rust is primarily distributed under the terms of both the MIT license
222234
and the Apache License (Version 2.0), with portions covered by various

src/doc/book

Submodule book updated 53 files

src/doc/nomicon

src/doc/reference

src/libcore/ops/deref.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
/// [book]: ../../book/second-edition/ch15-02-deref.html
4141
/// [`DerefMut`]: trait.DerefMut.html
4242
/// [more]: #more-on-deref-coercion
43-
/// [ref-deref-op]: ../../reference/expressions.html#the-dereference-operator
43+
/// [ref-deref-op]: ../../reference/expressions/operator-expr.html#the-dereference-operator
4444
/// [ref-deref-trait]: ../../reference/the-deref-trait.html
4545
/// [type coercions]: ../../reference/type-coercions.html
4646
///
@@ -127,7 +127,7 @@ impl<'a, T: ?Sized> Deref for &'a mut T {
127127
/// [book]: ../../book/second-edition/ch15-02-deref.html
128128
/// [`Deref`]: trait.Deref.html
129129
/// [more]: #more-on-deref-coercion
130-
/// [ref-deref-op]: ../../reference/expressions.html#the-dereference-operator
130+
/// [ref-deref-op]: ../../reference/expressions/operator-expr.html#the-dereference-operator
131131
/// [ref-deref-trait]: ../../reference/the-deref-trait.html
132132
/// [type coercions]: ../../reference/type-coercions.html
133133
///

src/libcore/ops/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
//! [`Sub`]: trait.Sub.html
151151
//! [`Mul`]: trait.Mul.html
152152
//! [`clone`]: ../clone/trait.Clone.html#tymethod.clone
153-
//! [operator precedence]: ../../reference/expressions.html#operator-precedence
153+
//! [operator precedence]: ../../reference/expressions/operator-expr.html#operator-precedence
154154
155155
#![stable(feature = "rust1", since = "1.0.0")]
156156

src/librustc/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ take:
153153
- LLVM then runs its various optimizations, which produces a number of `.o` files
154154
(one for each "codegen unit").
155155
6. **Linking**
156-
- Finally, those `.o` files are linke together.
156+
- Finally, those `.o` files are linked together.
157157

158158
Glossary
159159
========

src/librustc_mir/dataflow/impls/borrows.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ impl<'a, 'tcx> BitDenotation for Borrows<'a, 'tcx> {
145145
});
146146
match stmt.kind {
147147
mir::StatementKind::EndRegion(region_scope) => {
148-
let borrow_indexes = self.region_map.get(&ReScope(region_scope)).unwrap_or_else(|| {
149-
panic!("could not find BorrowIndexs for region scope {:?}", region_scope);
150-
});
151-
152-
for idx in borrow_indexes { sets.kill(&idx); }
148+
if let Some(borrow_indexes) = self.region_map.get(&ReScope(region_scope)) {
149+
for idx in borrow_indexes { sets.kill(&idx); }
150+
} else {
151+
// (if there is no entry, then there are no borrows to be tracked)
152+
}
153153
}
154154

155155
mir::StatementKind::Assign(_, ref rhs) => {

src/libstd/sync/mutex.rs

+17-7
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ use sys_common::poison::{self, TryLockError, TryLockResult, LockResult};
1919
/// A mutual exclusion primitive useful for protecting shared data
2020
///
2121
/// This mutex will block threads waiting for the lock to become available. The
22-
/// mutex can also be statically initialized or created via a `new`
22+
/// mutex can also be statically initialized or created via a [`new`]
2323
/// constructor. Each mutex has a type parameter which represents the data that
2424
/// it is protecting. The data can only be accessed through the RAII guards
25-
/// returned from `lock` and `try_lock`, which guarantees that the data is only
25+
/// returned from [`lock`] and [`try_lock`], which guarantees that the data is only
2626
/// ever accessed when the mutex is locked.
2727
///
2828
/// # Poisoning
@@ -33,16 +33,24 @@ use sys_common::poison::{self, TryLockError, TryLockResult, LockResult};
3333
/// data by default as it is likely tainted (some invariant is not being
3434
/// upheld).
3535
///
36-
/// For a mutex, this means that the `lock` and `try_lock` methods return a
37-
/// `Result` which indicates whether a mutex has been poisoned or not. Most
38-
/// usage of a mutex will simply `unwrap()` these results, propagating panics
36+
/// For a mutex, this means that the [`lock`] and [`try_lock`] methods return a
37+
/// [`Result`] which indicates whether a mutex has been poisoned or not. Most
38+
/// usage of a mutex will simply [`unwrap()`] these results, propagating panics
3939
/// among threads to ensure that a possibly invalid invariant is not witnessed.
4040
///
4141
/// A poisoned mutex, however, does not prevent all access to the underlying
42-
/// data. The `PoisonError` type has an `into_inner` method which will return
42+
/// data. The [`PoisonError`] type has an [`into_inner`] method which will return
4343
/// the guard that would have otherwise been returned on a successful lock. This
4444
/// allows access to the data, despite the lock being poisoned.
4545
///
46+
/// [`new`]: #method.new
47+
/// [`lock`]: #method.lock
48+
/// [`try_lock`]: #method.try_lock
49+
/// [`Result`]: ../../std/result/enum.Result.html
50+
/// [`unwrap()`]: ../../std/result/enum.Result.html#method.unwrap
51+
/// [`PoisonError`]: ../../std/sync/struct.PoisonError.html
52+
/// [`into_inner`]: ../../std/sync/struct.PoisonError.html#method.into_inner
53+
///
4654
/// # Examples
4755
///
4856
/// ```
@@ -226,7 +234,7 @@ impl<T: ?Sized> Mutex<T> {
226234

227235
/// Attempts to acquire this lock.
228236
///
229-
/// If the lock could not be acquired at this time, then `Err` is returned.
237+
/// If the lock could not be acquired at this time, then [`Err`] is returned.
230238
/// Otherwise, an RAII guard is returned. The lock will be unlocked when the
231239
/// guard is dropped.
232240
///
@@ -238,6 +246,8 @@ impl<T: ?Sized> Mutex<T> {
238246
/// this call will return failure if the mutex would otherwise be
239247
/// acquired.
240248
///
249+
/// [`Err`]: ../../std/result/enum.Result.html#variant.Err
250+
///
241251
/// # Examples
242252
///
243253
/// ```

src/libsyntax/ast.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1927,7 +1927,7 @@ pub enum ItemKind {
19271927
///
19281928
/// E.g. `trait Foo { .. }` or `trait Foo<T> { .. }`
19291929
Trait(Unsafety, Generics, TyParamBounds, Vec<TraitItem>),
1930-
// Default trait implementation.
1930+
/// Auto trait implementation.
19311931
///
19321932
/// E.g. `impl Trait for .. {}` or `impl<T> Trait<T> for .. {}`
19331933
DefaultImpl(Unsafety, TraitRef),

src/libsyntax/feature_gate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ declare_features! (
378378
// #[doc(cfg(...))]
379379
(active, doc_cfg, "1.21.0", Some(43781)),
380380
// #[doc(masked)]
381-
(active, doc_masked, "1.21.0", None),
381+
(active, doc_masked, "1.21.0", Some(44027)),
382382

383383
// allow `#[must_use]` on functions and comparison operators (RFC 1940)
384384
(active, fn_must_use, "1.21.0", Some(43302)),

0 commit comments

Comments
 (0)