Skip to content

Commit dc72046

Browse files
committed
---
yaml --- r: 133052 b: refs/heads/dist-snap c: e61ec99 h: refs/heads/master v: v3
1 parent 1e219a1 commit dc72046

File tree

330 files changed

+6160
-3049
lines changed

Some content is hidden

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

330 files changed

+6160
-3049
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 457a3c991d79b971be07fce75f9d0c12848fb37c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 9eb9fcd71962fae50c63431d63caab923c68182e
9+
refs/heads/dist-snap: e61ec99af28584982652a3573d2455424e87a83f
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/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/dist-snap/configure

Lines changed: 12 additions & 6 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

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

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

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

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

835833
#[cfg(target_os = "windows")]
836-
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
837834
fn prefix_matches( line : &str, prefix : &str ) -> bool {
838835
to_lower(line).as_slice().starts_with(to_lower(prefix).as_slice())
839836
}
@@ -1251,15 +1248,13 @@ fn make_cmdline(_libpath: &str, prog: &str, args: &[String]) -> String {
12511248
}
12521249

12531250
#[cfg(target_os = "windows")]
1254-
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
12551251
fn make_cmdline(libpath: &str, prog: &str, args: &[String]) -> String {
12561252
format!("{} {} {}", lib_path_cmd_prefix(libpath), prog, args.connect(" "))
12571253
}
12581254

12591255
// Build the LD_LIBRARY_PATH variable as it would be seen on the command line
12601256
// for diagnostic purposes
12611257
#[cfg(target_os = "windows")]
1262-
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
12631258
fn lib_path_cmd_prefix(path: &str) -> String {
12641259
format!("{}=\"{}\"", util::lib_path_env_var(), util::make_new_path(path))
12651260
}

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

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

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

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

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

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

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

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

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

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

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1801,7 +1801,6 @@ 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-
$
18051804
```
18061805

18071806
Excellent! Open up your `src/main.rs` again. We'll be writing all of
@@ -1817,7 +1816,6 @@ $ cargo run
18171816
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
18181817
Running `target/guessing_game`
18191818
Hello, world!
1820-
$
18211819
```
18221820

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

