Skip to content

Commit 9fa400b

Browse files
author
Ulrik Sverdrup
committed
---
yaml --- r: 212472 b: refs/heads/master c: c00b859 h: refs/heads/master v: v3
1 parent 0187b1e commit 9fa400b

File tree

121 files changed

+1028
-2984
lines changed

Some content is hidden

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

121 files changed

+1028
-2984
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: cf685cb8f887ea1e3f058e57490bfb44a5bfd7d4
2+
refs/heads/master: c00b859c9daf6e2c42bef89147e1da7eb05f3e4e
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
55
refs/heads/try: 1864973ae17213c5a58c4dd3f9af6d1b6c7d2e05

trunk/mk/cfg/x86_64-pc-windows-msvc.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ CFG_STATIC_LIB_NAME_x86_64-pc-windows-msvc=$(1).lib
99
CFG_LIB_GLOB_x86_64-pc-windows-msvc=$(1)-*.dll
1010
CFG_LIB_DSYM_GLOB_x86_64-pc-windows-msvc=$(1)-*.dylib.dSYM
1111
CFG_JEMALLOC_CFLAGS_x86_64-pc-windows-msvc :=
12-
CFG_GCCISH_CFLAGS_x86_64-pc-windows-msvc := -MD
13-
CFG_GCCISH_CXXFLAGS_x86_64-pc-windows-msvc := -MD
12+
CFG_GCCISH_CFLAGS_x86_64-pc-windows-msvc :=
13+
CFG_GCCISH_CXXFLAGS_x86_64-pc-windows-msvc :=
1414
CFG_GCCISH_LINK_FLAGS_x86_64-pc-windows-msvc :=
1515
CFG_GCCISH_DEF_FLAG_x86_64-pc-windows-msvc :=
1616
CFG_LLC_FLAGS_x86_64-pc-windows-msvc :=

trunk/mk/docs.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ DOC_TARGETS += doc/not_found.html
169169
doc/not_found.html: $(D)/not_found.md $(HTML_DEPS) | doc/
170170
@$(call E, rustdoc: $@)
171171
$(Q)$(RUSTDOC) $(RUSTDOC_HTML_OPTS_NO_CSS) \
172-
--markdown-no-toc \
173172
--markdown-css http://doc.rust-lang.org/rust.css $<
174173

175174
define DEF_DOC

trunk/src/doc/complement-lang-faq.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ You may also be interested in browsing [trending Rust repositories][github-rust]
3030

3131
## Is anyone using Rust in production?
3232

33-
Yes. For example (incomplete):
33+
Currently, Rust is still pre-1.0, and so we don't recommend that you use Rust
34+
in production unless you know exactly what you're getting into.
35+
36+
That said, there are two production deployments of Rust that we're aware of:
3437

