Skip to content

Commit 2640b46

Browse files
committed
---
yaml --- r: 114319 b: refs/heads/master c: f9bd6b4 h: refs/heads/master i: 114317: 39c7caa 114315: acd85ba 114311: 6a02453 114303: 7c3db05 v: v3
1 parent ef8d031 commit 2640b46

File tree

96 files changed

+1395
-471
lines changed

Some content is hidden

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

96 files changed

+1395
-471
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 66d8c3cb2bc8d872e65c8340783512a5e9520cfd
2+
refs/heads/master: f9bd6b4e3900da77f06ebad04ae6bada1e26e042
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ec0258a381b88b5574e3f8ce72ae553ac3a574b7
55
refs/heads/try: 7c6c492fb2af9a85f21ff952942df3523b22fd17

trunk/mk/crates.mk

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,15 @@
5151

5252
TARGET_CRATES := libc std green rustuv native flate arena glob term semver \
5353
uuid serialize sync getopts collections num test time rand \
54-
workcache url log regex graphviz core rlibc
54+
workcache url log regex graphviz core rlibc alloc
5555
HOST_CRATES := syntax rustc rustdoc fourcc hexfloat regex_macros fmt_macros
5656
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5757
TOOLS := compiletest rustdoc rustc
5858

5959
DEPS_core :=
6060
DEPS_rlibc :=
61-
DEPS_std := core libc native:rustrt native:compiler-rt native:backtrace native:jemalloc
61+
DEPS_alloc := core libc native:jemalloc
62+
DEPS_std := core libc alloc native:rustrt native:backtrace
6263
DEPS_graphviz := std
6364
DEPS_green := std rand native:context_switch
6465
DEPS_rustuv := std native:uv native:uv_support
@@ -76,7 +77,7 @@ DEPS_serialize := std collections log
7677
DEPS_term := std collections log
7778
DEPS_semver := std
7879
DEPS_uuid := std serialize rand
79-
DEPS_sync := std
80+
DEPS_sync := std alloc
8081
DEPS_getopts := std
8182
DEPS_collections := std rand
8283
DEPS_fourcc := syntax std
@@ -101,6 +102,7 @@ TOOL_SOURCE_rustc := $(S)src/driver/driver.rs
101102

102103
ONLY_RLIB_core := 1
103104
ONLY_RLIB_rlibc := 1
105+
ONLY_RLIB_alloc := 1
104106

105107
################################################################################
106108
# You should not need to edit below this line

trunk/mk/main.mk

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -349,18 +349,45 @@ CFGFLAG$(1)_T_$(2)_H_$(3) = stage$(1)
349349
endef
350350

351351
# Same macro/variables as above, but defined in a separate loop so it can use
352-
# all the varibles above for all archs. The RPATH_VAR setup sometimes needs to
352+
# all the variables above for all archs. The RPATH_VAR setup sometimes needs to
353353
# reach across triples to get things in order.
354+
#
355+
# Defines (with the standard $(1)_T_$(2)_H_$(3) suffix):
356+
# * `LD_LIBRARY_PATH_ENV_NAME`: the name for the key to use in the OS
357+
# environment to access or extend the lookup path for dynamic
358+
# libraries. Note on Windows, that key is `$PATH`, and thus not
359+
# only conflates programs with dynamic libraries, but also often
360+
# contains spaces which confuse make.
361+
# * `LD_LIBRARY_PATH_ENV_HOSTDIR`: the entry to add to lookup path for the host
362+
# * `LD_LIBRARY_PATH_ENV_TARGETDIR`: the entry to add to lookup path for target
363+
#
364+
# Below that, HOST_RPATH_VAR and TARGET_RPATH_VAR are defined in terms of the
365+
# above settings.
366+
#
354367
define SREQ_CMDS
355368

