Skip to content

Commit a4edeb8

Browse files
committed
---
yaml --- r: 129503 b: refs/heads/snap-stage3 c: a3d77e6 h: refs/heads/master i: 129501: 9c0d45b 129499: efded4e 129495: abc5845 129487: f5b8a03 129471: 444b485 v: v3
1 parent df8a2cd commit a4edeb8

Some content is hidden

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

47 files changed

+138
-341
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 566b470e138e929e8a93d613372db1ba177c494f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 1153ad3239dc1d5f08f2325ded25f5bb95872cb5
4+
refs/heads/snap-stage3: a3d77e616bb8455e158c22a379b655437916d404
55
refs/heads/try: 80b45ddbd351f0a4a939c3a3c4e20b4defec4b35
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ To easily build on windows we can use [MSYS2](http://sourceforge.net/projects/ms
7171
3. With that now start `mingw32_shell.bat` from where you installed MSYS2 (i.e. `C:\msys`).
7272
4. From there just navigate to where you have Rust's source code, configure and build it:
7373

74-
$ ./configure --build=i686-pc-mingw32
74+
$ ./configure
7575
$ make && make install
7676

7777
[repo]: https://github.com/rust-lang/rust

branches/snap-stage3/configure

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -299,13 +299,19 @@ case $CFG_OSTYPE in
299299
CFG_OSTYPE=apple-darwin
300300
;;
301301

302-
MINGW32*)
302+
MINGW*)
303+
# msys' `uname` does not print gcc configuration, but prints msys
304+
# configuration. so we cannot believe `uname -m`:
305+
# msys1 is always i686 and msys2 is always x86_64.
306+
# instead, msys defines $MSYSTEM which is MINGW32 on i686 and
307+
# MINGW64 on x86_64.
308+
CFG_CPUTYPE=i686
303309
CFG_OSTYPE=pc-mingw32
304-
;;
305-
306-
MINGW64*)
307-
# msys2, MSYSTEM=MINGW64
308-
CFG_OSTYPE=w64-mingw32
310+
if [ "$MSYSTEM" = MINGW64 ]
311+
then
312+
CFG_CPUTYPE=x86_64
313+
CFG_OSTYPE=w64-mingw32
314+
fi
309315
;;
310316

311317
# Thad's Cygwin identifers below
@@ -635,7 +641,7 @@ then
635641
LLVM_VERSION=$($LLVM_CONFIG --version)
636642

637643
case $LLVM_VERSION in
638-
(3.[2-6]*)
644+
(3.[2-5]*)
639645
msg "found ok version of LLVM: $LLVM_VERSION"
640646
;;
641647
(*)

branches/snap-stage3/src/compiletest/runtest.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use header;
1717
use procsrv;
1818
use util::logv;
1919
#[cfg(target_os = "windows")]
20+
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
2021
use util;
2122

2223
use std::io::File;
@@ -818,6 +819,7 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
818819
}).collect::<Vec<String> >();
819820

