Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 22 pull requests #22149

Closed
wants to merge 45 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
8f7c2d5
Replace `be` with `become`
ranma42 Jan 17, 2015
6f87211
Add QPath construction to ExtCtxt for UFCS support.
hugwijst Feb 4, 2015
4ef7551
Fix type inference related to upvars in closures
sanxiyn Jan 18, 2015
00d1873
Use `for` instead of `while` in ascii.rs tests
iKevinY Feb 2, 2015
d3c787a
Book Compound Data Types update
Feb 6, 2015
4038694
Link to rustdoc page in the Rust book directly
caspark Feb 7, 2015
d163f1f
add missing features to libcollections tests
Gankra Feb 7, 2015
4f61e16
Fix std::ops::Range size_hint and ExactSizeIterator impls
Feb 7, 2015
bb49195
reference.md: Byte string literals start with a 'b'
geofft Feb 8, 2015
8fb4264
adapt run-make test suite for openbsd
semarie Feb 8, 2015
34afe5e
Rename Show to Debug, String to Display
alkor Feb 5, 2015
a6e8496
Deduplicate --crate-type arguments
nagisa Feb 9, 2015
d9393c2
Given `<expr> as Box<Trait>`, infer that `Box<_>` is expected type fo…
pnkfelix Feb 6, 2015
a1b3189
add test illustrating the feature.
pnkfelix Feb 6, 2015
45f6672
Make fallback font 'serif', rather than 'sans-serif' fonts
cllns Feb 9, 2015
0479d90
Update deprecation notice.
octplane Feb 7, 2015
1163cef
remove obsolete closure syntax from the guide
lukesteensen Feb 9, 2015
dbccd70
Add documentation on trait objects.
steveklabnik Feb 9, 2015
e40d058
Remove incorrect docs from mem::transmute
steveklabnik Feb 10, 2015
b42c559
Remove bottom from the reference
steveklabnik Feb 10, 2015
17abb43
Set up docs for missing core types
steveklabnik Feb 10, 2015
792dc8d
Made the `ptr::Unique` type accept unsized types, to allow for use cases
Kimundi Feb 10, 2015
6e8b873
Add a flag to skip the LLVM version check in configure
dotdash Feb 10, 2015
705b209
Rollup merge of #21353 - sanxiyn:upvar, r=nikomatsakis
Manishearth Feb 10, 2015
ad9b64d
Rollup merge of #21862 - iKevinY:libstd-ascii-tests, r=brson
Manishearth Feb 10, 2015
4ecefd1
Rollup merge of #21918 - ranma42:replace-be, r=nikomatsakis
Manishearth Feb 10, 2015
e696922
Rollup merge of #21943 - hugwijst:extctxt_ufcs, r=alexcrichton
Manishearth Feb 10, 2015
b7956d9
Rollup merge of #22007 - thiagooak:master, r=steveklabnik
Manishearth Feb 10, 2015
31f190e
Rollup merge of #22012 - pnkfelix:propagate-container-across-object-c…
Manishearth Feb 10, 2015
e54040d
Rollup merge of #22049 - caspark:fix-link-to-rustdoc, r=steveklabnik
Manishearth Feb 10, 2015
fa4732c
Rollup merge of #22052 - octplane:patch-1, r=alexcrichton
Manishearth Feb 10, 2015
3c5eb95
Rollup merge of #22065 - bluss:range-size-hint, r=Gankro
Manishearth Feb 10, 2015
634d5dc
Rollup merge of #22067 - Gankro:collections-tests, r=alexcrichton
Manishearth Feb 10, 2015
81f5e33
Rollup merge of #22072 - geofft:doc-byte-string-literal, r=kmcallister
Manishearth Feb 10, 2015
843d046
Rollup merge of #22088 - semarie:openbsd-rmake, r=alexcrichton
Manishearth Feb 10, 2015
415fd95
Rollup merge of #22094 - alkor:cleanup-show-string, r=alexcrichton
Manishearth Feb 10, 2015
4b9a48a
Rollup merge of #22097 - cllns:fix-fallback-fonts, r=steveklabnik
Manishearth Feb 10, 2015
98cb33f
Rollup merge of #22106 - steveklabnik:doc_trait_objects, r=alexcrichton
Manishearth Feb 10, 2015
9e97e08
Rollup merge of #22115 - nagisa:dedupe-cratetypes, r=alexcrichton
Manishearth Feb 10, 2015
9b46822
Rollup merge of #22120 - lukesteensen:closures_guide, r=steveklabnik
Manishearth Feb 10, 2015
4a8d205
Rollup merge of #22128 - steveklabnik:gh22085, r=alexcrichton
Manishearth Feb 10, 2015
84214d1
Rollup merge of #22129 - steveklabnik:gh22032, r=alexcrichton
Manishearth Feb 10, 2015
f0348fc
Rollup merge of #22130 - steveklabnik:gh20172, r=alexcrichton
Manishearth Feb 10, 2015
f447486
Rollup merge of #22142 - Kimundi:unsized_unique, r=alexcrichton
Manishearth Feb 10, 2015
99a870c
Rollup merge of #22147 - dotdash:llvm_version, r=alexcrichton
Manishearth Feb 10, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion configure
Original file line number Diff line number Diff line change
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
2 changes: 1 addition & 1 deletion src/doc/grammar.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading