Skip to content

Commit a535b70

Browse files
committed
---
yaml --- r: 152471 b: refs/heads/try2 c: 4f90025 h: refs/heads/master i: 152469: f00ac30 152467: bcab0e0 152463: 983cc2f v: v3
1 parent 897de0f commit a535b70

File tree

243 files changed

+4041
-3930
lines changed

Some content is hidden

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

243 files changed

+4041
-3930
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: c0a6f72e8bfea2647da7f63f9f09b2cfeaa161c9
8+
refs/heads/try2: 4f90025b68b41cc9e32bb8da7765ddae081a2ed7
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ install:
1212
- sudo apt-get update -qq
1313
- sudo apt-get install -qq --force-yes -y llvm-$LLVM_VERSION
1414
llvm-${LLVM_VERSION}-dev clang-$LLVM_VERSION lldb-$LLVM_VERSION
15-
libjemalloc-dev
1615

1716

1817
# All of the llvm tools are suffixed with "-$VERS" which we don't want, so
@@ -28,8 +27,7 @@ before_script:
2827
- ln -nsf /usr/bin/llvm-dis-$LLVM_VERSION local-llvm/bin/llvm-dis
2928
- ln -nsf /usr/bin/llc-$LLVM_VERSION local-llvm/bin/llc
3029
- ln -nsf /usr/include/llvm-$LLVM_VERSION local-llvm/include
31-
- ./configure --disable-optimize-tests --llvm-root=`pwd`/local-llvm
32-
--enable-fast-make --enable-clang --jemalloc-root=/usr/lib
30+
- ./configure --disable-optimize-tests --llvm-root=`pwd`/local-llvm --enable-fast-make --enable-clang
3331

3432
# Tidy everything up first, then build a few things, and then run a few tests.
3533
# Note that this is meant to run in a "fairly small" amount of time, so this

branches/try2/configure

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,6 @@ opt verify-install 1 "verify installed binaries work"
425425
valopt prefix "/usr/local" "set installation prefix"
426426
valopt local-rust-root "/usr/local" "set prefix for local rust binary"
427427
valopt llvm-root "" "set LLVM root"
428-
valopt jemalloc-root "" "set directory where libjemalloc_pic.a is located"
429-
valopt libuv-root "" "set directory where libuv.a is located"
430428
valopt android-cross-path "/opt/ndk_standalone" "Android NDK standalone path"
431429
valopt mingw32-cross-path "" "MinGW32 cross compiler path"
432430

@@ -1200,8 +1198,6 @@ putvar CFG_ANDROID_CROSS_PATH
12001198
putvar CFG_MINGW32_CROSS_PATH
12011199
putvar CFG_MANDIR
12021200
putvar CFG_DISABLE_INJECT_STD_VERSION
1203-
putvar CFG_JEMALLOC_ROOT
1204-
putvar CFG_LIBUV_ROOT
12051201

12061202
# Avoid spurious warnings from clang by feeding it original source on
12071203
# ccache-miss rather than preprocessed input.

branches/try2/mk/crates.mk

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,16 @@ DEPS_rlibc :=
6161
DEPS_alloc := core libc native:jemalloc
6262
DEPS_debug := std
6363
DEPS_rustrt := alloc core libc collections native:rustrt_native
64-
DEPS_std := core libc rand alloc collections rustrt sync \
64+
DEPS_std := core libc rand alloc collections rustrt \
6565
native:rust_builtin native:backtrace
6666
DEPS_graphviz := std
6767
DEPS_green := std native:context_switch
6868
DEPS_rustuv := std native:uv native:uv_support
6969
DEPS_native := std
7070
DEPS_syntax := std term serialize log fmt_macros debug
71-
DEPS_rustc := syntax native:rustllvm flate arena serialize getopts \
71+
DEPS_rustc := syntax native:rustllvm flate arena serialize sync getopts \
7272
time log graphviz debug
73-
DEPS_rustdoc := rustc native:hoedown serialize getopts \
73+
DEPS_rustdoc := rustc native:hoedown serialize sync getopts \
7474
test time debug
7575
DEPS_flate := std native:miniz
7676
DEPS_arena := std
@@ -80,17 +80,17 @@ DEPS_serialize := std log
8080
DEPS_term := std log
8181
DEPS_semver := std
8282
DEPS_uuid := std serialize
83-
DEPS_sync := core alloc rustrt collections
83+
DEPS_sync := std alloc
8484
DEPS_getopts := std
8585
DEPS_collections := core alloc
8686
DEPS_fourcc := rustc syntax std
8787
DEPS_hexfloat := rustc syntax std
8888
DEPS_num := std
8989
DEPS_test := std getopts serialize term time regex native:rust_test_helpers
90-
DEPS_time := std serialize
90+
DEPS_time := std serialize sync
9191
DEPS_rand := core
9292
DEPS_url := std
93-
DEPS_log := std
93+
DEPS_log := std sync
9494
DEPS_regex := std
9595
DEPS_regex_macros = rustc syntax std regex
9696
DEPS_fmt_macros = std

