Skip to content

Commit d14a633

Browse files
committed
---
yaml --- r: 152510 b: refs/heads/try2 c: 1cde9d8 h: refs/heads/master v: v3
1 parent dcabf6a commit d14a633

File tree

165 files changed

+7661
-3817
lines changed

Some content is hidden

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

165 files changed

+7661
-3817
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: ffa4ae81e4b5d1ada347eb7c0edb6a872c87ca83
8+
refs/heads/try2: 1cde9d8cbb8dca25d381304f999e38e478dc6ba2
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 & 2 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
@@ -29,7 +28,7 @@ before_script:
2928
- ln -nsf /usr/bin/llc-$LLVM_VERSION local-llvm/bin/llc
3029
- ln -nsf /usr/include/llvm-$LLVM_VERSION local-llvm/include
3130
- ./configure --disable-optimize-tests --llvm-root=`pwd`/local-llvm
32-
--enable-fast-make --enable-clang --jemalloc-root=/usr/lib
31+
--enable-fast-make --enable-clang
3332

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

branches/try2/configure

Lines changed: 19 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,6 @@ opt mingw-cross 0 "cross-compile for win32 using mingw"
416416
opt clang 0 "prefer clang to gcc for building the runtime"
417417
opt ccache 0 "invoke gcc/clang via ccache to reuse object files between builds"
418418
opt local-rust 0 "use an installed rustc rather than downloading a snapshot"
419-
opt pax-flags 0 "apply PaX flags to rustc binaries (required for GRSecurity/PaX-patched kernels)"
420419
opt inject-std-version 1 "inject the current compiler version of libstd into programs"
421420
opt llvm-static-stdcpp 0 "statically link to libstdc++ for LLVM"
422421
opt rpath 1 "build rpaths into rustc itself"
@@ -518,12 +517,6 @@ then
518517
fi
519518
fi
520519

521-
if [ "$CFG_OSTYPE" = "unknown-linux-gnu" ]
522-
then
523-
probe CFG_PAXCTL paxctl /sbin/paxctl
524-
probe CFG_ZCAT zcat
525-
fi
526-
527520
step_msg "looking for target specific programs"
528521

529522
probe CFG_ADB adb
@@ -546,51 +539,6 @@ then
546539
fi
547540
fi
548541

549-
if [ "$CFG_OSTYPE" = "unknown-linux-gnu" ]
550-
then
551-
if [ ! -z "$CFG_ENABLE_PAX_FLAGS" -a -z "$CFG_PAXCTL" ]
552-
then
553-
err "enabled PaX markings but no paxctl binary found"
554-
fi
555-
556-
if [ -z "$CFG_DISABLE_PAX_FLAGS" ]
557-
then
558-
# GRSecurity/PaX detection. This can be very flaky.
559-
GRSEC_DETECTED=
560-
561-
# /dev/grsec only exists if CONFIG_GRKERNSEC_NO_RBAC is not set.
562-
# /proc/sys/kernel/grsecurity is not available if ÇONFIG_GRKERNSEC_SYSCTL is not set.
563-
if [ -e /dev/grsec -o -d /proc/sys/kernel/grsecurity ]
564-
then
565-
GRSEC_DETECTED=1
566-
# /proc/config.gz is normally only available to root, and only if CONFIG_IKCONFIG_PROC has been set.
567-
elif [ -r /proc/config.gz -a ! -z "$CFG_ZCAT" ]
568-
then
569-
if "$CFG_ZCAT" /proc/config.gz | grep --quiet "CONFIG_GRKERNSEC=y"
570-
then
571-
GRSEC_DETECTED=1
572-
fi
573-
# Flaky.
574-
elif grep --quiet grsec /proc/version
575-
then
576-
GRSEC_DETECTED=1
577-
fi
578-
579-
if [ ! -z "$GRSEC_DETECTED" ]
580-
then
581-
step_msg "GRSecurity: yes"
582-
if [ ! -z "$CFG_PAXCTL" ]
583-
then
584-
CFG_ENABLE_PAX_FLAGS=1
585-
else
586-
warn "GRSecurity kernel detected but no paxctl binary found: not setting CFG_ENABLE_PAX_FLAGS"
587-
fi
588-
else
589-
step_msg "GRSecurity: no"
590-
fi
591-
fi
592-
fi
593-
594542
BIN_SUF=
595543
if [ "$CFG_OSTYPE" = "pc-mingw32" ] || [ "$CFG_OSTYPE" = "w64-mingw32" ]
596544
then
@@ -942,16 +890,33 @@ then
942890
msg "git: submodule sync"
943891
"${CFG_GIT}" submodule sync
944892