3538
* [OpenDNS](http://labs.opendns.com/2013/10/04/zeromq-helping-us-block-malicious-domains/)
3639
* [Skylight](http://skylight.io)
37-
* [wit.ai](https://github.com/wit-ai/witd)
38-
* [Codius](https://codius.org/blog/codius-rust/)
39-
* [MaidSafe](http://maidsafe.net/)
40+
41+
Let the fact that this is an easily countable number be a warning.
4042

4143
## Does it run on Windows?
4244

trunk/src/doc/grammar.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,7 @@ type_path_tail : '<' type_expr [ ',' type_expr ] + '>'
281281
## Macros
282282

283283
```antlr
284-
expr_macro_rules : "macro_rules" '!' ident '(' macro_rule * ')' ';'
285-
| "macro_rules" '!' ident '{' macro_rule * '}' ;
284+
expr_macro_rules : "macro_rules" '!' ident '(' macro_rule * ')' ;
286285
macro_rule : '(' matcher * ')' "=>" '(' transcriber * ')' ';' ;
287286
matcher : '(' matcher * ')' | '[' matcher * ']'
288287
| '{' matcher * '}' | '$' ident ':' ident

trunk/src/doc/not_found.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ Looks like you've taken a wrong turn.
1111

1212
Some things that might be helpful to you though:
1313

14-
# Search
14+
## Search
1515

1616
* <form action="https://duckduckgo.com/">
1717
<input type="text" id="site-search" name="q" size="80"></input>
1818
<input type="submit" value="Search DuckDuckGo">
1919
</form>
2020
* Rust doc search: <span id="core-search"></span>
2121

22-
# Reference
22+
## Reference
2323

2424
* [The Rust official site](http://rust-lang.org)
2525
* [The Rust reference](http://doc.rust-lang.org/reference.html)
2626

27-
# Docs
27+
## Docs
2828

2929
* [The standard library](http://doc.rust-lang.org/std/)
3030

trunk/src/doc/reference.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,6 +1367,7 @@ Traits can include default implementations of methods, as in:
13671367
```
13681368
trait Foo {
13691369
fn bar(&self);
1370+
13701371
fn baz(&self) { println!("We called baz."); }
13711372
}
13721373
```

trunk/src/doc/trpl/const-and-static.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,7 @@ unsafe {
6464

6565
[unsafe]: unsafe.html
6666

67-
Furthermore, any type stored in a `static` must be `Sync`, and may not have
68-
a [`Drop`][drop] implementation.
69-
70-
[drop]: drop.html
67+
Furthermore, any type stored in a `static` must be `Sync`.
7168

7269
# Initializing
7370

@@ -81,3 +78,7 @@ Almost always, if you can choose between the two, choose `const`. It’s pretty
8178
rare that you actually want a memory location associated with your constant,
8279
and using a const allows for optimizations like constant propagation not only
8380
in your crate but downstream crates.
81+
82+
A const can be thought of as a `#define` in C: it has metadata overhead but it
83+
has no runtime overhead. “Should I use a #define or a static in C,” is largely
84+
the same question as whether you should use a const or a static in Rust.

trunk/src/doc/trpl/dining-philosophers.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -674,13 +674,9 @@ let handles: Vec<_> = philosophers.into_iter().map(|p| {
674674

675675
Finally, inside of our `map()`/`collect()` loop, we call `table.clone()`. The
676676
`clone()` method on `Arc<T>` is what bumps up the reference count, and when it
677-
goes out of scope, it decrements the count. This is needed so that we know how
678-
many references to `table` exist across our threads. If we didn’t have a count,
679-
we wouldn’t know how to deallocate it.
680-
681-
You’ll notice we can introduce a new binding to `table` here, and it will
682-
shadow the old one. This is often used so that you don’t need to come up with
683-
two unique names.
677+
goes out of scope, it decrements the count. You’ll notice we can introduce a
678+
new binding to `table` here, and it will shadow the old one. This is often used
679+
so that you don’t need to come up with two unique names.
684680

685681
With this, our program works! Only two philosophers can eat at any one time,
686682
and so you’ll get some output like this:

trunk/src/doc/trpl/enums.md

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -64,45 +64,3 @@ equality yet, but we’ll find out in the [`traits`][traits] section.
6464
[match]: match.html
6565
[if-let]: if-let.html
6666
[traits]: traits.html
67-
68-
# Constructors as functions
69-
70-
An enum’s constructors can also be used like functions. For example:
71-
72-
```rust
73-
# enum Message {
74-
# Write(String),
75-
# }
76-
let m = Message::Write("Hello, world".to_string());
77-
```
78-
79-
Is the same as
80-
81-
```rust
82-
# enum Message {
83-
# Write(String),
84-
# }
85-
fn foo(x: String) -> Message {
86-
Message::Write(x)
87-
}
88-
89-
let x = foo("Hello, world".to_string());
90-
```
91-
92-
This is not immediately useful to us, but when we get to
93-
[`closures`][closures], we’ll talk about passing functions as arguments to
94-
other functions. For example, with [`iterators`][iterators], we can do this
95-
to convert a vector of `String`s into a vector of `Message::Write`s:
96-
97-
```rust
98-
# enum Message {
99-
# Write(String),
100-
# }
101-
102-
let v = vec!["Hello".to_string(), "World".to_string()];
103-
104-
let v1: Vec<Message> = v.into_iter().map(Message::Write).collect();
105-
```
106-
107-
[closures]: closures.html
108-
[iterators]: iterators.html

trunk/src/doc/trpl/ffi.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ However it is often desired that the callback is targeted to a special
238238
Rust object. This could be the object that represents the wrapper for the
239239
respective C object.
240240
241-
This can be achieved by passing an raw pointer to the object down to the
241+
This can be achieved by passing an unsafe pointer to the object down to the
242242
C library. The C library can then include the pointer to the Rust object in
243243
the notification. This will allow the callback to unsafely access the
244244
referenced Rust object.
@@ -342,10 +342,8 @@ Note that frameworks are only available on OSX targets.
342342
The different `kind` values are meant to differentiate how the native library
343343
participates in linkage. From a linkage perspective, the rust compiler creates
344344
two flavors of artifacts: partial (rlib/staticlib) and final (dylib/binary).
345-
Native dynamic library and framework dependencies are propagated to the final
346-
artifact boundary, while static library dependencies are not propagated at
347-
all, because the static libraries are integrated directly into the subsequent
348-
artifact.
345+
Native dynamic libraries and frameworks are propagated to the final artifact
346+
boundary, while static libraries are not propagated at all.
349347
350348
A few examples of how this model can be used are:
351349
@@ -370,7 +368,7 @@ On OSX, frameworks behave with the same semantics as a dynamic library.
370368
371369
# Unsafe blocks
372370
373-
Some operations, like dereferencing raw pointers or calling functions that have been marked
371+
Some operations, like dereferencing unsafe pointers or calling functions that have been marked
374372
unsafe are only allowed inside unsafe blocks. Unsafe blocks isolate unsafety and are a promise to
375373
the compiler that the unsafety does not leak out of the block.
376374

trunk/src/doc/trpl/functions.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,7 @@ an expression, and a `let` can only begin a statement, not an expression.
144144
Note that assigning to an already-bound variable (e.g. `y = 5`) is still an
145145
expression, although its value is not particularly useful. Unlike other
146146
languages where an assignment evaluates to the assigned value (e.g. `5` in the
147-
previous example), in Rust the value of an assignment is an empty tuple `()`
148-
because the assigned value can have [just one owner](ownership.html), and any
149-
other returned value would be too surprising:
147+
previous example), in Rust the value of an assignment is an empty tuple `()`:
150148

151149
```rust
152150
let mut y = 5;

trunk/src/doc/trpl/method-syntax.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ impl Circle {
8686
# Chaining method calls
8787

8888
So, now we know how to call a method, such as `foo.bar()`. But what about our
89-
original example, `foo.bar().baz()`? This is called ‘method chaining’. Let’s
90-
look at an example:
89+
original example, `foo.bar().baz()`? This is called ‘method chaining’, and we
90+
can do it by returning `self`.
9191

9292
```rust
9393
struct Circle {

trunk/src/doc/trpl/patterns.md

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -154,31 +154,6 @@ match x {
154154

155155
This prints `Got an int!`.
156156

157-
If you’re using `if` with multiple patterns, the `if` applies to both sides:
158-
159-
```rust
160-
let x = 4;
161-
let y = false;
162-
163-
match x {
164-
4 | 5 if y => println!("yes"),
165-
_ => println!("no"),
166-
}
167-
```
168-
169-
This prints `no`, because the `if` applies to the whole of `4 | 5`, and not to
170-
just the `5`, In other words, the the precedence of `if` behaves like this:
171-
172-
```text
173-
(4 | 5) if y => ...
174-
```
175-
176-
not this:
177-
178-
```text
179-
4 | (5 if y) => ...
180-
```
181-
182157
# ref and ref mut
183158

184159
If you want to get a [reference][ref], use the `ref` keyword:

trunk/src/doc/trpl/raw-pointers.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ println!("raw points at {}", *raw);
5252
It gives this error:
5353

5454
```text
55-
error: dereference of raw pointer requires unsafe function or block [E0133]
56-
println!("raw points at {}", *raw);
57-
^~~~
55+
error: dereference of unsafe pointer requires unsafe function or block [E0133]
56+
println!("raw points at{}", *raw);
57+
^~~~
5858
```
5959

6060
When you dereference a raw pointer, you’re taking responsibility that it’s not

trunk/src/doc/trpl/references-and-borrowing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ As it turns out, there are rules.
151151

152152
Here’s the rules about borrowing in Rust:
153153

154-
First, any borrow must last for a scope no greater than that of the owner.
155-
Second, you may have one or the other of these two kinds of borrows, but not
156-
both at the same time:
154+
First, any borrow must last for a smaller scope than the owner. Second, you may
155+
have one or the other of these two kinds of borrows, but not both at the same
156+
time:
157157

158158
* one or more references (`&T`) to a resource.
159159
* exactly one mutable reference (`&mut T`)

trunk/src/doc/trpl/strings.md

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -117,30 +117,6 @@ let dog = hachiko.chars().nth(1); // kinda like hachiko[1]
117117

118118
This emphasizes that we have to go through the whole list of `chars`.
119119

120-
## Slicing
121-
122-
You can get a slice of a string with slicing syntax:
123-
124-
```rust
125-
let dog = "hachiko";
126-
let hachi = &dog[0..5];
127-
```
128-
129-
But note that these are _byte_ offsets, not _character_ offsets. So
130-
this will fail at runtime:
131-
132-
```rust,should_panic
133-
let dog = "忠犬ハチ公";
134-
let hachi = &dog[0..2];
135-
```
136-
137-
with this error:
138-
139-
```text
140-
thread '<main>' panicked at 'index 0 and/or 2 in `忠犬ハチ公` do not lie on
141-
character boundary'
142-
```
143-
144120
## Concatenation
145121

146122
If you have a `String`, you can concatenate a `&str` to the end of it:

0 commit comments

Comments
 (0)