From 0d5cae2d45a709e86e0a3fca61daa868f1f698e1 Mon Sep 17 00:00:00 2001 From: Vladimir Rutsky Date: Mon, 7 Sep 2015 09:41:02 +0300 Subject: [PATCH 1/7] fix punctuation in list r? @steveklabnik --- src/doc/trpl/references-and-borrowing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/doc/trpl/references-and-borrowing.md b/src/doc/trpl/references-and-borrowing.md index a7a77539f7958..ed6a8cfefa7ef 100644 --- a/src/doc/trpl/references-and-borrowing.md +++ b/src/doc/trpl/references-and-borrowing.md @@ -159,8 +159,8 @@ First, any borrow must last for a scope no greater than that of the owner. Second, you may have one or the other of these two kinds of borrows, but not both at the same time: -* one or more references (`&T`) to a resource. -* exactly one mutable reference (`&mut T`) +* one or more references (`&T`) to a resource, +* exactly one mutable reference (`&mut T`). You may notice that this is very similar, though not exactly the same as, From b1e80079994e1f147c726e964278b28a972991e5 Mon Sep 17 00:00:00 2001 From: Vladimir Rutsky Date: Mon, 7 Sep 2015 11:01:01 +0300 Subject: [PATCH 2/7] fix capitalization inside sentense --- src/doc/trpl/mutability.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/trpl/mutability.md b/src/doc/trpl/mutability.md index ef569a09e2137..5f71bc806bf09 100644 --- a/src/doc/trpl/mutability.md +++ b/src/doc/trpl/mutability.md @@ -62,7 +62,7 @@ fn foo(mut x: i32) { # Interior vs. Exterior Mutability However, when we say something is ‘immutable’ in Rust, that doesn’t mean that -it’s not able to be changed: We mean something has ‘exterior mutability’. Consider, +it’s not able to be changed: we mean something has ‘exterior mutability’. Consider, for example, [`Arc`][arc]: ```rust From b5b94037c4e36a0b07598fdb2e5e6a9ebf84b8af Mon Sep 17 00:00:00 2001 From: Vladimir Rutsky Date: Mon, 7 Sep 2015 11:03:53 +0300 Subject: [PATCH 3/7] fix punctuation in list (again) --- src/doc/trpl/mutability.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/doc/trpl/mutability.md b/src/doc/trpl/mutability.md index ef569a09e2137..9a9e38f7d0a58 100644 --- a/src/doc/trpl/mutability.md +++ b/src/doc/trpl/mutability.md @@ -85,8 +85,8 @@ philosophy, memory safety, and the mechanism by which Rust guarantees it, the > You may have one or the other of these two kinds of borrows, but not both at > the same time: > -> * one or more references (`&T`) to a resource. -> * exactly one mutable reference (`&mut T`) +> * one or more references (`&T`) to a resource, +> * exactly one mutable reference (`&mut T`). [ownership]: ownership.html [borrowing]: references-and-borrowing.html#borrowing From acea5f4c82fa8ae084606b5383562f3dc3357d90 Mon Sep 17 00:00:00 2001 From: Jake Goulding Date: Mon, 7 Sep 2015 20:01:14 -0400 Subject: [PATCH 4/7] Clarify that `include_bytes!` returns a reference to an array, not just a slice This can be shown with the example code ```rust fn main() { let () = include_bytes!("/etc/hosts"); } Which will have the error: expected `&[u8; 195]`, found `()` --- src/libstd/macros.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index e48669821766e..a0c3f013f2b4e 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -412,9 +412,9 @@ pub mod builtin { #[macro_export] macro_rules! include_str { ($file:expr) => ({ /* compiler built-in */ }) } - /// Includes a file as a byte slice. + /// Includes a file as a reference to a byte array. /// - /// This macro will yield an expression of type `&'static [u8]` which is + /// This macro will yield an expression of type `&'static [u8; N]` which is /// the contents of the filename specified. The file is located relative to /// the current file (similarly to how modules are found), /// From 3e8038bcab8e43e6f3f5761af4ea64372da0c4e0 Mon Sep 17 00:00:00 2001 From: midinastasurazz Date: Tue, 8 Sep 2015 14:06:35 +0200 Subject: [PATCH 5/7] Fix link to hygienic macros on Wikipedia --- src/doc/trpl/macros.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/trpl/macros.md b/src/doc/trpl/macros.md index c13b13b5a0792..d74cd6d0d35b4 100644 --- a/src/doc/trpl/macros.md +++ b/src/doc/trpl/macros.md @@ -313,7 +313,7 @@ fn main() { } ``` -This works because Rust has a [hygienic macro system][https://en.wikipedia.org/wiki/Hygienic_macro]. Each macro expansion +This works because Rust has a [hygienic macro system]. Each macro expansion happens in a distinct ‘syntax context’, and each variable is tagged with the syntax context where it was introduced. It’s as though the variable `state` inside `main` is painted a different "color" from the variable `state` inside From ca1a81df2388484ec6005b7c6ba8ba953c450bc7 Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Tue, 8 Sep 2015 09:33:53 -0400 Subject: [PATCH 6/7] Fix small sentence about references Thanks Eric, reported via email --- src/doc/trpl/references-and-borrowing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/doc/trpl/references-and-borrowing.md b/src/doc/trpl/references-and-borrowing.md index a7a77539f7958..0d27e99eae820 100644 --- a/src/doc/trpl/references-and-borrowing.md +++ b/src/doc/trpl/references-and-borrowing.md @@ -298,8 +298,8 @@ We can’t modify `v` because it’s borrowed by the loop. ### use after free -References must live as long as the resource they refer to. Rust will check the -scopes of your references to ensure that this is true. +References must not live longer than the resource they refer to. Rust will +check the scopes of your references to ensure that this is true. If Rust didn’t check this property, we could accidentally use a reference which was invalid. For example: From 37b1a8762b40717375a70755a75ac8773c382d7a Mon Sep 17 00:00:00 2001 From: Andrew Paseltiner Date: Tue, 8 Sep 2015 19:01:26 -0400 Subject: [PATCH 7/7] Remove references to removed Valgrind headers --- COPYRIGHT | 98 ------------------------------------------------------- 1 file changed, 98 deletions(-) diff --git a/COPYRIGHT b/COPYRIGHT index d4ad98e6e8799..0eac7ac9de2c5 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -22,104 +22,6 @@ The Rust Project includes packages written by third parties. The following third party packages are included, and carry their own copyright notices and license terms: -* Two header files that are part of the Valgrind - package. These files are found at src/rt/valgrind/valgrind.h and - src/rt/valgrind/memcheck.h, within this distribution. These files - are redistributed under the following terms, as noted in - them: - - for src/rt/valgrind/valgrind.h: - - This file is part of Valgrind, a dynamic binary - instrumentation framework. - - Copyright (C) 2000-2010 Julian Seward. All rights - reserved. - - Redistribution and use in source and binary forms, with - or without modification, are permitted provided that the - following conditions are met: - - 1. Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - - 2. The origin of this software must not be - misrepresented; you must not claim that you wrote the - original software. If you use this software in a - product, an acknowledgment in the product - documentation would be appreciated but is not - required. - - 3. Altered source versions must be plainly marked as - such, and must not be misrepresented as being the - original software. - - 4. The name of the author may not be used to endorse or - promote products derived from this software without - specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE - USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - OF SUCH DAMAGE. - - for src/rt/valgrind/memcheck.h: - - This file is part of MemCheck, a heavyweight Valgrind - tool for detecting memory errors. - - Copyright (C) 2000-2010 Julian Seward. All rights - reserved. - - Redistribution and use in source and binary forms, with - or without modification, are permitted provided that the - following conditions are met: - - 1. Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - - 2. The origin of this software must not be - misrepresented; you must not claim that you wrote the - original software. If you use this software in a - product, an acknowledgment in the product - documentation would be appreciated but is not - required. - - 3. Altered source versions must be plainly marked as - such, and must not be misrepresented as being the - original software. - - 4. The name of the author may not be used to endorse or - promote products derived from this software without - specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE - USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - OF SUCH DAMAGE. - * The src/rt/miniz.c file, carrying an implementation of RFC1950/RFC1951 DEFLATE, by Rich Geldreich . All uses of this file are