Skip to content

Commit b98d273

Browse files
authored
Merge pull request #75 from rust-lang-nursery/backfill-contents
Backfill contents since 1.0
2 parents 9421990 + fcc1b17 commit b98d273

File tree

72 files changed

+2145
-287
lines changed

Some content is hidden

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

72 files changed

+2145
-287
lines changed

book.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
authors = ["The Rust Project Developers"]
33
multilingual = false
44
src = "src"
5-
title = "The Rust Edition Guide"
5+
title = "The Edition Guide"

src/2018/transitioning/concurrency/async-await.md

-17
This file was deleted.

src/2018/transitioning/concurrency/index.md

-10
This file was deleted.

src/2018/transitioning/errors/index.md

-5
This file was deleted.

src/2018/transitioning/modules/index.md

-13
This file was deleted.

src/2018/transitioning/ownership-and-lifetimes/default-match-bindings.md

-57
This file was deleted.

src/2018/transitioning/ownership-and-lifetimes/in-band-lifetimes.md

-20
This file was deleted.

src/2018/transitioning/ownership-and-lifetimes/index.md

-5
This file was deleted.

src/2018/transitioning/ownership-and-lifetimes/lifetime-elision-in-impl.md

-52
This file was deleted.

src/2018/transitioning/to-rust-2018.md

-5
This file was deleted.

src/2018/transitioning/traits/index.md

-5
This file was deleted.

src/SUMMARY.md

+68-27
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,71 @@
1-
# Summary
1+
# The Edition Guide
22

33
[Introduction](introduction.md)
44

