Skip to content

Commit b5dee26

Browse files
---
yaml --- r: 232646 b: refs/heads/try c: 2f84173 h: refs/heads/master v: v3
1 parent 70c3c27 commit b5dee26

File tree

337 files changed

+4930
-8371
lines changed

Some content is hidden

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

337 files changed

+4930
-8371
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: edeb4f1c86cbf6af8ef9874d4b3af50f721ea1b8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: 9f227ca2c2150205fcc39d7a3b1839eb592baee0
4+
refs/heads/try: 2f84173f2c359041d364579d17a1adc8c6569a44
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/README.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -82,28 +82,6 @@ Read ["Installing Rust"] from [The Book].
8282
$ make && make install
8383
```
8484

85-
## Building Documentation
86-
87-
If you’d like to build the documentation, it’s almost the same:
88-
89-
```sh
90-
./configure
91-
$ make docs
92-
```
93-
94-
Building the documentation requires building the compiler, so the above
95-
details will apply. Once you have the compiler built, you can
96-
97-
```sh
98-
$ make docs NO_REBUILD=1
99-
```
100-
101-
To make sure you don’t re-build the compiler because you made a change
102-
to some documentation.
103-
104-
The generated documentation will appear in a top-level `doc` directory,
105-
created by the `make` rule.
106-
10785
## Notes
10886

10987
Since the Rust compiler is written in Rust, it must be built by a

branches/try/configure

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -607,10 +607,6 @@ valopt aarch64-linux-android-ndk "" "aarch64-linux-android NDK standalone path"
607607
valopt release-channel "dev" "the name of the release channel to build"
608608
valopt musl-root "/usr/local" "MUSL root installation directory"
609609

610-
# Used on systems where "cc" and "ar" are unavailable
611-
valopt default-linker "cc" "the default linker"
612-
valopt default-ar "ar" "the default ar"
613-
614610
# Many of these are saved below during the "writing configuration" step
615611
# (others are conditionally saved).
616612
opt_nosave manage-submodules 1 "let the build manage the git submodules"

branches/try/man/rustc.1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ look for anything here (the default)
4141
.RE
4242
.TP
4343
\fB\-l\fR [\fIKIND\fR=]\fINAME\fR
44-
Link the generated crate(s) to the specified library \fINAME\fR.
44+
Link the generated crate(s) to the specified native library \fINAME\fR.
4545
The optional \fIKIND\fR can be one of \fIstatic\fR, \fIdylib\fR, or
4646
\fIframework\fR.
4747
If omitted, \fIdylib\fR is assumed.
@@ -113,8 +113,7 @@ Print version info and exit.
113113
Use verbose output.
114114
.TP
115115
\fB\-\-extern\fR \fINAME\fR=\fIPATH\fR
116-
Specify where an external rust library is located. These should match
117-
\fIextern\fR declarations in the crate's source code.
116+
Specify where an external rust library is located.
118117
.TP
119118
\fB\-\-sysroot\fR \fIPATH\fR
120119
Override the system root.

branches/try/mk/crates.mk

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ TARGET_CRATES := libc std flate arena term \
5656
alloc_system
5757
RUSTC_CRATES := rustc rustc_typeck rustc_borrowck rustc_resolve rustc_driver \
5858
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \
59-
rustc_data_structures rustc_platform_intrinsics
59+
rustc_data_structures
6060
HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc fmt_macros
6161
TOOLS := compiletest rustdoc rustc rustbook error-index-generator
6262

@@ -74,16 +74,15 @@ DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_bo
7474
rustc_trans rustc_privacy rustc_lint
7575

7676
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back \
77-
log syntax serialize rustc_llvm rustc_platform_intrinsics
78-
DEPS_rustc_typeck := rustc syntax rustc_platform_intrinsics
77+
log syntax serialize rustc_llvm
78+
DEPS_rustc_typeck := rustc syntax
7979
DEPS_rustc_borrowck := rustc log graphviz syntax
8080
DEPS_rustc_resolve := rustc log syntax
8181
DEPS_rustc_privacy := rustc log syntax
8282
DEPS_rustc_lint := rustc log syntax
8383
DEPS_rustc := syntax flate arena serialize getopts rbml \
8484
log graphviz rustc_llvm rustc_back rustc_data_structures
8585
DEPS_rustc_llvm := native:rustllvm libc std rustc_bitflags
86-
DEPS_rustc_platform_intrinsics := rustc rustc_llvm
8786
DEPS_rustc_back := std syntax rustc_llvm flate log libc
8887
DEPS_rustc_data_structures := std log serialize
8988
DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \

branches/try/mk/target.mk

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
# this exists can be found on issue #2400
1414
export CFG_COMPILER_HOST_TRIPLE
1515

16-
# Used as defaults for the runtime ar and cc tools
17-
export CFG_DEFAULT_LINKER
18-
export CFG_DEFAULT_AR
19-
2016
# The standard libraries should be held up to a higher standard than any old
2117
# code, make sure that these common warnings are denied by default. These can
2218
# be overridden during development temporarily. For stage0, we allow warnings

branches/try/src/doc/nomicon/coercions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Coercion is allowed between the following types:
2222
for all pointer types (including smart pointers like Box and Rc). Unsize is
2323
only implemented automatically, and enables the following transformations:
2424

25-
* `[T; n]` => `[T]`
25+
* `[T, ..n]` => `[T]`
2626
* `T` => `Trait` where `T: Trait`
2727
* `Foo<..., T, ...>` => `Foo<..., U, ...>` where:
2828
* `T: Unsize<U>`

branches/try/src/doc/nomicon/safe-unsafe-meaning.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ unsafe impl UnsafeOrd for MyType {
125125
But it's probably not the implementation you want.
126126

127127
Rust has traditionally avoided making traits unsafe because it makes Unsafe
128-
pervasive, which is not desirable. The reason Send and Sync are unsafe is because thread
128+
pervasive, which is not desirable. Send and Sync are unsafe is because thread
129129
safety is a *fundamental property* that unsafe code cannot possibly hope to defend
130130
against in the same way it would defend against a bad Ord implementation. The
131131
only way to possibly defend against thread-unsafety would be to *not use

branches/try/src/doc/reference.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2059,11 +2059,6 @@ The following configurations must be defined by the implementation:
20592059
`"mips"`, `"powerpc"`, `"arm"`, or `"aarch64"`.
20602060
* `target_endian = "..."`. Endianness of the target CPU, either `"little"` or
20612061
`"big"`.
2062-
* `target_env = ".."` - an option provided by the compiler by default
2063-
describing the runtime environment of the target platform. Some examples of
2064-
this are `musl` for builds targeting the MUSL libc implementation, `msvc` for
2065-
Windows builds targeting MSVC, and `gnu` frequently the rest of the time. This
2066-
option may also be blank on some platforms.
20672062
* `target_family = "..."`. Operating system family of the target, e. g.
20682063
`"unix"` or `"windows"`. The value of this configuration option is defined
20692064
as a configuration itself, like `unix` or `windows`.
@@ -2073,7 +2068,6 @@ The following configurations must be defined by the implementation:
20732068
* `target_pointer_width = "..."`. Target pointer width in bits. This is set
20742069
to `"32"` for targets with 32-bit pointers, and likewise set to `"64"` for
20752070
64-bit pointers.
2076-
* `test`. Enabled when compiling the test harness (using the `--test` flag).
20772071
* `unix`. See `target_family`.
20782072
* `windows`. See `target_family`.
20792073

branches/try/src/doc/trpl/concurrency.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -343,14 +343,12 @@ threads as a simple isolation mechanism:
343343
```rust
344344
use std::thread;
345345

