Skip to content

Commit bf8653e

Browse files
committed
---
yaml --- r: 129263 b: refs/heads/master c: 673c555 h: refs/heads/master i: 129261: 4e68610 129259: 5fbde74 129255: a97b4f7 129247: 72d9624 v: v3
1 parent bc7bec8 commit bf8653e

File tree

331 files changed

+3052
-6161
lines changed

Some content is hidden

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

331 files changed

+3052
-6161
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 80b45ddbd351f0a4a939c3a3c4e20b4defec4b35
2+
refs/heads/master: 673c5554437fe50d8c45f71ad8f97e769591b038
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a86d9ad15e339ab343a12513f9c90556f677b9ca
55
refs/heads/try: 8af051e3f9a2f2b4bf3233bb26abae2a533e736e

trunk/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
74+
$ ./configure --build=i686-pc-mingw32
7575
$ make && make install
7676

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

trunk/configure

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

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
302+
MINGW32*)
309303
CFG_OSTYPE=pc-mingw32
310-
if [ "$MSYSTEM" = MINGW64 ]
311-
then
312-
CFG_CPUTYPE=x86_64
313-
CFG_OSTYPE=w64-mingw32
314-
fi
304+
;;
305+
306+
MINGW64*)
307+
# msys2, MSYSTEM=MINGW64
308+
CFG_OSTYPE=w64-mingw32
315309
;;
316310

317311
# Thad's Cygwin identifers below

trunk/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
}