branches/try2/mk/docs.mk

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,18 +273,14 @@ LIB_DOC_DEP_$(1) = \
273273
$$(RSINPUTS_$(1)) \
274274
$$(RUSTDOC_EXE) \
275275
$$(foreach dep,$$(RUST_DEPS_$(1)), \
276-
$$(TLIB2_T_$(CFG_BUILD)_H_$(CFG_BUILD))/stamp.$$(dep) \
277-
doc/$$(dep)/)
276+
$$(TLIB2_T_$(CFG_BUILD)_H_$(CFG_BUILD))/stamp.$$(dep))
278277
else
279278
LIB_DOC_DEP_$(1) = $$(CRATEFILE_$(1)) $$(RSINPUTS_$(1))
280279
endif
281280

282-
doc/$(1)/:
283-
$$(Q)mkdir -p $$@
284-
285281
$(2) += doc/$(1)/index.html
286282
doc/$(1)/index.html: CFG_COMPILER_HOST_TRIPLE = $(CFG_TARGET)
287-
doc/$(1)/index.html: $$(LIB_DOC_DEP_$(1)) doc/$(1)/
283+
doc/$(1)/index.html: $$(LIB_DOC_DEP_$(1))
288284
@$$(call E, rustdoc $$@)
289285
$$(Q)$$(RUSTDOC) --cfg dox --cfg stage2 $$<
290286
endef

branches/try2/mk/rt.mk

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -204,17 +204,19 @@ $$(LIBUV_MAKEFILE_$(1)): $$(LIBUV_DEPS) $$(MKFILE_DEPS) $$(LIBUV_STAMP_$(1))
204204
# theory when we support msvc then we should be using gyp's msvc output instead
205205
# of mingw's makefile for windows
206206
ifdef CFG_WINDOWSY_$(1)
207-
LIBUV_LOCAL_$(1) := $$(S)src/libuv/libuv.a
208-
$$(LIBUV_LOCAL_$(1)): $$(LIBUV_DEPS) $$(MKFILE_DEPS)
207+
$$(LIBUV_LIB_$(1)): $$(LIBUV_DEPS) $$(MKFILE_DEPS)
209208
$$(Q)$$(MAKE) -C $$(S)src/libuv -f Makefile.mingw \
210209
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS_$(1))" \
211210
CC="$$(CC_$(1)) $$(LIBUV_CFLAGS_$(1)) $$(SNAP_DEFINES)" \
212211
CXX="$$(CXX_$(1))" \
213212
AR="$$(AR_$(1))" \
214213
V=$$(VERBOSE)
214+
$$(Q)cp $$(S)src/libuv/libuv.a $$@
215215
else
216-
LIBUV_LOCAL_$(1) := $$(LIBUV_DIR_$(1))/Release/libuv.a
217-
$$(LIBUV_LOCAL_$(1)): $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1)) $$(MKFILE_DEPS)
216+
$$(LIBUV_LIB_$(1)): $$(LIBUV_DIR_$(1))/Release/libuv.a $$(MKFILE_DEPS)
217+
$$(Q)cp $$< $$@
218+
$$(LIBUV_DIR_$(1))/Release/libuv.a: $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1)) \
219+
$$(MKFILE_DEPS)
218220
$$(Q)$$(MAKE) -C $$(LIBUV_DIR_$(1)) \
219221
CFLAGS="$$(LIBUV_CFLAGS_$(1)) $$(SNAP_DEFINES)" \
220222
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS_$(1))" \
@@ -229,19 +231,6 @@ $$(LIBUV_LOCAL_$(1)): $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1)) $$(MKFILE_DEPS)
229231