5-
- [What are Editions?](editions/index.md)
6-
- [Transitioning your code to a new edition](editions/transitioning.md)
7-
8-
- [Rust 2015](2015/index.md)
9-
10-
- [Rust 2018](2018/index.md)
11-
- [Feature status](2018/status.md)
12-
- [Transitioning to Rust 2018](2018/transitioning/to-rust-2018.md)
13-
- [Trait system](2018/transitioning/traits/index.md)
14-
- [`dyn Trait`](2018/transitioning/traits/dyn-trait.md)
15-
- [`impl Trait`](2018/transitioning/traits/impl-trait.md)
16-
- [Module system](2018/transitioning/modules/index.md)
17-
- [Path clarity](2018/transitioning/modules/path-clarity.md)
18-
- [Macro changes](2018/transitioning/modules/macros.md)
19-
- [Concurrency additions](2018/transitioning/concurrency/index.md)
20-
- [`async`/`await`](2018/transitioning/concurrency/async-await.md)
21-
- [Ownership and lifetimes](2018/transitioning/ownership-and-lifetimes/index.md)
22-
- [`'_`, the anonymous lifetime](2018/transitioning/ownership-and-lifetimes/anonymous-lifetime.md)
23-
- [In-band lifetimes](2018/transitioning/ownership-and-lifetimes/in-band-lifetimes.md)
24-
- [Default match bindings](2018/transitioning/ownership-and-lifetimes/default-match-bindings.md)
25-
- [Lifetime elision in `impl`](2018/transitioning/ownership-and-lifetimes/lifetime-elision-in-impl.md)
26-
- [`T: 'a` inference in structs](2018/transitioning/ownership-and-lifetimes/struct-inference.md)
27-
- [Slice patterns](2018/transitioning/slice-patterns.md)
28-
- [Error Handling](2018/transitioning/errors/index.md)
29-
- [`?` in `fn main()` and `#[test]`s](2018/transitioning/errors/question-mark.md)
30-
- [Raw identifiers](2018/transitioning/raw-identifiers.md)
5+
## What are editions?
6+
7+
- [What are editions?](editions/index.md)
8+
- [Transitioning your code to a new edition](editions/transitioning-your-code-to-a-new-edition.md)
9+
10+
## Rust 2015
11+
12+
- [Rust 2015](rust-2015/index.md)
13+
14+
## Rust 2018
15+
16+
- [Rust 2018](rust-2018/index.md)
17+
- [MUSL support for fully static binaries](rust-2018/musl-support-for-fully-static-binaries.md)
18+
- [`cargo rustc` for passing arbitrary flags to `rustc`](rust-2018/cargo-rustc-for-passing-arbitrary-flags-to-rustc.md)
19+
- [MSVC toolchain support](rust-2018/msvc-toolchain-support.md)
20+
- [Better support for trait objects](rust-2018/better-support-for-trait-objects.md)
21+
- [The Rustonomicon](rust-2018/the-rustonomicon.md)
22+
- [`cargo install` for easy installation of tools](rust-2018/cargo-install-for-easy-installation-of-tools.md)
23+
- [`libcore` for low-level Rust](rust-2018/libcore-for-low-level-rust.md)
24+
- [Crates.io disallows wildcard dependencies](rust-2018/crates-io-disallows-wildcard-dependencies.md)
25+
- ["Operator-equals" are now implementable](rust-2018/operator-equals-are-now-implementable.md)
26+
- [Controlling panics with `std::panic`](rust-2018/controlling-panics-with-std-panic.md)
27+
- [An attribute for deprecation](rust-2018/an-attribute-for-deprecation.md)
28+
- [Aborting on panic](rust-2018/aborting-on-panic.md)
29+
- [`cdylib` crates for C interoperability](rust-2018/cdylib-crates-for-c-interoperability.md)
30+
- [Improved error messages](rust-2018/improved-error-messages.md)
31+
- [Cargo workspaces for multi-package projects](rust-2018/cargo-workspaces-for-multi-package-projects.md)
32+
- [Cargo can use a local registry replacement](rust-2018/cargo-can-use-a-local-registry-replacement.md)
33+
- [The question mark operator for easier error handling](rust-2018/the-question-mark-operator-for-easier-error-handling.md)
34+
- [Rustup for managing Rust versions](rust-2018/rustup-for-managing-rust-versions.md)
35+
- [WebAssembly support](rust-2018/webassembly-support.md)
36+
- [Custom Derive](rust-2018/custom-derive.md)
37+
- [`cargo check` for faster checking](rust-2018/cargo-check-for-faster-checking.md)
38+
- [Simpler lifetimes in `static` and `const`](rust-2018/simpler-lifetimes-in-static-and-const.md)
39+
- [Field init shorthand](rust-2018/field-init-shorthand.md)
40+
- [New editions of the "the book"](rust-2018/new-editions-of-the-book.md)
41+
- [`pub` learns some new tricks](rust-2018/pub-learns-some-new-tricks.md)
42+
- [`union` for an unsafe form of `enum`](rust-2018/union-for-an-unsafe-form-of-enum.md)
43+
- [Loops can `break` with a value](rust-2018/loops-can-break-with-a-value.md)
44+
- [Associated constants](rust-2018/associated-constants.md)
45+
- [`std::os` has documentation for all platforms](rust-2018/std-os-has-documentation-for-all-platforms.md)
46+
- [The Rust Bookshelf](rust-2018/the-rust-bookshelf.md)
47+
- [Replacing dependencies with `patch`](rust-2018/replacing-dependencies-with-patch.md)
48+
- [Documentation tests can now `compile-fail`](rust-2018/documentation-tests-can-now-compile-fail.md)
49+
- [Multi-file `examples`](rust-2018/multi-file-examples.md)
50+
- [Incremental Compilation for faster compiles](rust-2018/incremental-compilation-for-faster-compiles.md)
51+
- [Nested imports with `use`](rust-2018/nested-imports-with-use.md)
52+
- [Rustdoc uses CommonMark](rust-2018/rustdoc-uses-commonmark.md)
53+
- [Choosing alignment with the `repr` attribute](rust-2018/choosing-alignment-with-the-repr-attribute.md)
54+
- [`cargo new` defaults to a binary project](rust-2018/cargo-new-defaults-to-a-binary-project.md)
55+
- [`impl Trait` for returning complex types with ease](rust-2018/impl-trait-for-returning-complex-types-with-ease.md)
56+
- [Default `match` bindings](rust-2018/default-match-bindings.md)
57+
- [`..=` for inclusive ranges](rust-2018/inclusive-ranges.md)
58+
- [Slice patterns](rust-2018/slice-patterns.md)
59+
- [128 bit integers](rust-2018/128-bit-integers.md)
60+
- [SIMD for faster computing](rust-2018/simd-for-faster-computing.md)
61+
- [`dyn Trait` for trait objects](rust-2018/dyn-trait-for-trait-objects.md)
62+
- [Global allocators](rust-2018/global-allocators.md)
63+
- [Raw identifiers](rust-2018/raw-identifiers.md)
64+
- [`'_`, the anonymous lifetime](rust-2018/the-anonymous-lifetime.md)
65+
- [Lifetime elision in `impl`](rust-2018/lifetime-elision-in-impl.md)
66+
- [`T: 'a` inference in structs](rust-2018/inference-in-structs.md)
67+
- [Macro changes](rust-2018/macro-changes.md)
68+
- [Path clarity](rust-2018/path-clarity.md)
69+
- [`async`/`await` for easier concurrency](rust-2018/async-await-for-easier-concurrency.md)
70+
71+
- [Unstable feature status](unstable-feature-status.md)