346-
let handle = thread::spawn(move || {
346+
let result = thread::spawn(move || {
347347
panic!("oops!");
348-
});
349-
350-
let result = handle.join();
348+
}).join();
351349

352350
assert!(result.is_err());
353351
```
354352

355-
`Thread.join()` gives us a `Result` back, which allows us to check if the thread
353+
Our `Thread` gives us a `Result` back, which allows us to check if the thread
356354
has panicked or not.

branches/try/src/doc/trpl/documentation.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ hello.rs:4 }
7373
```
7474

7575
This [unfortunate error](https://github.com/rust-lang/rust/issues/22547) is
76-
correct: documentation comments apply to the thing after them, and there's
77-
nothing after that last comment.
76+
correct: documentation comments apply to the thing after them, and there's no
77+
thing after that last comment.
7878

7979
[rc-new]: https://doc.rust-lang.org/nightly/std/rc/struct.Rc.html#method.new
8080

@@ -196,10 +196,10 @@ This will highlight according to whatever language you're showing off.
196196
If you're just showing plain text, choose `text`.
197197

198198
It's important to choose the correct annotation here, because `rustdoc` uses it
199-
in an interesting way: It can be used to actually test your examples in a
200-
library crate, so that they don't get out of date. If you have some C code but
201-
`rustdoc` thinks it's Rust because you left off the annotation, `rustdoc` will
202-
complain when trying to generate the documentation.
199+
in an interesting way: It can be used to actually test your examples, so that
200+
they don't get out of date. If you have some C code but `rustdoc` thinks it's
201+
Rust because you left off the annotation, `rustdoc` will complain when trying to
202+
generate the documentation.
203203

204204
## Documentation as tests
205205

@@ -377,8 +377,8 @@ $ rustdoc --test path/to/my/crate/root.rs
377377
$ cargo test
378378
```
379379

380-
That's right, `cargo test` tests embedded documentation too. **However,
381-
`cargo test` will not test binary crates, only library ones.** This is
380+
That's right, `cargo test` tests embedded documentation too. However,
381+
`cargo test` will not test binary crates, only library ones. This is
382382
due to the way `rustdoc` works: it links against the library to be tested,
383383
but with a binary, there’s nothing to link to.
384384

branches/try/src/doc/trpl/functions.md

Lines changed: 4 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -214,61 +214,11 @@ fn diverges() -> ! {
214214

215215
`panic!` is a macro, similar to `println!()` that we’ve already seen. Unlike
216216
`println!()`, `panic!()` causes the current thread of execution to crash with
217-
the given message. Because this function will cause a crash, it will never
218-
return, and so it has the type ‘`!`’, which is read ‘diverges’.
217+
the given message.
219218

220-
If you add a main function that calls `diverges()` and run it, you’ll get
221-
some output that looks like this:
222-
223-
```text
224-
thread ‘<main>’ panicked at ‘This function never returns!’, hello.rs:2
225-
```
226-
227-
If you want more information, you can get a backtrace by setting the
228-
`RUST_BACKTRACE` environment variable:
229-
230-
```text
231-
$ RUST_BACKTRACE=1 ./diverges
232-
thread '<main>' panicked at 'This function never returns!', hello.rs:2
233-
stack backtrace:
234-
1: 0x7f402773a829 - sys::backtrace::write::h0942de78b6c02817K8r
235-
2: 0x7f402773d7fc - panicking::on_panic::h3f23f9d0b5f4c91bu9w
236-
3: 0x7f402773960e - rt::unwind::begin_unwind_inner::h2844b8c5e81e79558Bw
237-
4: 0x7f4027738893 - rt::unwind::begin_unwind::h4375279447423903650
238-
5: 0x7f4027738809 - diverges::h2266b4c4b850236beaa
239-
6: 0x7f40277389e5 - main::h19bb1149c2f00ecfBaa
240-
7: 0x7f402773f514 - rt::unwind::try::try_fn::h13186883479104382231
241-
8: 0x7f402773d1d8 - __rust_try
242-
9: 0x7f402773f201 - rt::lang_start::ha172a3ce74bb453aK5w
243-
10: 0x7f4027738a19 - main
244-
11: 0x7f402694ab44 - __libc_start_main
245-
12: 0x7f40277386c8 - <unknown>
246-
13: 0x0 - <unknown>
247-
```
248-
249-
`RUST_BACKTRACE` also works with Cargo’s `run` command:
250-
251-
```text
252-
$ RUST_BACKTRACE=1 cargo run
253-
Running `target/debug/diverges`
254-
thread '<main>' panicked at 'This function never returns!', hello.rs:2
255-
stack backtrace:
256-
1: 0x7f402773a829 - sys::backtrace::write::h0942de78b6c02817K8r
257-
2: 0x7f402773d7fc - panicking::on_panic::h3f23f9d0b5f4c91bu9w
258-
3: 0x7f402773960e - rt::unwind::begin_unwind_inner::h2844b8c5e81e79558Bw
259-
4: 0x7f4027738893 - rt::unwind::begin_unwind::h4375279447423903650
260-
5: 0x7f4027738809 - diverges::h2266b4c4b850236beaa
261-
6: 0x7f40277389e5 - main::h19bb1149c2f00ecfBaa
262-
7: 0x7f402773f514 - rt::unwind::try::try_fn::h13186883479104382231
263-
8: 0x7f402773d1d8 - __rust_try
264-
9: 0x7f402773f201 - rt::lang_start::ha172a3ce74bb453aK5w
265-
10: 0x7f4027738a19 - main
266-
11: 0x7f402694ab44 - __libc_start_main
267-
12: 0x7f40277386c8 - <unknown>
268-
13: 0x0 - <unknown>
269-
```
270-
271-
A diverging function can be used as any type:
219+
Because this function will cause a crash, it will never return, and so it has
220+
the type ‘`!`’, which is read ‘diverges’. A diverging function can be used
221+
as any type:
272222

273223
```should_panic
274224
# fn diverges() -> ! {

branches/try/src/doc/trpl/glossary.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,6 @@ let z = (8, 2, 6);
3838

3939
In the example above `x` and `y` have arity 2. `z` has arity 3.
4040

41-
### DST (Dynamically Sized Type)
42-
43-
A type without a statically known size or alignment. ([more info][link])
44-
45-
[link]: ../nomicon/exotic-sizes.html#dynamically-sized-types-(dsts)
46-
4741
### Expression
4842

4943
In computer programming, an expression is a combination of values, constants,

branches/try/src/doc/trpl/testing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,8 @@ Let's finally check out that third section: documentation tests.
355355
Nothing is better than documentation with examples. Nothing is worse than
356356
examples that don't actually work, because the code has changed since the
357357
documentation has been written. To this end, Rust supports automatically
358-
running examples in your documentation (**note:** this only works in library
359-
crates, not binary crates). Here's a fleshed-out `src/lib.rs` with examples:
358+
running examples in your documentation. Here's a fleshed-out `src/lib.rs`
359+
with examples:
360360

361361
```rust,ignore
362362
//! The `adder` crate provides functions that add numbers to other numbers.

branches/try/src/doc/trpl/trait-objects.md

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -300,41 +300,3 @@ let y = TraitObject {
300300
// y.method();
301301
(y.vtable.method)(y.data);
302302
```
303-
304-
## Object Safety
305-
306-
Not every trait can be used to make a trait object. For example, vectors implement
307-
`Clone`, but if we try to make a trait object:
308-
309-
```ignore
310-
let v = vec![1, 2, 3];
311-
let o = &v as &Clone;
312-
```
313-
314-
We get an error:
315-
316-
```text
317-
error: cannot convert to a trait object because trait `core::clone::Clone` is not object-safe [E0038]
318-
let o = &v as &Clone;
319-
^~
320-
note: the trait cannot require that `Self : Sized`
321-
let o = &v as &Clone;
322-
^~
323-
```
324-
325-
The error says that `Clone` is not ‘object-safe’. Only traits that are
326-
object-safe can be made into trait objects. A trait is object-safe if both of
327-
these are true:
328-
329-
* the trait does not require that `Self: Sized`
330-
* all of its methods are object-safe
331-
332-
So what makes a method object-safe? Each method must require that `Self: Sized`
333-
or all of the following:
334-
335-
* must not have any type parameters
336-
* must not use `Self`
337-
338-
Whew! As we can see, almost all of these rules talk about `Self`. A good intuition
339-
is “except in special circumstances, if your trait’s method uses `Self`, it is not
340-
object-safe.”

0 commit comments

Comments
 (0)