Skip to content

Rollup of 9 pull requests #45046

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Oct 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
daf3ed5
Add links to headers in README and CONTRIBUTING and dependencies to C…
vitiral Sep 29, 2017
e6c3c7f
Corrected the CONTRIBUTING.md "External Dependencies" section
budziq Sep 17, 2017
5517a1c
fix ItemKind::DefaultImpl doc comment
durka Oct 2, 2017
fc5e8dc
fix comment on DefaultImpl
durka Oct 2, 2017
851b6d4
update books for next release
steveklabnik Oct 2, 2017
17f6b68
Remove assertion that the argument to every `EndRegion` correspond to
pnkfelix Oct 2, 2017
2d108ec
Use HTTPS protocol for `chat.mibbit.com`
suriyaa Oct 3, 2017
b3d85fc
Typo in `librustc/README.md`
MaikKlein Oct 3, 2017
e1df72f
Add missing urls for Mutex
GuillaumeGomez Oct 4, 2017
2af12b7
add the issue number to doc_masked's feature gate
QuietMisdreavus Oct 4, 2017
b34ade0
Rollup merge of #44664 - budziq:contributing_external, r=steveklabnik
kennytm Oct 5, 2017
3a037f1
Rollup merge of #44935 - vitiral:dependencies, r=steveklabnik
kennytm Oct 5, 2017
b380254
Rollup merge of #44972 - durka:patch-44, r=arielb1
kennytm Oct 5, 2017
14d8055
Rollup merge of #44980 - steveklabnik:update-books, r=estebank
kennytm Oct 5, 2017
9a43c28
Rollup merge of #44987 - pnkfelix:mir-borrowck-fix-borrowindexes-ice,…
kennytm Oct 5, 2017
856a12d
Rollup merge of #44997 - SuriyaaKudoIsc:patch-1, r=steveklabnik
kennytm Oct 5, 2017
71fba53
Rollup merge of #45006 - MaikKlein:patch-2, r=nikomatsakis
kennytm Oct 5, 2017
8249004
Rollup merge of #45017 - GuillaumeGomez:mutex-links, r=estebank
kennytm Oct 5, 2017
5440733
Rollup merge of #45024 - QuietMisdreavus:doc-masked-issue-num, r=pnkf…
kennytm Oct 5, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Contributing to Rust
[contributing-to-rust]: #contributing-to-rust

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

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

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

## Feature Requests
[feature-requests]: #feature-requests

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

## Bug Reports
[bug-reports]: #bug-reports

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

## The Build System
[the-build-system]: #the-build-system

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

### Configuration
[configuration]: #configuration

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

### Building
[building]: #building

