Skip to content

Commit ba27415

Browse files
committed
Auto merge of #46922 - kennytm:rollup, r=kennytm
Rollup of 14 pull requests - Successful merges: #46636, #46780, #46784, #46809, #46814, #46820, #46839, #46847, #46858, #46878, #46884, #46890, #46898, #46918 - Failed merges:
2 parents 250b492 + 0787ad9 commit ba27415

File tree

40 files changed

+453
-329
lines changed

40 files changed

+453
-329
lines changed

Diff for: CONTRIBUTING.md

+28-4
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,17 @@ There are large number of options provided in this config file that will alter t
112112
configuration used in the build process. Some options to note:
113113

114114
#### `[llvm]`:
115+
- `assertions = true` = This enables LLVM assertions, which makes LLVM misuse cause an assertion failure instead of weird misbehavior. This also slows down the compiler's runtime by ~20%.
115116
- `ccache = true` - Use ccache when building llvm
116117

117118
#### `[build]`:
118119
- `compiler-docs = true` - Build compiler documentation
119120

120121
#### `[rust]`:
121-
- `debuginfo = true` - Build a compiler with debuginfo
122-
- `optimize = false` - Disable optimizations to speed up compilation of stage1 rust
122+
- `debuginfo = true` - Build a compiler with debuginfo. Makes building rustc slower, but then you can use a debugger to debug `rustc`.
123+
- `debuginfo-lines = true` - An alternative to `debuginfo = true` that doesn't let you use a debugger, but doesn't make building rustc slower and still gives you line numbers in backtraces.
124+
- `debug-assertions = true` - Makes the log output of `debug!` work.
125+
- `optimize = false` - Disable optimizations to speed up compilation of stage1 rust, but makes the stage1 compiler x100 slower.
123126

124127
For more options, the `config.toml` file contains commented out defaults, with
125128
descriptions of what each option will do.
@@ -273,6 +276,27 @@ build, you'll need to build rustdoc specially, since it's not normally built in
273276
stage 1. `python x.py build --stage 1 src/libstd src/tools/rustdoc` will build
274277
rustdoc and libstd, which will allow rustdoc to be run with that toolchain.)
275278

279+
### Out-of-tree builds
280+
[out-of-tree-builds]: #out-of-tree-builds
281+
282+
Rust's `x.py` script fully supports out-of-tree builds - it looks for
283+
the Rust source code from the directory `x.py` was found in, but it
284+
reads the `config.toml` configuration file from the directory it's
285+
run in, and places all build artifacts within a subdirectory named `build`.
286+
287+
This means that if you want to do an out-of-tree build, you can just do it:
288+
```
289+
$ cd my/build/dir
290+
$ cp ~/my-config.toml config.toml # Or fill in config.toml otherwise
291+
$ path/to/rust/x.py build
292+
...
293+
$ # This will use the Rust source code in `path/to/rust`, but build
294+
$ # artifacts will now be in ./build
295+
```
296+
297+
It's absolutely fine to have multiple build directories with different
298+
`config.toml` configurations using the same code.
299+
276300
## Pull Requests
277301
[pull-requests]: #pull-requests
278302

@@ -446,14 +470,14 @@ failed to run: ~/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo build --ma
446470
If you haven't used the `[patch]`
447471
section of `Cargo.toml` before, there is [some relevant documentation about it
448472
in the cargo docs](http://doc.crates.io/manifest.html#the-patch-section). In
449-
addition to that, you should read the
473+
addition to that, you should read the
450474
[Overriding dependencies](http://doc.crates.io/specifying-dependencies.html#overriding-dependencies)
451475
section of the documentation as well.
452476

453477
Specifically, the following [section in Overriding dependencies](http://doc.crates.io/specifying-dependencies.html#testing-a-bugfix) reveals what the problem is:
454478

455479
> 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-
>
480+
>
457481
> 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!
458482
459483
This says that when we updated the submodule, the version number in our

Diff for: src/liballoc/vec.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,10 @@ use Bound::{Excluded, Included, Unbounded};
224224
/// types inside a `Vec`, it will not allocate space for them. *Note that in this case
225225
/// the `Vec` may not report a [`capacity`] of 0*. `Vec` will allocate if and only
226226
/// if [`mem::size_of::<T>`]`() * capacity() > 0`. In general, `Vec`'s allocation
227-
/// details are subtle enough that it is strongly recommended that you only
228-
/// free memory allocated by a `Vec` by creating a new `Vec` and dropping it.
227+
/// details are very subtle &mdash; if you intend to allocate memory using a `Vec`
228+
/// and use it for something else (either to pass to unsafe code, or to build your
229+
/// own memory-backed collection), be sure to deallocate this memory by using
230+
/// `from_raw_parts` to recover the `Vec` and then dropping it.
229231
///
230232
/// If a `Vec` *has* allocated memory, then the memory it points to is on the heap
231233
/// (as defined by the allocator Rust is configured to use by default), and its

Diff for: src/libcompiler_builtins

Diff for: src/libcore/num/bignum.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ macro_rules! define_bignum {
114114
/// copying it recklessly may result in the performance hit.
115115
/// Thus this is intentionally not `Copy`.
116116
///
117-
/// All operations available to bignums panic in the case of over/underflows.
117+
/// All operations available to bignums panic in the case of overflows.
118118
/// The caller is responsible to use large enough bignum types.
119119
pub struct $name {
120120
/// One plus the offset to the maximum "digit" in use.

0 commit comments

Comments
 (0)