Skip to content

Commit 39a523b

Browse files
committed
Auto merge of #34139 - steveklabnik:rollup, r=steveklabnik
Rollup of 13 pull requests - Successful merges: #33645, #33897, #33945, #34007, #34060, #34070, #34094, #34098, #34099, #34104, #34124, #34125, #34138 - Failed merges:
2 parents 9b2beca + a0bf3b8 commit 39a523b

Some content is hidden

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

75 files changed

+483
-331
lines changed

CONTRIBUTING.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ root.
108108
There are large number of options accepted by this script to alter the
109109
configuration used later in the build process. Some options to note:
110110

111-
- `--enable-debug` - Build a debug version of the compiler (disables optimizations)
111+
- `--enable-debug` - Build a debug version of the compiler (disables optimizations,
112+
which speeds up compilation of stage1 rustc)
112113
- `--enable-optimize` - Enable optimizations (can be used with `--enable-debug`
113114
to make a debug build with optimizations)
114115
- `--disable-valgrind-rpass` - Don't run tests with valgrind
@@ -128,6 +129,12 @@ Some common make targets are:
128129
cases we don't need to build the stage2 compiler, so we can save time by not
129130
building it. The stage1 compiler is a fully functioning compiler and
130131
(probably) will be enough to determine if your change works as expected.
132+
- `make $host/stage1/bin/rustc` - Where $host is a target triple like x86_64-unknown-linux-gnu.
133+
This will build just rustc, without libstd. This is the fastest way to recompile after
134+
you changed only rustc source code. Note however that the resulting rustc binary
135+
won't have a stdlib to link against by default. You can build libstd once with
136+
`make rustc-stage1`, rustc will pick it up afterwards. libstd is only guaranteed to
137+
work if recompiled, so if there are any issues recompile it.
131138
- `make check` - build the full compiler & run all tests (takes a while). This
132139
is what gets run by the continuous integration system against your pull
133140
request. You should run this before submitting to make sure your tests pass

Makefile.in

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@
6262
# * tidy - Basic style check, show highest rustc error code and
6363
# the status of language and lib features
6464
# * rustc-stage$(stage) - Only build up to a specific stage
65+
# * $host/stage1/bin/rustc - Only build stage1 rustc, not libstd. For further
66+
# information see "Rust recipes for build system success" below.
6567
#
6668
# Then mix in some of these environment variables to harness the
6769
# ultimate power of The Rust Build System.
@@ -93,6 +95,15 @@
9395
# // Modifying libstd? Use this command to run unit tests just on your change
9496
# make check-stage1-std NO_REBUILD=1 NO_BENCH=1
9597
#
98+
# // Modifying just rustc?
99+
# // Compile rustc+libstd once
100+
# make rustc-stage1
101+
# // From now on use this command to rebuild just rustc and reuse the previously built libstd
102+
# // $host is a target triple, eg. x86_64-unknown-linux-gnu
103+
# // The resulting binary is located at $host/stage1/bin/rustc.
104+
# // If there are any issues with libstd recompile it with the command above.
105+
# make $host/stage1/bin/rustc
106+
#
96107
# // Added a run-pass test? Use this to test running your test
97108
# make check-stage1-rpass TESTNAME=my-shiny-new-test
98109
#

configure

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -988,11 +988,11 @@ then
988988
LLVM_VERSION=$($LLVM_CONFIG --version)
989989

990990
case $LLVM_VERSION in
991-
(3.[6-8]*)
991+
(3.[7-8]*)
992992
msg "found ok version of LLVM: $LLVM_VERSION"
993993
;;
994994
(*)
995-
err "bad LLVM version: $LLVM_VERSION, need >=3.6"
995+
err "bad LLVM version: $LLVM_VERSION, need >=3.7"
996996
;;
997997
esac
998998
fi

src/doc/book/functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ stack backtrace:
249249
If you need to override an already set `RUST_BACKTRACE`,
250250
in cases when you cannot just unset the variable,
251251
then set it to `0` to avoid getting a backtrace.
252-
Any other value(even no value at all) turns on backtrace.
252+
Any other value (even no value at all) turns on backtrace.
253253