356369
ifeq ($$(OSTYPE_$(3)),apple-darwin)
357-
RPATH_VAR$(1)_T_$(2)_H_$(3) := \
358-
DYLD_LIBRARY_PATH="$$$$DYLD_LIBRARY_PATH:$$(CURDIR)/$$(HLIB$(1)_H_$(3))"
370+
LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3) := DYLD_LIBRARY_PATH
371+
else
372+
ifeq ($$(CFG_WINDOWSY_$(2)),1)
373+
LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3) := PATH
359374
else
360-
RPATH_VAR$(1)_T_$(2)_H_$(3) := \
361-
LD_LIBRARY_PATH="$$$$LD_LIBRARY_PATH:$$(CURDIR)/$$(HLIB$(1)_H_$(3))"
375+
LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3) := LD_LIBRARY_PATH
376+
endif
362377
endif
363378

379+
LD_LIBRARY_PATH_ENV_HOSTDIR$(1)_T_$(2)_H_$(3) := \
380+
$$(CURDIR)/$$(HLIB$(1)_H_$(3))
381+
LD_LIBRARY_PATH_ENV_TARGETDIR$(1)_T_$(2)_H_$(3) := \
382+
$$(CURDIR)/$$(TLIB1_T_$(2)_H_$(CFG_BUILD))
383+
384+
HOST_RPATH_VAR$(1)_T_$(2)_H_$(3) := \
385+
$$(LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3))=$$$$$$(LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3)):$$(LD_LIBRARY_PATH_ENV_HOSTDIR$(1)_T_$(2)_H_$(3))
386+
TARGET_RPATH_VAR$(1)_T_$(2)_H_$(3) := \
387+
$$(LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3))=$$$$$$(LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3)):$$(LD_LIBRARY_PATH_ENV_TARGETDIR$(1)_T_$(2)_H_$(3))
388+
389+
RPATH_VAR$(1)_T_$(2)_H_$(3) := $$(HOST_RPATH_VAR$(1)_T_$(2)_H_$(3))
390+
364391
# Pass --cfg stage0 only for the build->host part of stage0;
365392
# if you're building a cross config, the host->* parts are
366393
# effectively stage1, since it uses the just-built stage0.
@@ -376,13 +403,7 @@ ifeq ($(1),0)
376403
ifneq ($(strip $(CFG_BUILD)),$(strip $(3)))
377404
CFGFLAG$(1)_T_$(2)_H_$(3) = stage1
378405

379-
ifeq ($$(OSTYPE_$(3)),apple-darwin)
380-
RPATH_VAR$(1)_T_$(2)_H_$(3) := \
381-
DYLD_LIBRARY_PATH="$$$$DYLD_LIBRARY_PATH:$$(CURDIR)/$$(TLIB1_T_$(2)_H_$(CFG_BUILD))"
382-
else
383-
RPATH_VAR$(1)_T_$(2)_H_$(3) := \
384-
LD_LIBRARY_PATH="$$$$LD_LIBRARY_PATH:$$(CURDIR)/$$(TLIB1_T_$(2)_H_$(CFG_BUILD))"
385-
endif
406+
RPATH_VAR$(1)_T_$(2)_H_$(3) := $$(TARGET_RPATH_VAR$(1)_T_$(2)_H_$(3))
386407
endif
387408
endif
388409

trunk/mk/tests.mk

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,8 +793,27 @@ else
793793
CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4))
794794
endif
795795

796+
# (Issues #13732, #13983, #14000) The doc for the regex crate includes
797+
# uses of the `regex!` macro from the regex_macros crate. There is
798+
# normally a dependence injected that makes the target's regex depend
799+
# upon the host's regex_macros (see #13845), but that dependency
800+
# injection is currently skipped for stage1 as a special case.
801+
#
802+
# Therefore, as a further special case, this conditional skips
803+
# attempting to run the doc tests for the regex crate atop stage1,
804+
# (since there is no regex_macros crate for the stage1 rustc to load).
805+
#
806+
# (Another approach for solving this would be to inject the desired
807+
# dependence for stage1 as well, by setting things up to generate a
808+
# regex_macros crate that was compatible with the stage1 rustc and
809+
# thus re-enable our ability to run this test.)
810+
ifeq (stage$(1)-crate-$(4),stage1-crate-regex)
811+
check-stage$(1)-T-$(2)-H-$(3)-doc-crate-$(4)-exec:
812+
@$$(call E, skipping doc-crate-$(4) as it uses macros and cannot run at stage$(1))
813+
else
796814
check-stage$(1)-T-$(2)-H-$(3)-doc-crate-$(4)-exec: \
797815
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4))
816+
endif
798817

