From dc7c3cd5c7115a8e7878922f5300d2f911be9be8 Mon Sep 17 00:00:00 2001 From: Zach Reizner Date: Sun, 13 Dec 2015 12:00:00 -0800 Subject: [PATCH 1/9] fix copy-paste typo in docs for wrapping_shr --- src/libcore/num/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 4f3c12567095e..8abb12706a5e3 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -644,7 +644,7 @@ macro_rules! int_impl { self.overflowing_shl(rhs).0 } - /// Panic-free bitwise shift-left; yields `self >> mask(rhs)`, + /// Panic-free bitwise shift-right; yields `self >> mask(rhs)`, /// where `mask` removes any high-order bits of `rhs` that /// would cause the shift to exceed the bitwidth of the type. /// @@ -1446,7 +1446,7 @@ macro_rules! uint_impl { self.overflowing_shl(rhs).0 } - /// Panic-free bitwise shift-left; yields `self >> mask(rhs)`, + /// Panic-free bitwise shift-right; yields `self >> mask(rhs)`, /// where `mask` removes any high-order bits of `rhs` that /// would cause the shift to exceed the bitwidth of the type. /// From bf14d8f0e8363d0d771260f5edb00479f3f9df58 Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Wed, 16 Dec 2015 11:42:18 -0500 Subject: [PATCH 2/9] Remove incorrect words about libcore's stability --- src/libcore/lib.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index 454e2b02b1ca0..cde86230d7509 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -23,12 +23,6 @@ //! nor does it provide concurrency or I/O. These things require //! platform integration, and this library is platform-agnostic. //! -//! *It is not recommended to use the core library*. The stable -//! functionality of libcore is reexported from the -//! [standard library](../std/index.html). The composition of this library is -//! subject to change over time; only the interface exposed through libstd is -//! intended to be stable. -//! //! # How to use the core library //! // FIXME: Fill me in with more detail when the interface settles From 936149fc25c2a94a7f1ed974765bb15565958c59 Mon Sep 17 00:00:00 2001 From: Jake Goulding Date: Wed, 16 Dec 2015 13:25:33 -0500 Subject: [PATCH 3/9] Remove rogue I --- src/librustc/diagnostics.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc/diagnostics.rs b/src/librustc/diagnostics.rs index cde8e7a6d1e13..6a5910074d915 100644 --- a/src/librustc/diagnostics.rs +++ b/src/librustc/diagnostics.rs @@ -1337,7 +1337,7 @@ explanatory comments for the same example: // `for`-loops use a protocol based on the `Iterator` // trait. Each item yielded in a `for` loop has the - // type `Iterator::Item` -- that is,I `Item` is the + // type `Iterator::Item` -- that is, `Item` is the // associated type of the concrete iterator impl. for v in &vs { // ~ ~~~ From 62fa40f87a25b3a8bd79eb614ed92ccff7e6f819 Mon Sep 17 00:00:00 2001 From: Shiney Date: Tue, 15 Dec 2015 22:13:04 +0000 Subject: [PATCH 4/9] Used bold and italic in the markdown to make the stack and heap documentation clearer --- src/doc/book/the-stack-and-the-heap.md | 42 ++++++++++++++------------ 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/doc/book/the-stack-and-the-heap.md b/src/doc/book/the-stack-and-the-heap.md index 9cc3e12aa04ac..63b73a7fc31fc 100644 --- a/src/doc/book/the-stack-and-the-heap.md +++ b/src/doc/book/the-stack-and-the-heap.md @@ -130,63 +130,64 @@ on the stack is the first one you retrieve from it. Let’s try a three-deep example: ```rust -fn bar() { +fn italic() { let i = 6; } -fn foo() { +fn bold() { let a = 5; let b = 100; let c = 1; - bar(); + italic(); } fn main() { let x = 42; - foo(); + bold(); } ``` +We have some kooky function names to make the diagrams clearer. + Okay, first, we call `main()`: | Address | Name | Value | |---------|------|-------| | 0 | x | 42 | -Next up, `main()` calls `foo()`: +Next up, `main()` calls `bold()`: | Address | Name | Value | |---------|------|-------| -| 3 | c | 1 | -| 2 | b | 100 | -| 1 | a | 5 | +| **3** | **c**|**1** | +| **2** | **b**|**100**| +| **1** | **a**| **5** | | 0 | x | 42 | -And then `foo()` calls `bar()`: +And then `bold()` calls `italic()`: | Address | Name | Value | |---------|------|-------| -| 4 | i | 6 | -| 3 | c | 1 | -| 2 | b | 100 | -| 1 | a | 5 | +| *4* | *i* | *6* | +| **3** | **c**|**1** | +| **2** | **b**|**100**| +| **1** | **a**| **5** | | 0 | x | 42 | - Whew! Our stack is growing tall. -After `bar()` is over, its frame is deallocated, leaving just `foo()` and +After `italic()` is over, its frame is deallocated, leaving just `bold()` and `main()`: | Address | Name | Value | |---------|------|-------| -| 3 | c | 1 | -| 2 | b | 100 | -| 1 | a | 5 | -| 0 | x | 42 | +| **3** | **c**|**1** | +| **2** | **b**|**100**| +| **1** | **a**| **5** | +| 0 | x | 42 | -And then `foo()` ends, leaving just `main()`: +And then `bold()` ends, leaving just `main()`: | Address | Name | Value | |---------|------|-------| @@ -578,3 +579,4 @@ comes at the cost of either significant runtime support (e.g. in the form of a garbage collector) or significant programmer effort (in the form of explicit memory management calls that require verification not provided by the Rust compiler). + From 4e2ec9a178bef97619e4ffdc3d916650eb2ccfd4 Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Wed, 16 Dec 2015 22:12:47 -0500 Subject: [PATCH 5/9] small fix to str doc example --- src/libstd/primitive_docs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstd/primitive_docs.rs b/src/libstd/primitive_docs.rs index afeb4231aba48..ed59c51b0f0d8 100644 --- a/src/libstd/primitive_docs.rs +++ b/src/libstd/primitive_docs.rs @@ -333,7 +333,7 @@ mod prim_slice { } /// let ptr = story.as_ptr(); /// let len = story.len(); /// -/// // story has thirteen bytes +/// // story has nineteen bytes /// assert_eq!(19, len); /// /// // We can re-build a str out of ptr and len. This is all unsafe becuase From 22b30fad962b1b19bc5075bfd503866c6e9844d3 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Thu, 17 Dec 2015 19:27:52 +0200 Subject: [PATCH 6/9] doc: improve clarity by introducing a pause --- src/libcore/ops.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs index 0abbd70762d68..dd4702376d43c 100644 --- a/src/libcore/ops.rs +++ b/src/libcore/ops.rs @@ -1616,7 +1616,7 @@ impl fmt::Debug for RangeTo { } /// The `Deref` trait is used to specify the functionality of dereferencing -/// operations like `*v`. +/// operations, like `*v`. /// /// `Deref` also enables ['`Deref` coercions'][coercions]. /// From fc862182c9b63ca550f1965180bc410220652ec7 Mon Sep 17 00:00:00 2001 From: Steve Wooster Date: Thu, 17 Dec 2015 09:40:02 -0800 Subject: [PATCH 7/9] Change "big ask" to "tall order" in Rustonomicon. The Rustonomicon's Lifetimes chapter uses the idiom "big ask", which is obscure compared to "tall order" (check Google ngrams). Also, it's easily mistaken for a typo; either "a big task" or "a big thing to ask" could plausibly work there. --- src/doc/nomicon/lifetimes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/doc/nomicon/lifetimes.md b/src/doc/nomicon/lifetimes.md index e21207efdcf9d..45eb68baeb732 100644 --- a/src/doc/nomicon/lifetimes.md +++ b/src/doc/nomicon/lifetimes.md @@ -107,8 +107,8 @@ This signature of `as_str` takes a reference to a u32 with *some* lifetime, and promises that it can produce a reference to a str that can live *just as long*. Already we can see why this signature might be trouble. That basically implies that we're going to find a str somewhere in the scope the reference -to the u32 originated in, or somewhere *even earlier*. That's a bit of a big -ask. +to the u32 originated in, or somewhere *even earlier*. That's a bit of a tall +order. We then proceed to compute the string `s`, and return a reference to it. Since the contract of our function says the reference must outlive `'a`, that's the From 6fdde01368eb9e04360f0be7256fc5f2ad241ed1 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Thu, 17 Dec 2015 20:55:20 +0200 Subject: [PATCH 8/9] doc: add a missing comma --- src/libstd/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 054f281c07071..0f8b2f6e17b25 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -25,7 +25,7 @@ //! //! # How to read this documentation //! -//! If you already know the name of what you are looking for the fastest way to +//! If you already know the name of what you are looking for, the fastest way to //! find it is to use the search //! bar at the top of the page. //! From bd4aa64f31591b6fd75b798ce19cb5bf52172ebb Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Thu, 17 Dec 2015 20:57:14 +0200 Subject: [PATCH 9/9] doc: fix typo --- src/libstd/prelude/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstd/prelude/mod.rs b/src/libstd/prelude/mod.rs index bda4cdfb43733..04568ad85bffe 100644 --- a/src/libstd/prelude/mod.rs +++ b/src/libstd/prelude/mod.rs @@ -43,7 +43,7 @@ //! //! [`std::io::prelude`]: ../io/prelude/index.html //! -//! The differece between 'the prelude' and these other preludes is that they +//! The difference between 'the prelude' and these other preludes is that they //! are not automatically `use`'d, and must be imported manually. This is still //! easier than importing all of their consitutent components. //!