Skip to content

Commit 2e8bca7

Browse files
committed
---
yaml --- r: 233519 b: refs/heads/beta c: 288edec h: refs/heads/master i: 233517: f800b4b 233515: 25c2a82 233511: 353603b 233503: 964cb94 v: v3
1 parent 226c593 commit 2e8bca7

File tree

5 files changed

+11
-94
lines changed

5 files changed

+11
-94
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 572526be2742e368cd522709eccd35df6428fd64
26+
refs/heads/beta: 288edec968441254d42b38ec3d8dec76767f0f24
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 370fe2786109360f7c35b8ba552b83b773dd71d6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/doc/reference.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2059,6 +2059,11 @@ 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.
20622067
* `target_family = "..."`. Operating system family of the target, e. g.
20632068
`"unix"` or `"windows"`. The value of this configuration option is defined
20642069
as a configuration itself, like `unix` or `windows`.

branches/beta/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/beta/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.”

branches/beta/src/libcollections/binary_heap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
//! // 7
113113
//! // +-----------------+
114114
//! // | |
115-
//! // v 1 2 | 2
115+
//! // v 1 2 |
116116
//! // 0 -----> 1 -----> 3 ---> 4
117117
//! // | ^ ^ ^
118118
//! // | | 1 | |

0 commit comments

Comments
 (0)