Skip to content

Commit 0f08eb5

Browse files
committed
---
yaml --- r: 209534 b: refs/heads/try c: 6de33c2 h: refs/heads/master v: v3
1 parent 3653b1c commit 0f08eb5

Some content is hidden

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

69 files changed

+768
-1638
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 3e561f05c00cd180ec02db4ccab2840a4aba93d2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
5-
refs/heads/try: bdef7f62f5b15ba8dac1479cdc7fa8dded8f52c4
5+
refs/heads/try: 6de33c22e306505c95cc2f3b775e1a82925560fd
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/doc/complement-design-faq.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Types which are [`Sync`][sync] are thread-safe when multiple shared
5656
references to them are used concurrently. Types which are not `Sync` are not
5757
thread-safe, and thus when used in a global require unsafe code to use.
5858

59-
[sync]: core/marker/trait.Sync.html
59+
[sync]: core/kinds/trait.Sync.html
6060

6161
### If mutable static items that implement `Sync` are safe, why is taking &mut SHARABLE unsafe?
6262

@@ -139,7 +139,7 @@ and explicitly calling the `clone` method. Making user-defined copy operators
139139
explicit surfaces the underlying complexity, forcing the developer to opt-in
140140
to potentially expensive operations.
141141

142-
[copy]: core/marker/trait.Copy.html
142+
[copy]: core/kinds/trait.Copy.html
143143
[clone]: core/clone/trait.Clone.html
144144

145145
## No move constructors

branches/try/src/doc/reference.md

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2177,14 +2177,6 @@ The following configurations must be defined by the implementation:
21772177
* `unix`. See `target_family`.
21782178
* `windows`. See `target_family`.
21792179

2180-
You can also set another attribute based on a `cfg` variable with `cfg_attr`:
2181-
2182-
```rust,ignore
2183-
#[cfg_attr(a, b)]
2184-
```
2185-
2186-
Will be the same as `#[b]` if `a` is set by `cfg`, and nothing otherwise.
2187-
21882180
### Lint check attributes
21892181

21902182
A lint check names a potentially undesirable coding pattern, such as
@@ -2376,7 +2368,7 @@ The currently implemented features of the reference compiler are:
23762368
removed entirely for something more wholesome.
23772369

23782370
* `custom_attribute` - Allows the usage of attributes unknown to the compiler
2379-
so that new attributes can be added in a backwards compatible
2371+
so that new attributes can be added in a bacwards compatible
23802372
manner (RFC 572).
23812373

23822374
* `custom_derive` - Allows the use of `#[derive(Foo,Bar)]` as sugar for
@@ -2405,7 +2397,7 @@ The currently implemented features of the reference compiler are:
24052397
nasty hack that will certainly be removed.
24062398

24072399
* `main` - Allows use of the `#[main]` attribute, which changes the entry point
2408-
into a Rust program. This capability is subject to change.
2400+
into a Rust program. This capabiilty is subject to change.
24092401

24102402
* `macro_reexport` - Allows macros to be re-exported from one crate after being imported
24112403
from another. This feature was originally designed with the sole
@@ -2452,9 +2444,7 @@ The currently implemented features of the reference compiler are:
24522444
* `simd_ffi` - Allows use of SIMD vectors in signatures for foreign functions.
24532445
The SIMD interface is subject to change.
24542446

2455-
* `staged_api` - Allows usage of stability markers and `#![staged_api]` in a
2456-
crate. Stability markers are also attributes: `#[stable]`,
2457-
`#[unstable]`, and `#[deprecated]` are the three levels.
2447+
* `staged_api` - Allows usage of stability markers and `#![staged_api]` in a crate
24582448

24592449
* `static_assert` - The `#[static_assert]` functionality is experimental and
24602450
unstable. The attribute can be attached to a `static` of
@@ -2463,7 +2453,7 @@ The currently implemented features of the reference compiler are:
24632453
is unintuitive and suboptimal.
24642454

24652455
* `start` - Allows use of the `#[start]` attribute, which changes the entry point
2466-
into a Rust program. This capability, especially the signature for the
2456+
into a Rust program. This capabiilty, especially the signature for the
24672457
annotated function, is subject to change.
24682458

24692459
* `struct_inherit` - Allows using struct inheritance, which is barely

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,11 @@ you tons of control over what your code does, and closures are no different.
205205

206206
Rust's implementation of closures is a bit different than other languages. They
207207
are effectively syntax sugar for traits. You'll want to make sure to have read
208-
the [traits chapter][traits] before this one, as well as the chapter on [trait
209-
objects][trait-objects].
208+
the [traits chapter][traits] before this one, as well as the chapter on [static
209+
and dynamic dispatch][dispatch], which talks about trait objects.
210210

