Skip to content

Commit a44538f

Browse files
committed
---
yaml --- r: 163391 b: refs/heads/snap-stage3 c: 38d2909 h: refs/heads/master i: 163389: 4a67fde 163387: 331f4d9 163383: 0adfd59 163375: 797f6a3 163359: b0e4721 163327: ea191f7 v: v3
1 parent 81ec169 commit a44538f

File tree

543 files changed

+13607
-18051
lines changed

Some content is hidden

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

543 files changed

+13607
-18051
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 9146a919b616e39e528e4d7100d16eef52f1f852
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: cb2119823d097439db53933186632cf4ca96711d
4+
refs/heads/snap-stage3: 38d29092f95a2ff8794513b64c1069e1680adf9e
55
refs/heads/try: 20cbbffeefc1f35e2ea63afce7b42fbd79611d42
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/mk/crates.mk

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ TARGET_CRATES := libc std flate arena term \
5353
serialize getopts collections test time rand \
5454
log regex graphviz core rbml alloc rustrt \
5555
unicode
56-
RUSTC_CRATES := rustc rustc_typeck rustc_borrowck rustc_driver rustc_trans rustc_back rustc_llvm
56+
RUSTC_CRATES := rustc rustc_typeck rustc_driver rustc_trans rustc_back rustc_llvm
5757
HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc regex_macros fmt_macros
5858
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5959
TOOLS := compiletest rustdoc rustc
@@ -67,12 +67,11 @@ DEPS_std := core libc rand alloc collections rustrt unicode \
6767
native:rust_builtin native:backtrace
6868
DEPS_graphviz := std
6969
DEPS_syntax := std term serialize log fmt_macros arena libc
70-
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
70+
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back \
7171
rustc_typeck log syntax serialize rustc_llvm rustc_trans
7272
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back \
7373
log syntax serialize rustc_llvm
7474
DEPS_rustc_typeck := rustc syntax
75-
DEPS_rustc_borrowck := rustc log graphviz syntax
7675
DEPS_rustc := syntax flate arena serialize getopts rbml \
7776
time log graphviz rustc_llvm rustc_back
7877
DEPS_rustc_llvm := native:rustllvm libc std
@@ -118,10 +117,9 @@ ONLY_RLIB_unicode := 1
118117
DOC_CRATES := $(filter-out rustc, \
119118
$(filter-out rustc_trans, \
120119
$(filter-out rustc_typeck, \
121-
$(filter-out rustc_borrowck, \
122120
$(filter-out rustc_driver, \
123-
$(filter-out syntax, $(CRATES)))))))
124-
COMPILER_DOC_CRATES := rustc rustc_trans rustc_borrowck rustc_typeck rustc_driver syntax
121+
$(filter-out syntax, $(CRATES))))))
122+
COMPILER_DOC_CRATES := rustc rustc_trans rustc_typeck rustc_driver syntax
125123

126124
# This macro creates some simple definitions for each crate being built, just
127125
# some munging of all of the parameters above.

branches/snap-stage3/mk/rustllvm.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ LLVM_EXTRA_INCDIRS_$(1)= -iquote $(S)src/llvm/include \
2222
-iquote $$(CFG_LLVM_BUILD_DIR_$(1))/include
2323
endif
2424

25-
RUSTLLVM_OBJS_CS_$(1) := $$(addprefix rustllvm/, \
26-
ExecutionEngineWrapper.cpp RustWrapper.cpp PassWrapper.cpp)
25+
RUSTLLVM_OBJS_CS_$(1) := $$(addprefix rustllvm/, RustWrapper.cpp PassWrapper.cpp)
2726

2827
RUSTLLVM_DEF_$(1) := $(1)/rustllvm/rustllvm$(CFG_DEF_SUFFIX_$(1))
2928

branches/snap-stage3/mk/tests.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $(eval $(call RUST_CRATE,coretest))
2121

2222
TEST_TARGET_CRATES = $(filter-out core unicode,$(TARGET_CRATES)) coretest
2323
TEST_DOC_CRATES = $(DOC_CRATES)
24-
TEST_HOST_CRATES = $(filter-out rustc_typeck rustc_borrowck rustc_trans,$(HOST_CRATES))
24+
TEST_HOST_CRATES = $(filter-out rustc_typeck rustc_trans,$(HOST_CRATES))
2525
TEST_CRATES = $(TEST_TARGET_CRATES) $(TEST_HOST_CRATES)
2626

2727
######################################################################

