Skip to content

Commit

Permalink
Auto merge of #25525 - Manishearth:rollup, r=Manishearth
Browse files Browse the repository at this point in the history
- Successful merges: #25465, #25469, #25472, #25474, #25476, #25484, #25490, #25493, #25503, #25506, #25508, #25510, #25516, #25522
- Failed merges:
  • Loading branch information
bors committed May 17, 2015
2 parents 4f83c4b + a0815c8 commit 9f3a7f0
Show file tree
Hide file tree
Showing 14 changed files with 45 additions and 28 deletions.
2 changes: 1 addition & 1 deletion AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
8 changes: 4 additions & 4 deletions src/doc/complement-lang-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/doc/trpl/dining-philosophers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 we’re not actually going to use the value, just hold onto it.
Expand Down
6 changes: 3 additions & 3 deletions src/doc/trpl/installing-rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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!
Expand Down
2 changes: 1 addition & 1 deletion src/doc/trpl/rust-inside-other-languages.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
})
Expand Down
4 changes: 2 additions & 2 deletions src/doc/trpl/strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ Rust has two main types of strings: `&str` and `String`. Let’s 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 it’s 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.

Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ impl String {
///
/// ```
/// let mut s = String::new();
/// s.reserve(10);
/// s.reserve_exact(10);
/// assert!(s.capacity() >= 10);
/// ```
#[inline]
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/collections/hash/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down
3 changes: 1 addition & 2 deletions src/libstd/ffi/c_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
/// }
Expand Down
11 changes: 5 additions & 6 deletions src/libstd/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
/// }
/// }
/// }
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/net/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/libstd/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
///
Expand All @@ -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:
///
Expand Down
2 changes: 0 additions & 2 deletions src/test/compile-fail/gated-associated_consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@
trait MyTrait {
const C: bool;
//~^ associated constants are experimental
//~| add #![feature(associated_consts)] to the crate attributes to enable
}

struct Foo;

impl Foo {
const C: bool = true;
//~^ associated constants are experimental
//~| add #![feature(associated_consts)] to the crate attributes to enable
}
21 changes: 21 additions & 0 deletions src/test/run-pass/issue18173.rs
Original file line number Diff line number Diff line change
@@ -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() {
}

0 comments on commit 9f3a7f0

Please sign in to comment.