Auto merge of #25525 - Manishearth:rollup, r=Manishearth

- Successful merges: #25465, #25469, #25472, #25474, #25476, #25484, #25490, #25493, #25503, #25506, #25508, #25510, #25516, #25522
- Failed merges:
This commit is contained in:
bors 2015-05-17 06:25:58 +00:00
commit 9f3a7f0c2b
14 changed files with 45 additions and 28 deletions

View File

@ -8,7 +8,7 @@ Aaron Raimist <aaron@aaronraimist.com>
Aaron Todd <github@opprobrio.us>
Aaron Turon <aturon@mozilla.com>
Aaron Weiss <aaronweiss74@gmail.com>
Abhishek Chanda <abhishek@cloudscaling.com>
Abhishek Chanda <abhishek.becs@gmail.com>
Adam Bozanich <adam.boz@gmail.com>
Adam Jacob <adam@opscode.com>
Adam Roben <adam@roben.org>

View File

@ -5,8 +5,8 @@
There aren't many large programs yet. The Rust [compiler][rustc], 60,000+ lines at the time of writing, is written in Rust. As the oldest body of Rust code it has gone through many iterations of the language, and some parts are nicer to look at than others. It may not be the best code to learn from, but [borrowck] and [resolve] were written recently.
[rustc]: https://github.com/rust-lang/rust/tree/master/src/librustc
[resolve]: https://github.com/rust-lang/rust/blob/master/src/librustc/middle/resolve.rs
[borrowck]: https://github.com/rust-lang/rust/blob/master/src/librustc/middle/borrowck/
[resolve]: https://github.com/rust-lang/rust/tree/master/src/librustc_resolve
[borrowck]: https://github.com/rust-lang/rust/tree/master/src/librustc_borrowck/borrowck
A research browser engine called [Servo][servo], currently 30,000+ lines across more than a dozen crates, will be exercising a lot of Rust's distinctive type-system and concurrency features, and integrating many native libraries.
@ -20,8 +20,8 @@ Some examples that demonstrate different aspects of the language:
* The standard library's [json] module. Enums and pattern matching
[sprocketnes]: https://github.com/pcwalton/sprocketnes
[hash]: https://github.com/rust-lang/rust/blob/master/src/libstd/hash/mod.rs
[HashMap]: https://github.com/rust-lang/rust/blob/master/src/libcollections/hashmap.rs
[hash]: https://github.com/rust-lang/rust/tree/master/src/libcore/hash
[HashMap]: https://github.com/rust-lang/rust/tree/master/src/libstd/collections/hash
[json]: https://github.com/rust-lang/rust/blob/master/src/libserialize/json.rs
You may also be interested in browsing [trending Rust repositories][github-rust] on GitHub.

View File

@ -320,7 +320,7 @@ from the standard library, and so we need to `use` it.
We now print out two messages, with a `sleep_ms()` in the middle. This will
simulate the time it takes a philosopher to eat.
If you run this program, You should see each philosopher eat in turn:
If you run this program, you should see each philosopher eat in turn:
```text
Baruch Spinoza is eating.
@ -480,7 +480,7 @@ struct Table {
}
```
This `Table` has an vector of `Mutex`es. A mutex is a way to control
This `Table` has a vector of `Mutex`es. A mutex is a way to control
concurrency: only one thread can access the contents at once. This is exactly
the property we need with our forks. We use an empty tuple, `()`, inside the
mutex, since were not actually going to use the value, just hold onto it.

View File

@ -23,8 +23,8 @@ $ sh rustup.sh
If you're on Windows, please download either the [32-bit installer][win32] or
the [64-bit installer][win64] and run it.
[win32]: https://static.rust-lang.org/dist/rust-1.0.0-beta-i686-pc-windows-gnu.msi
[win64]: https://static.rust-lang.org/dist/rust-1.0.0-beta-x86_64-pc-windows-gnu.msi
[win32]: https://static.rust-lang.org/dist/rust-1.0.0-i686-pc-windows-gnu.msi
[win64]: https://static.rust-lang.org/dist/rust-1.0.0-x86_64-pc-windows-gnu.msi
## Uninstalling
@ -74,7 +74,7 @@ $ rustc --version
You should see the version number, commit hash, commit date and build date:
```bash
rustc 1.0.0-beta (9854143cb 2015-04-02) (built 2015-04-02)
rustc 1.0.0 (a59de37e9 2015-05-13) (built 2015-05-14)
```
If you did, Rust has been installed successfully! Congrats!

View File

