Skip to content

Commit 7a347aa

Browse files
committed
---
yaml --- r: 153321 b: refs/heads/try2 c: e11e094 h: refs/heads/master i: 153319: a02e3bd v: v3
1 parent 8305be8 commit 7a347aa

File tree

108 files changed

+1463
-1190
lines changed

Some content is hidden

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

108 files changed

+1463
-1190
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: 780a8291aae59a67e4c0633f57ffdfbd51312d1b
8+
refs/heads/try2: e11e094c0a90e1a518ea996f826abdf3ad0e4cbb
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/dist.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ distcheck-tar-bins: dist-tar-bins
259259
$(Q)cd tmp/distcheck && tar -xzf ../../dist/$(PKG_NAME)-$(CFG_BUILD).tar.gz
260260
$(Q)mkdir -p tmp/distcheck/tarbininstall
261261
$(Q)sh tmp/distcheck/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix=tmp/distcheck/tarbininstall
262-
$(Q)tmp/distcheck/tarbininstall/bin/rustc --version
263262
$(Q)sh tmp/distcheck/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix=tmp/distcheck/tarbininstall --uninstall
264263
$(Q)rm -Rf tmp/distcheck/$(PKG_NAME)-$(CFG_BUILD)
265264
$(Q)rm -Rf tmp/distcheck/tarbininstall