Dependencies
- [build dependencies](README.md#building-from-source)
- `gdb` 6.2.0 minimum, 7.1 or later recommended for test builds

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

### Useful commands
[useful-commands]: #useful-commands

Some common invocations of `x.py` are:

Expand Down Expand Up @@ -234,6 +245,7 @@ Some common invocations of `x.py` are:
code.

### Using your local build
[using-local-build]: #using-local-build

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

## Pull Requests
[pull-requests]: #pull-requests

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

### External Dependencies
[external-dependencies]: #external-dependencies

Currently building Rust will also build the following external projects:

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

If your changes break one of these projects, you need to fix them by opening
a pull request against the broken project. When you have opened a pull request,
you can disable the tool via `src/tools/toolstate.toml`.
a pull request against the broken project asking to put the fix on a branch.
Then you can disable the tool building via `src/tools/toolstate.toml`.
Once the branch containing your fix is likely to be merged, you can point
the affected submodule at this branch.

Don't forget to also add your changes with

```
git add path/to/submodule
```

outside the submodule.

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

## Writing Documentation
[writing-documentation]: #writing-documentation

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

## Issue Triage
[issue-triage]: #issue-triage

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

## Out-of-tree Contributions
[out-of-tree-contributions]: #out-of-tree-contributions

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

## Helpful Links and Information
[helpful-info]: #helpful-info

For people new to Rust, and just starting to contribute, or even for
more seasoned developers, some useful places to look for information
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ standard library, and documentation.
[Rust]: https://www.rust-lang.org

## Quick Start
[quick-start]: #quick-start

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

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

## Building from Source
[building-from-source]: #building-from-source

1. Make sure you have installed the dependencies:

Expand Down Expand Up @@ -52,6 +54,7 @@ Read ["Installation"] from [The Book].
[Cargo]: https://github.com/rust-lang/cargo

### Building on Windows
[building-on-windows]: #building-on-windows

There are two prominent ABIs in use on Windows: the native (MSVC) ABI used by
Visual Studio, and the GNU ABI used by the GCC toolchain. Which version of Rust
Expand All @@ -61,6 +64,7 @@ for interop with GNU software built using the MinGW/MSYS2 toolchain use the GNU
build.

#### MinGW
[windows-mingw]: #windows-mingw

[MSYS2][msys2] can be used to easily build Rust on Windows:

Expand Down Expand Up @@ -101,6 +105,7 @@ build.
```

#### MSVC
[windows-msvc]: #windows-msvc

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

#### Specifying an ABI
[specifying-an-abi]: #specifying-an-abi

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

### Configure and Make
[configure-and-make]: #configure-and-make

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

## Building Documentation
[building-documentation]: #building-documentation

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

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

## Notes
[notes]: #notes

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

## Getting Help
[getting-help]: #getting-help

The Rust community congregates in a few places:

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

## Contributing
[contributing]: #contributing

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

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

## License
[license]: #license

Rust is primarily distributed under the terms of both the MIT license
and the Apache License (Version 2.0), with portions covered by various
Expand Down
2 changes: 1 addition & 1 deletion src/doc/book
Submodule book updated 53 files
+1 −0 .travis.yml
+29 −0 second-edition/dictionary.txt
+111 −99 second-edition/nostarch/chapter05.md
+469 −360 second-edition/nostarch/chapter08.md
+413 −399 second-edition/nostarch/chapter09.md
+1,834 −764 second-edition/nostarch/chapter15.md
+ second-edition/nostarch/odt/chapter05.docx
+ second-edition/nostarch/odt/chapter08.docx
+ second-edition/nostarch/odt/chapter09.docx
+22 −22 second-edition/src/appendix-02-operators.md
+1 −1 second-edition/src/ch01-02-hello-world.md
+8 −12 second-edition/src/ch03-02-data-types.md
+4 −4 second-edition/src/ch05-00-structs.md
+57 −45 second-edition/src/ch05-01-defining-structs.md
+30 −30 second-edition/src/ch05-02-example-structs.md
+17 −17 second-edition/src/ch05-03-method-syntax.md
+1 −1 second-edition/src/ch06-01-defining-an-enum.md
+1 −1 second-edition/src/ch06-02-match.md
+1 −1 second-edition/src/ch07-01-mod-and-the-filesystem.md
+9 −9 second-edition/src/ch08-00-common-collections.md
+159 −103 second-edition/src/ch08-01-vectors.md
+192 −157 second-edition/src/ch08-02-strings.md
+117 −90 second-edition/src/ch08-03-hash-maps.md
+14 −13 second-edition/src/ch09-00-error-handling.md
+80 −69 second-edition/src/ch09-01-unrecoverable-errors-with-panic.md
+150 −119 second-edition/src/ch09-02-recoverable-errors-with-result.md
+94 −94 second-edition/src/ch09-03-to-panic-or-not-to-panic.md
+3 −3 second-edition/src/ch10-02-traits.md
+1 −1 second-edition/src/ch10-03-lifetime-syntax.md
+5 −6 second-edition/src/ch11-01-writing-tests.md
+1 −1 second-edition/src/ch11-02-running-tests.md
+1 −1 second-edition/src/ch12-04-testing-the-librarys-functionality.md
+1 −1 second-edition/src/ch12-06-writing-to-stderr-instead-of-stdout.md
+1 −1 second-edition/src/ch13-02-iterators.md
+1 −1 second-edition/src/ch13-04-performance.md
+87 −31 second-edition/src/ch15-00-smart-pointers.md
+233 −85 second-edition/src/ch15-01-box.md
+394 −143 second-edition/src/ch15-02-deref.md
+183 −88 second-edition/src/ch15-03-drop.md
+142 −89 second-edition/src/ch15-04-rc.md
+425 −161 second-edition/src/ch15-05-interior-mutability.md
+354 −185 second-edition/src/ch15-06-reference-cycles.md
+4 −4 second-edition/src/ch16-02-message-passing.md
+2 −2 second-edition/src/ch16-03-shared-state.md
+1 −1 second-edition/src/ch19-02-advanced-lifetimes.md
+253 −76 second-edition/src/ch19-03-advanced-traits.md
+7 −7 second-edition/src/ch19-04-advanced-types.md
+2 −2 second-edition/src/ch19-05-advanced-functions-and-closures.md
+1 −1 second-edition/src/ch20-01-single-threaded.md
+1 −1 second-edition/src/ch20-05-sending-requests-via-channels.md
+1 −1 second-edition/src/ch20-06-graceful-shutdown-and-cleanup.md
+56 −11 second-edition/theme/index.hbs
+1 −0 second-edition/tools/docx-to-md.xsl
2 changes: 1 addition & 1 deletion src/doc/nomicon
2 changes: 1 addition & 1 deletion src/doc/reference
4 changes: 2 additions & 2 deletions src/libcore/ops/deref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
/// [book]: ../../book/second-edition/ch15-02-deref.html
/// [`DerefMut`]: trait.DerefMut.html
/// [more]: #more-on-deref-coercion
/// [ref-deref-op]: ../../reference/expressions.html#the-dereference-operator
/// [ref-deref-op]: ../../reference/expressions/operator-expr.html#the-dereference-operator
/// [ref-deref-trait]: ../../reference/the-deref-trait.html
/// [type coercions]: ../../reference/type-coercions.html
///
Expand Down Expand Up @@ -127,7 +127,7 @@ impl<'a, T: ?Sized> Deref for &'a mut T {
/// [book]: ../../book/second-edition/ch15-02-deref.html
/// [`Deref`]: trait.Deref.html
/// [more]: #more-on-deref-coercion
/// [ref-deref-op]: ../../reference/expressions.html#the-dereference-operator
/// [ref-deref-op]: ../../reference/expressions/operator-expr.html#the-dereference-operator
/// [ref-deref-trait]: ../../reference/the-deref-trait.html
/// [type coercions]: ../../reference/type-coercions.html
///
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/ops/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
//! [`Sub`]: trait.Sub.html
//! [`Mul`]: trait.Mul.html
//! [`clone`]: ../clone/trait.Clone.html#tymethod.clone
//! [operator precedence]: ../../reference/expressions.html#operator-precedence
//! [operator precedence]: ../../reference/expressions/operator-expr.html#operator-precedence

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

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ take:
- LLVM then runs its various optimizations, which produces a number of `.o` files
(one for each "codegen unit").
6. **Linking**
- Finally, those `.o` files are linke together.
- Finally, those `.o` files are linked together.

Glossary
========
Expand Down
10 changes: 5 additions & 5 deletions src/librustc_mir/dataflow/impls/borrows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ impl<'a, 'tcx> BitDenotation for Borrows<'a, 'tcx> {
});
match stmt.kind {
mir::StatementKind::EndRegion(region_scope) => {
let borrow_indexes = self.region_map.get(&ReScope(region_scope)).unwrap_or_else(|| {
panic!("could not find BorrowIndexs for region scope {:?}", region_scope);
});

for idx in borrow_indexes { sets.kill(&idx); }
if let Some(borrow_indexes) = self.region_map.get(&ReScope(region_scope)) {
for idx in borrow_indexes { sets.kill(&idx); }
} else {
// (if there is no entry, then there are no borrows to be tracked)
}
}

mir::StatementKind::Assign(_, ref rhs) => {
Expand Down
24 changes: 17 additions & 7 deletions src/libstd/sync/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ use sys_common::poison::{self, TryLockError, TryLockResult, LockResult};
/// A mutual exclusion primitive useful for protecting shared data
///
/// This mutex will block threads waiting for the lock to become available. The
/// mutex can also be statically initialized or created via a `new`
/// mutex can also be statically initialized or created via a [`new`]
/// constructor. Each mutex has a type parameter which represents the data that
/// it is protecting. The data can only be accessed through the RAII guards
/// returned from `lock` and `try_lock`, which guarantees that the data is only
/// returned from [`lock`] and [`try_lock`], which guarantees that the data is only
/// ever accessed when the mutex is locked.
///
/// # Poisoning
Expand All @@ -33,16 +33,24 @@ use sys_common::poison::{self, TryLockError, TryLockResult, LockResult};
/// data by default as it is likely tainted (some invariant is not being
/// upheld).
///
/// For a mutex, this means that the `lock` and `try_lock` methods return a
/// `Result` which indicates whether a mutex has been poisoned or not. Most
/// usage of a mutex will simply `unwrap()` these results, propagating panics
/// For a mutex, this means that the [`lock`] and [`try_lock`] methods return a
/// [`Result`] which indicates whether a mutex has been poisoned or not. Most
/// usage of a mutex will simply [`unwrap()`] these results, propagating panics
/// among threads to ensure that a possibly invalid invariant is not witnessed.
///
/// A poisoned mutex, however, does not prevent all access to the underlying
/// data. The `PoisonError` type has an `into_inner` method which will return
/// data. The [`PoisonError`] type has an [`into_inner`] method which will return
/// the guard that would have otherwise been returned on a successful lock. This
/// allows access to the data, despite the lock being poisoned.
///
/// [`new`]: #method.new
/// [`lock`]: #method.lock
/// [`try_lock`]: #method.try_lock
/// [`Result`]: ../../std/result/enum.Result.html
/// [`unwrap()`]: ../../std/result/enum.Result.html#method.unwrap
/// [`PoisonError`]: ../../std/sync/struct.PoisonError.html
/// [`into_inner`]: ../../std/sync/struct.PoisonError.html#method.into_inner
///
/// # Examples
///
/// ```
Expand Down Expand Up @@ -226,7 +234,7 @@ impl<T: ?Sized> Mutex<T> {

/// Attempts to acquire this lock.
///
/// If the lock could not be acquired at this time, then `Err` is returned.
/// If the lock could not be acquired at this time, then [`Err`] is returned.
/// Otherwise, an RAII guard is returned. The lock will be unlocked when the
/// guard is dropped.
///
Expand All @@ -238,6 +246,8 @@ impl<T: ?Sized> Mutex<T> {
/// this call will return failure if the mutex would otherwise be
/// acquired.
///
/// [`Err`]: ../../std/result/enum.Result.html#variant.Err
///
/// # Examples
///
/// ```
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1927,7 +1927,7 @@ pub enum ItemKind {
///
/// E.g. `trait Foo { .. }` or `trait Foo<T> { .. }`
Trait(Unsafety, Generics, TyParamBounds, Vec<TraitItem>),
// Default trait implementation.
/// Auto trait implementation.
///
/// E.g. `impl Trait for .. {}` or `impl<T> Trait<T> for .. {}`
DefaultImpl(Unsafety, TraitRef),
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ declare_features! (
// #[doc(cfg(...))]
(active, doc_cfg, "1.21.0", Some(43781)),
// #[doc(masked)]
(active, doc_masked, "1.21.0", None),
(active, doc_masked, "1.21.0", Some(44027)),

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