@ -104,7 +104,7 @@ fn process() {
let handles: Vec<_> = (0..10).map(|_| {
thread::spawn(|| {
let mut _x = 0;
for _ in (0..5_000_001) {
for _ in (0..5_000_000) {
_x += 1
}
})

View File

@ -16,11 +16,11 @@ Rust has two main types of strings: `&str` and `String`. Lets talk about
`&'static str`:
```rust
let string = "Hello there."; // string: &'static str
let greeting = "Hello there."; // greeting: &'static str
```
This string is statically allocated, meaning that its saved inside our
compiled program, and exists for the entire duration it runs. The `string`
compiled program, and exists for the entire duration it runs. The `greeting`
binding is a reference to this statically allocated string. String slices
have a fixed size, and cannot be mutated.

View File

@ -433,7 +433,7 @@ impl String {
///
/// ```
/// let mut s = String::new();
/// s.reserve(10);
/// s.reserve_exact(10);
/// assert!(s.capacity() >= 10);
/// ```
#[inline]

View File

@ -539,7 +539,7 @@ impl<K, V, S> HashMap<K, V, S>
{
/// Creates an empty hashmap which will use the given hasher to hash keys.
///
/// The creates map has the default initial capacity.
/// The created map has the default initial capacity.
///
/// # Examples
///

View File

@ -53,8 +53,7 @@ use vec::Vec;
/// fn my_printer(s: *const libc::c_char);
/// }
///
/// let to_print = &b"Hello, world!"[..];
/// let c_to_print = CString::new(to_print).unwrap();
/// let c_to_print = CString::new("Hello, world!").unwrap();
/// unsafe {
/// my_printer(c_to_print.as_ptr());
/// }

View File

@ -1099,20 +1099,19 @@ pub fn remove_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> {
/// # Examples
///
/// ```
/// # #![feature(path_ext)]
/// use std::io;
/// use std::fs::{self, PathExt, DirEntry};
/// use std::fs::{self, DirEntry};
/// use std::path::Path;
///
/// // one possible implementation of fs::walk_dir only visiting files
/// fn visit_dirs(dir: &Path, cb: &mut FnMut(DirEntry)) -> io::Result<()> {
/// if dir.is_dir() {
/// fn visit_dirs(dir: &Path, cb: &Fn(&DirEntry)) -> io::Result<()> {
/// if try!(fs::metadata(dir)).is_dir() {
/// for entry in try!(fs::read_dir(dir)) {
/// let entry = try!(entry);
/// if entry.path().is_dir() {
/// if try!(fs::metadata(entry.path())).is_dir() {
/// try!(visit_dirs(&entry.path(), cb));
/// } else {
/// cb(entry);
/// cb(&entry);
/// }
/// }
/// }

View File

@ -19,7 +19,7 @@ use sys_common::net as net_imp;
pub use self::ip::{IpAddr, Ipv4Addr, Ipv6Addr, Ipv6MulticastScope};
pub use self::addr::{SocketAddr, SocketAddrV4, SocketAddrV6, ToSocketAddrs};
pub use self::tcp::{TcpStream, TcpListener};
pub use self::tcp::{TcpStream, TcpListener, Incoming};
pub use self::udp::UdpSocket;
pub use self::parser::AddrParseError;

View File

@ -1485,7 +1485,7 @@ impl Path {
iter_after(self.components().rev(), child.as_ref().components().rev()).is_some()
}
/// Extracts the stem (non-extension) portion of `self.file()`.
/// Extracts the stem (non-extension) portion of `self.file_name()`.
///
/// The stem is:
///
@ -1508,7 +1508,7 @@ impl Path {
self.file_name().map(split_file_at_dot).and_then(|(before, after)| before.or(after))
}
/// Extracts the extension of `self.file()`, if possible.
/// Extracts the extension of `self.file_name()`, if possible.
///
/// The extension is:
///

View File

@ -11,7 +11,6 @@
trait MyTrait {
const C: bool;
//~^ associated constants are experimental
//~| add #![feature(associated_consts)] to the crate attributes to enable
}
struct Foo;
@ -19,5 +18,4 @@ struct Foo;
impl Foo {
const C: bool = true;
//~^ associated constants are experimental
//~| add #![feature(associated_consts)] to the crate attributes to enable
}

View File

@ -0,0 +1,21 @@
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
trait Foo {
type T;
}
// should be able to use a trait with an associated type without specifying it as an argument
trait Bar<F: Foo> {
fn bar(foo: &F);
}
pub fn main() {
}