Skip to content

Commit 9563cea

Browse files
committed
---
yaml --- r: 145247 b: refs/heads/try2 c: c0cc37b h: refs/heads/master i: 145245: 72769eb 145243: 2a05ff3 145239: a57860b 145231: 240d42d 145215: 2850ff1 v: v3
1 parent 0617884 commit 9563cea

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

+1930
-649
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: d2b0b11aebfe3167bf41f7c6c31cf7b1e396efe7
8+
refs/heads/try2: c0cc37b96398aa21ca6f718cbe7170210ea337d9
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/doc/rust.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ string_body : non_double_quote
248248
| '\x5c' [ '\x22' | common_escape ] ;
249249
250250
common_escape : '\x5c'
251-
| 'n' | 'r' | 't' | '0'
251+
| 'n' | 'r' | 't'
252252
| 'x' hex_digit 2
253253
| 'u' hex_digit 4
254254
| 'U' hex_digit 8 ;

branches/try2/mk/llvm.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ LLVM_STAMP_$(1) = $$(CFG_LLVM_BUILD_DIR_$(1))/llvm-auto-clean-stamp
2828

2929
$$(LLVM_CONFIG_$(1)): $$(LLVM_DEPS) $$(LLVM_STAMP_$(1))
3030
@$$(call E, make: llvm)
31-
$$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1)) $$(CFG_LLVM_BUILD_ENV_$(1))
31+
$$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1)) $$(CFG_LLVM_BUILD_ENV)
3232
$$(Q)touch $$(LLVM_CONFIG_$(1))
3333
endif
3434

branches/try2/mk/platform.mk

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,6 @@ CFG_PATH_MUNGE_mips-unknown-linux-gnu := true
343343
CFG_LDPATH_mips-unknown-linux-gnu :=
344344
CFG_RUN_mips-unknown-linux-gnu=
345345
CFG_RUN_TARG_mips-unknown-linux-gnu=
346-
RUSTC_FLAGS_mips-unknown-linux-gnu := --linker=$(CXX_mips-unknown-linux-gnu) --target-cpu mips32r2 --target-feature +mips32r2,+o32
347346

348347
# i686-pc-mingw32 configuration
349348
CC_i686-pc-mingw32=$(CC)
@@ -353,7 +352,7 @@ AR_i686-pc-mingw32=$(AR)
353352
CFG_LIB_NAME_i686-pc-mingw32=$(1).dll
354353
CFG_LIB_GLOB_i686-pc-mingw32=$(1)-*.dll
355354
CFG_LIB_DSYM_GLOB_i686-pc-mingw32=$(1)-*.dylib.dSYM
356-
CFG_GCCISH_CFLAGS_i686-pc-mingw32 := -Wall -Werror -g -m32 -march=i686 -D_WIN32_WINNT=0x0600 -I$(CFG_SRC_DIR)src/etc/mingw-fix-include
355+
CFG_GCCISH_CFLAGS_i686-pc-mingw32 := -Wall -Werror -g -m32 -march=i686 -D_WIN32_WINNT=0x0600
357356
CFG_GCCISH_CXXFLAGS_i686-pc-mingw32 := -fno-rtti
358357
CFG_GCCISH_LINK_FLAGS_i686-pc-mingw32 := -shared -fPIC -g -m32
359358
CFG_GCCISH_DEF_FLAG_i686-pc-mingw32 :=
@@ -362,7 +361,6 @@ CFG_GCCISH_POST_LIB_FLAGS_i686-pc-mingw32 :=
362361
CFG_DEF_SUFFIX_i686-pc-mingw32 := .mingw32.def
363362
CFG_INSTALL_NAME_i686-pc-mingw32 =
364363
CFG_LIBUV_LINK_FLAGS_i686-pc-mingw32 := -lWs2_32 -lpsapi -liphlpapi
365-
CFG_LLVM_BUILD_ENV_i686-pc-mingw32 := CPATH=$(CFG_SRC_DIR)src/etc/mingw-fix-include
366364
CFG_EXE_SUFFIX_i686-pc-mingw32 := .exe
367365
CFG_WINDOWSY_i686-pc-mingw32 := 1
368366
CFG_UNIXY_i686-pc-mingw32 :=
@@ -481,7 +479,7 @@ define CFG_MAKE_TOOLCHAIN
481479
$$(CFG_GCCISH_DEF_FLAG_$(1))$$(3) $$(2) \
482480
$$(call CFG_INSTALL_NAME_$(1),$$(4))
483481

