Skip to content

Commit bca47e4

Browse files
committed
Merge branch 'master' into update-rls-data-for-save-analysis
2 parents 69ba673 + c2799fc commit bca47e4

File tree

595 files changed

+15135
-6756
lines changed

Some content is hidden

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

595 files changed

+15135
-6756
lines changed

.travis.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ matrix:
1212
fast_finish: true
1313
include:
1414
# Images used in testing PR and try-build should be run first.
15-
- env: IMAGE=x86_64-gnu-llvm-3.7 RUST_BACKTRACE=1
15+
- env: IMAGE=x86_64-gnu-llvm-3.9 RUST_BACKTRACE=1
1616
if: type = pull_request OR branch = auto
1717

1818
- env: IMAGE=dist-x86_64-linux DEPLOY=1
@@ -36,7 +36,7 @@ matrix:
3636
NO_LLVM_ASSERTIONS=1
3737
NO_DEBUG_ASSERTIONS=1
3838
os: osx
39-
osx_image: xcode7
39+
osx_image: xcode7.3
4040
if: branch = auto
4141
4242
# macOS builders. These are placed near the beginning because they are very
@@ -57,7 +57,7 @@ matrix:
5757
NO_LLVM_ASSERTIONS=1
5858
NO_DEBUG_ASSERTIONS=1
5959
os: osx
60-
osx_image: xcode8.2
60+
osx_image: xcode8.3
6161
if: branch = auto
6262
6363
- env: >
@@ -71,7 +71,7 @@ matrix:
7171
NO_LLVM_ASSERTIONS=1
7272
NO_DEBUG_ASSERTIONS=1
7373
os: osx
74-
osx_image: xcode8.2
74+
osx_image: xcode8.3
7575
if: branch = auto
7676
7777
# OSX builders producing releases. These do not run the full test suite and
@@ -91,7 +91,7 @@ matrix:
9191
NO_LLVM_ASSERTIONS=1
9292
NO_DEBUG_ASSERTIONS=1
9393
os: osx
94-
osx_image: xcode7
94+
osx_image: xcode7.3
9595
if: branch = auto
9696
9797
- env: >
@@ -105,7 +105,7 @@ matrix:
105105
NO_LLVM_ASSERTIONS=1
106106
NO_DEBUG_ASSERTIONS=1
107107
os: osx
108-
osx_image: xcode7
108+
osx_image: xcode7.3
109109
if: branch = auto
110110
111111
# Linux builders, remaining docker images
@@ -115,6 +115,8 @@ matrix:
115115
if: branch = auto
116116
- env: IMAGE=cross DEPLOY=1
117117
if: branch = auto
118+
- env: IMAGE=cross2 DEPLOY=1
119+
if: branch = auto
118120
- env: IMAGE=dist-aarch64-linux DEPLOY=1
119121
if: branch = auto
120122
- env: IMAGE=dist-android DEPLOY=1
@@ -125,8 +127,6 @@ matrix:
125127
if: branch = auto
126128
- env: IMAGE=dist-armv7-linux DEPLOY=1
127129
if: branch = auto
128-
- env: IMAGE=dist-fuchsia DEPLOY=1
129-
if: branch = auto
130130
- env: IMAGE=dist-i586-gnu-i686-musl DEPLOY=1
131131
if: branch = auto
132132
- env: IMAGE=dist-i686-freebsd DEPLOY=1