branches/snap-stage3/src/compiletest/compiletest.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
#![crate_type = "bin"]
12-
#![feature(phase, slicing_syntax, globs, unboxed_closures)]
12+
#![feature(phase, slicing_syntax, globs)]
1313

1414
#![deny(warnings)]
1515

@@ -23,7 +23,6 @@ use std::os;
2323
use std::io;
2424
use std::io::fs;
2525
use std::str::FromStr;
26-
use std::thunk::{Thunk};
2726
use getopts::{optopt, optflag, reqopt};
2827
use common::Config;
2928
use common::{Pretty, DebugInfoGdb, DebugInfoLldb, Codegen};
@@ -370,16 +369,16 @@ pub fn make_test_closure(config: &Config, testfile: &Path) -> test::TestFn {
370369
let config = (*config).clone();
371370
// FIXME (#9639): This needs to handle non-utf8 paths
372371
let testfile = testfile.as_str().unwrap().to_string();
373-
test::DynTestFn(Thunk::new(move || {
372+
test::DynTestFn(proc() {
374373
runtest::run(config, testfile)
375-
}))
374+
})
376375
}
377376

378377
pub fn make_metrics_test_closure(config: &Config, testfile: &Path) -> test::TestFn {
379378
let config = (*config).clone();
380379
// FIXME (#9639): This needs to handle non-utf8 paths
381380
let testfile = testfile.as_str().unwrap().to_string();
382-
test::DynMetricFn(box move |: mm: &mut test::MetricMap| {
381+
test::DynMetricFn(proc(mm) {
383382
runtest::run_metrics(config, testfile, mm)
384383
})
385384
}

branches/snap-stage3/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
445445
loop {
446446
//waiting 1 second for gdbserver start
447447
timer::sleep(Duration::milliseconds(1000));
448-
let result = task::try(move || {
448+
let result = task::try(proc() {
449449
tcp::TcpStream::connect("127.0.0.1:5039").unwrap();
450450
});
451451
if result.is_err() {

branches/snap-stage3/src/doc/complement-bugreport.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ It's also helpful to provide the exact version and host by copying the output of
3737
re-running the erroneous rustc command with the `--version=verbose` flag, which will
3838
produce something like this:
3939

40-
```text
40+
```{ignore}
4141
rustc 0.12.0 (ba4081a5a 2014-10-07 13:44:41 -0700)
4242
binary: rustc
4343
commit-hash: ba4081a5a8573875fed17545846f6f6902c8ba8d
@@ -46,13 +46,8 @@ host: i686-apple-darwin
4646
release: 0.12.0
4747
```
4848

49-
Finally, if you can also provide a backtrace, that'd be great. You can get a
50-
backtrace by setting the `RUST_BACKTRACE` environment variable to `1`, like
51-
this:
52-
53-
```bash
54-
$ RUST_BACKTRACE=1 rustc ...
55-
```
49+
Finally, if you can run the offending command under gdb, pasting a stack trace can be
50+
useful; to do so, you will need to set a breakpoint on `rust_panic`.
5651

5752
# I submitted a bug, but nobody has commented on it!
5853

branches/snap-stage3/src/doc/guide-crates.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ fn main() {
452452
453453
Rust will give us a compile-time error:
454454
455-
```text
455+
```{notrust}
456456
Compiling phrases v0.0.1 (file:///home/you/projects/phrases)
457457
/home/you/projects/phrases/src/main.rs:4:5: 4:40 error: a value named `hello` has already been imported in this module
458458
/home/you/projects/phrases/src/main.rs:4 use phrases::japanese::greetings::hello;

branches/snap-stage3/src/doc/guide-error-handling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ fn main() {
7676

7777
This will give us an error:
7878

79-
```text
79+
```{notrust}
8080
error: non-exhaustive patterns: `_` not covered [E0004]
8181
```
8282

@@ -189,7 +189,7 @@ panic!("boom");
189189

190190
gives
191191

192-
```text
192+
```{notrust}
193193
task '<main>' panicked at 'boom', hello.rs:2
194194
```
195195

branches/snap-stage3/src/doc/guide-ownership.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ fn add_one(mut num: Box<int>) {
130130

131131
This does not compile, and gives us an error:
132132

133-
```text
133+
```{notrust}
134134
error: use of moved value: `x`
135135
println!("{}", x);
136136
^
@@ -406,7 +406,7 @@ fn main() {
406406
We try to make four `Wheel`s, each with a `Car` that it's attached to. But the
407407
compiler knows that on the second iteration of the loop, there's a problem:
408408

409-
```text
409+
```{notrust}
410410
error: use of moved value: `car`
411411
Wheel { size: 360, owner: car };
412412
^~~

branches/snap-stage3/src/doc/guide-pointers.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ println!("{}", x + z);
8484

8585
This gives us an error:
8686

87-
```text
87+
```{notrust}
8888
hello.rs:6:24: 6:25 error: mismatched types: expected `int` but found `&int` (expected int but found &-ptr)
8989
hello.rs:6 println!("{}", x + z);
9090
^
@@ -132,7 +132,7 @@ Pointers are useful in languages that are pass-by-value, rather than
132132
pass-by-reference. Basically, languages can make two choices (this is made
133133
up syntax, it's not Rust):
134134

135-
```text
135+
```{ignore}
136136
func foo(x) {
137137
x = 5
138138
}
@@ -152,7 +152,7 @@ and therefore, can change its value. At the comment, `i` will be `5`.
152152
So what do pointers have to do with this? Well, since pointers point to a
153153
location in memory...
154154

155-
```text
155+
```{ignore}
156156
func foo(&int x) {
157157
*x = 5
158158
}
@@ -191,7 +191,7 @@ knows. This might be harmless, and it might be catastrophic.
191191
When you combine pointers and functions, it's easy to accidentally invalidate
192192
the memory the pointer is pointing to. For example:
193193

194-
```text
194+
```{ignore}
195195
func make_pointer(): &int {
196196
x = 5;
197197
@@ -213,7 +213,7 @@ As one last example of a big problem with pointers, **aliasing** can be an
213213
issue. Two pointers are said to alias when they point at the same location
214214
in memory. Like this:
215215

216-
```text
216+
```{ignore}
217217
func mutate(&int i, int j) {
218218
*i = j;
219219
}
@@ -398,7 +398,7 @@ fn main() {
398398

399399
It gives this error:
400400

401-
```text
401+
```{notrust}
402402
test.rs:5:8: 5:10 error: cannot assign to `*x` because it is borrowed
403403
test.rs:5 *x -= 1;
404404
^~
@@ -522,7 +522,7 @@ boxes, though. As a rough approximation, you can treat this Rust code:
522522

523523
As being similar to this C code:
524524

525-
```c
525+
```{ignore}
526526
{
527527
int *x;
528528
x = (int *)malloc(sizeof(int));
@@ -626,7 +626,7 @@ fn main() {
626626

627627
This prints:
628628

629-
```text
629+
```{ignore}
630630
Cons(1, box Cons(2, box Cons(3, box Nil)))
631631
```
632632

branches/snap-stage3/src/doc/guide-tasks.md

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -29,37 +29,31 @@ with a closure argument. `spawn` executes the closure in the new task.
2929
fn print_message() { println!("I am running in a different task!"); }
3030
spawn(print_message);
3131
32-
// Alternatively, use a `move ||` expression instead of a named function.
33-
// `||` expressions evaluate to an unnamed closure. The `move` keyword
34-
// indicates that the closure should take ownership of any variables it
35-
// touches.
36-
spawn(move || println!("I am also running in a different task!"));
32+
// Alternatively, use a `proc` expression instead of a named function.
33+
// The `proc` expression evaluates to an (unnamed) proc.
34+
// That proc will call `println!(...)` when the spawned task runs.
35+
spawn(proc() println!("I am also running in a different task!") );
3736
```
3837

3938
In Rust, a task is not a concept that appears in the language semantics.
4039
Instead, Rust's type system provides all the tools necessary to implement safe
4140
concurrency: particularly, ownership. The language leaves the implementation
4241
details to the standard library.
4342

44-
The `spawn` function has the type signature: `fn
45-
spawn<F:FnOnce()+Send>(f: F)`. This indicates that it takes as
46-
argument a closure (of type `F`) that it will run exactly once. This
47-
closure is limited to capturing `Send`-able data from its environment
48-
(that is, data which is deeply owned). Limiting the closure to `Send`
49-
ensures that `spawn` can safely move the entire closure and all its
50-
associated state into an entirely different task for execution.
43+
The `spawn` function has a very simple type signature: `fn spawn(f: proc():
44+
Send)`. Because it accepts only procs, and procs contain only owned data,
45+
`spawn` can safely move the entire proc and all its associated state into an
46+
entirely different task for execution. Like any closure, the function passed to
47+
`spawn` may capture an environment that it carries across tasks.
5148

5249
```{rust}
5350
# use std::task::spawn;
5451
# fn generate_task_number() -> int { 0 }
5552
// Generate some state locally
5653
let child_task_number = generate_task_number();
5754
58-
spawn(move || {
59-
// Capture it in the remote task. The `move` keyword indicates
60-
// that this closure should move `child_task_number` into its
61-
// environment, rather than capturing a reference into the
62-
// enclosing stack frame.
55+
spawn(proc() {
56+
// Capture it in the remote task
6357
println!("I am child number {}", child_task_number);
6458
});
6559
```
@@ -80,7 +74,7 @@ example of calculating two results concurrently:
8074
8175
let (tx, rx): (Sender<int>, Receiver<int>) = channel();
8276
83-
spawn(move || {
77+
spawn(proc() {
8478
let result = some_expensive_computation();
8579
tx.send(result);
8680
});
@@ -108,7 +102,7 @@ task.
108102
# use std::task::spawn;
109103
# fn some_expensive_computation() -> int { 42 }
110104
# let (tx, rx) = channel();
111-
spawn(move || {
105+
spawn(proc() {
112106
let result = some_expensive_computation();
113107
tx.send(result);
114108
});
@@ -141,13 +135,13 @@ results across a number of tasks? The following program is ill-typed:
141135
# fn some_expensive_computation() -> int { 42 }
142136
let (tx, rx) = channel();
143137
144-
spawn(move || {
138+
spawn(proc() {
145139
tx.send(some_expensive_computation());
146140
});
147141
148142
// ERROR! The previous spawn statement already owns the sender,
149143
// so the compiler will not allow it to be captured again
150-
spawn(move || {
144+
spawn(proc() {
151145
tx.send(some_expensive_computation());
152146
});
153147
```
@@ -160,7 +154,7 @@ let (tx, rx) = channel();
160154
for init_val in range(0u, 3) {
161155
// Create a new channel handle to distribute to the child task
162156
let child_tx = tx.clone();
163-
spawn(move || {
157+
spawn(proc() {
164158
child_tx.send(some_expensive_computation(init_val));
165159
});
166160
}
@@ -185,7 +179,7 @@ reference, written with multiple streams, it might look like the example below.
185179
// Create a vector of ports, one for each child task
186180
let rxs = Vec::from_fn(3, |init_val| {
187181
let (tx, rx) = channel();
188-
spawn(move || {
182+
spawn(proc() {
189183
tx.send(some_expensive_computation(init_val));
190184
});
191185
rx
@@ -213,7 +207,7 @@ fn fib(n: u64) -> u64 {
213207
12586269025
214208
}
215209
216-
let mut delayed_fib = Future::spawn(move || fib(50));
210+
let mut delayed_fib = Future::spawn(proc() fib(50));
217211
make_a_sandwich();
218212
println!("fib(50) = {}", delayed_fib.get())
219213
# }
@@ -242,7 +236,7 @@ fn partial_sum(start: uint) -> f64 {
242236
}
243237
244238
fn main() {
245-
let mut futures = Vec::from_fn(200, |ind| Future::spawn(move || partial_sum(ind)));
239+
let mut futures = Vec::from_fn(200, |ind| Future::spawn( proc() { partial_sum(ind) }));
246240
247241
let mut final_res = 0f64;
248242
for ft in futures.iter_mut() {
@@ -284,7 +278,7 @@ fn main() {
284278
for num in range(1u, 10) {
285279
let task_numbers = numbers_arc.clone();
286280
287-
spawn(move || {
281+
spawn(proc() {
288282
println!("{}-norm = {}", num, pnorm(task_numbers.as_slice(), num));
289283
});
290284
}
@@ -318,7 +312,7 @@ if it were local.
318312
# let numbers_arc = Arc::new(numbers);
319313
# let num = 4;
320314
let task_numbers = numbers_arc.clone();
321-
spawn(move || {
315+
spawn(proc() {
322316
// Capture task_numbers and use it as if it was the underlying vector
323317
println!("{}-norm = {}", num, pnorm(task_numbers.as_slice(), num));
324318
});
@@ -350,7 +344,7 @@ result with an `int` field (representing a successful result) or an `Err` result
350344
# use std::task;
351345
# fn some_condition() -> bool { false }
352346
# fn calculate_result() -> int { 0 }
353-
let result: Result<int, Box<std::any::Any + Send>> = task::try(move || {
347+
let result: Result<int, Box<std::any::Any + Send>> = task::try(proc() {
354348
if some_condition() {
355349
calculate_result()
356350
} else {

0 commit comments

Comments
 (0)