484-
ifeq ($$(findstring $(HOST_$(1)),arm mips),)
482+
ifneq ($(HOST_$(1)),arm)
485483

486484
# We're using llvm-mc as our assembler because it supports
487485
# .cfi pseudo-ops on mac
@@ -493,7 +491,7 @@ define CFG_MAKE_TOOLCHAIN
493491
-o=$$(1)
494492
else
495493

496-
# For the ARM and MIPS crosses, use the toolchain assembler
494+
# For the ARM crosses, use the toolchain assembler
497495
# XXX: We should be able to use the LLVM assembler
498496
CFG_ASSEMBLE_$(1)=$$(CC_$(1)) $$(CFG_DEPEND_FLAGS) $$(2) -c -o $$(1)
499497

branches/try2/mk/rt.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# working under these assumptions).
2525

2626
# Hack for passing flags into LIBUV, see below.
27-
LIBUV_FLAGS_i386 = -m32 -fPIC -I$(S)src/etc/mingw-fix-include
27+
LIBUV_FLAGS_i386 = -m32 -fPIC
2828
LIBUV_FLAGS_x86_64 = -m64 -fPIC
2929
ifeq ($(OSTYPE_$(1)), linux-androideabi)
3030
LIBUV_FLAGS_arm = -fPIC -DANDROID -std=gnu99

branches/try2/src/compiletest/compiletest.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ extern mod extra;
1717

1818
use std::os;
1919
use std::rt;
20+
use std::f64;
2021

2122
use extra::getopts;
2223
use extra::getopts::groups::{optopt, optflag, reqopt};
@@ -130,7 +131,7 @@ pub fn parse_config(args: ~[~str]) -> config {
130131
ratchet_noise_percent:
131132
getopts::opt_maybe_str(matches,
132133
"ratchet-noise-percent").map_move(|s|
133-
from_str::<f64>(s).unwrap()),
134+
f64::from_str(s).unwrap()),
134135
runtool: getopts::opt_maybe_str(matches, "runtool"),
135136
rustcflags: getopts::opt_maybe_str(matches, "rustcflags"),
136137
jit: getopts::opt_present(matches, "jit"),

branches/try2/src/etc/mingw-fix-include/README.txt

Lines changed: 0 additions & 6 deletions
This file was deleted.

branches/try2/src/etc/mingw-fix-include/bits/c++config.h

Lines changed: 0 additions & 8 deletions
This file was deleted.

branches/try2/src/etc/mingw-fix-include/winbase.h

Lines changed: 0 additions & 8 deletions
This file was deleted.

branches/try2/src/etc/mingw-fix-include/winsock2.h

Lines changed: 0 additions & 12 deletions
This file was deleted.

branches/try2/src/libextra/glob.rs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,16 @@ fn list_dir_sorted(path: &Path) -> ~[Path] {
137137
/**
138138
* A compiled Unix shell style pattern.
139139
*/
140+
#[cfg(stage0)]
141+
#[deriving(Clone, Eq, TotalEq, Ord, TotalOrd, IterBytes)]
142+
pub struct Pattern {
143+
priv tokens: ~[PatternToken]
144+
}
145+
146+
/**
147+
* A compiled Unix shell style pattern.
148+
*/
149+
#[cfg(not(stage0))]
140150
#[deriving(Clone, Eq, TotalEq, Ord, TotalOrd, IterBytes, Default)]
141151
pub struct Pattern {
142152
priv tokens: ~[PatternToken]
@@ -455,10 +465,39 @@ fn is_sep(c: char) -> bool {
455465
}
456466
}
457467
468+
/**
469+
* Configuration options to modify the behaviour of `Pattern::matches_with(..)`
470+
*/
471+
#[cfg(stage0)]
472+
#[deriving(Clone, Eq, TotalEq, Ord, TotalOrd, IterBytes)]
473+
pub struct MatchOptions {
474+
475+
/**
476+
* Whether or not patterns should be matched in a case-sensitive manner. This
477+
* currently only considers upper/lower case relationships between ASCII characters,
478+
* but in future this might be extended to work with Unicode.
479+
*/
480+
case_sensitive: bool,
481+
482+
/**
483+
* If this is true then path-component separator characters (e.g. `/` on Posix)
484+
* must be matched by a literal `/`, rather than by `*` or `?` or `[...]`
485+
*/
486+
require_literal_separator: bool,
487+
488+
/**
489+
* If this is true then paths that contain components that start with a `.` will
490+
* not match unless the `.` appears literally in the pattern: `*`, `?` or `[...]`
491+
* will not match. This is useful because such files are conventionally considered
492+
* hidden on Unix systems and it might be desirable to skip them when listing files.
493+
*/
494+
require_literal_leading_dot: bool
495+
}
458496
459497
/**
460498
* Configuration options to modify the behaviour of `Pattern::matches_with(..)`
461499
*/
500+
#[cfg(not(stage0))]
462501
#[deriving(Clone, Eq, TotalEq, Ord, TotalOrd, IterBytes, Default)]
463502
pub struct MatchOptions {
464503

branches/try2/src/libextra/num/bigint.rs

Lines changed: 2 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -697,13 +697,6 @@ impl BigUint {
697697
}
698698
return BigUint::new(shifted);
699699
}
700-
701-
/// Determines the fewest bits necessary to express the BigUint.
702-
pub fn bits(&self) -> uint {
703-
if self.is_zero() { return 0; }
704-
let zeros = self.data.last().leading_zeros();
705-
return self.data.len()*BigDigit::bits - (zeros as uint);
706-
}
707700
}
708701