230232
endif
231233

232-
ifeq ($(1),$$(CFG_BUILD))
233-
ifneq ($$(CFG_LIBUV_ROOT),)
234-
$$(LIBUV_LIB_$(1)): $$(CFG_LIBUV_ROOT)/libuv.a
235-
$$(Q)cp $$< $$@
236-
else
237-
$$(LIBUV_LIB_$(1)): $$(LIBUV_LOCAL_$(1))
238-
$$(Q)cp $$< $$@
239-
endif
240-
else
241-
$$(LIBUV_LIB_$(1)): $$(LIBUV_LOCAL_$(1))
242-
$$(Q)cp $$< $$@
243-
endif
244-
245234
################################################################################
246235
# jemalloc
247236
################################################################################
@@ -264,9 +253,8 @@ else
264253
endif
265254
JEMALLOC_LIB_$(1) := $$(RT_OUTPUT_DIR_$(1))/$$(JEMALLOC_NAME_$(1))
266255
JEMALLOC_BUILD_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/jemalloc
267-
JEMALLOC_LOCAL_$(1) := $$(JEMALLOC_BUILD_DIR_$(1))/lib/$$(JEMALLOC_REAL_NAME_$(1))
268256

269-
$$(JEMALLOC_LOCAL_$(1)): $$(JEMALLOC_DEPS) $$(MKFILE_DEPS)
257+
$$(JEMALLOC_LIB_$(1)): $$(JEMALLOC_DEPS) $$(MKFILE_DEPS)
270258
@$$(call E, make: jemalloc)
271259
cd "$$(JEMALLOC_BUILD_DIR_$(1))"; "$(S)src/jemalloc/configure" \
272260
$$(JEMALLOC_ARGS_$(1)) --enable-cc-silence --with-jemalloc-prefix=je_ \
@@ -277,20 +265,7 @@ $$(JEMALLOC_LOCAL_$(1)): $$(JEMALLOC_DEPS) $$(MKFILE_DEPS)
277265
CPPFLAGS="-I $(S)src/rt/" \
278266
EXTRA_CFLAGS="$$(CFG_CFLAGS_$(1)) -g1"
279267
$$(Q)$$(MAKE) -C "$$(JEMALLOC_BUILD_DIR_$(1))" build_lib_static
280-
281-
ifeq ($(1),$$(CFG_BUILD))
282-
ifneq ($$(CFG_JEMALLOC_ROOT),)
283-
$$(JEMALLOC_LIB_$(1)): $$(CFG_JEMALLOC_ROOT)/libjemalloc_pic.a
284-
@$$(call E, copy: jemalloc)
285-
$$(Q)cp $$< $$@
286-
else
287-
$$(JEMALLOC_LIB_$(1)): $$(JEMALLOC_LOCAL_$(1))
288-
$$(Q)cp $$< $$@
289-
endif
290-
else
291-
$$(JEMALLOC_LIB_$(1)): $$(JEMALLOC_LOCAL_$(1))
292-
$$(Q)cp $$< $$@
293-
endif
268+
$$(Q)cp $$(JEMALLOC_BUILD_DIR_$(1))/lib/$$(JEMALLOC_REAL_NAME_$(1)) $$(JEMALLOC_LIB_$(1))
294269

295270
################################################################################
296271
# compiler-rt

branches/try2/src/doc/guide-lifetimes.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ value. We also call this _borrowing_ the local variable
7878
name for the same data.
7979

8080
In the case of `on_the_heap`, however, no explicit action is necessary.
81-
The compiler will automatically convert a box point to a reference like &point.
81+
The compiler will automatically convert a box box point to a reference like &point.
8282
This is another form of borrowing; in this case, the contents of the owned box
8383
are being lent out.
8484