211211
[traits]: traits.html
212-
[trait-objects]: trait-objects.html
212+
[dispatch]: static-and-dynamic-dispatch.html
213213

214214
Got all that? Good.
215215

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ Here's the error:
176176
^~~~~~~~~~~~~
177177
```
178178

179-
You see, [`Mutex`](../std/sync/struct.Mutex.html) has a
180-
[`lock`](../std/sync/struct.Mutex.html#method.lock)
179+
You see, [`Mutex`](std/sync/struct.Mutex.html) has a
180+
[`lock`](http://doc.rust-lang.org/nightly/std/sync/struct.Mutex.html#method.lock)
181181
method which has this signature:
182182

183183
```ignore

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

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -380,10 +380,7 @@ $ rustdoc --test path/to/my/crate/root.rs
380380
$ cargo test
381381
```
382382

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

388385
There are a few more annotations that are useful to help `rustdoc` do the right
389386
thing when testing your code:
@@ -563,13 +560,3 @@ This sets a few different options, with a logo, favicon, and a root URL.
563560
- `--html-before-content FILE`: includes the contents of FILE directly after
564561
`<body>`, before the rendered content (including the search bar).
565562
- `--html-after-content FILE`: includes the contents of FILE after all the rendered content.
566-
567-
## Security note
568-
569-
The Markdown in documentation comments is placed without processing into
570-
the final webpage. Be careful with literal HTML:
571-
572-
```rust
573-
/// <script>alert(document.cookie)</script>
574-
# fn foo() {}
575-
```

branches/try/src/doc/trpl/error-handling.md

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ panic. A *failure* is an error that can be recovered from in some way. A
2020
*panic* is an error that cannot be recovered from.
2121

2222
What do we mean by "recover"? Well, in most cases, the possibility of an error
23-
is expected. For example, consider the `parse` function:
23+
is expected. For example, consider the `from_str` function:
2424

25-
```ignore
26-
"5".parse();
25+
```{rust,ignore}
26+
from_str("5");
2727
```
2828

29-
This method converts a string into another type. But because it's a string, you
30-
can't be sure that the conversion actually works. For example, what should this
31-
convert to?
29+
This function takes a string argument and converts it into another type. But
30+
because it's a string, you can't be sure that the conversion actually works.
31+
For example, what should this convert to?
3232

33-
```ignore
34-
"hello5world".parse();
33+
```{rust,ignore}
34+
from_str("hello5world");
3535
```
3636

3737
This won't work. So we know that this function will only work properly for some
@@ -40,8 +40,7 @@ inputs. It's expected behavior. We call this kind of error a *failure*.
4040
On the other hand, sometimes, there are errors that are unexpected, or which
4141
we cannot recover from. A classic example is an `assert!`:
4242

43-
```rust
44-
# let x = 5;
43+
```{rust,ignore}
4544
assert!(x == 5);
4645
```
4746

@@ -120,19 +119,17 @@ Rust calls these sorts of errors *panics*.
120119
# Handling errors with `Option` and `Result`
121120

122121
The simplest way to indicate that a function may fail is to use the `Option<T>`
123-
type. For example, the `find` method on strings attempts to find a pattern
124-
in a string, and returns an `Option`:
122+
type. Remember our `from_str()` example? Here's its type signature:
125123

126-
```rust
127-
let s = "foo";
128-
129-
assert_eq!(s.find('f'), Some(0));
130-
assert_eq!(s.find('z'), None);
124+
```{rust,ignore}
125+
pub fn from_str<A: FromStr>(s: &str) -> Option<A>
131126
```
132127

128+
`from_str()` returns an `Option<A>`. If the conversion succeeds, it will return
129+
`Some(value)`, and if it fails, it will return `None`.
133130

134131
This is appropriate for the simplest of cases, but doesn't give us a lot of
135-
information in the failure case. What if we wanted to know _why_ the function
132+
information in the failure case. What if we wanted to know _why_ the conversion
136133
failed? For this, we can use the `Result<T, E>` type. It looks like this:
137134

138135
```rust
@@ -300,5 +297,5 @@ It's worth noting that you can only use `try!` from a function that returns a
300297
`Result`, which means that you cannot use `try!` inside of `main()`, because
301298
`main()` doesn't return anything.
302299

303-
`try!` makes use of [`From<Error>`](../std/convert/trait.From.html) to determine
300+
`try!` makes use of [`From<Error>`](../std/convert/trait.From.hml) to determine
304301
what to return in the error case.

