Skip to content

Commit

Permalink
Auto merge of #22153 - alexcrichton:rollup, r=alexcrichton
Browse files Browse the repository at this point in the history
  • Loading branch information
bors committed Feb 10, 2015
2 parents 88d8ba5 + 3e10785 commit bc87efe
Show file tree
Hide file tree
Showing 92 changed files with 1,029 additions and 433 deletions.
3 changes: 2 additions & 1 deletion configure
Expand Up @@ -525,6 +525,7 @@ opt verify-install 1 "verify installed binaries work"
opt dist-host-only 0 "only install bins for the host architecture"
opt inject-std-version 1 "inject the current compiler version of libstd into programs"
opt jemalloc 1 "build liballoc with jemalloc"
opt llvm-version-check 1 "don't check if the LLVM version is supported, build anyway"

valopt localstatedir "/var/lib" "local state directory"
valopt sysconfdir "/etc" "install system configuration files"
Expand Down Expand Up @@ -796,7 +797,7 @@ then
putvar CFG_ENABLE_CLANG
fi

if [ ! -z "$CFG_LLVM_ROOT" -a -e "$CFG_LLVM_ROOT/bin/llvm-config" ]
if [ ! -z "$CFG_LLVM_ROOT" -a -z "$CFG_DISABLE_LLVM_VERSION_CHECK" -a -e "$CFG_LLVM_ROOT/bin/llvm-config" ]
then
step_msg "using custom LLVM at $CFG_LLVM_ROOT"

Expand Down
1 change: 0 additions & 1 deletion src/compiletest/compiletest.rs
Expand Up @@ -12,7 +12,6 @@

#![feature(box_syntax)]
#![feature(collections)]
#![feature(core)]
#![feature(int_uint)]
#![feature(io)]
#![feature(os)]
Expand Down
2 changes: 1 addition & 1 deletion src/doc/grammar.md
Expand Up @@ -157,7 +157,7 @@ token : simple_token | ident | literal | symbol | whitespace token ;

| | | | | |
|----------|----------|----------|----------|--------|
| abstract | alignof | as | be | box |
| abstract | alignof | as | become | box |
| break | const | continue | crate | do |
| else | enum | extern | false | final |
| fn | for | if | impl | in |
Expand Down
3 changes: 1 addition & 2 deletions src/doc/index.md
Expand Up @@ -59,8 +59,7 @@ tools we have are really nice.
[Cargo](http://crates.io) is Rust's package manager, and its website contains
lots of good documentation.

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

# FAQs

Expand Down
22 changes: 11 additions & 11 deletions src/doc/reference.md
Expand Up @@ -189,7 +189,7 @@ grammar as double-quoted strings. Other tokens have exact rules given.

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

##### Byte string literals

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

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

It might be necessary to declare a diverging function because as mentioned
previously, the typechecker checks that every control path in a function ends
Expand Down Expand Up @@ -2354,8 +2354,8 @@ Supported traits for `derive` are:
* `FromPrimitive`, to create an instance from a numeric primitive.
* `Hash`, to iterate over the bytes in a data type.
* `Rand`, to create a random instance of a data type.
* `Show`, to format a value using the `{}` formatter.
* `Zero`, to create a zero instance of a numeric data type.
* `Debug`, to format a value using the `{:?}` formatter.
* `Copy`, for "Plain Old Data" types which can be copied by simply moving bits.

### Compiler Features

Expand Down
2 changes: 1 addition & 1 deletion src/doc/rust.css
Expand Up @@ -58,7 +58,7 @@
body {
margin: 0 auto;
padding: 0 15px;
font-family: "Source Serif Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-family: "Source Serif Pro", Georgia, Times, "Times New Roman", serif;
font-size: 18px;
color: #333;
line-height: 1.428571429;
Expand Down
1 change: 1 addition & 0 deletions src/doc/trpl/SUMMARY.md
Expand Up @@ -27,6 +27,7 @@
* [Iterators](iterators.md)
* [Generics](generics.md)
* [Traits](traits.md)
* [Static and Dynamic Dispatch](static-and-dynamic-dispatch.md)
* [Concurrency](concurrency.md)
* [Error Handling](error-handling.md)
* [Documentation](documentation.md)
Expand Down
20 changes: 10 additions & 10 deletions src/doc/trpl/closures.md
Expand Up @@ -9,7 +9,7 @@ arguments, really powerful things are possible.
Let's make a closure:

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

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

As you may have noticed, closures infer their argument and return types, so you
Expand All @@ -37,7 +37,7 @@ this:
fn main() {
let x: i32 = 5;
let printer = |&:| { println!("x is: {}", x); };
let printer = || { println!("x is: {}", x); };
printer(); // prints "x is: 5"
}
Expand All @@ -53,7 +53,7 @@ defined. The closure borrows any variables it uses, so this will error:
fn main() {
let mut x: i32 = 5;
let printer = |&:| { println!("x is: {}", x); };
let printer = || { println!("x is: {}", x); };
x = 6; // error: cannot assign to `x` because it is borrowed
}
Expand All @@ -80,7 +80,7 @@ fn twice<F: Fn(i32) -> i32>(x: i32, f: F) -> i32 {
}
fn main() {
let square = |&: x: i32| { x * x };
let square = |x: i32| { x * x };
twice(5, square); // evaluates to 50
}
Expand All @@ -89,15 +89,15 @@ fn main() {
Let's break the example down, starting with `main`:

```{rust}
let square = |&: x: i32| { x * x };
let square = |x: i32| { x * x };
```

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

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

Expand Down Expand Up @@ -184,8 +184,8 @@ fn compose<F, G>(x: i32, f: F, g: G) -> i32
fn main() {
compose(5,
|&: n: i32| { n + 42 },
|&: n: i32| { n * 2 }); // evaluates to 94
|n: i32| { n + 42 },
|n: i32| { n * 2 }); // evaluates to 94
}
```

Expand Down
14 changes: 14 additions & 0 deletions src/doc/trpl/compound-data-types.md
Expand Up @@ -72,6 +72,20 @@ if x == y {

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

Note that the order of the values is considered when checking for equality,
so the following example will also print `no`.

```rust
let x = (1, 2, 3);
let y = (2, 1, 3);

if x == y {
println!("yes");
} else {
println!("no");
}
```

One other use of tuples is to return multiple values from a function:

```rust
Expand Down

0 comments on commit bc87efe

Please sign in to comment.