src/editions/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ advantage of such features.
4747
At the time of writing, there are two editions: 2015 and 2018. 2015 is today's
4848
Rust; Rust 2018 will ship later this year. To transition to the 2018 edition
4949
from the 2015 edition, you'll want to get started with the [transition
50-
guide](editions/transitioning.html).
50+
section](editions/transitioning-your-code-to-a-new-edition.html).

src/introduction.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,8 @@ In this guide, we'll discuss:
99
* What each edition is about
1010
* How to migrate your code from one edition to another
1111

12-
Read on for more!
12+
Note that the standard library grows with each Rust release; there are *many*
13+
additions to the standard library that are not called out in this guide. Only
14+
the major ones are, but there's tons of medium and small things that are
15+
great too. You may want to check out [the standard library
16+
documentation](https://doc.rust-lang.org/std/) as well.

src/2015/index.md renamed to src/rust-2015/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ projects on top of.
1515

1616
Since it's the default edition, there's no way to port your code to Rust
1717
2015; it just *is*. You'll be transitioning *away* from 2015, but never
18-
really *to* 2015. As such, there's not much else to say about it!
18+
really *to* 2015. As such, there's not much else to say about it!

src/rust-2018/128-bit-integers.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# 128 bit integers
2+
3+
![Minimum Rust version: 1.26](https://img.shields.io/badge/Minimum%20Rust%20Version-1.26-brightgreen.svg)
4+
5+
A very simple feature: Rust now has 128 bit integers!
6+
7+
```rust
8+
let x: i128 = 0;
9+
let y: u128 = 0;
10+
```
11+
12+
These are twice the size of `u64`, and so can hold more values. More specifically,
13+
14+
* `u128`: `0` - `340,282,366,920,938,463,463,374,607,431,768,211,455`
15+
* `i128`: `−170,141,183,460,469,231,731,687,303,715,884,105,728` - `170,141,183,460,469,231,731,687,303,715,884,105,727`
16+
17+
Whew!

src/rust-2018/aborting-on-panic.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Aborting on panic
2+
3+
![Minimum Rust version: 1.10](https://img.shields.io/badge/Minimum%20Rust%20Version-1.10-brightgreen.svg)
4+
5+
By default, Rust programs will unwind the stack when a `panic!` happens. If you'd prefer an
6+
immediate abort instead, you can configure this in `Cargo.toml`:
7+
8+
```toml
9+
[profile.debug]
10+
panic = "abort"
11+
12+
[profile.release]
13+
panic = "abort"
14+
```
15+
16+
Why might you choose to do this? By removing support for unwinding, you'll
17+
get smaller binaries. You will lose the ability to catch panics. Which choice
18+
is right for you depends on exactly what you're doing.

0 commit comments

Comments
 (0)