893+
msg "git: submodule init"
894+
"${CFG_GIT}" submodule init
895+
896+
# Disable submodules that we're not using
897+
if [ ! -z "${CFG_LLVM_ROOT}" ]; then
898+
msg "git: submodule deinit src/llvm"
899+
"${CFG_GIT}" submodule deinit src/llvm
900+
fi
901+
if [ ! -z "${CFG_JEMALLOC_ROOT}" ]; then
902+
msg "git: submodule deinit src/jemalloc"
903+
"${CFG_GIT}" submodule deinit src/jemalloc
904+
fi
905+
if [ ! -z "${CFG_LIBUV_ROOT}" ]; then
906+
msg "git: submodule deinit src/libuv"
907+
"${CFG_GIT}" submodule deinit src/libuv
908+
fi
909+
945910
msg "git: submodule update"
946-
"${CFG_GIT}" submodule update --init
911+
"${CFG_GIT}" submodule update
947912
need_ok "git failed"
948913

949914
msg "git: submodule foreach sync"
950915
"${CFG_GIT}" submodule foreach --recursive 'if test -e .gitmodules; then git submodule sync; fi'
951916
need_ok "git failed"
952917

953918
msg "git: submodule foreach update"
954-
"${CFG_GIT}" submodule update --init --recursive
919+
"${CFG_GIT}" submodule update --recursive
955920
need_ok "git failed"
956921

957922
# NB: this is just for the sake of getting the submodule SHA1 values

branches/try2/mk/stage0.mk

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ ifdef CFG_ENABLE_LOCAL_RUST
1818
$(Q)$(S)src/etc/local_stage0.sh $(CFG_BUILD) $(CFG_LOCAL_RUST_ROOT) rustlib
1919
else
2020
$(Q)$(CFG_PYTHON) $(S)src/etc/get-snapshot.py $(CFG_BUILD) $(SNAPSHOT_FILE)
21-
ifdef CFG_ENABLE_PAX_FLAGS
22-
@$(call E, apply PaX flags: $@)
23-
@"$(CFG_PAXCTL)" -cm "$@"
24-
endif
2521
endif
2622
$(Q)touch $@
2723

branches/try2/src/libcollections/bitv.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,7 @@ impl cmp::PartialEq for BitvSet {
842842
}
843843

844844
impl fmt::Show for BitvSet {
845+
#[cfg(stage0)]
845846
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
846847
try!(write!(fmt, r"\{"));
847848
let mut first = true;
@@ -854,6 +855,19 @@ impl fmt::Show for BitvSet {
854855
}
855856
write!(fmt, r"\}")
856857
}
858+
#[cfg(not(stage0))]
859+
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
860+
try!(write!(fmt, "{{"));
861+
let mut first = true;
862+
for n in self.iter() {
863+
if !first {
864+
try!(write!(fmt, ", "));
865+
}
866+
try!(write!(fmt, "{}", n));
867+
first = false;
868+
}
869+
write!(fmt, "}}")
870+
}
857871
}
858872