@@ -275,8 +275,10 @@ invalidate the pointer `owner_age`.
275275

276276
# Borrowing and enums
277277

278-
The previous example showed that the type system forbids any borrowing
279-
of owned boxes found in aliasable, mutable memory. This restriction
278+
The previous example showed that the type system forbids any mutations
279+
of owned boxed values while they are being borrowed. In general, the type
280+
system also forbids borrowing a value as mutable if it is already being
281+
borrowed - either as a mutable reference or an immutable one. This restriction
280282
prevents pointers from pointing into freed memory. There is one other
281283
case where the compiler must be very careful to ensure that pointers
282284
remain valid: pointers into the interior of an `enum`.

branches/try2/src/doc/guide-tasks.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ later.
269269
The basic example below illustrates this.
270270

271271
~~~
272-
use std::sync::Future;
272+
extern crate sync;
273273
274274
# fn main() {
275275
# fn make_a_sandwich() {};
@@ -278,7 +278,7 @@ fn fib(n: u64) -> u64 {
278278
12586269025
279279
}
280280
281-
let mut delayed_fib = Future::spawn(proc() fib(50));
281+
let mut delayed_fib = sync::Future::spawn(proc() fib(50));
282282
make_a_sandwich();
283283
println!("fib(50) = {}", delayed_fib.get())
284284
# }
@@ -294,7 +294,7 @@ Here is another example showing how futures allow you to background computations
294294
be distributed on the available cores.
295295