799818
ifeq ($(2),$$(CFG_BUILD))
800819
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4)): $$(CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4))
@@ -951,7 +970,10 @@ $(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok: \
951970
"$$(CC_$(3)) $$(CFG_GCCISH_CFLAGS_$(3))" \
952971
$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \
953972
"$$(TESTNAME)" \
954-
"$$(RPATH_VAR$(1)_T_$(2)_H_$(3))"
973+
$$(LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3)) \
974+
"$$(LD_LIBRARY_PATH_ENV_HOSTDIR$(1)_T_$(2)_H_$(3))" \
975+
"$$(LD_LIBRARY_PATH_ENV_TARGETDIR$(1)_T_$(2)_H_$(3))" \
976+
$(1)
955977
@touch $$@
956978
else
957979
# FIXME #11094 - The above rule doesn't work right for multiple targets

trunk/src/compiletest/procsrv.rs

Lines changed: 19 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -11,54 +11,31 @@
1111
use std::os;
1212
use std::str;
1313
use std::io::process::{ProcessExit, Command, Process, ProcessOutput};
14+
use std::unstable::dynamic_lib::DynamicLibrary;
1415

15-
#[cfg(target_os = "win32")]
1616
fn target_env(lib_path: &str, prog: &str) -> Vec<(StrBuf, StrBuf)> {
17-
let env = os::env();
17+
let prog = if cfg!(windows) {prog.slice_to(prog.len() - 4)} else {prog};
18+
let aux_path = prog + ".libaux";
1819

19-
// Make sure we include the aux directory in the path
20-
assert!(prog.ends_with(".exe"));
21-
let aux_path = prog.slice(0u, prog.len() - 4u).to_owned() + ".libaux";
20+
// Need to be sure to put both the lib_path and the aux path in the dylib
21+
// search path for the child.
22+
let mut path = DynamicLibrary::search_path();
23+
path.insert(0, Path::new(aux_path));
24+
path.insert(0, Path::new(lib_path));
2225

23-
let mut new_env: Vec<_> = env.move_iter().map(|(k, v)| {
24-
let new_v = if "PATH" == k {
25-
format_strbuf!("{};{};{}", v, lib_path, aux_path)
26-
} else {
27-
v.to_strbuf()
28-
};
29-
(k.to_strbuf(), new_v)
30-
}).collect();
31-
if prog.ends_with("rustc.exe") {
32-
new_env.push(("RUST_THREADS".to_strbuf(), "1".to_strbuf()));
26+
// Remove the previous dylib search path var
27+
let var = DynamicLibrary::envvar();
28+
let mut env: Vec<(StrBuf,StrBuf)> =
29+
os::env().move_iter().map(|(a,b)|(a.to_strbuf(), b.to_strbuf())).collect();
30+
match env.iter().position(|&(ref k, _)| k.as_slice() == var) {
31+
Some(i) => { env.remove(i); }
32+
None => {}
3333
}
34-
return new_env;
35-
}
3634

37-
#[cfg(target_os = "linux")]
38-
#[cfg(target_os = "macos")]
39-
#[cfg(target_os = "freebsd")]
40-
fn target_env(lib_path: &str, prog: &str) -> Vec<(StrBuf,StrBuf)> {
41-
// Make sure we include the aux directory in the path
42-
let aux_path = prog + ".libaux";
43-
44-
let mut env: Vec<(StrBuf,StrBuf)> =
45-
os::env().move_iter()
46-
.map(|(ref k, ref v)| (k.to_strbuf(), v.to_strbuf()))
47-
.collect();
48-
let var = if cfg!(target_os = "macos") {
49-
"DYLD_LIBRARY_PATH"
50-
} else {
51-
"LD_LIBRARY_PATH"
52-
};
53-
let prev = match env.iter().position(|&(ref k, _)| k.as_slice() == var) {
54-
Some(i) => env.remove(i).unwrap().val1(),
55-
None => "".to_strbuf(),
56-
};
57-
env.push((var.to_strbuf(), if prev.is_empty() {
58-
format_strbuf!("{}:{}", lib_path, aux_path)
59-
} else {
60-
format_strbuf!("{}:{}:{}", lib_path, aux_path, prev)
61-
}));
35+
// Add the new dylib search path var
36+
let newpath = DynamicLibrary::create_path(path.as_slice());
37+
env.push((var.to_strbuf(),
38+
str::from_utf8(newpath.as_slice()).unwrap().to_strbuf()));
6239
return env;
6340
}
6441

trunk/src/doc/rust.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -848,11 +848,11 @@ extern crate foo = "some/where/rust-foo#foo:1.0"; // a full crate ID for externa
848848
##### Use declarations
849849

850850
~~~~ {.notrust .ebnf .gram}
851-
use_decl : "pub" ? "use" ident [ '=' path
852-
| "::" path_glob ] ;
851+
use_decl : "pub" ? "use" [ ident '=' path
852+
| path_glob ] ;
853853
854-
path_glob : ident [ "::" path_glob ] ?
855-
| '*'
854+
path_glob : ident [ "::" [ path_glob
855+
| '*' ] ] ?
856856
| '{' ident [ ',' ident ] * '}' ;
857857
~~~~
858858

@@ -1743,7 +1743,7 @@ import public items from their destination, not private items.
17431743
attribute : '#' '!' ? '[' meta_item ']' ;
17441744
meta_item : ident [ '=' literal
17451745
| '(' meta_seq ')' ] ? ;
1746-
meta_seq : meta_item [ ',' meta_seq ]* ;
1746+
meta_seq : meta_item [ ',' meta_seq ] ? ;
17471747
~~~~
17481748

17491749
Static entities in Rust &mdash; crates, modules and items &mdash; may have _attributes_
@@ -2943,7 +2943,7 @@ See [Break expressions](#break-expressions) and [Continue expressions](#continue
29432943
break_expr : "break" [ lifetime ];
29442944
~~~~
29452945

2946-
A `break` expression has an optional `label`.
2946+
A `break` expression has an optional _label_.
29472947
If the label is absent, then executing a `break` expression immediately terminates the innermost loop enclosing it.
29482948
It is only permitted in the body of a loop.
29492949
If the label is present, then `break foo` terminates the loop with label `foo`,
@@ -2956,7 +2956,7 @@ but must enclose it.
29562956
continue_expr : "continue" [ lifetime ];
29572957
~~~~
29582958

2959-
A `continue` expression has an optional `label`.
2959+
A `continue` expression has an optional _label_.
29602960
If the label is absent,
29612961
then executing a `continue` expression immediately terminates the current iteration of the innermost loop enclosing it,
29622962
returning control to the loop *head*.
@@ -3027,11 +3027,11 @@ then any `else` block is executed.
30273027
### Match expressions
30283028

30293029
~~~~ {.notrust .ebnf .gram}
3030-
match_expr : "match" expr '{' match_arm [ '|' match_arm ] * '}' ;
3030+
match_expr : "match" expr '{' match_arm * '}' ;
30313031
3032-
match_arm : match_pat "=>" [ expr "," | '{' block '}' ] ;
3032+
match_arm : attribute * match_pat "=>" [ expr "," | '{' block '}' ] ;
30333033
3034-
match_pat : pat [ ".." pat ] ? [ "if" expr ] ;
3034+
match_pat : pat [ '|' pat ] * [ "if" expr ] ? ;
30353035
~~~~
30363036

30373037
A `match` expression branches on a *pattern*. The exact form of matching that
@@ -3115,7 +3115,7 @@ let x: List<int> = Cons(10, box Cons(11, box Nil));
31153115
31163116
match x {
31173117
Cons(a, box Cons(b, _)) => {
3118-
process_pair(a,b);
3118+
process_pair(a, b);
31193119
}
31203120
Cons(10, _) => {
31213121
process_ten();
@@ -3137,7 +3137,7 @@ using the `ref` keyword,
31373137
or to a mutable reference using `ref mut`.
31383138

31393139
Subpatterns can also be bound to variables by the use of the syntax
3140-
`variable @ pattern`.
3140+
`variable @ subpattern`.
31413141
For example:
31423142

31433143
~~~~
@@ -3329,8 +3329,8 @@ order specified by the tuple type.
33293329
An example of a tuple type and its use:
33303330

33313331
~~~~
3332-
type Pair<'a> = (int,&'a str);
3333-
let p: Pair<'static> = (10,"hello");
3332+
type Pair<'a> = (int, &'a str);
3333+
let p: Pair<'static> = (10, "hello");
33343334
let (a, b) = p;
33353335
assert!(b != "world");
33363336
~~~~

trunk/src/doc/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2602,7 +2602,7 @@ fn main() {
26022602
~~~
26032603

26042604
The full list of derivable traits is `Eq`, `TotalEq`, `Ord`,
2605-
`TotalOrd`, `Encodable` `Decodable`, `Clone`,
2605+
`TotalOrd`, `Encodable`, `Decodable`, `Clone`,
26062606
`Hash`, `Rand`, `Default`, `Zero`, `FromPrimitive` and `Show`.
26072607

26082608
# Crates and the module system

trunk/src/etc/maketest.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,21 @@ def putenv(name, value):
3030
value = normalize_path(value)
3131
os.putenv(name, value)
3232

33+
def convert_path_spec(name, value):
34+
if os.name == 'nt' and name != 'PATH':
35+
value = ":".join(normalize_path(v) for v in value.split(";"))
36+
return value
3337

3438
make = sys.argv[2]
3539
putenv('RUSTC', os.path.abspath(sys.argv[3]))
3640
putenv('TMPDIR', os.path.abspath(sys.argv[4]))
3741
putenv('CC', sys.argv[5])
3842
putenv('RUSTDOC', os.path.abspath(sys.argv[6]))
3943
filt = sys.argv[7]
40-
ldpath = sys.argv[8]
41-
if ldpath != '':
42-
name = ldpath.split('=')[0]
43-
value = ldpath.split('=')[1]
44-
if os.name == 'nt' and name != 'PATH':
45-
value = ":".join(normalize_path(v) for v in value.split(";"))
46-
os.putenv(name, value)
44+
putenv('LD_LIB_PATH_ENVVAR', sys.argv[8]);
45+
putenv('HOST_RPATH_DIR', os.path.abspath(sys.argv[9]));
46+
putenv('TARGET_RPATH_DIR', os.path.abspath(sys.argv[10]));
47+
putenv('RUST_BUILD_STAGE', sys.argv[11])
4748

4849
if not filt in sys.argv[1]:
4950
sys.exit(0)

trunk/src/libsync/arc.rs renamed to trunk/src/liballoc/arc.rs

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,16 @@
1313
* between tasks.
1414
*/
1515

16-
use std::mem;
17-
use std::ptr;
18-
use std::rt::heap::deallocate;
19-
use std::sync::atomics;
20-
use std::mem::{min_align_of, size_of};
16+
use core::atomics;
17+
use core::clone::Clone;
18+
use core::kinds::{Share, Send};
19+
use core::mem::{min_align_of, size_of, drop};
20+
use core::mem;
21+
use core::ops::{Drop, Deref};
22+
use core::option::{Some, None, Option};
23+
use core::ptr;
24+
use core::ptr::RawPtr;
25+
use heap::deallocate;
2126

2227
/// An atomically reference counted wrapper for shared state.
2328
///
@@ -28,6 +33,8 @@ use std::mem::{min_align_of, size_of};
2833
/// task.
2934
///
3035
/// ```rust
36+
/// extern crate sync;
37+
///
3138
/// use sync::Arc;
3239
///
3340
/// fn main() {
@@ -251,10 +258,16 @@ impl<T: Share + Send> Drop for Weak<T> {
251258
#[cfg(test)]
252259
#[allow(experimental)]
253260
mod tests {
254-
use super::{Arc, Weak};
261+
use std::clone::Clone;
262+
use std::comm::channel;
263+
use std::mem::drop;
264+
use std::ops::{Drop, Deref, DerefMut};
265+
use std::option::{Option, Some, None};
255266
use std::sync::atomics;
256267
use std::task;
257-
use Mutex;
268+
use std::vec::Vec;
269+
use super::{Arc, Weak};
270+
use sync::Mutex;
258271

259272
struct Canary(*mut atomics::AtomicUint);
260273

0 commit comments

Comments
 (0)