Skip to content

Commit ad3e047

Browse files
committed
---
yaml --- r: 234199 b: refs/heads/beta c: 6873b9f h: refs/heads/master i: 234197: b834b2a 234195: 725a97f 234191: 5353b85 v: v3
1 parent 919cd71 commit ad3e047

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+619
-699
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 15d5c0878d93c553558bf23245c6be6f7ab65fab
26+
refs/heads/beta: 6873b9fee4af732fe81d54fdcedbd31201e3edf0
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 370fe2786109360f7c35b8ba552b83b773dd71d6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/COMPILER_TESTS.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Compiler Test Documentation
2+
3+
In the Rust project, we use a special set of comands imbedded in
4+
comments to test the Rust compiler. There are two groups of commands:
5+
6+
1. Header commands
7+
2. Error info commands
8+
9+
Both types of commands are inside comments, but header commands should
10+
be in a comment before any code.
11+
12+
## Summary of Error Info Commands
13+
14+
Error commands specify something about certain lines of the
15+
program. They tell the test what kind of error and what message you
16+
are expecting.
17+
18+
* `~`: Associates the following error level and message with the
19+
current line
20+
* `~|`: Associates the following error level and message with the same
21+
line as the previous comment
22+
* `~^`: Associates the following error level and message with the
23+
previous line. Each caret (`^`) that you add adds a line to this, so
24+
`~^^^^^^^` is seven lines up.
25+
26+
The error levels that you can have are:
27+
1. `ERROR`
28+
2. `WARNING`
29+
3. `NOTE`
30+
4. `HELP` and `SUGGESTION`*
31+
32+
\* **Note**: `SUGGESTION` must follow emediatly after `HELP`.
33+
34+
## Summary of Header Commands
35+
36+
Header commands specify something about the entire test file, as a
37+
whole, instead of just a few lines inside the test.
38+
39+
* `ignore-X` where `X` is an architecture, OS or stage will ignore the test accordingly
40+
* `ignore-pretty` will not compile the pretty-printed test (this is done to test the pretty-printer, but might not always work)
41+
* `ignore-test` always ignores the test
42+
* `ignore-lldb` and `ignore-gdb` will skip the debuginfo tests
43+
* `min-{gdb,lldb}-version`

