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 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 diff --git a/src/doc/trpl/mutability.md b/src/doc/trpl/mutability.md index ef569a09e2137..2c4316e651a8e 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 @@ -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 diff --git a/src/doc/trpl/references-and-borrowing.md b/src/doc/trpl/references-and-borrowing.md index a7a77539f7958..50297b266d98c 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, @@ -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: 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), ///