859873
impl<S: hash::Writer> hash::Hash<S> for BitvSet {

branches/try2/src/libcollections/slice.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2034,6 +2034,16 @@ mod tests {
20342034
assert!(xs == [1,2,0,4,3,0,0,6,5,0]);
20352035
}
20362036

2037+
#[test]
2038+
fn test_get_mut() {
2039+
let mut v = [0,1,2];
2040+
assert_eq!(v.get_mut(3), None);
2041+
v.get_mut(1).map(|e| *e = 7);
2042+
assert_eq!(v[1], 7);
2043+
let mut x = 2;
2044+
assert_eq!(v.get_mut(2), Some(&mut x));
2045+
}
2046+
20372047
#[test]
20382048
fn test_mut_chunks() {
20392049
let mut v = [0u8, 1, 2, 3, 4, 5, 6];

branches/try2/src/libcollections/smallintmap.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ impl<V:Clone> SmallIntMap<V> {
185185
}
186186

187187
impl<V: fmt::Show> fmt::Show for SmallIntMap<V> {
188+
#[cfg(stage0)]
188189
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
189190
try!(write!(f, r"\{"));
190191

@@ -195,6 +196,17 @@ impl<V: fmt::Show> fmt::Show for SmallIntMap<V> {
195196

196197
write!(f, r"\}")
197198
}
199+
#[cfg(not(stage0))]
200+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
201+
try!(write!(f, "{{"));
202+
203+
for (i, (k, v)) in self.iter().enumerate() {
204+
if i != 0 { try!(write!(f, ", ")); }
205+
try!(write!(f, "{}: {}", k, *v));
206+
}
207+
208+
write!(f, "}}")
209+
}
198210
}
199211

200212
macro_rules! iterator {

branches/try2/src/libcollections/treemap.rs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ impl<K: PartialOrd + Ord, V: PartialOrd> PartialOrd for TreeMap<K, V> {
7676
}
7777

7878
impl<K: Ord + Show, V: Show> Show for TreeMap<K, V> {
79+
#[cfg(stage0)]
7980
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
8081
try!(write!(f, r"\{"));
8182

@@ -86,6 +87,17 @@ impl<K: Ord + Show, V: Show> Show for TreeMap<K, V> {
8687

8788
write!(f, r"\}")
8889
}
90+
#[cfg(not(stage0))]
91+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
92+
try!(write!(f, "{{"));
93+
94+
for (i, (k, v)) in self.iter().enumerate() {
95+
if i != 0 { try!(write!(f, ", ")); }
96+
try!(write!(f, "{}: {}", *k, *v));
97+
}
98+
99+
write!(f, "}}")
100+
}
89101
}
90102

91103
impl<K: Ord, V> Collection for TreeMap<K, V> {
@@ -574,6 +586,7 @@ impl<T: PartialOrd + Ord> PartialOrd for TreeSet<T> {
574586
}
575587

576588
impl<T: Ord + Show> Show for TreeSet<T> {
589+
#[cfg(stage0)]
577590
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
578591
try!(write!(f, r"\{"));
579592

@@ -584,6 +597,17 @@ impl<T: Ord + Show> Show for TreeSet<T> {
584597

585598
write!(f, r"\}")
586599
}
600+
#[cfg(not(stage0))]
601+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
602+
try!(write!(f, "{{"));
603+
604+
for (i, x) in self.iter().enumerate() {
605+
if i != 0 { try!(write!(f, ", ")); }
606+
try!(write!(f, "{}", *x));
607+
}
608+
609+
write!(f, "}}")
610+
}
587611
}
588612

589613
impl<T: Ord> Collection for TreeSet<T> {
@@ -737,7 +761,7 @@ pub struct IntersectionItems<'a, T> {
737761
b: Peekable<&'a T, SetItems<'a, T>>,
738762
}
739763

740-
/// Lazy iterator producing elements in the set intersection (in-order)
764+
/// Lazy iterator producing elements in the set union (in-order)
741765
pub struct UnionItems<'a, T> {
742766
a: Peekable<&'a T, SetItems<'a, T>>,
743767
b: Peekable<&'a T, SetItems<'a, T>>,

branches/try2/src/libcore/any.rs

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

11-
//! Traits for dynamic typing of any type (through runtime reflection)
11+
//! Traits for dynamic typing of any `'static` type (through runtime reflection)
1212
//!
1313
//! This module implements the `Any` trait, which enables dynamic typing
14-
//! of any type, through runtime reflection.
14+
//! of any `'static` type through runtime reflection.
1515
//!
1616
//! `Any` itself can be used to get a `TypeId`, and has more features when used as a trait object.
1717
//! As `&Any` (a borrowed trait object), it has the `is` and `as_ref` methods, to test if the
@@ -32,8 +32,10 @@ pub enum Void { }
3232
// Any trait
3333
///////////////////////////////////////////////////////////////////////////////
3434

35-
/// The `Any` trait is implemented by all types, and can be used as a trait object
36-
/// for dynamic typing
35+
/// The `Any` trait is implemented by all `'static` types, and can be used for dynamic typing
36+
///
37+
/// Every type with no non-`'static` references implements `Any`, so `Any` can be used as a trait
38+
/// object to emulate the effects dynamic typing.
3739
pub trait Any {
3840
/// Get the `TypeId` of `self`
3941
fn get_type_id(&self) -> TypeId;
@@ -261,6 +263,14 @@ mod tests {
261263
let s = format!("{}", b);
262264
assert_eq!(s.as_slice(), "&Any");
263265
}
266+
267+
#[test]
268+
fn any_fixed_vec() {
269+
let test = [0u, ..8];
270+
let test = &test as &Any;
271+
assert!(test.is::<[uint, ..8]>());
272+
assert!(!test.is::<[uint, ..10]>());
273+
}
264274
}
265275

266276
#[cfg(test)]

0 commit comments

Comments
 (0)