Skip to content

Commit 85eeff8

Browse files
committed
---
yaml --- r: 218174 b: refs/heads/tmp c: 5d53921 h: refs/heads/master v: v3
1 parent b9ee72f commit 85eeff8

File tree

242 files changed

+5985
-4084
lines changed

Some content is hidden

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

242 files changed

+5985
-4084
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2626
refs/heads/beta: 18adf6230e2e229d4d73391cebff060afc5e5aaa
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
28-
refs/heads/tmp: 69d340a40d0ca37e91731026bd5d7041a145aa34
28+
refs/heads/tmp: 5d53921eff41f54586c370be1a72cb1b82d17e6d
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: e6596d0052e79e6393bbee3538bb122930d89887
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828

branches/tmp/CONTRIBUTING.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,21 @@ feature. We use the 'fork and pull' model described there.
8383

8484
Please make pull requests against the `master` branch.
8585

86+
Compiling all of `make check` can take a while. When testing your pull request,
87+
consider using one of the more specialized `make` targets to cut down on the
88+
amount of time you have to wait. You need to have built the compiler at least
89+
once before running these will work, but that’s only one full build rather than
90+
one each time.
91+
92+
$ make -j8 rustc-stage1 && make check-stage1
93+
94+
is one such example, which builds just `rustc`, and then runs the tests. If
95+
you’re adding something to the standard library, try
96+
97+
$ make -j8 check-stage1-std NO_REBUILD=1
98+
99+
This will not rebuild the compiler, but will run the tests.
100+
86101
All pull requests are reviewed by another person. We have a bot,
87102
@rust-highfive, that will automatically assign a random person to review your
88103
request.
@@ -108,6 +123,10 @@ will run all the tests on every platform we support. If it all works out,
108123

109124
[merge-queue]: http://buildbot.rust-lang.org/homu/queue/rust
110125

