Skip to content

Commit 214396c

Browse files
committed
---
yaml --- r: 209591 b: refs/heads/try c: e8fbd1c h: refs/heads/master i: 209589: b0a453d 209587: 12f608d 209583: f742959 v: v3
1 parent c2265f2 commit 214396c

File tree

263 files changed

+2654
-4408
lines changed

Some content is hidden

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

263 files changed

+2654
-4408
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: 7a5754b330e78e2ab5a2682a16f53f4f9fe96ed7
5+
refs/heads/try: e8fbd1ce048fdfc2db1d446fedfe8775ce446046
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/mk/crates.mk

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,18 @@
5252
TARGET_CRATES := libc std flate arena term \
5353
serialize getopts collections test rand \
5454
log graphviz core rbml alloc \
55-
rustc_unicode rustc_bitflags
55+
unicode rustc_bitflags
5656
RUSTC_CRATES := rustc rustc_typeck rustc_borrowck rustc_resolve rustc_driver \
57-
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \
58-
rustc_data_structures
57+
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint
5958
HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc fmt_macros
6059
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
6160
TOOLS := compiletest rustdoc rustc rustbook
6261

6362
DEPS_core :=
6463
DEPS_libc := core
65-
DEPS_rustc_unicode := core
64+
DEPS_unicode := core
6665
DEPS_alloc := core libc native:jemalloc
67-
DEPS_std := core libc rand alloc collections rustc_unicode \
66+
DEPS_std := core libc rand alloc collections unicode \
6867
native:rust_builtin native:backtrace native:rustrt_native \
6968
rustc_bitflags
7069
DEPS_graphviz := std
@@ -81,10 +80,9 @@ DEPS_rustc_resolve := rustc log syntax
8180
DEPS_rustc_privacy := rustc log syntax
8281
DEPS_rustc_lint := rustc log syntax
8382
DEPS_rustc := syntax flate arena serialize getopts rbml \
84-
log graphviz rustc_llvm rustc_back rustc_data_structures
83+
log graphviz rustc_llvm rustc_back
8584
DEPS_rustc_llvm := native:rustllvm libc std
8685
DEPS_rustc_back := std syntax rustc_llvm flate log libc
87-
DEPS_rustc_data_structures := std log serialize
8886
DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \
8987
test rustc_lint
9088
DEPS_rustc_bitflags := core
@@ -96,7 +94,7 @@ DEPS_serialize := std log
9694
DEPS_rbml := std log serialize
9795
DEPS_term := std log
9896
DEPS_getopts := std
99-
DEPS_collections := core alloc rustc_unicode
97+
DEPS_collections := core alloc unicode
10098
DEPS_num := std
10199
DEPS_test := std getopts serialize rbml term native:rust_test_helpers
102100
DEPS_rand := core
@@ -117,11 +115,11 @@ ONLY_RLIB_libc := 1
117115
ONLY_RLIB_alloc := 1
118116
ONLY_RLIB_rand := 1
119117
ONLY_RLIB_collections := 1
120-
ONLY_RLIB_rustc_unicode := 1
118+
ONLY_RLIB_unicode := 1
121119
ONLY_RLIB_rustc_bitflags := 1
122120

123121
# Documented-by-default crates
124-
DOC_CRATES := std alloc collections core libc rustc_unicode
122+
DOC_CRATES := std alloc collections core libc unicode
125123

126124
################################################################################
127125
# You should not need to edit below this line

branches/try/mk/tests.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515

1616
# The names of crates that must be tested
1717

18-
# libcore/librustc_unicode tests are in a separate crate
18+
# libcore/libunicode tests are in a separate crate
1919
DEPS_coretest :=
2020
$(eval $(call RUST_CRATE,coretest))
2121

2222
DEPS_collectionstest :=
2323
$(eval $(call RUST_CRATE,collectionstest))
2424