709702
#[cfg(target_word_size = "64")]
@@ -1122,23 +1115,10 @@ trait RandBigInt {
11221115
11231116
/// Generate a random BigInt of the given bit size.
11241117
fn gen_bigint(&mut self, bit_size: uint) -> BigInt;
1125-
1126-
/// Generate a random BigUint less than the given bound. Fails
1127-
/// when the bound is zero.
1128-
fn gen_biguint_below(&mut self, bound: &BigUint) -> BigUint;
1129-
1130-
/// Generate a random BigUint within the given range. The lower
1131-
/// bound is inclusive; the upper bound is exclusive. Fails when
1132-
/// the upper bound is not greater than the lower bound.
1133-
fn gen_biguint_range(&mut self, lbound: &BigUint, ubound: &BigUint) -> BigUint;
1134-
1135-
/// Generate a random BigInt within the given range. The lower
1136-
/// bound is inclusive; the upper bound is exclusive. Fails when
1137-
/// the upper bound is not greater than the lower bound.
1138-
fn gen_bigint_range(&mut self, lbound: &BigInt, ubound: &BigInt) -> BigInt;
11391118
}
11401119
11411120
impl<R: Rng> RandBigInt for R {
1121+
/// Generate a random BigUint of the given bit size.
11421122
fn gen_biguint(&mut self, bit_size: uint) -> BigUint {
11431123
let (digits, rem) = bit_size.div_rem(&BigDigit::bits);
11441124
let mut data = vec::with_capacity(digits+1);
@@ -1152,6 +1132,7 @@ impl<R: Rng> RandBigInt for R {
11521132
return BigUint::new(data);
11531133
}
11541134
1135+
/// Generate a random BigInt of the given bit size.
11551136
fn gen_bigint(&mut self, bit_size: uint) -> BigInt {
11561137
// Generate a random BigUint...
11571138
let biguint = self.gen_biguint(bit_size);
@@ -1173,32 +1154,6 @@ impl<R: Rng> RandBigInt for R {
11731154
};
11741155
return BigInt::from_biguint(sign, biguint);
11751156
}
1176-
1177-
fn gen_biguint_below(&mut self, bound: &BigUint) -> BigUint {
1178-
assert!(!bound.is_zero());
1179-
let bits = bound.bits();
1180-
loop {
1181-
let n = self.gen_biguint(bits);
1182-
if n < *bound { return n; }
1183-
}
1184-
}
1185-
1186-
fn gen_biguint_range(&mut self,
1187-
lbound: &BigUint,
1188-
ubound: &BigUint)
1189-
-> BigUint {
1190-
assert!(*lbound < *ubound);
1191-
return *lbound + self.gen_biguint_below(&(*ubound - *lbound));
1192-
}
1193-
1194-
fn gen_bigint_range(&mut self,
1195-
lbound: &BigInt,
1196-
ubound: &BigInt)
1197-
-> BigInt {
1198-
assert!(*lbound < *ubound);
1199-
let delta = (*ubound - *lbound).to_biguint();
1200-
return *lbound + self.gen_biguint_below(&delta).to_bigint();
1201-
}
12021157
}
12031158
12041159
impl BigInt {
@@ -1825,63 +1780,12 @@ mod biguint_tests {
18251780
check(30, "265252859812191058636308480000000");
18261781
}
18271782

1828-
#[test]
1829-
fn test_bits() {
1830-
assert_eq!(BigUint::new(~[0,0,0,0]).bits(), 0);
1831-
assert_eq!(BigUint::from_uint(0).bits(), 0);
1832-
assert_eq!(BigUint::from_uint(1).bits(), 1);
1833-
assert_eq!(BigUint::from_uint(3).bits(), 2);
1834-
let n: BigUint = FromStrRadix::from_str_radix("4000000000", 16).unwrap();
1835-
assert_eq!(n.bits(), 39);
1836-
let one: BigUint = One::one();
1837-
assert_eq!((one << 426).bits(), 427);
1838-
}
1839-
18401783
#[test]
18411784
fn test_rand() {
18421785
let mut rng = task_rng();
18431786
let _n: BigUint = rng.gen_biguint(137);
18441787
assert!(rng.gen_biguint(0).is_zero());
18451788
}
1846-
1847-
#[test]
1848-
fn test_rand_range() {
1849-
let mut rng = task_rng();
1850-
1851-
do 10.times {
1852-
assert_eq!(rng.gen_bigint_range(&BigInt::from_uint(236),
1853-
&BigInt::from_uint(237)),
1854-
BigInt::from_uint(236));
1855-
}
1856-
1857-
let l = BigUint::from_uint(403469000 + 2352);
1858-
let u = BigUint::from_uint(403469000 + 3513);
1859-
do 1000.times {
1860-
let n: BigUint = rng.gen_biguint_below(&u);
1861-
assert!(n < u);
1862-
1863-
let n: BigUint = rng.gen_biguint_range(&l, &u);
1864-
assert!(n >= l);
1865-
assert!(n < u);
1866-
}
1867-
}
1868-
1869-
#[test]
1870-
#[should_fail]
1871-
fn test_zero_rand_range() {
1872-
task_rng().gen_biguint_range(&BigUint::from_uint(54),
1873-
&BigUint::from_uint(54));
1874-
}
1875-
1876-
#[test]
1877-
#[should_fail]
1878-
fn test_negative_rand_range() {
1879-
let mut rng = task_rng();
1880-
let l = BigUint::from_uint(2352);
1881-
let u = BigUint::from_uint(3513);
1882-
// Switching u and l should fail:
1883-
let _n: BigUint = rng.gen_biguint_range(&u, &l);
1884-
}
18851789
}
18861790

18871791
#[cfg(test)]
@@ -2333,48 +2237,6 @@ mod bigint_tests {
23332237
let _n: BigInt = rng.gen_bigint(137);
23342238
assert!(rng.gen_bigint(0).is_zero());
23352239
}
2336-
2337-
#[test]
2338-
fn test_rand_range() {
2339-
let mut rng = task_rng();
2340-
2341-
do 10.times {
2342-
assert_eq!(rng.gen_bigint_range(&BigInt::from_uint(236),
2343-
&BigInt::from_uint(237)),
2344-
BigInt::from_uint(236));
2345-
}
2346-
2347-
fn check(l: BigInt, u: BigInt) {
2348-
let mut rng = task_rng();
2349-
do 1000.times {
2350-
let n: BigInt = rng.gen_bigint_range(&l, &u);
2351-
assert!(n >= l);
2352-
assert!(n < u);
2353-
}
2354-
}
2355-
let l = BigInt::from_uint(403469000 + 2352);
2356-
let u = BigInt::from_uint(403469000 + 3513);
2357-
check( l.clone(), u.clone());
2358-
check(-l.clone(), u.clone());
2359-
check(-u.clone(), -l.clone());
2360-
}
2361-
2362-
#[test]
2363-
#[should_fail]
2364-
fn test_zero_rand_range() {
2365-
task_rng().gen_bigint_range(&IntConvertible::from_int(54),
2366-
&IntConvertible::from_int(54));
2367-
}
2368-
2369-
#[test]
2370-
#[should_fail]
2371-
fn test_negative_rand_range() {
2372-
let mut rng = task_rng();
2373-
let l = BigInt::from_uint(2352);
2374-
let u = BigInt::from_uint(3513);
2375-
// Switching u and l should fail:
2376-
let _n: BigInt = rng.gen_bigint_range(&u, &l);
2377-
}
23782240
}
23792241

23802242
#[cfg(test)]

0 commit comments

Comments
 (0)