CODE_OF_CONDUCT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A version of this document [can be found online](https://www.rust-lang.org/condu
66

77
**Contact**: [[email protected]](mailto:[email protected])
88

9-
* We are committed to providing a friendly, safe and welcoming environment for all, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, nationality, or other similar characteristic.
9+
* We are committed to providing a friendly, safe and welcoming environment for all, regardless of level of experience, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, nationality, or other similar characteristic.
1010
* On IRC, please avoid using overtly sexual nicknames or other nicknames that might detract from a friendly, safe and welcoming environment for all.
1111
* Please be kind and courteous. There's no need to be mean or rude.
1212
* Respect that people have differences of opinion and that every design or implementation choice carries a trade-off and numerous costs. There is seldom a right answer.

CONTRIBUTING.md

+114-2
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,120 @@ git add path/to/submodule
360360

361361
outside the submodule.
362362

363-
It can also be more convenient during development to set `submodules = false`
364-
in the `config.toml` to prevent `x.py` from resetting to the original branch.
363+
In order to prepare your PR, you can run the build locally by doing
364+
`./x.py build src/tools/TOOL`. If you will be editing the sources
365+
there, you may wish to set `submodules = false` in the `config.toml`
366+
to prevent `x.py` from resetting to the original branch.
367+
368+
#### Breaking Tools Built With The Compiler
369+
[breaking-tools-built-with-the-compiler]: #breaking-tools-built-with-the-compiler
370+
371+
Rust's build system builds a number of tools that make use of the
372+
internals of the compiler. This includes clippy,
373+
[RLS](https://github.com/rust-lang-nursery/rls) and
374+
[rustfmt](https://github.com/rust-lang-nursery/rustfmt). If these tools
375+
break because of your changes, you may run into a sort of "chicken and egg"
376+
problem. These tools rely on the latest compiler to be built so you can't update
377+
them to reflect your changes to the compiler until those changes are merged into
378+
the compiler. At the same time, you can't get your changes merged into the compiler
379+
because the rust-lang/rust build won't pass until those tools build and pass their
380+
tests.
381+
382+
That means that, in the default state, you can't update the compiler without first
383+
fixing rustfmt, rls and the other tools that the compiler builds.
384+
385+
Luckily, a feature was [added to Rust's build](https://github.com/rust-lang/rust/pull/45243)
386+
to make all of this easy to handle. The idea is that you mark the tools as "broken",
387+
so that the rust-lang/rust build passes without trying to build them, then land the change
388+
in the compiler, wait for a nightly, and go update the tools that you broke. Once you're done
389+
and the tools are working again, you go back in the compiler and change the tools back
390+
from "broken".
391+
392+
This should avoid a bunch of synchronization dances and is also much easier on contributors as
393+
there's no need to block on rls/rustfmt/other tools changes going upstream.
394+
395+
Here are those same steps in detail:
396+
397+
1. (optional) First, if it doesn't exist already, create a `config.toml` by copying
398+
`config.toml.example` in the root directory of the Rust repository.
399+
Set `submodules = false` in the `[build]` section. This will prevent `x.py`
400+
from resetting to the original branch after you make your changes. If you
401+
need to [update any submodules to their latest versions][updating-submodules],
402+
see the section of this file about that for more information.
403+
2. (optional) Run `./x.py test src/tools/rustfmt` (substituting the submodule
404+
that broke for `rustfmt`). Fix any errors in the submodule (and possibly others).
405+
3. (optional) Make commits for your changes and send them to upstream repositories as a PR.
406+
4. (optional) Maintainers of these submodules will **not** merge the PR. The PR can't be
407+
merged because CI will be broken. You'll want to write a message on the PR referencing
408+
your change, and how the PR should be merged once your change makes it into a nightly.
409+
5. Update `src/tools/toolstate.toml` to indicate that the tool in question is "broken",
410+
that will disable building it on CI. See the documentation in that file for the exact
411+
configuration values you can use.
412+
6. Commit the changes to `src/tools/toolstate.toml`, **do not update submodules in your commit**,
413+
and then update the PR you have for rust-lang/rust.
414+
7. Wait for your PR to merge.
415+
8. Wait for a nightly
416+
9. (optional) Help land your PR on the upstream repository now that your changes are in nightly.
417+
10. (optional) Send a PR to rust-lang/rust updating the submodule, reverting `src/tools/toolstate.toml` back to a "building" or "testing" state.
418+
419+
#### Updating submodules
420+
[updating-submodules]: #updating-submodules
421+
422+
These instructions are specific to updating `rustfmt`, however they may apply
423+
to the other submodules as well. Please help by improving these instructions
424+
if you find any discrepencies or special cases that need to be addressed.
425+
426+
To update the `rustfmt` submodule, start by running the appropriate
427+
[`git submodule` command](https://git-scm.com/book/en/v2/Git-Tools-Submodules).
428+
For example, to update to the latest commit on the remote master branch,
429+
you may want to run:
430+
```
431+
git submodule update --remote src/tools/rustfmt
432+
```
433+
If you run `./x.py build` now, and you are lucky, it may just work. If you see
434+
an error message about patches that did not resolve to any crates, you will need
435+
to complete a few more steps which are outlined with their rationale below.
436+
437+
*(This error may change in the future to include more information.)*
438+
```
439+
error: failed to resolve patches for `https://github.com/rust-lang-nursery/rustfmt`
440+
441+
Caused by:
442+
patch for `rustfmt-nightly` in `https://github.com/rust-lang-nursery/rustfmt` did not resolve to any crates
443+
failed to run: ~/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo build --manifest-path ~/rust/src/bootstrap/Cargo.toml
444+
```
445+
446+
If you haven't used the `[patch]`
447+
section of `Cargo.toml` before, there is [some relevant documentation about it
448+
in the cargo docs](http://doc.crates.io/manifest.html#the-patch-section). In
449+
addition to that, you should read the
450+
[Overriding dependencies](http://doc.crates.io/specifying-dependencies.html#overriding-dependencies)
451+
section of the documentation as well.
452+
453+
Specifically, the following [section in Overriding dependencies](http://doc.crates.io/specifying-dependencies.html#testing-a-bugfix) reveals what the problem is:
454+
455+
> Next up we need to ensure that our lock file is updated to use this new version of uuid so our project uses the locally checked out copy instead of one from crates.io. The way [patch] works is that it'll load the dependency at ../path/to/uuid and then whenever crates.io is queried for versions of uuid it'll also return the local version.
456+
>
457+
> This means that the version number of the local checkout is significant and will affect whether the patch is used. Our manifest declared uuid = "1.0" which means we'll only resolve to >= 1.0.0, < 2.0.0, and Cargo's greedy resolution algorithm also means that we'll resolve to the maximum version within that range. Typically this doesn't matter as the version of the git repository will already be greater or match the maximum version published on crates.io, but it's important to keep this in mind!
458+
459+
This says that when we updated the submodule, the version number in our
460+
`src/tools/rustfmt/Cargo.toml` changed. The new version is different from
461+
the version in `Cargo.lock`, so the build can no longer continue.
462+
463+
To resolve this, we need to update `Cargo.lock`. Luckily, cargo provides a
464+
command to do this easily.
465+
466+
First, go into the `src/` directory since that is where `Cargo.toml` is in
467+
the rust repository. Then run, `cargo update -p rustfmt-nightly` to solve
468+
the problem.
469+
470+
```
471+
$ cd src
472+
$ cargo update -p rustfmt-nightly
473+
```
474+
475+
This should change the version listed in `src/Cargo.lock` to the new version you updated
476+
the submodule to. Running `./x.py build` should work now.
365477

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

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Read ["Installation"] from [The Book].
1616
## Building from Source
1717
[building-from-source]: #building-from-source
1818

19+
### Building on *nix
1920
1. Make sure you have installed the dependencies:
2021

2122
* `g++` 4.7 or later or `clang++` 3.x or later
@@ -193,7 +194,7 @@ Snapshot binaries are currently built and tested on several platforms:
193194
You may find that other platforms work, but these are our officially
194195
supported build environments that are most likely to work.
195196

196-
Rust currently needs between 600MiB and 1.5GiB to build, depending on platform.
197+
Rust currently needs between 600MiB and 1.5GiB of RAM to build, depending on platform.
197198
If it hits swap, it will take a very long time to build.
198199

199200
There is more advice about hacking on Rust in [CONTRIBUTING.md].

RELEASES.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ Version 1.21.0 (2017-10-12)
33

44
Language
55
--------
6-
- [Relaxed path syntax. You can now add type parameters to values][43540]
7-
Example:
8-
```rust
9-
my_macro!(Vec<i32>::new); // Always worked
10-
my_macro!(Vec::<i32>::new); // Now works
11-
```
126
- [You can now use static references for literals.][43838]
137
Example:
148
```rust
159
fn main() {
1610
let x: &'static u32 = &0;
1711
}
1812
```
13+
- [Relaxed path syntax. Optional `::` before `<` is now allowed in all contexts.][43540]
14+
Example:
15+
```rust
16+
my_macro!(Vec<i32>::new); // Always worked
17+
my_macro!(Vec::<i32>::new); // Now works
18+
```
1919

2020
Compiler
2121
--------

config.toml.example

+14-8
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
# If an external LLVM root is specified, we automatically check the version by
3636
# default to make sure it's within the range that we're expecting, but setting
3737
# this flag will indicate that this version check should not be done.
38-
#version-check = false
38+
#version-check = true
3939

4040
# Link libstdc++ statically into the librustc_llvm instead of relying on a
4141
# dynamic version to be available.
@@ -250,14 +250,11 @@
250250
# Whether or not `panic!`s generate backtraces (RUST_BACKTRACE)
251251
#backtrace = true
252252

253-
# The default linker that will be used by the generated compiler. Note that this
254-
# is not the linker used to link said compiler.
253+
# The default linker that will be hard-coded into the generated compiler for
254+
# targets that don't specify linker explicitly in their target specifications.
255+
# Note that this is not the linker used to link said compiler.
255256
#default-linker = "cc"
256257

257-
# The default ar utility that will be used by the generated compiler if LLVM
258-
# cannot be used. Note that this is not used to assemble said compiler.
259-
#default-ar = "ar"
260-
261258
# The "channel" for the Rust build to produce. The stable/beta channels only
262259
# allow using stable features, whereas the nightly and dev channels allow using
263260
# nightly features
@@ -303,7 +300,7 @@
303300
# =============================================================================
304301
[target.x86_64-unknown-linux-gnu]
305302

306-
# C compiler to be used to compiler C code and link Rust code. Note that the
303+
# C compiler to be used to compiler C code. Note that the
307304
# default value is platform specific, and if not specified it may also depend on
308305
# what platform is crossing to what platform.
309306
#cc = "cc"
@@ -312,6 +309,15 @@
312309
# This is only used for host targets.
313310
#cxx = "c++"
314311

312+
# Archiver to be used to assemble static libraries compiled from C/C++ code.
313+
# Note: an absolute path should be used, otherwise LLVM build will break.
314+
#ar = "ar"
315+
316+
# Linker to be used to link Rust code. Note that the
317+
# default value is platform specific, and if not specified it may also depend on
318+
# what platform is crossing to what platform.
319+
#linker = "cc"
320+
315321
# Path to the `llvm-config` binary of the installation of a custom LLVM to link
316322
# against. Note that if this is specifed we don't compile LLVM at all for this
317323
# target.

0 commit comments

Comments
 (0)