820821
#[cfg(target_os = "windows")]
822+
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
821823
fn to_lower( s : &str ) -> String {
822824
let i = s.chars();
823825
let c : Vec<char> = i.map( |c| {
@@ -831,6 +833,7 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
831833
}
832834

833835
#[cfg(target_os = "windows")]
836+
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
834837
fn prefix_matches( line : &str, prefix : &str ) -> bool {
835838
to_lower(line).as_slice().starts_with(to_lower(prefix).as_slice())
836839
}
@@ -1248,13 +1251,15 @@ fn make_cmdline(_libpath: &str, prog: &str, args: &[String]) -> String {
12481251
}
12491252

12501253
#[cfg(target_os = "windows")]
1254+
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
12511255
fn make_cmdline(libpath: &str, prog: &str, args: &[String]) -> String {
12521256
format!("{} {} {}", lib_path_cmd_prefix(libpath), prog, args.connect(" "))
12531257
}
12541258

12551259
// Build the LD_LIBRARY_PATH variable as it would be seen on the command line
12561260
// for diagnostic purposes
12571261
#[cfg(target_os = "windows")]
1262+
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
12581263
fn lib_path_cmd_prefix(path: &str) -> String {
12591264
format!("{}=\"{}\"", util::lib_path_env_var(), util::make_new_path(path))
12601265
}

branches/snap-stage3/src/compiletest/util.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use common::Config;
1212

1313
#[cfg(target_os = "windows")]
14+
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
1415
use std::os::getenv;
1516

1617
/// Conversion table from triple OS name to Rust SYSNAME
@@ -35,6 +36,7 @@ pub fn get_os(triple: &str) -> &'static str {
3536
}
3637

3738
#[cfg(target_os = "windows")]
39+
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
3840
pub fn make_new_path(path: &str) -> String {
3941

4042
// Windows just uses PATH as the library search path, so we have to
@@ -48,9 +50,11 @@ pub fn make_new_path(path: &str) -> String {
4850
}
4951

5052
#[cfg(target_os = "windows")]
53+
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
5154
pub fn lib_path_env_var() -> &'static str { "PATH" }
5255

5356
#[cfg(target_os = "windows")]
57+
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
5458
pub fn path_div() -> &'static str { ";" }
5559

5660
pub fn logv(config: &Config, s: String) {

branches/snap-stage3/src/doc/guide.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2896,11 +2896,9 @@ pub fn print_hello() {
28962896
}
28972897
```
28982898

2899-
When we include a module like this, we don't need to make the `mod` declaration
2900-
in `hello.rs`, because it's already been declared in `lib.rs`. `hello.rs` just
2901-
contains the body of the module which is defined (by the `pub mod hello`) in
2902-
`lib.rs`. This helps prevent 'rightward drift': when you end up indenting so
2903-
many times that your code is hard to read.
2899+
When we include a module like this, we don't need to make the `mod` declaration,
2900+
it's just understood. This helps prevent 'rightward drift': when you end up
2901+
indenting so many times that your code is hard to read.
29042902

29052903
Finally, make a new directory, `src/goodbye`, and make a new file in it,
29062904
`src/goodbye/mod.rs`:
@@ -3325,8 +3323,7 @@ To do that, we'll need to make a new module. Make a new file, `src/lib.rs`,
33253323
and put this in it:
33263324

33273325
```{rust}
3328-
# fn main() {}
3329-
pub fn add_three_times_four(x: int) -> int {
3326+
fn add_three_times_four(x: int) -> int {
33303327
(x + 3) * 4
33313328
}
33323329
```

branches/snap-stage3/src/etc/mklldeps.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ def run(args):
6868
]
6969

7070
f.write("#[cfg(" + ', '.join(cfg) + ")]\n")
71+
if os == "windows": # NOTE: Remove after snapshot
72+
f.write("#[cfg(stage0, target_arch = \"%s\", target_os = \"win32\")]\n" % (arch,))
7173

7274
version = run([llconfig, '--version']).strip()
7375

branches/snap-stage3/src/libarena/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ mod tests {
563563

564564
struct Noncopy {
565565
string: String,
566-
array: Vec<int>,
566+
array: Vec<int> ,
567567
}
568568

569569
#[test]

branches/snap-stage3/src/libcollections/bitv.rs

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2566,9 +2566,7 @@ mod tests {
25662566
let mut r = rng();
25672567
let mut bitv = 0 as uint;
25682568
b.iter(|| {
2569-
for _ in range(0u, 100) {
2570-
bitv |= 1 << ((r.next_u32() as uint) % uint::BITS);
2571-
}
2569+
bitv |= 1 << ((r.next_u32() as uint) % uint::BITS);
25722570
&bitv
25732571
})
25742572
}
@@ -2578,9 +2576,7 @@ mod tests {
25782576
let mut r = rng();
25792577
let mut bitv = Bitv::with_capacity(BENCH_BITS, false);
25802578
b.iter(|| {
2581-
for _ in range(0u, 100) {
2582-
bitv.set((r.next_u32() as uint) % BENCH_BITS, true);
2583-
}
2579+
bitv.set((r.next_u32() as uint) % BENCH_BITS, true);
25842580
&bitv
25852581
})
25862582
}
@@ -2590,9 +2586,7 @@ mod tests {
25902586
let mut r = rng();
25912587
let mut bitv = Bitv::with_capacity(uint::BITS, false);
25922588
b.iter(|| {
2593-
for _ in range(0u, 100) {
2594-
bitv.set((r.next_u32() as uint) % uint::BITS, true);
2595-
}
2589+
bitv.set((r.next_u32() as uint) % uint::BITS, true);
25962590
&bitv
25972591
})
25982592
}
@@ -2602,9 +2596,7 @@ mod tests {
26022596
let mut r = rng();
26032597
let mut bitv = BitvSet::new();
26042598
b.iter(|| {
2605-
for _ in range(0u, 100) {
2606-
bitv.insert((r.next_u32() as uint) % uint::BITS);
2607-
}
2599+
bitv.insert((r.next_u32() as uint) % uint::BITS);
26082600
&bitv
26092601
})
26102602
}
@@ -2614,9 +2606,7 @@ mod tests {
26142606
let mut r = rng();
26152607
let mut bitv = BitvSet::new();
26162608
b.iter(|| {
2617-
for _ in range(0u, 100) {
2618-
bitv.insert((r.next_u32() as uint) % BENCH_BITS);
2619-
}
2609+
bitv.insert((r.next_u32() as uint) % BENCH_BITS);
26202610
&bitv
26212611
})
26222612
}
@@ -2626,33 +2616,29 @@ mod tests {
26262616
let mut b1 = Bitv::with_capacity(BENCH_BITS, false);
26272617
let b2 = Bitv::with_capacity(BENCH_BITS, false);
26282618
b.iter(|| {
2629-
b1.union(&b2)
2619+
b1.union(&b2);
26302620
})
26312621
}
26322622

26332623
#[bench]
2634-
fn bench_bitv_small_iter(b: &mut Bencher) {
2624+
fn bench_btv_small_iter(b: &mut Bencher) {
26352625
let bitv = Bitv::with_capacity(uint::BITS, false);
26362626
b.iter(|| {
2637-
let mut sum = 0;
2638-
for _ in range(0u, 10) {
2639-
for pres in bitv.iter() {
2640-
sum += pres as uint;
2641-
}
2627+
let mut _sum = 0;
2628+
for pres in bitv.iter() {
2629+
_sum += pres as uint;
26422630
}
2643-
sum
26442631
})
26452632
}
26462633

26472634
#[bench]
26482635
fn bench_bitv_big_iter(b: &mut Bencher) {
26492636
let bitv = Bitv::with_capacity(BENCH_BITS, false);
26502637
b.iter(|| {
2651-
let mut sum = 0;
2638+
let mut _sum = 0;
26522639
for pres in bitv.iter() {
2653-
sum += pres as uint;
2640+
_sum += pres as uint;
26542641
}
2655-
sum
26562642
})
26572643
}
26582644

@@ -2661,11 +2647,10 @@ mod tests {
26612647
let bitv = BitvSet::from_bitv(from_fn(BENCH_BITS,
26622648
|idx| {idx % 3 == 0}));
26632649
b.iter(|| {
2664-
let mut sum = 0;
2650+
let mut _sum = 0;
26652651
for idx in bitv.iter() {
2666-
sum += idx;
2652+
_sum += idx;
26672653
}
2668-
sum
26692654
})
26702655
}
26712656
}

branches/snap-stage3/src/libcollections/priority_queue.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,9 +529,10 @@ impl<'a, T> Iterator<&'a T> for Items<'a, T> {
529529
}
530530

531531
impl<T: Ord> FromIterator<T> for PriorityQueue<T> {
532-
fn from_iter<Iter: Iterator<T>>(mut iter: Iter) -> PriorityQueue<T> {
533-
let vec: Vec<T> = iter.collect();
534-
PriorityQueue::from_vec(vec)
532+
fn from_iter<Iter: Iterator<T>>(iter: Iter) -> PriorityQueue<T> {
533+
let mut q = PriorityQueue::new();
534+
q.extend(iter);
535+
q
535536
}
536537
}
537538

branches/snap-stage3/src/libcore/str.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,6 @@ struct TwoWaySearcher {
419419
memory: uint
420420
}
421421

422-
// This is the Two-Way search algorithm, which was introduced in the paper:
423-
// Crochemore, M., Perrin, D., 1991, Two-way string-matching, Journal of the ACM 38(3):651-675.
424422
impl TwoWaySearcher {
425423
fn new(needle: &[u8]) -> TwoWaySearcher {
426424
let (critPos1, period1) = TwoWaySearcher::maximal_suffix(needle, false);
@@ -439,14 +437,7 @@ impl TwoWaySearcher {
439437
let byteset = needle.iter()
440438
.fold(0, |a, &b| (1 << ((b & 0x3f) as uint)) | a);
441439

442-
443-
// The logic here (calculating critPos and period, the final if statement to see which
444-
// period to use for the TwoWaySearcher) is essentially an implementation of the
445-
// "small-period" function from the paper (p. 670)
446-
//
447-
// In the paper they check whether `needle.slice_to(critPos)` is a suffix of
448-
// `needle.slice(critPos, critPos + period)`, which is precisely what this does
449-
if needle.slice_to(critPos) == needle.slice(period, period + critPos) {
440+
if needle.slice_to(critPos) == needle.slice_from(needle.len() - critPos) {
450441
TwoWaySearcher {
451442
critPos: critPos,
452443
period: period,
@@ -517,9 +508,6 @@ impl TwoWaySearcher {
517508
}
518509
}
519510

520-
// returns (i, p) where i is the "critical position", the starting index of
521-
// of maximal suffix, and p is the period of the suffix
522-
// see p. 668 of the paper
523511
#[inline]
524512
fn maximal_suffix(arr: &[u8], reversed: bool) -> (uint, uint) {
525513
let mut left = -1; // Corresponds to i in the paper

branches/snap-stage3/src/libcoretest/str.rs

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

11-
fn check_contains_all_substrings(s: &str) {
12-
assert!(s.contains(""));
13-
for i in range(0, s.len()) {
14-
for j in range(i+1, s.len() + 1) {
15-
assert!(s.contains(s.slice(i, j)));
16-
}
17-
}
18-
}
19-
2011
#[test]
2112
fn strslice_issue_16589() {
2213
assert!("bananas".contains("nana"));
23-
24-
// prior to the fix for #16589, x.contains("abcdabcd") returned false
25-
// test all substrings for good measure
26-
check_contains_all_substrings("012345678901234567890123456789bcdabcdabcd");
27-
}
28-
29-
30-
#[test]
31-
fn test_strslice_contains() {
32-
let x = "There are moments, Jeeves, when one asks oneself, 'Do trousers matter?'";
33-
check_contains_all_substrings(x);
3414
}

0 commit comments

Comments
 (0)