25-
TEST_TARGET_CRATES = $(filter-out core rustc_unicode,$(TARGET_CRATES)) \
25+
TEST_TARGET_CRATES = $(filter-out core unicode,$(TARGET_CRATES)) \
2626
collectionstest coretest
2727
TEST_DOC_CRATES = $(DOC_CRATES)
2828
TEST_HOST_CRATES = $(filter-out rustc_typeck rustc_borrowck rustc_resolve \

branches/try/src/compiletest/compiletest.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ pub fn make_metrics_test_closure(config: &Config, testfile: &Path) -> test::Test
368368
fn extract_gdb_version(full_version_line: Option<String>) -> Option<String> {
369369
match full_version_line {
370370
Some(ref full_version_line)
371-
if !full_version_line.trim().is_empty() => {
371+
if full_version_line.trim().len() > 0 => {
372372
let full_version_line = full_version_line.trim();
373373

374374
// used to be a regex "(^|[^0-9])([0-9]\.[0-9])([^0-9]|$)"
@@ -408,7 +408,7 @@ fn extract_lldb_version(full_version_line: Option<String>) -> Option<String> {
408408

409409
match full_version_line {
410410
Some(ref full_version_line)
411-
if !full_version_line.trim().is_empty() => {
411+
if full_version_line.trim().len() > 0 => {
412412
let full_version_line = full_version_line.trim();
413413

414414
for (pos, l) in full_version_line.char_indices() {
@@ -426,7 +426,7 @@ fn extract_lldb_version(full_version_line: Option<String>) -> Option<String> {
426426
let vers = full_version_line[pos + 5..].chars().take_while(|c| {
427427
c.is_digit(10)
428428
}).collect::<String>();
429-
if !vers.is_empty() { return Some(vers) }
429+
if vers.len() > 0 { return Some(vers) }
430430
}
431431
println!("Could not extract LLDB version from line '{}'",
432432
full_version_line);

branches/try/src/compiletest/runtest.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ fn check_debugger_output(debugger_run_result: &ProcRes, check_lines: &[String])
864864
}
865865
first = false;
866866
}
867-
if !failed && rest.is_empty() {
867+
if !failed && rest.len() == 0 {
868868
i += 1;
869869
}
870870
if i == num_check_lines {
@@ -1662,7 +1662,7 @@ fn _arm_push_aux_shared_library(config: &Config, testfile: &Path) {
16621662
// codegen tests (vs. clang)
16631663

16641664
fn append_suffix_to_stem(p: &Path, suffix: &str) -> PathBuf {
1665-
if suffix.is_empty() {
1665+
if suffix.len() == 0 {
16661666
p.to_path_buf()
16671667
} else {
16681668
let mut stem = p.file_stem().unwrap().to_os_string();

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/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ideas behind Rust.
1919
donated to the Rust project. As the name implies, it teaches you Rust through a
2020
series of small examples.
2121

22-
[rbe]: http://rustbyexample.com/
22+
[rbe]: rustbyexample.com
2323

2424
# Community & Getting Help
2525

branches/try/src/doc/reference.md

Lines changed: 5 additions & 15 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
@@ -3798,7 +3788,7 @@ its type parameters are types:
37983788

37993789
```ignore
38003790
fn map<A: Clone, B: Clone>(f: |A| -> B, xs: &[A]) -> Vec<B> {
3801-
if xs.is_empty() {
3791+
if xs.len() == 0 {
38023792
return vec![];
38033793
}
38043794
let first: B = f(xs[0].clone());

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/ffi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ pub fn uncompress(src: &[u8]) -> Option<Vec<u8>> {
166166
}
167167
```
168168

169-
For reference, the examples used here are also available as a [library on
169+
For reference, the examples used here are also available as an [library on
170170
GitHub](https://github.com/thestinger/rust-snappy).
171171

172172
# Destructors

branches/try/src/doc/trpl/hello-cargo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ we hadn’t changed the source file, and so it just ran the binary. If we had
8989
made a modification, we would have seen it do both:
9090

9191
```bash
92-
$ cargo run
92+
$ cargo build
9393
Compiling hello_world v0.0.1 (file:///home/yourname/projects/hello_world)
9494
Running `target/debug/hello_world`
9595
Hello, world!

branches/try/src/doc/trpl/hello-world.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ We’ll get to the details eventually, you’ll just have to trust us for now.
104104

105105
Next, `"Hello, world!"` is a ‘string’. Strings are a surprisingly complicated
106106
topic in a systems programming language, and this is a ‘statically allocated’
107-
string. If you want to read further about allocation, check out
108-
[the stack and the heap][allocation], but you don’t need to right now if you
109-
don’t want to. We pass this string as an argument to `println!`, which prints the
110-
string to the screen. Easy enough!
107+
string. If you want to read further about allocation, check out [the stack and
108+
the heap], but you don’t need to right now if you don’t want to. We pass this
109+
string as an argument to `println!`, which prints the string to the screen.
110+
Easy enough!
111111

112112
[allocation]: the-stack-and-the-heap.html
113113

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ If not, there are a number of places where you can get help. The easiest is
9090
[the #rust IRC channel on irc.mozilla.org][irc], which you can access through
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
93-
resources include [the user’s forum][users], and
94-
[Stack Overflow][stackoverflow].
93+
resources include [the user’s forum][users], and [Stack Overflow][stack
94+
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];

0 commit comments

Comments
 (0)