Auto merge of #28316 - Manishearth:rollup, r=Manishearth
- Successful merges: #28281, #28283, #28289, #28294, #28295, #28305 - Failed merges:
This commit is contained in:
commit
3a4fb823e2
5 changed files with 10 additions and 108 deletions
98
COPYRIGHT
98
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
|
||||
<richgel99@gmail.com>. All uses of this file are
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<T>`][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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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),
|
||||
///
|
||||
|
|
Loading…
Reference in a new issue