branches/try/src/doc/trpl/installing-rust.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ If not, there are a number of places where you can get help. The easiest is
9191
[Mibbit][mibbit]. Click that link, and you'll be chatting with other Rustaceans
9292
(a silly nickname we call ourselves), and we can help you out. Other great
9393
resources include [the user’s forum][users], and
94-
[Stack Overflow][stackoverflow].
94+
[Stack Overflow][stack overflow].
9595

9696
[irc]: irc://irc.mozilla.org/#rust
9797
[mibbit]: http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust
9898
[users]: http://users.rust-lang.org/
99-
[stackoverflow]: http://stackoverflow.com/questions/tagged/rust
99+
[stack overflow]: http://stackoverflow.com/questions/tagged/rust

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ mind.
3333
You may have seen the `vec!` macro, used to initialize a [vector][] with any
3434
number of elements.
3535

36-
[vector]: vectors.html
36+
[vector]: arrays-vectors-and-slices.html
3737

3838
```rust
3939
let x: Vec<u32> = vec![1, 2, 3];

branches/try/src/doc/trpl/primitive-types.md

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -216,18 +216,6 @@ In systems programming languages, strings are a bit more complex than in other
216216
languages. For now, just read `&str` as a *string slice*, and we’ll learn more
217217
soon.
218218

219-
You can assign one tuple into another, if they have the same contained types
220-
and [arity]. Tuples have the same arity when they have the same length.
221-
222-
[arity]: glossary.html#arity
223-
224-
```rust
225-
let mut x = (1, 2); // x: (i32, i32)
226-
let y = (2, 3); // y: (i32, i32)
227-
228-
x = y;
229-
```
230-
231219
You can access the fields in a tuple through a *destructuring let*. Here’s
232220
an example:
233221

@@ -247,24 +235,20 @@ or "breaks up," the tuple, and assigns the bits to three bindings.
247235

248236
This pattern is very powerful, and we’ll see it repeated more later.
249237

250-
## Tuple Indexing
251-
252-
You can also access fields of a tuple with indexing syntax:
238+
There are also a few things you can do with a tuple as a whole, without
239+
destructuring. You can assign one tuple into another, if they have the same
240+
contained types and [arity]. Tuples have the same arity when they have the same
241+
length.
253242

243+
[arity]: glossary.html#arity
254244

255245
```rust
256-
let tuple = (1, 2, 3);
257-
258-
let x = tuple.0;
259-
let y = tuple.1;
260-
let z = tuple.2;
246+
let mut x = (1, 2); // x: (i32, i32)
247+
let y = (2, 3); // y: (i32, i32)
261248

262-
println!("x is {}", x);
249+
x = y;
263250
```
264251

265-
Like array indexing, it starts at zero, but unlike array indexing, it uses a
266-
`.`, rather than `[]`s.
267-
268252
You can find more documentation for tuples [in the standard library
269253
documentation][tuple].
270254

branches/try/src/libcore/iter.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ pub trait Iterator {
179179

180180
/// Creates an iterator that iterates over both this and the specified
181181
/// iterators simultaneously, yielding the two elements as pairs. When
182-
/// either iterator returns `None`, all further invocations of next() will
183-
/// return `None`.
182+
/// either iterator returns None, all further invocations of next() will
183+
/// return None.
184184
///
185185
/// # Examples
186186
///
@@ -254,7 +254,7 @@ pub trait Iterator {
254254
}
255255

256256
/// Creates an iterator that both filters and maps elements.
257-
/// If the specified function returns `None`, the element is skipped.
257+
/// If the specified function returns None, the element is skipped.
258258
/// Otherwise the option is unwrapped and the new value is yielded.
259259
///
260260
/// # Examples
@@ -403,7 +403,7 @@ pub trait Iterator {
403403
/// Creates a new iterator that behaves in a similar fashion to fold.
404404
/// There is a state which is passed between each iteration and can be
405405
/// mutated as necessary. The yielded values from the closure are yielded
406-
/// from the Scan instance when not `None`.
406+
/// from the Scan instance when not None.
407407
///
408408
/// # Examples
409409
///
@@ -701,7 +701,7 @@ pub trait Iterator {
701701

702702
/// Returns the index of the last element satisfying the specified predicate
703703
///
704-
/// If no element matches, `None` is returned.
704+
/// If no element matches, None is returned.
705705
///
706706
/// Does not consume the iterator *before* the first found element.
707707
///

0 commit comments

Comments
 (0)