branches/beta/CONTRIBUTING.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ links to the major sections:
1010
* [Writing Documentation](#writing-documentation)
1111
* [Issue Triage](#issue-triage)
1212
* [Out-of-tree Contributions](#out-of-tree-contributions)
13+
* [Helpful Links and Information](#helpful-links-and-information)
1314

1415
If you have questions, please make a post on [internals.rust-lang.org][internals] or
1516
hop on [#rust-internals][pound-rust-internals].
@@ -210,3 +211,28 @@ valuable!
210211
[users]: https://users.rust-lang.org/
211212
[so]: http://stackoverflow.com/questions/tagged/rust
212213
[community-library]: https://github.com/rust-lang/rfcs/labels/A-community-library
214+
215+
## Helpful Links and Information
216+
217+
For people new to Rust, and just starting to contribute, or even for
218+
more seasoned developers, some useful places to look for information
219+
are:
220+
221+
* The [Rust Internals forum][rif], a place to ask questions and
222+
discuss Rust's internals
223+
* The [generated documentation for rust's compiler][gdfrustc]
224+
* The [rust referance][rr], even though it doesn't specifically talk about Rust's internals, its a great reasource nontheless
225+
* Although out of date, [Tom Lee's great blog article][tlgba] is very helpful
226+
* [rustaceans.org][ro] is helpful, but mostly dedicated to IRC
227+
* The [Rust Compiler Testing Docs][rctd]
228+
* For @bors, [this cheetsheat][cheetsheat] is helpful (Remember to replace `@homu` with `@bors` in the commands that you use.)
229+
* **Google**!
230+
* Don't be afraid to ask! The Rust community is friendly and helpful.
231+
232+
[gdfrustc]: http://manishearth.github.io/rust-internals-docs/rustc/
233+
[rif]: http://internals.rust-lang.org
234+
[rr]: https://doc.rust-lang.org/book/README.html
235+
[tlgba]: http://tomlee.co/2014/04/03/a-more-detailed-tour-of-the-rust-compiler/
236+
[ro]: http://www.rustaceans.org/
237+
[rctd]: ./COMPILER_TESTS.md
238+
[cheetsheat]: http://buildbot.rust-lang.org/homu/

branches/beta/configure

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,12 +1191,21 @@ do
11911191
#
11921192
# Consequently here we try to detect when that happens and print an
11931193
# error if it does.
1194-
if $CFG_PYTHON -c 'import sys; print sys.argv[1]' `pwd` | grep '^/'
1194+
if $CFG_PYTHON -c 'import sys; print sys.argv[1]' `pwd` | grep '^/' > /dev/null
11951195
then
1196-
err "python is silently translating windows paths to MSYS paths \
1197-
and the build will fail if this python is used.\n\n \
1198-
Either an official python install must be used or an \
1199-
alternative python package in MinGW must be used."
1196+
err "
1197+
1198+
python is silently translating windows paths to MSYS paths \
1199+
and the build will fail if this python is used.
1200+
1201+
Either an official python install must be used or an \
1202+
alternative python package in MinGW must be used.
1203+
1204+
If you are building under msys2 try installing the mingw-w64-x86_64-python2 \
1205+
package instead of python2:
1206+
1207+
$ pacman -R python2 && pacman -S mingw-w64-x86_64-python2
1208+
"
12001209
fi
12011210

12021211
# MSVC requires cmake because that's how we're going to build LLVM
@@ -1207,10 +1216,19 @@ do
12071216
# detect that here and error.
12081217
if ! "$CFG_CMAKE" --help | sed -n '/^Generators/,$p' | grep 'Visual Studio' > /dev/null
12091218
then
1210-
err "cmake does not support Visual Studio generators.\n\n \
1211-
This is likely due to it being an msys/cygwin build of cmake, \
1212-
rather than the required windows version, built using MinGW \
1213-
or Visual Studio."
1219+
err "
1220+
1221+
cmake does not support Visual Studio generators.
1222+
1223+
This is likely due to it being an msys/cygwin build of cmake, \
1224+
rather than the required windows version, built using MinGW \
1225+
or Visual Studio.
1226+
1227+
If you are building under msys2 try installing the mingw-w64-x86_64-cmake \
1228+
package instead of cmake:
1229+
1230+
$ pacman -R cmake && pacman -S mingw-w64-x86_64-cmake
1231+
"
12141232
fi
12151233

12161234
# Use the REG program to figure out where VS is installed

branches/beta/src/doc/nomicon/destructors.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,16 @@ this is totally fine.
2626
For instance, a custom implementation of `Box` might write `Drop` like this:
2727

2828
```rust
29-
#![feature(heap_api, core_intrinsics, unique)]
29+
#![feature(alloc, heap_api, core_intrinsics, unique)]
30+
31+
extern crate alloc;
3032

31-
use std::rt::heap;
3233
use std::ptr::Unique;
3334
use std::intrinsics::drop_in_place;
3435
use std::mem;
3536

37+
use alloc::heap;
38+
3639
struct Box<T>{ ptr: Unique<T> }
3740

3841
impl<T> Drop for Box<T> {
@@ -45,22 +48,26 @@ impl<T> Drop for Box<T> {
4548
}
4649
}
4750
}
51+
# fn main() {}
4852
```
4953

5054
and this works fine because when Rust goes to drop the `ptr` field it just sees
51-
a [Unique][] that has no actual `Drop` implementation. Similarly nothing can
55+
a [Unique] that has no actual `Drop` implementation. Similarly nothing can
5256
use-after-free the `ptr` because when drop exits, it becomes inacessible.
5357

5458
However this wouldn't work:
5559

5660
```rust
57-
#![feature(heap_api, core_intrinsics, unique)]
61+
#![feature(alloc, heap_api, core_intrinsics, unique)]
62+
63+
extern crate alloc;
5864

59-
use std::rt::heap;
6065
use std::ptr::Unique;
6166
use std::intrinsics::drop_in_place;
6267
use std::mem;
6368

69+
use alloc::heap;
70+
6471
struct Box<T>{ ptr: Unique<T> }
6572

6673
impl<T> Drop for Box<T> {
@@ -87,6 +94,7 @@ impl<T> Drop for SuperBox<T> {
8794
}
8895
}
8996
}
97+
# fn main() {}
9098
```
9199

92100
After we deallocate the `box`'s ptr in SuperBox's destructor, Rust will
@@ -129,13 +137,16 @@ The classic safe solution to overriding recursive drop and allowing moving out
129137
of Self during `drop` is to use an Option:
130138

131139
```rust
132-
#![feature(heap_api, core_intrinsics, unique)]
140+
#![feature(alloc, heap_api, core_intrinsics, unique)]
141+
142+
extern crate alloc;
133143

134-
use std::rt::heap;
135144
use std::ptr::Unique;
136145
use std::intrinsics::drop_in_place;
137146
use std::mem;
138147

148+
use alloc::heap;
149+
139150
struct Box<T>{ ptr: Unique<T> }
140151

141152
impl<T> Drop for Box<T> {
@@ -165,6 +176,7 @@ impl<T> Drop for SuperBox<T> {
165176
}
166177
}
167178
}
179+
# fn main() {}
168180
```
169181

170182
However this has fairly odd semantics: you're saying that a field that *should*

branches/beta/src/doc/nomicon/meet-safe-and-unsafe.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ Unlike C, Undefined Behaviour is pretty limited in scope in Rust. All the core
6060
language cares about is preventing the following things:
6161

6262
* Dereferencing null or dangling pointers
63-
* Reading [uninitialized memory][]
64-
* Breaking the [pointer aliasing rules][]
63+
* Reading [uninitialized memory]
64+
* Breaking the [pointer aliasing rules]
6565
* Producing invalid primitive values:
6666
* dangling/null references
6767
* a `bool` that isn't 0 or 1

branches/beta/src/doc/nomicon/other-reprs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ still consumes a byte of space.
2626
* DSTs, tuples, and tagged unions are not a concept in C and as such are never
2727
FFI safe.
2828

29-
* **If the type would have any [drop flags][], they will still be added**
29+
* **If the type would have any [drop flags], they will still be added**
3030

3131
* This is equivalent to one of `repr(u*)` (see the next section) for enums. The
3232
chosen size is the default enum size for the target platform's C ABI. Note that

branches/beta/src/doc/nomicon/safe-unsafe-meaning.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ unchecked contracts:
3535

3636
There is also `#[unsafe_no_drop_flag]`, which is a special case that exists for
3737
historical reasons and is in the process of being phased out. See the section on
38-
[drop flags][] for details.
38+
[drop flags] for details.
3939

4040
Some examples of unsafe functions:
4141

@@ -44,7 +44,7 @@ Some examples of unsafe functions:
4444
* `ptr::offset` is an intrinsic that invokes Undefined Behaviour if it is
4545
not "in bounds" as defined by LLVM.
4646
* `mem::transmute` reinterprets some value as having the given type,
47-
bypassing type safety in arbitrary ways. (see [conversions][] for details)
47+
bypassing type safety in arbitrary ways. (see [conversions] for details)
4848
* All FFI functions are `unsafe` because they can do arbitrary things.
4949
C being an obvious culprit, but generally any language can do something
5050
that Rust isn't happy about.

branches/beta/src/doc/nomicon/send-and-sync.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ captures this through the `Send` and `Sync` traits.
1010

1111
Send and Sync are fundamental to Rust's concurrency story. As such, a
1212
substantial amount of special tooling exists to make them work right. First and
13-
foremost, they're [unsafe traits][]. This means that they are unsafe to
13+
foremost, they're [unsafe traits]. This means that they are unsafe to
1414
implement, and other unsafe code can assume that they are correctly
1515
implemented. Since they're *marker traits* (they have no associated items like
1616
methods), correctly implemented simply means that they have the intrinsic

branches/beta/src/doc/nomicon/transmutes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ same size. The ways to cause Undefined Behaviour with this are mind boggling.
2121
* No you can't do it
2222
* No you're not special
2323
* Transmuting to a reference without an explicitly provided lifetime
24-
produces an [unbounded lifetime][]
24+
produces an [unbounded lifetime]
2525

2626
`mem::transmute_copy<T, U>` somehow manages to be *even more* wildly unsafe than
2727
this. It copies `size_of<U>` bytes out of an `&T` and interprets them as a `U`.

branches/beta/src/doc/nomicon/vec-alloc.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This is perfectly fine because we already have `cap == 0` as our sentinel for no
99
allocation. We don't even need to handle it specially in almost any code because
1010
we usually need to check if `cap > len` or `len > 0` anyway. The traditional
1111
Rust value to put here is `0x01`. The standard library actually exposes this
12-
as `std::rt::heap::EMPTY`. There are quite a few places where we'll
12+
as `alloc::heap::EMPTY`. There are quite a few places where we'll
1313
want to use `heap::EMPTY` because there's no real allocation to talk about but
1414
`null` would make the compiler do bad things.
1515

@@ -20,11 +20,12 @@ the `heap` API anyway, so let's just get that dependency over with.
2020
So:
2121

2222
```rust,ignore
23-
#![feature(heap_api)]
23+
#![feature(alloc, heap_api)]
2424
25-
use std::rt::heap::EMPTY;
2625
use std::mem;
2726
27+
use alloc::heap::EMPTY;
28+
2829
impl<T> Vec<T> {
2930
fn new() -> Self {
3031
assert!(mem::size_of::<T>() != 0, "We're not ready to handle ZSTs");

branches/beta/src/doc/nomicon/vec-final.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22

33
```rust
44
#![feature(unique)]
5-
#![feature(heap_api)]
5+
#![feature(alloc, heap_api)]
6+
7+
extern crate alloc;
68

79
use std::ptr::{Unique, self};
8-
use std::rt::heap;
910
use std::mem;
1011
use std::ops::{Deref, DerefMut};
1112
use std::marker::PhantomData;
1213

13-
14-
15-
14+
use alloc::heap;
1615

1716
struct RawVec<T> {
1817
ptr: Unique<T>,

branches/beta/src/doc/reference.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2367,9 +2367,6 @@ The currently implemented features of the reference compiler are:
23672367
into a Rust program. This capability, especially the signature for the
23682368
annotated function, is subject to change.
23692369

2370-
* `struct_inherit` - Allows using struct inheritance, which is barely
2371-
implemented and will probably be removed. Don't use this.
2372-
23732370
* `struct_variant` - Structural enum variants (those with named fields). It is
23742371
currently unknown whether this style of enum variant is as
23752372
fully supported as the tuple-forms, and it's not certain

0 commit comments

Comments
 (0)