Skip to content

Commit 30e7e6e

Browse files
committed
Auto merge of #24195 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #24143, #24149, #24167, #24178 - Failed merges:
2 parents 9266d59 + 12e9d7c commit 30e7e6e

Some content is hidden

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

52 files changed

+970
-2032
lines changed

src/doc/complement-design-faq.md

+10-6
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,17 @@ This is to make the language easier to parse for humans, especially in the face
163163
of higher-order functions. `fn foo<T>(f: fn(int): int, fn(T): U): U` is not
164164
particularly easy to read.
165165

166-
## `let` is used to introduce variables
166+
## Why is `let` used to introduce variables?
167167

168-
`let` not only defines variables, but can do pattern matching. One can also
169-
redeclare immutable variables with `let`. This is useful to avoid unnecessary
170-
`mut` annotations. An interesting historical note is that Rust comes,
171-
syntactically, most closely from ML, which also uses `let` to introduce
172-
bindings.
168+
We don't use the term "variable", instead, we use "variable bindings". The
169+
simplest way for binding is the `let` syntax, other ways including `if let`,
170+
`while let` and `match`. Bindings also exist in function arguments positions.
171+
172+
Bindings always happen in pattern matching positions, and it's also Rust's way
173+
to declare mutability. One can also redeclare mutability of a binding in
174+
pattern matching. This is useful to avoid unnecessary `mut` annotations. An
175+
interesting historical note is that Rust comes, syntactically, most closely
176+
from ML, which also uses `let` to introduce bindings.
173177

174178
See also [a long thread][alt] on renaming `let mut` to `var`.
175179

src/doc/trpl/SUMMARY.md

+48-27
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,69 @@
11
# Summary
22

3-
* [The Basics](basic.md)
3+
* [Getting Started](getting-started.md)
44
* [Installing Rust](installing-rust.md)
55
* [Hello, world!](hello-world.md)
66
* [Hello, Cargo!](hello-cargo.md)
7+
* [Learn Rust](learn-rust.md)
8+
* [Effective Rust](effective-rust.md)
9+
* [The Stack and the Heap](the-stack-and-the-heap.md)
10+
* [`Debug` and `Display`](debug-and-display.md)
11+
* [Testing](testing.md)
12+
* [Documentation](documentation.md)
13+
* [Iterators](iterators.md)
14+
* [Concurrency](concurrency.md)
15+
* [Error Handling](error-handling.md)
16+
* [FFI](ffi.md)
17+
* [`Deref` coercions](deref-coercions.md)
18+
* [Syntax and Semantics](syntax-and-semantics.md)
719
* [Variable Bindings](variable-bindings.md)
8-
* [If](if.md)
20+
* [Primitive Types](primitive-types.md)
921
* [Functions](functions.md)
1022
* [Comments](comments.md)
11-
* [Compound Data Types](compound-data-types.md)
23+
* [Structs](structs.md)
24+
* [Mutability](mutability.md)
25+
* [Method Syntax](method-syntax.md)
26+
* [Enums](enums.md)
27+
* [`if`](if.md)
1228
* [Match](match.md)
13-
* [Looping](looping.md)
29+
* [Patterns](patterns.md)
30+
* [`for` loops](for-loops.md)
31+
* [`while` loops](while-loops.md)
32+
* [Ownership](ownership.md)
33+
* [References and Borrowing](references-and-borrowing.md)
34+
* [Lifetimes](lifetimes.md)
35+
* [Move semantics](move-semantics.md)
36+
* [Drop](drop.md)
37+
* [Vectors](vectors.md)
38+
* [Arrays](arrays.md)
39+
* [Slices](slices.md)
1440
* [Strings](strings.md)
15-
* [Arrays, Vectors, and Slices](arrays-vectors-and-slices.md)
16-
* [Intermediate Rust](intermediate.md)
41+
* [Traits](traits.md)
42+
* [Operators and Overloading](operators-and-overloading.md)
43+
* [Generics](generics.md)
44+
* [Trait Objects](trait-objects.md)
45+
* [Closures](closures.md)
46+
* [Universal Function Call Syntax](ufcs.md)
1747
* [Crates and Modules](crates-and-modules.md)
18-
* [Testing](testing.md)
19-
* [Pointers](pointers.md)
20-
* [Ownership](ownership.md)
21-
* [More Strings](more-strings.md)
22-
* [Patterns](patterns.md)
23-
* [Method Syntax](method-syntax.md)
48+
* [`static`](static.md)
49+
* [`const`](const.md)
50+
* [Tuples](tuples.md)
51+
* [Tuple Structs](tuple-structs.md)
52+
* [Attributes](attributes.md)
53+
* [Conditional Compilation](conditional-compilation.md)
54+
* [`type` aliases](type-aliases.md)
55+
* [Casting between types](casting-between-types.md)
2456
* [Associated Types](associated-types.md)
25-
* [Closures](closures.md)
26-
* [Iterators](iterators.md)
27-
* [Generics](generics.md)
28-
* [Traits](traits.md)
29-
* [Static and Dynamic Dispatch](static-and-dynamic-dispatch.md)
57+
* [Unsized Types](unsized-types.md)
3058
* [Macros](macros.md)
31-
* [Concurrency](concurrency.md)
32-
* [Error Handling](error-handling.md)
33-
* [Documentation](documentation.md)
34-
* [Advanced Topics](advanced.md)
35-
* [FFI](ffi.md)
36-
* [Unsafe Code](unsafe.md)
37-
* [Advanced Macros](advanced-macros.md)
38-
* [Unstable Rust](unstable.md)
39-
* [Compiler Plugins](plugins.md)
59+
* [`unsafe` Code](unsafe-code.md)
60+
* [Nightly Rust](nightly-rust.md)
61+
* [Compiler Plugins](compiler-plugins.md)
4062
* [Inline Assembly](inline-assembly.md)
4163
* [No stdlib](no-stdlib.md)
4264
* [Intrinsics](intrinsics.md)
4365
* [Lang items](lang-items.md)
4466
* [Link args](link-args.md)
4567
* [Benchmark Tests](benchmark-tests.md)
4668
* [Box Syntax and Patterns](box-syntax-and-patterns.md)
47-
* [Conclusion](conclusion.md)
4869
* [Glossary](glossary.md)

src/doc/trpl/advanced-macros.md

-242
This file was deleted.

src/doc/trpl/advanced.md

-8
This file was deleted.

0 commit comments

Comments
 (0)