Skip to content

Commit ba03a92

Browse files
committed
---
yaml --- r: 179836 b: refs/heads/tmp c: ad3be9f h: refs/heads/master v: v3
1 parent 285cbf8 commit ba03a92

File tree

117 files changed

+693
-1093
lines changed

Some content is hidden

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

117 files changed

+693
-1093
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3434
refs/heads/beta: 44a287e6eb22ec3c2a687fc156813577464017f7
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
37-
refs/heads/tmp: 3161cb096f2e966a7d907afd69c175dab9eb55ed
37+
refs/heads/tmp: ad3be9f23f9389c71f7f712ae5195d4190becf05

branches/tmp/src/doc/grammar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ token : simple_token | ident | literal | symbol | whitespace token ;
157157

158158
| | | | | |
159159
|----------|----------|----------|----------|--------|
160-
| abstract | alignof | as | become | box |
160+
| abstract | alignof | as | be | box |
161161
| break | const | continue | crate | do |
162162
| else | enum | extern | false | final |
163163
| fn | for | if | impl | in |

branches/tmp/src/doc/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ tools we have are really nice.
5959
[Cargo](http://crates.io) is Rust's package manager, and its website contains
6060
lots of good documentation.
6161

62-
[`rustdoc`](book/documentation.html) is used to generate documentation for Rust code.
62+
[The `rustdoc` manual](rustdoc.html) contains information about Rust's
63+
documentation tool.
6364

6465
# FAQs
6566

branches/tmp/src/doc/reference.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ grammar as double-quoted strings. Other tokens have exact rules given.
189189

190190
| | | | | |
191191
|----------|----------|----------|----------|---------|
192-
| abstract | alignof | as | become | box |
192+
| abstract | alignof | as | be | box |
193193
| break | const | continue | crate | do |
194194
| else | enum | extern | false | final |
195195
| fn | for | if | impl | in |
@@ -381,13 +381,11 @@ character (`\`), or a single _escape_. It is equivalent to a `u8` unsigned
381381

382382
##### Byte string literals
383383

384-
A non-raw _byte string literal_ is a sequence of ASCII characters and _escapes_,
385-
preceded by the characters `U+0062` (`b`) and `U+0022` (double-quote), and
386-
followed by the character `U+0022`. If the character `U+0022` is present within
387-
the literal, it must be _escaped_ by a preceding `U+005C` (`\`) character.
388-
Alternatively, a byte string literal can be a _raw byte string literal_, defined
389-
below. A byte string literal is equivalent to a `&'static [u8]` borrowed array
390-
of unsigned 8-bit integers.
384+
A _byte string literal_ is a sequence of ASCII characters and _escapes_
385+
enclosed within two `U+0022` (double-quote) characters, with the exception of
386+
`U+0022` itself, which must be _escaped_ by a preceding `U+005C` character
387+
(`\`), or a _raw byte string literal_. It is equivalent to a `&'static [u8]`
388+
borrowed array of unsigned 8-bit integers.
391389

392390
Some additional _escapes_ are available in either byte or non-raw byte string
393391
literals. An escape starts with a `U+005C` (`\`) and continues with one of the
@@ -1255,7 +1253,9 @@ fn my_err(s: &str) -> ! {
12551253
We call such functions "diverging" because they never return a value to the
12561254
caller. Every control path in a diverging function must end with a `panic!()` or
12571255
a call to another diverging function on every control path. The `!` annotation
1258-
does *not* denote a type.
1256+
does *not* denote a type. Rather, the result type of a diverging function is a
1257+
special type called ⊥ ("bottom") that unifies with any type. Rust has no
1258+
syntax for ⊥.
12591259

12601260
It might be necessary to declare a diverging function because as mentioned
12611261
previously, the typechecker checks that every control path in a function ends
@@ -2014,11 +2014,6 @@ type int8_t = i8;
20142014
- `no_start` - disable linking to the `native` crate, which specifies the
20152015
"start" language item.
20162016
- `no_std` - disable linking to the `std` crate.
2017-
- `plugin` — load a list of named crates as compiler plugins, e.g.
2018-
`#![plugin(foo, bar)]`. Optional arguments for each plugin,
2019-
i.e. `#![plugin(foo(... args ...))]`, are provided to the plugin's
2020-
registrar function. The `plugin` feature gate is required to use
2021-
this attribute.
20222017

20232018
### Module-only attributes
20242019

@@ -2087,7 +2082,7 @@ On `struct`s:
20872082
remove any padding between fields (note that this is very fragile and may
20882083
break platforms which require aligned access).
20892084

2090-
### Macro-related attributes
2085+
### Macro- and plugin-related attributes
20912086

20922087
- `macro_use` on a `mod` — macros defined in this module will be visible in the
20932088
module's parent, after this module has been included.
@@ -2102,8 +2097,13 @@ On `struct`s:
21022097

21032098
- `macro_export` - export a macro for cross-crate usage.
21042099

2105-
- `no_link` on an `extern crate` — even if we load this crate for macros, don't
2106-
link it into the output.
2100+
- `plugin` on an `extern crate` — load this crate as a [compiler
2101+
plugin][plugin]. The `plugin` feature gate is required. Any arguments to
2102+
the attribute, e.g. `#[plugin=...]` or `#[plugin(...)]`, are provided to the
2103+
plugin.
2104+
2105+
- `no_link` on an `extern crate` — even if we load this crate for macros or
2106+
compiler plugins, don't link it into the output.
21072107

21082108
See the [macros section of the
21092109
book](book/macros.html#scoping-and-macro-import/export) for more information on
@@ -2354,8 +2354,8 @@ Supported traits for `derive` are:
23542354
* `FromPrimitive`, to create an instance from a numeric primitive.
23552355
* `Hash`, to iterate over the bytes in a data type.
23562356
* `Rand`, to create a random instance of a data type.
2357-
* `Debug`, to format a value using the `{:?}` formatter.
2358-
* `Copy`, for "Plain Old Data" types which can be copied by simply moving bits.
2357+
* `Show`, to format a value using the `{}` formatter.
2358+
* `Zero`, to create a zero instance of a numeric data type.
23592359

23602360
### Compiler Features
23612361

branches/tmp/src/doc/rust.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
body {
5959
margin: 0 auto;
6060
padding: 0 15px;
61-
font-family: "Source Serif Pro", Georgia, Times, "Times New Roman", serif;
61+
font-family: "Source Serif Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
6262
font-size: 18px;
6363
color: #333;
6464
line-height: 1.428571429;

branches/tmp/src/doc/trpl/SUMMARY.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
* [Iterators](iterators.md)
2828
* [Generics](generics.md)
2929
* [Traits](traits.md)
30-
* [Static and Dynamic Dispatch](static-and-dynamic-dispatch.md)
3130
* [Concurrency](concurrency.md)
3231
* [Error Handling](error-handling.md)
3332
* [Documentation](documentation.md)

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ arguments, really powerful things are possible.
99
Let's make a closure:
1010

1111
```{rust}
12-
let add_one = |x| { 1 + x };
12+
let add_one = |&: x| { 1 + x };
1313
1414
println!("The sum of 5 plus 1 is {}.", add_one(5));
1515
```
@@ -21,8 +21,8 @@ binding name and two parentheses, just like we would for a named function.
2121
Let's compare syntax. The two are pretty close:
2222

2323
```{rust}
24-
let add_one = |x: i32| -> i32 { 1 + x };
25-
fn add_one (x: i32) -> i32 { 1 + x }
24+
let add_one = |&: x: i32| -> i32 { 1 + x };
25+
fn add_one (x: i32) -> i32 { 1 + x }
2626
```
2727

2828
As you may have noticed, closures infer their argument and return types, so you
@@ -37,7 +37,7 @@ this:
3737
fn main() {
3838
let x: i32 = 5;
3939
40-
let printer = || { println!("x is: {}", x); };
40+
let printer = |&:| { println!("x is: {}", x); };
4141
4242
printer(); // prints "x is: 5"
4343
}
@@ -53,7 +53,7 @@ defined. The closure borrows any variables it uses, so this will error:
5353
fn main() {
5454
let mut x: i32 = 5;
5555
56-
let printer = || { println!("x is: {}", x); };
56+
let printer = |&:| { println!("x is: {}", x); };
5757
5858
x = 6; // error: cannot assign to `x` because it is borrowed
5959
}
@@ -80,7 +80,7 @@ fn twice<F: Fn(i32) -> i32>(x: i32, f: F) -> i32 {
8080
}
8181
8282
fn main() {
83-
let square = |x: i32| { x * x };
83+
let square = |&: x: i32| { x * x };
8484
8585
twice(5, square); // evaluates to 50
8686
}
@@ -89,15 +89,15 @@ fn main() {
8989
Let's break the example down, starting with `main`:
9090

9191
```{rust}
92-
let square = |x: i32| { x * x };
92+
let square = |&: x: i32| { x * x };
9393
```
9494

9595
We've seen this before. We make a closure that takes an integer, and returns
9696
its square.
9797

9898
```{rust}
9999
# fn twice<F: Fn(i32) -> i32>(x: i32, f: F) -> i32 { f(x) + f(x) }
100-
# let square = |x: i32| { x * x };
100+
# let square = |&: x: i32| { x * x };
101101
twice(5, square); // evaluates to 50
102102
```
103103

@@ -184,8 +184,8 @@ fn compose<F, G>(x: i32, f: F, g: G) -> i32
184184
185185
fn main() {
186186
compose(5,
187-
|n: i32| { n + 42 },
188-
|n: i32| { n * 2 }); // evaluates to 94
187+
|&: n: i32| { n + 42 },
188+
|&: n: i32| { n * 2 }); // evaluates to 94
189189
}
190190
```
191191

branches/tmp/src/doc/trpl/compound-data-types.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,6 @@ if x == y {
7272

7373
This will print `no`, because some of the values aren't equal.
7474

75-
Note that the order of the values is considered when checking for equality,
76-
so the following example will also print `no`.
77-
78-
```rust
79-
let x = (1, 2, 3);
80-
let y = (2, 1, 3);
81-
82-
if x == y {
83-
println!("yes");
84-
} else {
85-
println!("no");
86-
}
87-
```
88-
8975
One other use of tuples is to return multiple values from a function:
9076

9177
```rust

branches/tmp/src/doc/trpl/plugins.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ information.
3030
extend the compiler's behavior with new syntax extensions, lint checks, etc.
3131

3232
A plugin is a dynamic library crate with a designated *registrar* function that
33-
registers extensions with `rustc`. Other crates can load these extensions using
34-
the crate attribute `#![plugin(...)]`. See the
33+
registers extensions with `rustc`. Other crates can use these extensions by
34+
loading the plugin crate with `#[plugin] extern crate`. See the
3535
[`rustc::plugin`](../rustc/plugin/index.html) documentation for more about the
3636
mechanics of defining and loading a plugin.
3737

38-
If present, arguments passed as `#![plugin(foo(... args ...))]` are not
39-
interpreted by rustc itself. They are provided to the plugin through the
40-
`Registry`'s [`args` method](../rustc/plugin/registry/struct.Registry.html#method.args).
38+
Arguments passed as `#[plugin=...]` or `#[plugin(...)]` are not interpreted by
39+
rustc itself. They are provided to the plugin through the `Registry`'s [`args`
40+
method](../rustc/plugin/registry/struct.Registry.html#method.args).
4141

4242
# Syntax extensions
4343

@@ -110,7 +110,8 @@ Then we can use `rn!()` like any other macro:
110110

111111
```ignore
112112
#![feature(plugin)]
113-
#![plugin(roman_numerals)]
113+
114+
#[plugin] extern crate roman_numerals;
114115
115116
fn main() {
116117
assert_eq!(rn!(MMXV), 2015);
@@ -218,7 +219,7 @@ pub fn plugin_registrar(reg: &mut Registry) {
218219
Then code like
219220

220221
```ignore
221-
#![plugin(lint_plugin_test)]
222+
#[plugin] extern crate lint_plugin_test;
222223
223224
fn lintme() { }
224225
```

0 commit comments

Comments
 (0)