branches/try2/mk/target.mk

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,6 @@ $(foreach host,$(CFG_HOST), \
6868
# $(4) is the crate name
6969
define RUST_TARGET_STAGE_N
7070

71-
# NOTE: after a stage0 snap this should be just EXTRA_FILENAME, not with a stage
72-
# or target bound
73-
EXTRA_FILENAME_$(1)_$(2) = -C extra-filename=-$$(CFG_FILENAME_EXTRA)
74-
ifeq ($(1),0)
75-
ifeq ($$(CFG_BUILD),$(2))
76-
EXTRA_FILENAME_$(1)_$(2) =
77-
endif
78-
endif
79-
8071
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): CFG_COMPILER_HOST_TRIPLE = $(2)
8172
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
8273
$$(CRATEFILE_$(4)) \
@@ -95,7 +86,7 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
9586
-L "$$(dir $$(LLVM_STDCPP_LOCATION_$(2)))" \
9687
$$(RUSTFLAGS_$(4)) \
9788
--out-dir $$(@D) \
98-
$$(EXTRA_FILENAME_$(1)_$(2)) \
89+
-C extra-filename=-$$(CFG_FILENAME_EXTRA) \
9990
$$<
10091
@touch $$@
10192
$$(call LIST_ALL_OLD_GLOB_MATCHES,\

branches/try2/src/compiletest/procsrv.rs

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::os;
1211
use std::str;
1312
use std::io::process::{ProcessExit, Command, Process, ProcessOutput};
1413
use std::dynamic_lib::DynamicLibrary;
1514

16-
fn target_env(lib_path: &str, aux_path: Option<&str>) -> Vec<(String, String)> {
15+
fn add_target_env(cmd: &mut Command, lib_path: &str, aux_path: Option<&str>) {
1716
// Need to be sure to put both the lib_path and the aux path in the dylib
1817
// search path for the child.
1918
let mut path = DynamicLibrary::search_path();
@@ -23,19 +22,11 @@ fn target_env(lib_path: &str, aux_path: Option<&str>) -> Vec<(String, String)> {
2322
}
2423
path.insert(0, Path::new(lib_path));
2524

26-
// Remove the previous dylib search path var
27-
let var = DynamicLibrary::envvar();
28-
let mut env: Vec<(String,String)> = os::env();
29-
match env.iter().position(|&(ref k, _)| k.as_slice() == var) {
30-
Some(i) => { env.remove(i); }
31-
None => {}
32-
}
33-
3425
// Add the new dylib search path var
26+
let var = DynamicLibrary::envvar();
3527
let newpath = DynamicLibrary::create_path(path.as_slice());
3628
let newpath = str::from_utf8(newpath.as_slice()).unwrap().to_string();
37-
env.push((var.to_string(), newpath));
38-
return env;
29+
cmd.env(var.to_string(), newpath);
3930
}
4031

4132
pub struct Result {pub status: ProcessExit, pub out: String, pub err: String}
@@ -47,8 +38,14 @@ pub fn run(lib_path: &str,
4738
env: Vec<(String, String)> ,
4839
input: Option<String>) -> Option<Result> {
4940

50-
let env = env.clone().append(target_env(lib_path, aux_path).as_slice());
51-
match Command::new(prog).args(args).env(env.as_slice()).spawn() {
41+
let mut cmd = Command::new(prog);
42+
cmd.args(args);
43+
add_target_env(&mut cmd, lib_path, aux_path);
44+
for (key, val) in env.move_iter() {
45+
cmd.env(key, val);
46+
}
47+
48+
match cmd.spawn() {
5249
Ok(mut process) => {
5350
for input in input.iter() {
5451
process.stdin.get_mut_ref().write(input.as_bytes()).unwrap();
@@ -73,8 +70,14 @@ pub fn run_background(lib_path: &str,
7370
env: Vec<(String, String)> ,
7471
input: Option<String>) -> Option<Process> {
7572

76-
let env = env.clone().append(target_env(lib_path, aux_path).as_slice());
77-
match Command::new(prog).args(args).env(env.as_slice()).spawn() {
73+
let mut cmd = Command::new(prog);
74+
cmd.args(args);
75+
add_target_env(&mut cmd, lib_path, aux_path);
76+
for (key, val) in env.move_iter() {
77+
cmd.env(key, val);
78+
}
79+
80+
match cmd.spawn() {
7881
Ok(mut process) => {
7982
for input in input.iter() {
8083
process.stdin.get_mut_ref().write(input.as_bytes()).unwrap();

branches/try2/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
574574
cmd.arg("./src/etc/lldb_batchmode.py")
575575
.arg(test_executable)
576576
.arg(debugger_script)
577-
.env([("PYTHONPATH", config.lldb_python_dir.clone().unwrap().as_slice())]);
577+
.env_set_all([("PYTHONPATH", config.lldb_python_dir.clone().unwrap().as_slice())]);
578578

579579
let (status, out, err) = match cmd.spawn() {
580580
Ok(process) => {

branches/try2/src/doc/guide.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -273,16 +273,11 @@ is still a work in progress. However, it is already good enough to use for many
273273
Rust projects, and so it is assumed that Rust projects will use Cargo from the
274274
beginning.
275275

276-
Programmers love car analogies, so I've got a good one for you to think about
277-
the relationship between `cargo` and `rustc`: `rustc` is like a car, and
278-
`cargo` is like a robotic driver. You can drive your car yourself, of course,
279-
but isn't it just easier to let a computer drive it for you?
280-
281-
Anyway, Cargo manages three things: building your code, downloading the
282-
dependencies your code needs, and building the dependencies your code needs.
283-
At first, your program doesn't have any dependencies, so we'll only be using
284-
the first part of its functionality. Eventually, we'll add more. Since we
285-
started off by using Cargo, it'll be easy to add later.
276+
Cargo manages three things: building your code, downloading the dependencies
277+
your code needs, and building the dependencies your code needs. At first, your
278+
program doesn't have any dependencies, so we'll only be using the first part of
279+
its functionality. Eventually, we'll add more. Since we started off by using
280+
Cargo, it'll be easy to add later.
286281

287282
Let's convert Hello World to Cargo. The first thing we need to do to begin using Cargo
288283
is to install Cargo. To do this, we need to build it from source. There are no binaries

branches/try2/src/etc/install.sh

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,19 @@ then
285285
CFG_LIBDIR_RELATIVE=bin
286286
fi
287287

288+
if [ "$CFG_OSTYPE" = "pc-mingw32" ] || [ "$CFG_OSTYPE" = "w64-mingw32" ]
289+
then
290+
CFG_LD_PATH_VAR=PATH
291+
CFG_OLD_LD_PATH_VAR=$PATH
292+
elif [ "$CFG_OSTYPE" = "Darwin" ]
293+
then
294+
CFG_LD_PATH_VAR=DYLD_LIBRARY_PATH
295+
CFG_OLD_LD_PATH_VAR=$DYLD_LIBRARY_PATH
296+
else
297+
CFG_LD_PATH_VAR=LD_LIBRARY_PATH
298+
CFG_OLD_LD_PATH_VAR=$LD_LIBRARY_PATH
299+
fi
300+
288301
flag uninstall "only uninstall from the installation prefix"
289302
opt verify 1 "verify that the installed binaries run correctly"
290303
valopt prefix "/usr/local" "set installation prefix"
@@ -312,11 +325,13 @@ then
312325
if [ -z "${CFG_UNINSTALL}" ]
313326
then
314327
msg "verifying platform can run binaries"
328+
export $CFG_LD_PATH_VAR="${CFG_SRC_DIR}/lib":$CFG_OLD_LD_PATH_VAR
315329
"${CFG_SRC_DIR}/bin/rustc" --version > /dev/null
316330
if [ $? -ne 0 ]
317331
then
318332
err "can't execute rustc binary on this platform"
319333
fi
334+
export $CFG_LD_PATH_VAR=$CFG_OLD_LD_PATH_VAR
320335
fi
321336
fi
322337

@@ -452,17 +467,31 @@ while read p; do
452467
done < "${CFG_SRC_DIR}/${CFG_LIBDIR_RELATIVE}/rustlib/manifest.in"
453468

454469
# Sanity check: can we run the installed binaries?
470+
#
471+
# As with the verification above, make sure the right LD_LIBRARY_PATH-equivalent
472+
# is in place. Try first without this variable, and if that fails try again with
473+
# the variable. If the second time tries, print a hopefully helpful message to
474+
# add something to the appropriate environment variable.
455475
if [ -z "${CFG_DISABLE_VERIFY}" ]
456476
then
457477
msg "verifying installed binaries are executable"
458-
"${CFG_PREFIX}/bin/rustc" --version > /dev/null
478+
"${CFG_PREFIX}/bin/rustc" --version 2> /dev/null 1> /dev/null
459479
if [ $? -ne 0 ]
460480
then
461-
ERR="can't execute installed rustc binary. "
462-
ERR="${ERR}installation may be broken. "
463-
ERR="${ERR}if this is expected then rerun install.sh with \`--disable-verify\` "
464-
ERR="${ERR}or \`make install\` with \`--disable-verify-install\`"
465-
err "${ERR}"
481+
export $CFG_LD_PATH_VAR="${CFG_PREFIX}/lib":$CFG_OLD_LD_PATH_VAR
482+
"${CFG_PREFIX}/bin/rustc" --version > /dev/null
483+
if [ $? -ne 0 ]
484+
then
485+
ERR="can't execute installed rustc binary. "
486+
ERR="${ERR}installation may be broken. "
487+
ERR="${ERR}if this is expected then rerun install.sh with \`--disable-verify\` "
488+
ERR="${ERR}or \`make install\` with \`--disable-verify-install\`"
489+
err "${ERR}"
490+
else
491+
echo
492+
echo " please ensure '${CFG_PREFIX}/lib' is added to ${CFG_LD_PATH_VAR}"
493+
echo
494+
fi
466495
fi
467496
fi
468497

branches/try2/src/liballoc/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
//! by libc malloc/free. The `libc_heap` module is defined to be wired up to
6161
//! the system malloc/free.
6262
63-
#![crate_id = "alloc#0.11.0"] // NOTE: remove after a stage0 snap
6463
#![crate_name = "alloc"]
6564
#![experimental]
6665
#![license = "MIT/ASL2"]
@@ -71,7 +70,6 @@
7170

7271
#![no_std]
7372
#![feature(lang_items, phase, unsafe_destructor)]
74-
#![allow(unused_attribute)] // NOTE: remove after stage0
7573

7674
#[phase(plugin, link)]
7775
extern crate core;

branches/try2/src/libarena/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
//! arena but can only hold objects of a single type, and Arena, which is a
2020
//! more complex, slower Arena which can hold objects of any type.
2121
22-
#![crate_id = "arena#0.11.0"]
2322
#![crate_name = "arena"]
2423
#![experimental]
2524
#![crate_type = "rlib"]
@@ -31,7 +30,6 @@
3130

3231
#![feature(unsafe_destructor)]
3332
#![allow(missing_doc)]
34-
#![allow(unused_attribute)] // NOTE: remove after stage0
3533

3634
use std::cell::{Cell, RefCell};
3735
use std::cmp;

branches/try2/src/libcollections/bitv.rs

Lines changed: 11 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,16 @@ use core::cmp;
1616
use core::default::Default;
1717
use core::fmt;
1818
use core::iter::Take;
19+
use core::ops::Index;
1920
use core::slice;
2021
use core::uint;
2122
use std::hash;
2223

2324
use {Collection, Mutable, Set, MutableSet};
2425
use vec::Vec;
2526

26-
#[cfg(not(stage0))]
27-
use core::ops::Index;
2827

29-
#[cfg(not(stage0))]
3028
static TRUE: bool = true;
31-
32-
#[cfg(not(stage0))]
3329
static FALSE: bool = false;
3430

3531
#[deriving(Clone)]
@@ -80,7 +76,6 @@ pub struct Bitv {
8076
nbits: uint
8177
}
8278

83-
#[cfg(not(stage0))]
8479
impl Index<uint,bool> for Bitv {
8580
#[inline]
8681
fn index<'a>(&'a self, i: &uint) -> &'a bool {
@@ -1426,18 +1421,14 @@ mod tests {
14261421
fn test_small_clear() {
14271422
let mut b = Bitv::with_capacity(14, true);
14281423
b.clear();
1429-
BitvSet::from_bitv(b).iter().advance(|i| {
1430-
fail!("found 1 at {:?}", i)
1431-
});
1424+
assert!(b.none());
14321425
}
14331426

14341427
#[test]
14351428
fn test_big_clear() {
14361429
let mut b = Bitv::with_capacity(140, true);
14371430
b.clear();
1438-
BitvSet::from_bitv(b).iter().advance(|i| {
1439-
fail!("found 1 at {:?}", i)
1440-
});
1431+
assert!(b.none());
14411432
}
14421433

14431434
#[test]
@@ -1494,14 +1485,9 @@ mod tests {
14941485
assert!(b.insert(5));
14951486
assert!(b.insert(3));
14961487

1497-
let mut i = 0;
14981488
let expected = [3, 5, 11, 77];
1499-
a.intersection(&b).advance(|x| {
1500-
assert_eq!(x, expected[i]);
1501-
i += 1;
1502-
true
1503-
});
1504-
assert_eq!(i, expected.len());
1489+
let actual = a.intersection(&b).collect::<Vec<uint>>();
1490+
assert_eq!(actual.as_slice(), expected.as_slice());
15051491
}
15061492

15071493
#[test]
@@ -1518,14 +1504,9 @@ mod tests {
15181504
assert!(b.insert(3));
15191505
assert!(b.insert(200));
15201506

1521-
let mut i = 0;
15221507
let expected = [1, 5, 500];
1523-
a.difference(&b).advance(|x| {
1524-
assert_eq!(x, expected[i]);
1525-
i += 1;
1526-
true
1527-
});
1528-
assert_eq!(i, expected.len());
1508+
let actual = a.difference(&b).collect::<Vec<uint>>();
1509+
assert_eq!(actual.as_slice(), expected.as_slice());
15291510
}
15301511

15311512
#[test]
@@ -1544,14 +1525,9 @@ mod tests {
15441525
assert!(b.insert(14));
15451526
assert!(b.insert(220));
15461527

1547-
let mut i = 0;
15481528
let expected = [1, 5, 11, 14, 220];
1549-
a.symmetric_difference(&b).advance(|x| {
1550-
assert_eq!(x, expected[i]);
1551-
i += 1;
1552-
true
1553-
});
1554-
assert_eq!(i, expected.len());
1529+
let actual = a.symmetric_difference(&b).collect::<Vec<uint>>();
1530+
assert_eq!(actual.as_slice(), expected.as_slice());
15551531
}
15561532

15571533
#[test]
@@ -1573,14 +1549,9 @@ mod tests {
15731549
assert!(b.insert(13));
15741550
assert!(b.insert(19));
15751551

1576-
let mut i = 0;
15771552
let expected = [1, 3, 5, 9, 11, 13, 19, 24, 160];
1578-
a.union(&b).advance(|x| {
1579-
assert_eq!(x, expected[i]);
1580-
i += 1;
1581-
true
1582-
});
1583-
assert_eq!(i, expected.len());
1553+
let actual = a.union(&b).collect::<Vec<uint>>();
1554+
assert_eq!(actual.as_slice(), expected.as_slice());
15841555
}
15851556

15861557
#[test]

branches/try2/src/libcollections/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
* Collection types.
1313
*/
1414

15-
#![crate_id = "collections#0.11.0"] // NOTE: remove after stage0
1615
#![crate_name = "collections"]
1716
#![experimental]
1817
#![crate_type = "rlib"]
@@ -25,7 +24,6 @@
2524
#![feature(macro_rules, managed_boxes, default_type_params, phase, globs)]
2625
#![feature(unsafe_destructor)]
2726
#![no_std]
28-
#![allow(unused_attribute)] // NOTE: remove after stage0
2927

3028
#[phase(plugin, link)] extern crate core;
3129
extern crate unicode;

0 commit comments

Comments
 (0)