trunk/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) {

trunk/src/doc/guide.md

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1801,6 +1801,7 @@ Let's try compiling what Cargo gave us:
18011801
```{bash}
18021802
$ cargo build
18031803
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
1804+
$
18041805
```
18051806

18061807
Excellent! Open up your `src/main.rs` again. We'll be writing all of
@@ -1816,6 +1817,7 @@ $ cargo run
18161817
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
18171818
Running `target/guessing_game`
18181819
Hello, world!
1820+
$
18191821
```
18201822

18211823
Great! The `run` command comes in handy when you need to rapidly iterate on a project.
@@ -1960,6 +1962,7 @@ fn main() {
19601962
```{notrust,ignore}
19611963
$ cargo build
19621964
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
1965+
$
19631966
```
19641967

19651968
Excellent! Try running our new program a few times:
@@ -2018,7 +2021,7 @@ And trying it out:
20182021
```{notrust,ignore}
20192022
$ cargo build
20202023
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2021-
$ ./target/guessing_game
2024+
$ ./target/guessing_game
20222025
Guess the number!
20232026
The secret number is: 57
20242027
Please input your guess.
@@ -2289,12 +2292,13 @@ print an error message and return. Let's give this a shot:
22892292
```{notrust,ignore}
22902293
$ cargo build
22912294
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2292-
$ ./target/guessing_game
2295+
$ ./target/guessing_game
22932296
Guess the number!
22942297
The secret number is: 17
22952298
Please input your guess.
22962299
5
22972300
Please input a number!
2301+
$
22982302
```
22992303

23002304
Uh, what? But we did!
@@ -2354,13 +2358,14 @@ Let's try it!
23542358
```{notrust,ignore}
23552359
$ cargo build
23562360
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2357-
$ ./target/guessing_game
2361+
$ ./target/guessing_game
23582362
Guess the number!
23592363
The secret number is: 58
23602364
Please input your guess.
2361-
76
2365+
76
23622366
You guessed: 76
23632367
Too big!
2368+
$
23642369
```
23652370

23662371
Nice! You can see I even added spaces before my guess, and it still figured
@@ -2431,7 +2436,7 @@ that `return`? If we give a non-number answer, we'll `return` and quit. Observe:
24312436
```{notrust,ignore}
24322437
$ cargo build
24332438
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2434-
$ ./target/guessing_game
2439+
$ ./target/guessing_game
24352440
Guess the number!
24362441
The secret number is: 59
24372442
Please input your guess.
@@ -2449,6 +2454,7 @@ You win!
24492454
Please input your guess.
24502455
quit
24512456
Please input a number!
2457+
$
24522458
```
24532459

24542460
Ha! `quit` actually quits. As does any other non-number input. Well, this is
@@ -2563,7 +2569,7 @@ Now we should be good! Let's try:
25632569
```{rust,ignore}
25642570
$ cargo build
25652571
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2566-
$ ./target/guessing_game
2572+
$ ./target/guessing_game
25672573
Guess the number!
25682574
The secret number is: 61
25692575
Please input your guess.
@@ -2765,6 +2771,7 @@ $ cargo run
27652771
Compiling modules v0.0.1 (file:///home/you/projects/modules)
27662772
Running `target/modules`
27672773
Hello, world!
2774+
$
27682775
```
27692776

27702777
Nice!
@@ -2916,6 +2923,7 @@ This should all compile as usual:
29162923
```{notrust,ignore}
29172924
$ cargo build
29182925
Compiling modules v0.0.1 (file:///home/you/projects/modules)
2926+
$
29192927
```
29202928

29212929
We've seen how the `::` operator can be used to call into modules, but when
@@ -3089,6 +3097,7 @@ $ cargo run
30893097
Compiling testing v0.0.1 (file:///home/you/projects/testing)
30903098
Running `target/testing`
30913099
Hello, world!
3100+
$
30923101
```
30933102

30943103
Great. Rust's infrastructure supports tests in two sorts of places, and they're
@@ -3241,6 +3250,7 @@ running 1 test
32413250
test foo ... ok
32423251
32433252
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
3253+
$
32443254
```
32453255

32463256
Nice! Our test passes, as we expected. Let's get rid of that warning for our `main`
@@ -3315,8 +3325,7 @@ To do that, we'll need to make a new module. Make a new file, `src/lib.rs`,
33153325
and put this in it:
33163326

33173327
```{rust}
3318-
# fn main() {}
3319-
pub fn add_three_times_four(x: int) -> int {
3328+
fn add_three_times_four(x: int) -> int {
33203329
(x + 3) * 4
33213330
}
33223331
```
@@ -3708,18 +3717,18 @@ That's a lot to take in. It's also one of the _most_ important concepts in
37083717
all of Rust. Let's see this syntax in action:
37093718

37103719
```{rust}
3711-
{
3720+
{
37123721
let x = 5i; // x is the owner of this integer, which is memory on the stack.
37133722
37143723
// other code here...
3715-
3724+
37163725
} // privilege 1: when x goes out of scope, this memory is deallocated
37173726
37183727
/// this function borrows an integer. It's given back automatically when the
37193728
/// function returns.
3720-
fn foo(x: &int) -> &int { x }
3729+
fn foo(x: &int) -> &int { x }
37213730
3722-
{
3731+
{
37233732
let x = 5i; // x is the owner of this integer, which is memory on the stack.
37243733
37253734
// privilege 2: you may lend that resource, to as many borrowers as you'd like
@@ -3729,14 +3738,14 @@ fn foo(x: &int) -> &int { x }
37293738
foo(&x); // functions can borrow too!
37303739
37313740
let a = &x; // we can do this alllllll day!
3732-
}
3741+
}
37333742
3734-
{
3743+
{
37353744
let mut x = 5i; // x is the owner of this integer, which is memory on the stack.
37363745
37373746
let y = &mut x; // privilege 3: you may lend that resource to a single borrower,
37383747
// mutably
3739-
}
3748+
}
37403749
```
37413750

37423751
If you are a borrower, you get a few privileges as well, but must also obey a
@@ -4525,7 +4534,7 @@ let one_to_one_hundred = range(0i, 100i).collect();
45254534
```
45264535

45274536
As you can see, we call `collect()` on our iterator. `collect()` takes
4528-
as many values as the iterator will give it, and returns a collection
4537+
as many values as the iterator will give it, and returns a collection
45294538
of the results. So why won't this compile? Rust can't determine what
45304539
type of things you want to collect, and so you need to let it know.
45314540
Here's the version that does compile:
@@ -5498,7 +5507,7 @@ fn main() {
54985507
}
54995508
```
55005509

5501-
Whew! This isn't too terrible. You can see that we still `let x = 5i`,
5510+
Whew! This isn't too terrible. You can see that we still `let x = 5i`,
55025511
but then things get a little bit hairy. Three more bindings get set: a
55035512
static format string, an argument vector, and the aruments. We then
55045513
invoke the `println_args` function with the generated arguments.
@@ -5521,9 +5530,9 @@ There are two circumstances where Rust's safety provisions don't work well.
55215530
The first is when interfacing with C code, and the second is when building
55225531
certain kinds of abstractions.
55235532

5524-
Rust has support for FFI (which you can read about in the [FFI
5525-
Guide](guide-ffi.html)), but can't guarantee that the C code will be safe.
5526-
Therefore, Rust marks such functions with the `unsafe`
5533+
Rust has support for FFI, (which you can read about in the [FFI
5534+
Guide](guide-ffi.html)) but Rust can't guarantee that the C code will be safe,
5535+
like Rust's will. Therefore, Rust marks such functions with the `unsafe`
55275536
keyword, which indicates that the function may not behave properly.
55285537

55295538
Second, if you'd like to create some sort of shared-memory data structure, Rust

trunk/src/etc/maketest.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@
1515
# msys1/msys2 automatically converts `/abs/path1:/abs/path2` into
1616
# `c:\real\abs\path1;c:\real\abs\path2` (semicolons) if shell thinks
1717
# the value is list of paths.
18-
# (if there is only one path, it becomes `c:/real/abs/path`.)
1918
# this causes great confusion and error: shell and Makefile doesn't like
2019
# windows paths so it is really error-prone. revert it for peace.
2120
def normalize_path(v):
21+
# c:\path -> /c/path
22+
if ':\\' in v:
23+
v = '/' + v.replace(':\\', '/')
2224
v = v.replace('\\', '/')
23-
# c:/path -> /c/path
24-
if ':/' in v:
25-
v = '/' + v.replace(':/', '/')
2625
return v
2726

2827

trunk/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

trunk/src/liballoc/heap.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
// FIXME: #13996: mark the `allocate` and `reallocate` return value as `noalias`
1313
// and `nonnull`
1414

15-
use core::ptr::RawPtr;
1615
#[cfg(not(test))] use core::raw;
1716
#[cfg(not(test))] use util;
1817

@@ -70,11 +69,6 @@ pub unsafe fn reallocate_inplace(ptr: *mut u8, size: uint, align: uint,
7069
/// the value returned by `usable_size` for the requested size.
7170
#[inline]
7271
pub unsafe fn deallocate(ptr: *mut u8, size: uint, align: uint) {
73-
// FIXME(14395) This is only required for DST ~[T], it should be removed once
74-
// we fix that representation to not use null pointers.
75-
if ptr.is_null() {
76-
return;
77-
}
7872
imp::deallocate(ptr, size, align)
7973
}
8074

@@ -214,7 +208,6 @@ mod imp {
214208

215209
#[cfg(not(jemalloc), unix)]
216210
mod imp {
217-
use core::cmp;
218211
use core::mem;
219212
use core::ptr;
220213
use libc;
@@ -255,7 +248,7 @@ mod imp {
255248
pub unsafe fn reallocate(ptr: *mut u8, size: uint, align: uint,
256249
old_size: uint) -> *mut u8 {
257250
let new_ptr = allocate(size, align);
258-
ptr::copy_memory(new_ptr, ptr as *const u8, cmp::min(size, old_size));
251+
ptr::copy_memory(new_ptr, ptr as *const u8, old_size);
259252
deallocate(ptr, old_size, align);
260253
return new_ptr;
261254
}

trunk/src/libcollections/bitv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2557,7 +2557,7 @@ mod tests {
25572557
}
25582558

25592559
fn rng() -> rand::IsaacRng {
2560-
let seed: &[_] = &[1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
2560+
let seed = &[1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
25612561
rand::SeedableRng::from_seed(seed)
25622562
}
25632563

trunk/src/libcollections/dlist.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,8 +1088,7 @@ mod tests {
10881088
let n = list_from([1i,2,3]);
10891089
spawn(proc() {
10901090
check_links(&n);
1091-
let a: &[_] = &[&1,&2,&3];
1092-
assert_eq!(a, n.iter().collect::<Vec<&int>>().as_slice());
1091+
assert_eq!(&[&1,&2,&3], n.iter().collect::<Vec<&int>>().as_slice());
10931092
});
10941093
}
10951094

0 commit comments

Comments
 (0)