Skip to content

Commit c777bf6

Browse files
committed
---
yaml --- r: 123490 b: refs/heads/auto c: b9e35a1 h: refs/heads/master v: v3
1 parent b5ee35c commit c777bf6

File tree

60 files changed

+408
-147
lines changed

Some content is hidden

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

60 files changed

+408
-147
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 898701cb35833b2ecea8bc7f3902a35b7eccc219
16+
refs/heads/auto: b9e35a164416272a3aa3778c2ce9669dcc15c556
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/mk/target.mk

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@ $(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+
7180
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): CFG_COMPILER_HOST_TRIPLE = $(2)
7281
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
7382
$$(CRATEFILE_$(4)) \
@@ -86,7 +95,7 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
8695
-L "$$(dir $$(LLVM_STDCPP_LOCATION_$(2)))" \
8796
$$(RUSTFLAGS_$(4)) \
8897
--out-dir $$(@D) \
89-
-C extra-filename=-$$(CFG_FILENAME_EXTRA) \
98+
$$(EXTRA_FILENAME_$(1)_$(2)) \
9099
$$<
91100
@touch $$@
92101
$$(call LIST_ALL_OLD_GLOB_MATCHES,\

branches/auto/src/doc/guide.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,16 @@ 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-
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.
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.
281286

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

branches/auto/src/etc/install.sh

Lines changed: 6 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -285,19 +285,6 @@ 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-
301288
flag uninstall "only uninstall from the installation prefix"
302289
opt verify 1 "verify that the installed binaries run correctly"
303290
valopt prefix "/usr/local" "set installation prefix"
@@ -325,13 +312,11 @@ then
325312
if [ -z "${CFG_UNINSTALL}" ]
326313
then
327314
msg "verifying platform can run binaries"
328-
export $CFG_LD_PATH_VAR="${CFG_SRC_DIR}/lib":$CFG_OLD_LD_PATH_VAR
329315
"${CFG_SRC_DIR}/bin/rustc" --version > /dev/null
330316
if [ $? -ne 0 ]
331317
then
332318
err "can't execute rustc binary on this platform"
333319
fi
334-
export $CFG_LD_PATH_VAR=$CFG_OLD_LD_PATH_VAR
335320
fi
336321
fi
337322

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

469454
# 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.
475455
if [ -z "${CFG_DISABLE_VERIFY}" ]
476456
then
477457
msg "verifying installed binaries are executable"
478-
"${CFG_PREFIX}/bin/rustc" --version 2> /dev/null 1> /dev/null
458+
"${CFG_PREFIX}/bin/rustc" --version > /dev/null
479459
if [ $? -ne 0 ]
480460
then
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
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}"
495466
fi
496467
fi
497468

branches/auto/src/liballoc/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
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
6364
#![crate_name = "alloc"]
6465
#![experimental]
6566
#![license = "MIT/ASL2"]
@@ -70,6 +71,7 @@
7071

7172
#![no_std]
7273
#![feature(lang_items, phase, unsafe_destructor)]
74+
#![allow(unused_attribute)] // NOTE: remove after stage0
7375

7476
#[phase(plugin, link)]
7577
extern crate core;

branches/auto/src/libarena/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
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"]
2223
#![crate_name = "arena"]
2324
#![experimental]
2425
#![crate_type = "rlib"]
@@ -30,6 +31,7 @@
3031

3132
#![feature(unsafe_destructor)]
3233
#![allow(missing_doc)]
34+
#![allow(unused_attribute)] // NOTE: remove after stage0
3335

3436
use std::cell::{Cell, RefCell};
3537
use std::cmp;

branches/auto/src/libcollections/bitv.rs

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

2423
use {Collection, Mutable, Set, MutableSet};
2524
use vec::Vec;
2625

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

29+
#[cfg(not(stage0))]
2830
static TRUE: bool = true;
31+
32+
#[cfg(not(stage0))]
2933
static FALSE: bool = false;
3034

3135
#[deriving(Clone)]
@@ -76,6 +80,7 @@ pub struct Bitv {
7680
nbits: uint
7781
}
7882

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

14271434
#[test]
14281435
fn test_big_clear() {
14291436
let mut b = Bitv::with_capacity(140, true);
14301437
b.clear();
1431-
assert!(b.none());
1438+
BitvSet::from_bitv(b).iter().advance(|i| {
1439+
fail!("found 1 at {:?}", i)
1440+
});
14321441
}
14331442

