diff --git a/COMPILER_TESTS.md b/COMPILER_TESTS.md index 1cae4ef090fe0..91975c1f9ed9a 100644 --- a/COMPILER_TESTS.md +++ b/COMPILER_TESTS.md @@ -77,7 +77,7 @@ fn test_foo() { } ``` -Note that not all headers have meaning when customized too a revision. +Note that not all headers have meaning when customized to a revision. For example, the `ignore-test` header (and all "ignore" headers) currently only apply to the test as a whole, not to particular revisions. The only headers that are intended to really work when diff --git a/src/doc/book/no-stdlib.md b/src/doc/book/no-stdlib.md index 610940cde95e6..43bd0507ebbb6 100644 --- a/src/doc/book/no-stdlib.md +++ b/src/doc/book/no-stdlib.md @@ -38,7 +38,7 @@ fn start(_argc: isize, _argv: *const *const u8) -> isize { // for a bare-bones hello world. These are normally // provided by libstd. #[lang = "eh_personality"] extern fn eh_personality() {} -#[lang = "panic_fmt"] fn panic_fmt() -> ! { loop {} } +#[lang = "panic_fmt"] extern fn panic_fmt() -> ! { loop {} } # #[lang = "eh_unwind_resume"] extern fn rust_eh_unwind_resume() {} # #[no_mangle] pub extern fn rust_eh_register_frames () {} # #[no_mangle] pub extern fn rust_eh_unregister_frames () {} @@ -65,7 +65,7 @@ pub extern fn main(argc: i32, argv: *const *const u8) -> i32 { } #[lang = "eh_personality"] extern fn eh_personality() {} -#[lang = "panic_fmt"] fn panic_fmt() -> ! { loop {} } +#[lang = "panic_fmt"] extern fn panic_fmt() -> ! { loop {} } # #[lang = "eh_unwind_resume"] extern fn rust_eh_unwind_resume() {} # #[no_mangle] pub extern fn rust_eh_register_frames () {} # #[no_mangle] pub extern fn rust_eh_unregister_frames () {} diff --git a/src/doc/book/vectors.md b/src/doc/book/vectors.md index 6ac701e296985..e96dddf8c82cf 100644 --- a/src/doc/book/vectors.md +++ b/src/doc/book/vectors.md @@ -120,7 +120,7 @@ You can iterate the vector multiple times by taking a reference to the vector wh For example, the following code does not compile. ```rust,ignore -let mut v = vec![1, 2, 3, 4, 5]; +let v = vec![1, 2, 3, 4, 5]; for i in v { println!("Take ownership of the vector and its element {}", i); @@ -134,7 +134,7 @@ for i in v { Whereas the following works perfectly, ```rust -let mut v = vec![1, 2, 3, 4, 5]; +let v = vec![1, 2, 3, 4, 5]; for i in &v { println!("This is a reference to {}", i); diff --git a/src/libcollections/binary_heap.rs b/src/libcollections/binary_heap.rs index 2988a6360955f..c9dd1efb37435 100644 --- a/src/libcollections/binary_heap.rs +++ b/src/libcollections/binary_heap.rs @@ -173,7 +173,7 @@ use vec::{self, Vec}; /// ``` /// use std::collections::BinaryHeap; /// -/// // type inference lets us omit an explicit type signature (which +/// // Type inference lets us omit an explicit type signature (which /// // would be `BinaryHeap` in this example). /// let mut heap = BinaryHeap::new(); /// @@ -194,7 +194,7 @@ use vec::{self, Vec}; /// /// // We can iterate over the items in the heap, although they are returned in /// // a random order. -/// for x in heap.iter() { +/// for x in &heap { /// println!("{}", x); /// } /// diff --git a/src/libcore/convert.rs b/src/libcore/convert.rs index b4ac020795c38..2d999868f71ec 100644 --- a/src/libcore/convert.rs +++ b/src/libcore/convert.rs @@ -19,14 +19,14 @@ //! //! - Impl the `As*` traits for reference-to-reference conversions //! - Impl the `Into` trait when you want to consume the value in the conversion -//! - The `From` trait is the most flexible, useful for values _and_ references conversions +//! - The `From` trait is the most flexible, useful for value _and_ reference conversions //! -//! As a library writer, you should prefer implementing `From` rather than -//! `Into`, as `From` provides greater flexibility and offer the equivalent `Into` +//! As a library author, you should prefer implementing `From` rather than +//! `Into`, as `From` provides greater flexibility and offers an equivalent `Into` //! implementation for free, thanks to a blanket implementation in the standard library. //! //! **Note: these traits must not fail**. If the conversion can fail, you must use a dedicated -//! method which return an `Option` or a `Result`. +//! method which returns an `Option` or a `Result`. //! //! # Generic impl //! @@ -49,7 +49,7 @@ use marker::Sized; /// [book]: ../../book/borrow-and-asref.html /// /// **Note: this trait must not fail**. If the conversion can fail, use a dedicated method which -/// return an `Option` or a `Result`. +/// returns an `Option` or a `Result`. /// /// # Examples /// @@ -82,7 +82,7 @@ pub trait AsRef { /// A cheap, mutable reference-to-mutable reference conversion. /// /// **Note: this trait must not fail**. If the conversion can fail, use a dedicated method which -/// return an `Option` or a `Result`. +/// returns an `Option` or a `Result`. /// /// # Generic Impls /// @@ -99,10 +99,10 @@ pub trait AsMut { /// A conversion that consumes `self`, which may or may not be expensive. /// /// **Note: this trait must not fail**. If the conversion can fail, use a dedicated method which -/// return an `Option` or a `Result`. +/// returns an `Option` or a `Result`. /// -/// Library writer should not implement directly this trait, but should prefer the implementation -/// of the `From` trait, which offer greater flexibility and provide the equivalent `Into` +/// Library authors should not directly implement this trait, but should prefer implementing +/// the `From` trait, which offers greater flexibility and provides an equivalent `Into` /// implementation for free, thanks to a blanket implementation in the standard library. /// /// # Examples @@ -134,7 +134,7 @@ pub trait Into: Sized { /// Construct `Self` via a conversion. /// /// **Note: this trait must not fail**. If the conversion can fail, use a dedicated method which -/// return an `Option` or a `Result`. +/// returns an `Option` or a `Result`. /// /// # Examples /// diff --git a/src/libstd/env.rs b/src/libstd/env.rs index 749e58c11962b..40f6528f63efb 100644 --- a/src/libstd/env.rs +++ b/src/libstd/env.rs @@ -416,7 +416,7 @@ impl Error for JoinPathsError { fn description(&self) -> &str { self.inner.description() } } -/// Returns the path to the current user's home directory if known. +/// Returns the path of the current user's home directory if known. /// /// # Unix /// @@ -450,7 +450,7 @@ pub fn home_dir() -> Option { os_imp::home_dir() } -/// Returns the path to a temporary directory. +/// Returns the path of a temporary directory. /// /// On Unix, returns the value of the 'TMPDIR' environment variable if it is /// set, otherwise for non-Android it returns '/tmp'. If Android, since there @@ -459,7 +459,7 @@ pub fn home_dir() -> Option { /// /// On Windows, returns the value of, in order, the 'TMP', 'TEMP', /// 'USERPROFILE' environment variable if any are set and not the empty -/// string. Otherwise, tmpdir returns the path to the Windows directory. This +/// string. Otherwise, tmpdir returns the path of the Windows directory. This /// behavior is identical to that of [GetTempPath][msdn], which this function /// uses internally. /// @@ -482,14 +482,14 @@ pub fn temp_dir() -> PathBuf { os_imp::temp_dir() } -/// Returns the full filesystem path to the current running executable. +/// Returns the full filesystem path of the current running executable. /// -/// The path returned is not necessarily a "real path" to the executable as +/// The path returned is not necessarily a "real path" of the executable as /// there may be intermediate symlinks. /// /// # Errors /// -/// Acquiring the path to the current executable is a platform-specific operation +/// Acquiring the path of the current executable is a platform-specific operation /// that can fail for a good number of reasons. Some errors can include, but not /// be limited to, filesystem operations failing or general syscall failures. /// @@ -526,7 +526,7 @@ pub struct ArgsOs { inner: os_imp::Args } /// Returns the arguments which this program was started with (normally passed /// via the command line). /// -/// The first element is traditionally the path to the executable, but it can be +/// The first element is traditionally the path of the executable, but it can be /// set to arbitrary text, and may not even exist. This means this property should /// not be relied upon for security purposes. /// @@ -554,7 +554,7 @@ pub fn args() -> Args { /// Returns the arguments which this program was started with (normally passed /// via the command line). /// -/// The first element is traditionally the path to the executable, but it can be +/// The first element is traditionally the path of the executable, but it can be /// set to arbitrary text, and it may not even exist, so this property should /// not be relied upon for security purposes. ///