296296
~~~
297-
# use std::sync::Future;
297+
# extern crate sync;
298298
fn partial_sum(start: uint) -> f64 {
299299
let mut local_sum = 0f64;
300300
for num in range(start*100000, (start+1)*100000) {
@@ -304,7 +304,7 @@ fn partial_sum(start: uint) -> f64 {
304304
}
305305
306306
fn main() {
307-
let mut futures = Vec::from_fn(1000, |ind| Future::spawn( proc() { partial_sum(ind) }));
307+
let mut futures = Vec::from_fn(1000, |ind| sync::Future::spawn( proc() { partial_sum(ind) }));
308308
309309
let mut final_res = 0f64;
310310
for ft in futures.mut_iter() {
@@ -329,8 +329,10 @@ Here is a small example showing how to use Arcs. We wish to run concurrently sev
329329
a single large vector of floats. Each task needs the full vector to perform its duty.
330330

331331
~~~
332+
extern crate sync;
333+
334+
use sync::Arc;
332335
use std::rand;
333-
use std::sync::Arc;
334336
335337
fn pnorm(nums: &[f64], p: uint) -> f64 {
336338
nums.iter().fold(0.0, |a, b| a + b.powf(p as f64)).powf(1.0 / (p as f64))
@@ -355,8 +357,9 @@ at the power given as argument and takes the inverse power of this value). The A
355357
created by the line
356358

357359
~~~
360+
# extern crate sync;
358361
# use std::rand;
359-
# use std::sync::Arc;
362+
# use sync::Arc;
360363
# fn main() {
361364
# let numbers = Vec::from_fn(1000000, |_| rand::random::<f64>());
362365
let numbers_arc=Arc::new(numbers);
@@ -368,8 +371,9 @@ it's contents. Within the task's procedure, the captured Arc reference can be us
368371
reference to the underlying vector as if it were local.
369372

370373
~~~
374+
# extern crate sync;
371375
# use std::rand;
372-
# use std::sync::Arc;
376+
# use sync::Arc;
373377
# fn pnorm(nums: &[f64], p: uint) -> f64 { 4.0 }
374378
# fn main() {
375379
# let numbers=Vec::from_fn(1000000, |_| rand::random::<f64>());
@@ -457,9 +461,9 @@ the string in response. The child terminates when it receives `0`.
457461
Here is the function that implements the child task:
458462

459463
~~~
460-
use std::comm::DuplexStream;
464+
extern crate sync;
461465
# fn main() {
462-
fn stringifier(channel: &DuplexStream<String, uint>) {
466+
fn stringifier(channel: &sync::DuplexStream<String, uint>) {
463467
let mut value: uint;
464468
loop {
465469
value = channel.recv();
@@ -481,10 +485,10 @@ response itself is simply the stringified version of the received value,
481485
Here is the code for the parent task:
482486

483487
~~~
484-
use std::comm::duplex;
488+
extern crate sync;
485489
# use std::task::spawn;
486-
# use std::comm::DuplexStream;
487-
# fn stringifier(channel: &DuplexStream<String, uint>) {
490+
# use sync::DuplexStream;
491+
# fn stringifier(channel: &sync::DuplexStream<String, uint>) {
488492
# let mut value: uint;
489493
# loop {
490494
# value = channel.recv();
@@ -494,7 +498,7 @@ use std::comm::duplex;
494498
# }
495499
# fn main() {
496500
497-
let (from_child, to_child) = duplex();
501+
let (from_child, to_child) = sync::duplex();
498502
499503
spawn(proc() {
500504
stringifier(&to_child);

branches/try2/src/doc/intro.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,8 @@ an atomically reference counted box ("A.R.C." == "atomically reference counted")
297297
Here's some code:
298298

299299
```
300-
use std::sync::Arc;
300+
extern crate sync;
301+
use sync::Arc;
301302
302303
fn main() {
303304
let numbers = vec![1,2,3];
@@ -343,7 +344,8 @@ Let's take the same example yet again,
343344
and modify it to mutate the shared state:
344345

345346
```
346-
use std::sync::{Arc, Mutex};
347+
extern crate sync;
348+
use sync::{Arc, Mutex};
347349
348350
fn main() {
349351
let numbers = vec![1,2,3];

branches/try2/src/doc/rust.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ block_comment_body : [block_comment | character] * ;
160160
line_comment : "//" non_eol * ;
161161
~~~~
162162

163-
Comments in Rust code follow the general C++ style of line and block-comment forms.
164-
Nested block comments are supported.
163+
Comments in Rust code follow the general C++ style of line and block-comment forms,
164+
with no nesting of block-comment delimiters.
165165

166166
Line comments beginning with exactly _three_ slashes (`///`), and block
167167
comments beginning with exactly one repeated asterisk in the block-open

branches/try2/src/doc/tutorial.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,14 +1710,14 @@ having ownership of the box. It allows the creation of cycles, and the individua
17101710
not have a destructor.
17111711

17121712
~~~
1713-
use std::gc::GC;
1713+
use std::gc::Gc;
17141714
17151715
// A fixed-size array allocated in a garbage-collected box
1716-
let x = box(GC) [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
1716+
let x = Gc::new([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
17171717
let y = x; // does not perform a move, unlike with `Rc`
17181718
let z = x;
17191719
1720-
assert!(*z == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
1720+
assert!(*z.borrow() == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
17211721
~~~
17221722

17231723
With shared ownership, mutability cannot be inherited so the boxes are always immutable. However,
@@ -2459,7 +2459,7 @@ fn draw_all(shapes: &[Box<Drawable>]) {
24592459
}
24602460
~~~~
24612461

2462-
In this example, there is no type parameter. Instead, the `Box<Drawable>`
2462+
In this example, there is no type parameter. Instead, the `~Drawable`
24632463
type denotes any owned box value that implements the `Drawable` trait.
24642464
To construct such a value, you use the `as` operator to cast a value
24652465
to an object:

branches/try2/src/etc/licenseck.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
"rt/isaac/randport.cpp", # public domain
3939
"rt/isaac/rand.h", # public domain
4040
"rt/isaac/standard.h", # public domain
41-
"libsync/mpsc_queue.rs", # BSD
42-
"libsync/spsc_queue.rs", # BSD
43-
"libsync/mpmc_bounded_queue.rs", # BSD
41+
"libstd/sync/mpsc_queue.rs", # BSD
42+
"libstd/sync/spsc_queue.rs", # BSD
43+
"libstd/sync/mpmc_bounded_queue.rs", # BSD
4444
"libsync/mpsc_intrusive.rs", # BSD
4545
"test/bench/shootout-fannkuch-redux.rs", # BSD
4646
"test/bench/shootout-meteor.rs", # BSD

0 commit comments

Comments
 (0)