diff --git a/AUTHORS.txt b/AUTHORS.txt index 6e79eec3e79..6e2ed39f875 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -8,7 +8,7 @@ Aaron Raimist Aaron Todd Aaron Turon Aaron Weiss -Abhishek Chanda +Abhishek Chanda Adam Bozanich Adam Jacob Adam Roben diff --git a/src/doc/complement-lang-faq.md b/src/doc/complement-lang-faq.md index e51e7d414a8..4d7862788fb 100644 --- a/src/doc/complement-lang-faq.md +++ b/src/doc/complement-lang-faq.md @@ -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. diff --git a/src/doc/trpl/dining-philosophers.md b/src/doc/trpl/dining-philosophers.md index b179c90ceb9..035f4de9da2 100644 --- a/src/doc/trpl/dining-philosophers.md +++ b/src/doc/trpl/dining-philosophers.md @@ -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 we’re not actually going to use the value, just hold onto it. diff --git a/src/doc/trpl/installing-rust.md b/src/doc/trpl/installing-rust.md index b8230f060e0..b182ac745b8 100644 --- a/src/doc/trpl/installing-rust.md +++ b/src/doc/trpl/installing-rust.md @@ -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! diff --git a/src/doc/trpl/rust-inside-other-languages.md b/src/doc/trpl/rust-inside-other-languages.md index 204dd3895c3..868034ab23a 100644 --- a/src/doc/trpl/rust-inside-other-languages.md +++ b/src/doc/trpl/rust-inside-other-languages.md @@ -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 } }) diff --git a/src/doc/trpl/strings.md b/src/doc/trpl/strings.md index 61a6ec3eb3f..ece2c390be3 100644 --- a/src/doc/trpl/strings.md +++ b/src/doc/trpl/strings.md @@ -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. diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index 28e47674291..1f2443d9771 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -433,7 +433,7 @@ impl String { /// /// ``` /// let mut s = String::new(); - /// s.reserve(10); + /// s.reserve_exact(10); /// assert!(s.capacity() >= 10); /// ``` #[inline] diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs index 48f65a5abfd..a5fbc4374e0 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -539,7 +539,7 @@ impl HashMap { /// 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 /// diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs index 04513e9d048..b83a8efe1d0 100644 --- a/src/libstd/ffi/c_str.rs +++ b/src/libstd/ffi/c_str.rs @@ -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()); /// } diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs index fc5405ea7f6..481d9e69abd 100644 --- a/src/libstd/fs.rs +++ b/src/libstd/fs.rs @@ -1099,20 +1099,19 @@ pub fn remove_dir_all>(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); /// } /// } /// } diff --git a/src/libstd/net/mod.rs b/src/libstd/net/mod.rs index bff9774bcd0..a79a451305d 100644 --- a/src/libstd/net/mod.rs +++ b/src/libstd/net/mod.rs @@ -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; diff --git a/src/libstd/path.rs b/src/libstd/path.rs index 934b3156357..6732af556e0 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -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: /// diff --git a/src/test/compile-fail/gated-associated_consts.rs b/src/test/compile-fail/gated-associated_consts.rs index 21672b18bde..cfa75ff9763 100644 --- a/src/test/compile-fail/gated-associated_consts.rs +++ b/src/test/compile-fail/gated-associated_consts.rs @@ -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 } diff --git a/src/test/run-pass/issue18173.rs b/src/test/run-pass/issue18173.rs new file mode 100644 index 00000000000..f4266fada32 --- /dev/null +++ b/src/test/run-pass/issue18173.rs @@ -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 or the MIT license +// , 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 { + fn bar(foo: &F); +} + +pub fn main() { +}