254254
```text
255255
$ export RUST_BACKTRACE=1

src/doc/book/testing.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,9 @@ the `tests` directory.
380380

381381
# The `tests` directory
382382

383-
To write an integration test, let's make a `tests` directory, and
384-
put a `tests/lib.rs` file inside, with this as its contents:
383+
Each file in `tests/*.rs` directory is treated as individual crate.
384+
So, to write an integration test, let's make a `tests` directory, and
385+
put a `tests/integration_test.rs` file inside, with this as its contents:
385386

386387
```rust,ignore
387388
extern crate adder;
@@ -394,8 +395,8 @@ fn it_works() {
394395
```
395396

396397
This looks similar to our previous tests, but slightly different. We now have
397-
an `extern crate adder` at the top. This is because the tests in the `tests`
398-
directory are an entirely separate crate, and so we need to import our library.
398+
an `extern crate adder` at the top. This is because each test in the `tests`
399+
directory is an entirely separate crate, and so we need to import our library.
399400
This is also why `tests` is a suitable place to write integration-style tests:
400401
they use the library like any other consumer of it would.
401402

@@ -428,6 +429,11 @@ test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
428429
Now we have three sections: our previous test is also run, as well as our new
429430
one.
430431

432+
Cargo will ignore files in subdirectories of the `tests/` directory.
433+
Therefore shared modules in integrations tests are possible.
434+
For example `tests/common/mod.rs` is not seperatly compiled by cargo but can
435+
be imported in every test with `mod common;`
436+
431437
That's all there is to the `tests` directory. The `tests` module isn't needed
432438
here, since the whole thing is focused on tests.
433439

src/doc/book/variable-bindings.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ of our minds as we go forward.
3737
Rust is a statically typed language, which means that we specify our types up
3838
front, and they’re checked at compile time. So why does our first example
3939
compile? Well, Rust has this thing called ‘type inference’. If it can figure
40-
out what the type of something is, Rust doesn’t require you to actually type it
41-
out.
40+
out what the type of something is, Rust doesn’t require you to explicitly type
41+
it out.
4242

4343
We can add the type if we want to, though. Types come after a colon (`:`):
4444

@@ -159,8 +159,9 @@ error: aborting due to previous error
159159
Could not compile `hello_world`.
160160
```
161161

162-
Rust will not let us use a value that has not been initialized. Next, let’s
163-
talk about this stuff we've added to `println!`.
162+
Rust will not let us use a value that has not been initialized.
163+
164+
Let take a minute to talk about this stuff we've added to `println!`.
164165

165166
If you include two curly braces (`{}`, some call them moustaches...) in your
166167
string to print, Rust will interpret this as a request to interpolate some sort
@@ -222,8 +223,8 @@ To learn more, run the command again with --verbose.
222223
```
223224
224225
Additionally, variable bindings can be shadowed. This means that a later
225-
variable binding with the same name as another binding, that's currently in
226-
scope, will override the previous binding.
226+
variable binding with the same name as another binding that is currently in
227+
scope will override the previous binding.
227228
228229
```rust
229230
let x: i32 = 8;
@@ -240,7 +241,10 @@ println!("{}", x); // Prints "42"
240241
Shadowing and mutable bindings may appear as two sides of the same coin, but
241242
they are two distinct concepts that can't always be used interchangeably. For
242243
one, shadowing enables us to rebind a name to a value of a different type. It
243-
is also possible to change the mutability of a binding.
244+
is also possible to change the mutability of a binding. Note that shadowing a
245+
name does not alter or destroy the value it was bound to, and the value will
246+
continue to exist until it goes out of scope, even if it is no longer accessible
247+
by any means.
244248

245249
```rust
246250
let mut x: i32 = 1;

src/doc/reference.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1983,6 +1983,7 @@ macro scope.
19831983

19841984
### Miscellaneous attributes
19851985

1986+
- `deprecated` - mark the item as deprecated; the full attribute is `#[deprecated(since = "crate version", note = "...")`, where both arguments are optional.
19861987
- `export_name` - on statics and functions, this determines the name of the
19871988
exported symbol.
19881989
- `link_section` - on statics and functions, this specifies the section of the
@@ -2426,8 +2427,6 @@ The currently implemented features of the reference compiler are:
24262427
* - `stmt_expr_attributes` - Allows attributes on expressions and
24272428
non-item statements.
24282429

2429-
* - `deprecated` - Allows using the `#[deprecated]` attribute.
2430-
24312430
* - `type_ascription` - Allows type ascription expressions `expr: Type`.
24322431

24332432
* - `abi_vectorcall` - Allows the usage of the vectorcall calling convention

src/doc/rust.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ a > code {
229229
pre.rust .kw { color: #8959A8; }
230230
pre.rust .kw-2, pre.rust .prelude-ty { color: #4271AE; }
231231
pre.rust .number, pre.rust .string { color: #718C00; }
232-
pre.rust .self, pre.rust .boolval, pre.rust .prelude-val,
232+
pre.rust .self, pre.rust .bool-val, pre.rust .prelude-val,
233233
pre.rust .attribute, pre.rust .attribute .ident { color: #C82829; }
234234
pre.rust .comment { color: #8E908C; }
235235
pre.rust .doccomment { color: #4D4D4C; }

src/liballoc/rc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ impl<T> Rc<T> {
271271
}
272272

273273
impl<T: ?Sized> Rc<T> {
274-
/// Downgrades the `Rc<T>` to a `Weak<T>` reference.
274+
/// Creates a new `Weak<T>` reference from this value.
275275
///
276276
/// # Examples
277277
///

src/libcollections/str.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,8 +1404,8 @@ impl str {
14041404
/// Returns a string slice with all prefixes and suffixes that match a
14051405
/// pattern repeatedly removed.
14061406
///
1407-
/// The pattern can be a `&str`, [`char`], or a closure that determines
1408-
/// if a character matches.
1407+
/// The pattern can be a [`char`] or a closure that determines if a
1408+
/// character matches.
14091409
///
14101410
/// [`char`]: primitive.char.html
14111411
///

0 commit comments

Comments
 (0)