126+
Speaking of tests, Rust has a comprehensive test suite. More information about
127+
it can be found
128+
[here](https://github.com/rust-lang/rust-wiki-backup/blob/master/Note-testsuite.md).
129+
111130
## Writing Documentation
112131

113132
Documentation improvements are very welcome. The source of `doc.rust-lang.org`

branches/tmp/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Rust is a fast systems programming language that guarantees
44
memory safety and offers painless concurrency ([no data races]).
55
It does not employ a garbage collector and has minimal runtime overhead.
66

7-
This repo contains the code for `rustc`, the Rust compiler, as well
7+
This repo contains the code for the compiler (`rustc`), as well
88
as standard libraries, tools and documentation for Rust.
99

1010
[no data races]: http://blog.rust-lang.org/2015/04/10/Fearless-Concurrency.html
@@ -73,7 +73,7 @@ Read ["Installing Rust"] from [The Book].
7373
```
7474
7575
3. Run `mingw32_shell.bat` or `mingw64_shell.bat` from wherever you installed
76-
MYSY2 (i.e. `C:\msys`), depending on whether you want 32-bit or 64-bit Rust.
76+
MSYS2 (i.e. `C:\msys`), depending on whether you want 32-bit or 64-bit Rust.
7777
7878
4. Navigate to Rust's source code, configure and build it:
7979

branches/tmp/configure

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,10 @@ case $CFG_OSTYPE in
405405
CFG_OSTYPE=unknown-openbsd
406406
;;
407407

408+
NetBSD)
409+
CFG_OSTYPE=unknown-netbsd
410+
;;
411+
408412
Darwin)
409413
CFG_OSTYPE=apple-darwin
410414
;;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# x86_64-unknown-netbsd configuration
2+
CC_x86_64-unknown-netbsd=$(CC)
3+
CXX_x86_64-unknown-netbsd=$(CXX)
4+
CPP_x86_64-unknown-netbsd=$(CPP)
5+
AR_x86_64-unknown-netbsd=$(AR)
6+
CFG_LIB_NAME_x86_64-unknown-netbsd=lib$(1).so
7+
CFG_STATIC_LIB_NAME_x86_64-unknown-netbsd=lib$(1).a
8+
CFG_LIB_GLOB_x86_64-unknown-netbsd=lib$(1)-*.so
9+
CFG_LIB_DSYM_GLOB_x86_64-unknown-netbsd=$(1)-*.dylib.dSYM
10+
CFG_JEMALLOC_CFLAGS_x86_64-unknown-netbsd := -I/usr/local/include $(CFLAGS)
11+
CFG_GCCISH_CFLAGS_x86_64-unknown-netbsd := -Wall -Werror -g -fPIC -I/usr/local/include $(CFLAGS)
12+
CFG_GCCISH_LINK_FLAGS_x86_64-unknown-netbsd := -shared -fPIC -g -pthread -lrt
13+
CFG_GCCISH_DEF_FLAG_x86_64-unknown-netbsd := -Wl,--export-dynamic,--dynamic-list=
14+
CFG_LLC_FLAGS_x86_64-unknown-netbsd :=
15+
CFG_INSTALL_NAME_x86_64-unknown-netbsd =
16+
CFG_EXE_SUFFIX_x86_64-unknown-netbsd :=
17+
CFG_WINDOWSY_x86_64-unknown-netbsd :=
18+
CFG_UNIXY_x86_64-unknown-netbsd := 1
19+
CFG_LDPATH_x86_64-unknown-netbsd :=
20+
CFG_RUN_x86_64-unknown-netbsd=$(2)
21+
CFG_RUN_TARG_x86_64-unknown-netbsd=$(call CFG_RUN_x86_64-unknown-netbsd,,$(2))
22+
CFG_GNU_TRIPLE_x86_64-unknown-netbsd := x86_64-unknown-netbsd

branches/tmp/mk/main.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@ LLVM_BINDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --bindir)
295295
LLVM_INCDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --includedir)
296296
LLVM_LIBDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libdir)
297297
LLVM_LIBDIR_RUSTFLAGS_$(1)=-L "$$(LLVM_LIBDIR_$(1))"
298-
LLVM_LIBS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libs $$(LLVM_COMPONENTS))
299298
LLVM_LDFLAGS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --ldflags)
300299
ifeq ($$(findstring freebsd,$(1)),freebsd)
301300
# On FreeBSD, it may search wrong headers (that are for pre-installed LLVM),

branches/tmp/mk/target.mk

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,9 @@ endef
249249

250250
$(foreach host,$(CFG_HOST), \
251251
$(foreach target,$(CFG_TARGET), \
252-
$(foreach stage,$(STAGES), \
253-
$(foreach crate,$(CRATES), \
254-
$(eval $(call SETUP_LIB_MSVC_ENV_VARS,$(stage),$(target),$(host),$(crate)))))))
252+
$(foreach crate,$(CRATES), \
253+
$(eval $(call SETUP_LIB_MSVC_ENV_VARS,0,$(target),$(host),$(crate))))))
255254
$(foreach host,$(CFG_HOST), \
256255
$(foreach target,$(CFG_TARGET), \
257-
$(foreach stage,$(STAGES), \
258-
$(foreach tool,$(TOOLS), \
259-
$(eval $(call SETUP_TOOL_MSVC_ENV_VARS,$(stage),$(target),$(host),$(tool)))))))
256+
$(foreach tool,$(TOOLS), \
257+
$(eval $(call SETUP_TOOL_MSVC_ENV_VARS,0,$(target),$(host),$(tool))))))

branches/tmp/src/compiletest/runtest.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,16 +1126,10 @@ impl fmt::Display for Status {
11261126

11271127
fn compile_test(config: &Config, props: &TestProps,
11281128
testfile: &Path) -> ProcRes {
1129-
compile_test_(config, props, testfile, &[])
1130-
}
1131-
1132-
fn compile_test_(config: &Config, props: &TestProps,
1133-
testfile: &Path, extra_args: &[String]) -> ProcRes {
11341129
let aux_dir = aux_output_dir_name(config, testfile);
11351130
// FIXME (#9639): This needs to handle non-utf8 paths
1136-
let mut link_args = vec!("-L".to_string(),
1137-
aux_dir.to_str().unwrap().to_string());
1138-
link_args.extend(extra_args.iter().cloned());
1131+
let link_args = vec!("-L".to_string(),
1132+
aux_dir.to_str().unwrap().to_string());
11391133
let args = make_compile_args(config,
11401134
props,
11411135
link_args,
@@ -1144,7 +1138,7 @@ fn compile_test_(config: &Config, props: &TestProps,
11441138
}
11451139

11461140
fn document(config: &Config, props: &TestProps,
1147-
testfile: &Path, extra_args: &[String]) -> (ProcRes, PathBuf) {
1141+
testfile: &Path) -> (ProcRes, PathBuf) {
11481142
let aux_dir = aux_output_dir_name(config, testfile);
11491143
let out_dir = output_base_name(config, testfile);
11501144
let _ = fs::remove_dir_all(&out_dir);
@@ -1154,7 +1148,6 @@ fn document(config: &Config, props: &TestProps,
11541148
"-o".to_string(),
11551149
out_dir.to_str().unwrap().to_string(),
11561150
testfile.to_str().unwrap().to_string()];
1157-
args.extend(extra_args.iter().cloned());
11581151
args.extend(split_maybe_args(&props.compile_flags));
11591152
let args = ProcArgs {
11601153
prog: config.rustdoc_path.to_str().unwrap().to_string(),
@@ -1717,7 +1710,7 @@ fn charset() -> &'static str {
17171710
}
17181711

17191712
fn run_rustdoc_test(config: &Config, props: &TestProps, testfile: &Path) {
1720-
let (proc_res, out_dir) = document(config, props, testfile, &[]);
1713+
let (proc_res, out_dir) = document(config, props, testfile);
17211714
if !proc_res.status.success() {
17221715
fatal_proc_rec("rustdoc failed!", &proc_res);
17231716
}

branches/tmp/src/compiletest/util.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const OS_TABLE: &'static [(&'static str, &'static str)] = &[
2121
("ios", "ios"),
2222
("linux", "linux"),
2323
("mingw32", "windows"),
24+
("netbsd", "netbsd"),
2425
("openbsd", "openbsd"),
2526
("win32", "windows"),
2627
("windows", "windows"),
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
% The (old) Rust Pointer Guide
1+
% The Rust Pointer Guide
22

3-
This content has moved into
4-
[the Rust Programming Language book](book/pointers.html).
3+
This content has been removed, with no direct replacement. Rust only
4+
has two built-in pointer types now,
5+
[references](book/references-and-borrowing.html) and [raw
6+
pointers](book/raw-pointers.html). Older Rusts had many more pointer
7+
types, they’re gone now.

branches/tmp/src/doc/reference.md

Lines changed: 51 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -338,12 +338,16 @@ type of the literal. The integer suffix must be the name of one of the
338338
integral types: `u8`, `i8`, `u16`, `i16`, `u32`, `i32`, `u64`, `i64`,
339339
`isize`, or `usize`.
340340

341-
The type of an _unsuffixed_ integer literal is determined by type inference.
342-
If an integer type can be _uniquely_ determined from the surrounding program
343-
context, the unsuffixed integer literal has that type. If the program context
344-
underconstrains the type, it defaults to the signed 32-bit integer `i32`; if
345-
the program context overconstrains the type, it is considered a static type
346-
error.
341+
The type of an _unsuffixed_ integer literal is determined by type inference:
342+
343+
* If an integer type can be _uniquely_ determined from the surrounding
344+
program context, the unsuffixed integer literal has that type.
345+
346+
* If the program context underconstrains the type, it defaults to the
347+
signed 32-bit integer `i32`.
348+
349+
* If the program context overconstrains the type, it is considered a
350+
static type error.
347351

348352
Examples of integer literals of various forms:
349353

@@ -371,12 +375,17 @@ The suffix forcibly sets the type of the literal. There are two valid
371375
_floating-point suffixes_, `f32` and `f64` (the 32-bit and 64-bit floating point
372376
types), which explicitly determine the type of the literal.
373377

374-
The type of an _unsuffixed_ floating-point literal is determined by type
375-
inference. If a floating-point type can be _uniquely_ determined from the
376-
surrounding program context, the unsuffixed floating-point literal has that type.
377-
If the program context underconstrains the type, it defaults to double-precision `f64`;
378-
if the program context overconstrains the type, it is considered a static type
379-
error.
378+
The type of an _unsuffixed_ floating-point literal is determined by
379+
type inference:
380+
381+
* If a floating-point type can be _uniquely_ determined from the
382+
surrounding program context, the unsuffixed floating-point literal
383+
has that type.
384+
385+
* If the program context underconstrains the type, it defaults to `f64`.
386+
387+
* If the program context overconstrains the type, it is considered a
388+
static type error.
380389

381390
Examples of floating-point literals of various forms:
382391

@@ -2023,7 +2032,7 @@ The following configurations must be defined by the implementation:
20232032
as a configuration itself, like `unix` or `windows`.
20242033
* `target_os = "..."`. Operating system of the target, examples include
20252034
`"windows"`, `"macos"`, `"ios"`, `"linux"`, `"android"`, `"freebsd"`, `"dragonfly"`,
2026-
`"bitrig"` or `"openbsd"`.
2035+
`"bitrig"` , `"openbsd"` or `"netbsd"`.
20272036
* `target_pointer_width = "..."`. Target pointer width in bits. This is set
20282037
to `"32"` for targets with 32-bit pointers, and likewise set to `"64"` for
20292038
64-bit pointers.
@@ -2506,9 +2515,8 @@ Here are some examples:
25062515
#### Moved and copied types
25072516

25082517
When a [local variable](#variables) is used as an
2509-
[rvalue](#lvalues,-rvalues-and-temporaries) the variable will either be moved
2510-
or copied, depending on its type. All values whose type implements `Copy` are
2511-
copied, all others are moved.
2518+
[rvalue](#lvalues,-rvalues-and-temporaries), the variable will be copied
2519+
if its type implements `Copy`. All others are moved.
25122520

25132521
### Literal expressions
25142522

@@ -2873,7 +2881,6 @@ operand.
28732881
```
28742882
# let mut x = 0;
28752883
# let y = 0;
2876-
28772884
x = y;
28782885
```
28792886

@@ -2963,14 +2970,12 @@ move values (depending on their type) from the environment into the lambda
29632970
expression's captured environment.
29642971

29652972
In this example, we define a function `ten_times` that takes a higher-order
2966-
function argument, and call it with a lambda expression as an argument:
2973+
function argument, and we then call it with a lambda expression as an argument:
29672974

29682975
```
29692976
fn ten_times<F>(f: F) where F: Fn(i32) {
2970-
let mut i = 0i32;
2971-
while i < 10 {
2972-
f(i);
2973-
i += 1;
2977+
for index in 0..10 {
2978+
f(index);
29742979
}
29752980
}
29762981
@@ -3319,10 +3324,13 @@ An example of a tuple type and its use:
33193324

33203325
```
33213326
type Pair<'a> = (i32, &'a str);
3322-
let p: Pair<'static> = (10, "hello");
3327+
let p: Pair<'static> = (10, "ten");
33233328
let (a, b) = p;
3324-
assert!(b != "world");
3325-
assert!(p.0 == 10);
3329+
3330+
assert_eq!(a, 10);
3331+
assert_eq!(b, "ten");
3332+
assert_eq!(p.0, 10);
3333+
assert_eq!(p.1, "ten");
33263334
```
33273335

33283336
For historical reasons and convenience, the tuple type with no elements (`()`)
@@ -3332,27 +3340,32 @@ is often called ‘unit’ or ‘the unit type’.
33323340

33333341
Rust has two different types for a list of items:
33343342

3335-
* `[T; N]`, an 'array'.
3336-
* `&[T]`, a 'slice'.
3343+
* `[T; N]`, an 'array'
3344+
* `&[T]`, a 'slice'
33373345

33383346
An array has a fixed size, and can be allocated on either the stack or the
33393347
heap.
33403348

33413349
A slice is a 'view' into an array. It doesn't own the data it points
33423350
to, it borrows it.
33433351

3344-
An example of each kind:
3352+
Examples:
33453353

33463354
```{rust}
3347-
let vec: Vec<i32> = vec![1, 2, 3];
3348-
let arr: [i32; 3] = [1, 2, 3];
3349-
let s: &[i32] = &vec[..];
3355+
// A stack-allocated array
3356+
let array: [i32; 3] = [1, 2, 3];
3357+
3358+
// A heap-allocated array
3359+
let vector: Vec<i32> = vec![1, 2, 3];
3360+
3361+
// A slice into an array
3362+
let slice: &[i32] = &vector[..];
33503363
```
33513364

33523365
As you can see, the `vec!` macro allows you to create a `Vec<T>` easily. The
33533366
`vec!` macro is also part of the standard library, rather than the language.
33543367

3355-
All in-bounds elements of arrays, and slices are always initialized, and access
3368+
All in-bounds elements of arrays and slices are always initialized, and access
33563369
to an array or slice is always bounds-checked.
33573370

33583371
### Structure types
@@ -3486,7 +3499,7 @@ x = bo(5,7);
34863499

34873500
#### Function types for specific items
34883501

3489-
Internally to the compiler, there are also function types that are specific to a particular
3502+
Internal to the compiler, there are also function types that are specific to a particular
34903503
function item. In the following snippet, for example, the internal types of the functions
34913504
`foo` and `bar` are different, despite the fact that they have the same signature:
34923505

@@ -3514,13 +3527,14 @@ more of the closure traits:
35143527

35153528
* `FnMut`
35163529
: The closure can be called multiple times as mutable. A closure called as
3517-
`FnMut` can mutate values from its environment. `FnMut` implies
3518-
`FnOnce`.
3530+
`FnMut` can mutate values from its environment. `FnMut` inherits from
3531+
`FnOnce` (i.e. anything implementing `FnMut` also implements `FnOnce`).
35193532

35203533
* `Fn`
35213534
: The closure can be called multiple times through a shared reference.
35223535
A closure called as `Fn` can neither move out from nor mutate values
3523-
from its environment. `Fn` implies `FnMut` and `FnOnce`.
3536+
from its environment. `Fn` inherits from `FnMut`, which itself
3537+
inherits from `FnOnce`.
35243538

35253539

35263540
### Trait objects
@@ -3643,7 +3657,7 @@ Coercions are defined in [RFC401]. A coercion is implicit and has no syntax.
36433657
### Coercion sites
36443658

36453659
A coercion can only occur at certain coercion sites in a program; these are
3646-
typically places where the desired type is explicit or can be dervied by
3660+
typically places where the desired type is explicit or can be derived by
36473661
propagation from explicit types (without type inference). Possible coercion
36483662
sites are:
36493663

branches/tmp/src/doc/trpl/academic-research.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Recommended for inspiration and a better understanding of Rust's background.
1212
* [Macros that work together](https://www.cs.utah.edu/plt/publications/jfp12-draft-fcdf.pdf)
1313
* [Traits: composable units of behavior](http://scg.unibe.ch/archive/papers/Scha03aTraits.pdf)
1414
* [Alias burying](http://www.cs.uwm.edu/faculty/boyland/papers/unique-preprint.ps) - We tried something similar and abandoned it.
15-
* [External uniqueness is unique enough](http://www.computingscience.nl/research/techreps/repo/CS-2002/2002-048.pdf)
15+
* [External uniqueness is unique enough](http://www.cs.uu.nl/research/techreps/UU-CS-2002-048.html)
1616
* [Uniqueness and Reference Immutability for Safe Parallelism](https://research.microsoft.com/pubs/170528/msr-tr-2012-79.pdf)
1717
* [Region Based Memory Management](http://www.cs.ucla.edu/~palsberg/tba/papers/tofte-talpin-iandc97.pdf)
1818

@@ -26,10 +26,10 @@ Recommended for inspiration and a better understanding of Rust's background.
2626
* [Dynamic circular work stealing deque](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.170.1097&rep=rep1&type=pdf) - The Chase/Lev deque
2727
* [Work-first and help-first scheduling policies for async-finish task parallelism](http://www.cs.rice.edu/%7Eyguo/pubs/PID824943.pdf) - More general than fully-strict work stealing
2828
* [A Java fork/join calamity](http://www.coopsoft.com/ar/CalamityArticle.html) - critique of Java's fork/join library, particularly its application of work stealing to non-strict computation
29-
* [Scheduling techniques for concurrent systems](http://www.ece.rutgers.edu/%7Eparashar/Classes/ece572-papers/05/ps-ousterhout.pdf)
29+
* [Scheduling techniques for concurrent systems](http://www.stanford.edu/~ouster/cgi-bin/papers/coscheduling.pdf)
3030
* [Contention aware scheduling](http://www.blagodurov.net/files/a8-blagodurov.pdf)
3131
* [Balanced work stealing for time-sharing multicores](http://www.cse.ohio-state.edu/hpcs/WWW/HTML/publications/papers/TR-12-1.pdf)
32-
* [Three layer cake](http://www.upcrc.illinois.edu/workshops/paraplop10/papers/paraplop10_submission_8.pdf)
32+
* [Three layer cake for shared-memory programming](http://dl.acm.org/citation.cfm?id=1953616&dl=ACM&coll=DL&CFID=524387192&CFTOKEN=44362705)
3333
* [Non-blocking steal-half work queues](http://www.cs.bgu.ac.il/%7Ehendlerd/papers/p280-hendler.pdf)
3434
* [Reagents: expressing and composing fine-grained concurrency](http://www.mpi-sws.org/~turon/reagents.pdf)
3535
* [Algorithms for scalable synchronization of shared-memory multiprocessors](https://www.cs.rochester.edu/u/scott/papers/1991_TOCS_synch.pdf)

0 commit comments

Comments
 (0)