14341443
#[test]
@@ -1485,9 +1494,14 @@ mod tests {
14851494
assert!(b.insert(5));
14861495
assert!(b.insert(3));
14871496

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

14931507
#[test]
@@ -1504,9 +1518,14 @@ mod tests {
15041518
assert!(b.insert(3));
15051519
assert!(b.insert(200));
15061520

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

15121531
#[test]
@@ -1525,9 +1544,14 @@ mod tests {
15251544
assert!(b.insert(14));
15261545
assert!(b.insert(220));
15271546

1547+
let mut i = 0;
15281548
let expected = [1, 5, 11, 14, 220];
1529-
let actual = a.symmetric_difference(&b).collect::<Vec<uint>>();
1530-
assert_eq!(actual.as_slice(), expected.as_slice());
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());
15311555
}
15321556

15331557
#[test]
@@ -1549,9 +1573,14 @@ mod tests {
15491573
assert!(b.insert(13));
15501574
assert!(b.insert(19));
15511575

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

15571586
#[test]

branches/auto/src/libcollections/lib.rs

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

15+
#![crate_id = "collections#0.11.0"] // NOTE: remove after stage0
1516
#![crate_name = "collections"]
1617
#![experimental]
1718
#![crate_type = "rlib"]
@@ -24,6 +25,7 @@
2425
#![feature(macro_rules, managed_boxes, default_type_params, phase, globs)]
2526
#![feature(unsafe_destructor)]
2627
#![no_std]
28+
#![allow(unused_attribute)] // NOTE: remove after stage0
2729

2830
#[phase(plugin, link)] extern crate core;
2931
extern crate unicode;

branches/auto/src/libcollections/treemap.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,7 +1770,7 @@ mod test_set {
17701770
#[test]
17711771
fn test_intersection() {
17721772
fn check_intersection(a: &[int], b: &[int], expected: &[int]) {
1773-
check(a, b, expected, |x, y, f| x.intersection(y).all(f))
1773+
check(a, b, expected, |x, y, f| x.intersection(y).advance(f))
17741774
}
17751775

17761776
check_intersection([], [], []);
@@ -1786,7 +1786,7 @@ mod test_set {
17861786
#[test]
17871787
fn test_difference() {
17881788
fn check_difference(a: &[int], b: &[int], expected: &[int]) {
1789-
check(a, b, expected, |x, y, f| x.difference(y).all(f))
1789+
check(a, b, expected, |x, y, f| x.difference(y).advance(f))
17901790
}
17911791

17921792
check_difference([], [], []);
@@ -1804,7 +1804,7 @@ mod test_set {
18041804
fn test_symmetric_difference() {
18051805
fn check_symmetric_difference(a: &[int], b: &[int],
18061806
expected: &[int]) {
1807-
check(a, b, expected, |x, y, f| x.symmetric_difference(y).all(f))
1807+
check(a, b, expected, |x, y, f| x.symmetric_difference(y).advance(f))
18081808
}
18091809

18101810
check_symmetric_difference([], [], []);
@@ -1819,7 +1819,7 @@ mod test_set {
18191819
fn test_union() {
18201820
fn check_union(a: &[int], b: &[int],
18211821
expected: &[int]) {
1822-
check(a, b, expected, |x, y, f| x.union(y).all(f))
1822+
check(a, b, expected, |x, y, f| x.union(y).advance(f))
18231823
}
18241824

18251825
check_union([], [], []);

branches/auto/src/libcore/iter.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,10 +435,9 @@ pub trait Iterator<A> {
435435
///
436436
/// # Example
437437
///
438-
/// ```rust,ignore
438+
/// ```rust
439439
/// range(0u, 5).advance(|x| {print!("{} ", x); true});
440440
/// ```
441-
#[deprecated = "use the `all` method instead"]
442441
#[inline]
443442
fn advance(&mut self, f: |A| -> bool) -> bool {
444443
loop {

branches/auto/src/libcore/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
// Since libcore defines many fundamental lang items, all tests live in a
4848
// separate crate, libcoretest, to avoid bizarre issues.
4949

50+
#![crate_id = "core#0.11.0"]
5051
#![crate_name = "core"]
5152
#![experimental]
5253
#![license = "MIT/ASL2"]
@@ -60,6 +61,7 @@
6061
#![feature(globs, intrinsics, lang_items, macro_rules, managed_boxes, phase)]
6162
#![feature(simd, unsafe_destructor)]
6263
#![deny(missing_doc)]
64+
#![allow(unused_attribute)] // NOTE: remove after stage0
6365

6466
mod macros;
6567

branches/auto/src/libcore/ops.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,7 @@ shr_impl!(uint u8 u16 u32 u64 int i8 i16 i32 i64)
636636
* ```
637637
*/
638638
#[lang="index"]
639+
#[cfg(not(stage0))]
639640
pub trait Index<Index,Result> {
640641
/// The method for the indexing (`Foo[Bar]`) operation
641642
fn index<'a>(&'a self, index: &Index) -> &'a Result;
@@ -667,6 +668,7 @@ pub trait Index<Index,Result> {
667668
* ```
668669
*/
669670
#[lang="index_mut"]
671+
#[cfg(not(stage0))]
670672
pub trait IndexMut<Index,Result> {
671673
/// The method for the indexing (`Foo[Bar]`) operation
672674
fn index_mut<'a>(&'a mut self, index: &Index) -> &'a mut Result;

branches/auto/src/libcore/prelude.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ pub use ops::{Add, Sub, Mul, Div, Rem, Neg, Not};
3434
pub use ops::{BitAnd, BitOr, BitXor};
3535
pub use ops::{Drop, Deref, DerefMut};
3636
pub use ops::{Shl, Shr};
37+
#[cfg(not(stage0))]
3738
pub use ops::{Index, IndexMut};
3839
pub use option::{Option, Some, None};
3940
pub use result::{Result, Ok, Err};

branches/auto/src/libdebug/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
//! Additionally, it is not guaranteed that functionality such as reflection
1717
//! will persist into the future.
1818
19+
#![crate_id = "debug#0.11.0"] // NOTE: remove after stage0
1920
#![crate_name = "debug"]
2021
#![experimental]
2122
#![license = "MIT/ASL2"]
@@ -27,6 +28,7 @@
2728
#![experimental]
2829
#![feature(managed_boxes, macro_rules)]
2930
#![allow(experimental)]
31+
#![allow(unused_attribute)] // NOTE: remove after stage0
3032

3133
pub mod fmt;
3234
pub mod reflect;

0 commit comments

Comments
 (0)