19681965
Excellent! Try running our new program a few times:
@@ -2021,7 +2018,7 @@ And trying it out:
20212018
```{notrust,ignore}
20222019
$ cargo build
20232020
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2024-
$ ./target/guessing_game
2021+
$ ./target/guessing_game
20252022
Guess the number!
20262023
The secret number is: 57
20272024
Please input your guess.
@@ -2292,13 +2289,12 @@ print an error message and return. Let's give this a shot:
22922289
```{notrust,ignore}
22932290
$ cargo build
22942291
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2295-
$ ./target/guessing_game
2292+
$ ./target/guessing_game
22962293
Guess the number!
22972294
The secret number is: 17
22982295
Please input your guess.
22992296
5
23002297
Please input a number!
2301-
$
23022298
```
23032299

23042300
Uh, what? But we did!
@@ -2358,14 +2354,13 @@ Let's try it!
23582354
```{notrust,ignore}
23592355
$ cargo build
23602356
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2361-
$ ./target/guessing_game
2357+
$ ./target/guessing_game
23622358
Guess the number!
23632359
The secret number is: 58
23642360
Please input your guess.
2365-
76
2361+
76
23662362
You guessed: 76
23672363
Too big!
2368-
$
23692364
```
23702365

23712366
Nice! You can see I even added spaces before my guess, and it still figured
@@ -2436,7 +2431,7 @@ that `return`? If we give a non-number answer, we'll `return` and quit. Observe:
24362431
```{notrust,ignore}
24372432
$ cargo build
24382433
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2439-
$ ./target/guessing_game
2434+
$ ./target/guessing_game
24402435
Guess the number!
24412436
The secret number is: 59
24422437
Please input your guess.
@@ -2454,7 +2449,6 @@ You win!
24542449
Please input your guess.
24552450
quit
24562451
Please input a number!
2457-
$
24582452
```
24592453

24602454
Ha! `quit` actually quits. As does any other non-number input. Well, this is
@@ -2569,7 +2563,7 @@ Now we should be good! Let's try:
25692563
```{rust,ignore}
25702564
$ cargo build
25712565
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2572-
$ ./target/guessing_game
2566+
$ ./target/guessing_game
25732567
Guess the number!
25742568
The secret number is: 61
25752569
Please input your guess.
@@ -2771,7 +2765,6 @@ $ cargo run
27712765
Compiling modules v0.0.1 (file:///home/you/projects/modules)
27722766
Running `target/modules`
27732767
Hello, world!
2774-
$
27752768
```
27762769

27772770
Nice!
@@ -2923,7 +2916,6 @@ This should all compile as usual:
29232916
```{notrust,ignore}
29242917
$ cargo build
29252918
Compiling modules v0.0.1 (file:///home/you/projects/modules)
2926-
$
29272919
```
29282920

29292921
We've seen how the `::` operator can be used to call into modules, but when
@@ -3097,7 +3089,6 @@ $ cargo run
30973089
Compiling testing v0.0.1 (file:///home/you/projects/testing)
30983090
Running `target/testing`
30993091
Hello, world!
3100-
$
31013092
```
31023093

31033094
Great. Rust's infrastructure supports tests in two sorts of places, and they're
@@ -3250,7 +3241,6 @@ running 1 test
32503241
test foo ... ok
32513242
32523243
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
3253-
$
32543244
```
32553245

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

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

37193710
```{rust}
3720-
{
3711+
{
37213712
let x = 5i; // x is the owner of this integer, which is memory on the stack.
37223713
37233714
// other code here...
3724-
3715+
37253716
} // privilege 1: when x goes out of scope, this memory is deallocated
37263717
37273718
/// this function borrows an integer. It's given back automatically when the
37283719
/// function returns.
3729-
fn foo(x: &int) -> &int { x }
3720+
fn foo(x: &int) -> &int { x }
37303721
3731-
{
3722+
{
37323723
let x = 5i; // x is the owner of this integer, which is memory on the stack.
37333724
37343725
// privilege 2: you may lend that resource, to as many borrowers as you'd like
@@ -3738,14 +3729,14 @@ fn foo(x: &int) -> &int { x }
37383729
foo(&x); // functions can borrow too!
37393730
37403731
let a = &x; // we can do this alllllll day!
3741-
}
3732+
}
37423733
3743-
{
3734+
{
37443735
let mut x = 5i; // x is the owner of this integer, which is memory on the stack.
37453736
37463737
let y = &mut x; // privilege 3: you may lend that resource to a single borrower,
37473738
// mutably
3748-
}
3739+
}
37493740
```
37503741

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

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

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

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`
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`
55365527
keyword, which indicates that the function may not behave properly.
55375528

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

branches/dist-snap/src/etc/maketest.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@
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`.)
1819
# this causes great confusion and error: shell and Makefile doesn't like
1920
# windows paths so it is really error-prone. revert it for peace.
2021
def normalize_path(v):
21-
# c:\path -> /c/path
22-
if ':\\' in v:
23-
v = '/' + v.replace(':\\', '/')
2422
v = v.replace('\\', '/')
23+
# c:/path -> /c/path
24+
if ':/' in v:
25+
v = '/' + v.replace(':/', '/')
2526
return v
2627

2728

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ 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,))
7371

7472
version = run([llconfig, '--version']).strip()
7573

branches/dist-snap/src/liballoc/heap.rs

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

15+
use core::ptr::RawPtr;
1516
#[cfg(not(test))] use core::raw;
1617
#[cfg(not(test))] use util;
1718

@@ -69,6 +70,11 @@ pub unsafe fn reallocate_inplace(ptr: *mut u8, size: uint, align: uint,
6970
/// the value returned by `usable_size` for the requested size.
7071
#[inline]
7172
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+
}
7278
imp::deallocate(ptr, size, align)
7379
}
7480

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

209215
#[cfg(not(jemalloc), unix)]
210216
mod imp {
217+
use core::cmp;
211218
use core::mem;
212219
use core::ptr;
213220
use libc;
@@ -248,7 +255,7 @@ mod imp {
248255
pub unsafe fn reallocate(ptr: *mut u8, size: uint, align: uint,
249256
old_size: uint) -> *mut u8 {
250257
let new_ptr = allocate(size, align);
251-
ptr::copy_memory(new_ptr, ptr as *const u8, old_size);
258+
ptr::copy_memory(new_ptr, ptr as *const u8, cmp::min(size, old_size));
252259
deallocate(ptr, old_size, align);
253260
return new_ptr;
254261
}

branches/dist-snap/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

branches/dist-snap/src/libcollections/dlist.rs

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

0 commit comments

Comments
 (0)