Skip to content

Commit 912ab9a

Browse files
committed
---
yaml --- r: 129524 b: refs/heads/snap-stage3 c: 17f79af h: refs/heads/master v: v3
1 parent 12d6d96 commit 912ab9a

Some content is hidden

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

45 files changed

+451
-127
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: d363770851650d9e137d628de2efeb90b3154bb0
4+
refs/heads/snap-stage3: 17f79af31c4d413352a967b6cfe9ba7d70f66ff7
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-5]*)
644+
(3.[2-6]*)
639645
msg "found ok version of LLVM: $LLVM_VERSION"
640646
;;
641647
(*)

branches/snap-stage3/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/snap-stage3/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/snap-stage3/src/doc/guide.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2021,7 +2021,7 @@ And trying it out:
20212021
```{notrust,ignore}
20222022
$ cargo build
20232023
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2024-
$ ./target/guessing_game
2024+
$ ./target/guessing_game
20252025
Guess the number!
20262026
The secret number is: 57
20272027
Please input your guess.
@@ -2292,7 +2292,7 @@ print an error message and return. Let's give this a shot:
22922292
```{notrust,ignore}
22932293
$ cargo build
22942294
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2295-
$ ./target/guessing_game
2295+
$ ./target/guessing_game
22962296
Guess the number!
22972297
The secret number is: 17
22982298
Please input your guess.
@@ -2358,11 +2358,11 @@ Let's try it!
23582358
```{notrust,ignore}
23592359
$ cargo build
23602360
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2361-
$ ./target/guessing_game
2361+
$ ./target/guessing_game
23622362
Guess the number!
23632363
The secret number is: 58
23642364
Please input your guess.
2365-
76
2365+
76
23662366
You guessed: 76
23672367
Too big!
23682368
$
@@ -2436,7 +2436,7 @@ that `return`? If we give a non-number answer, we'll `return` and quit. Observe:
24362436
```{notrust,ignore}
24372437
$ cargo build
24382438
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2439-
$ ./target/guessing_game
2439+
$ ./target/guessing_game
24402440
Guess the number!
24412441
The secret number is: 59
24422442
Please input your guess.
@@ -2569,7 +2569,7 @@ Now we should be good! Let's try:
25692569
```{rust,ignore}
25702570
$ cargo build
25712571
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2572-
$ ./target/guessing_game
2572+
$ ./target/guessing_game
25732573
Guess the number!
25742574
The secret number is: 61
25752575
Please input your guess.
@@ -3325,7 +3325,8 @@ To do that, we'll need to make a new module. Make a new file, `src/lib.rs`,
33253325
and put this in it:
33263326

33273327
```{rust}
3328-
fn add_three_times_four(x: int) -> int {
3328+
# fn main() {}
3329+
pub fn add_three_times_four(x: int) -> int {
33293330
(x + 3) * 4
33303331
}
33313332
```
@@ -3717,18 +3718,18 @@ That's a lot to take in. It's also one of the _most_ important concepts in
37173718
all of Rust. Let's see this syntax in action:
37183719

37193720
```{rust}
3720-
{
3721+
{
37213722
let x = 5i; // x is the owner of this integer, which is memory on the stack.
37223723
37233724
// other code here...
3724-
3725+
37253726
} // privilege 1: when x goes out of scope, this memory is deallocated
37263727
37273728
/// this function borrows an integer. It's given back automatically when the
37283729
/// function returns.
3729-
fn foo(x: &int) -> &int { x }
3730+
fn foo(x: &int) -> &int { x }
37303731
3731-
{
3732+
{
37323733
let x = 5i; // x is the owner of this integer, which is memory on the stack.
37333734
37343735
// privilege 2: you may lend that resource, to as many borrowers as you'd like
@@ -3738,14 +3739,14 @@ fn foo(x: &int) -> &int { x }
37383739
foo(&x); // functions can borrow too!
37393740
37403741
let a = &x; // we can do this alllllll day!
3741-
}
3742+
}
37423743
3743-
{
3744+
{
37443745
let mut x = 5i; // x is the owner of this integer, which is memory on the stack.
37453746
37463747
let y = &mut x; // privilege 3: you may lend that resource to a single borrower,
37473748
// mutably
3748-
}
3749+
}
37493750
```
37503751

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

45364537
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
4538+
as many values as the iterator will give it, and returns a collection
45384539
of the results. So why won't this compile? Rust can't determine what
45394540
type of things you want to collect, and so you need to let it know.
45404541
Here's the version that does compile:
@@ -5507,7 +5508,7 @@ fn main() {
55075508
}
55085509
```
55095510

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

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`
5534+
Rust has support for FFI (which you can read about in the [FFI
5535+
Guide](guide-ffi.html)), but can't guarantee that the C code will be safe.
5536+
Therefore, Rust marks such functions with the `unsafe`
55365537
keyword, which indicates that the function may not behave properly.
55375538

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

branches/snap-stage3/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/snap-stage3/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/snap-stage3/src/liballoc/heap.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ mod imp {
208208

209209
#[cfg(not(jemalloc), unix)]
210210
mod imp {
211+
use core::cmp;
211212
use core::mem;
212213
use core::ptr;
213214
use libc;
@@ -248,7 +249,7 @@ mod imp {
248249
pub unsafe fn reallocate(ptr: *mut u8, size: uint, align: uint,
249250
old_size: uint) -> *mut u8 {
250251
let new_ptr = allocate(size, align);
251-
ptr::copy_memory(new_ptr, ptr as *const u8, old_size);
252+
ptr::copy_memory(new_ptr, ptr as *const u8, cmp::min(size, old_size));
252253
deallocate(ptr, old_size, align);
253254
return new_ptr;
254255
}

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -529,10 +529,9 @@ 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>>(iter: Iter) -> PriorityQueue<T> {
533-
let mut q = PriorityQueue::new();
534-
q.extend(iter);
535-
q
532+
fn from_iter<Iter: Iterator<T>>(mut iter: Iter) -> PriorityQueue<T> {
533+
let vec: Vec<T> = iter.collect();
534+
PriorityQueue::from_vec(vec)
536535
}
537536
}
538537

0 commit comments

Comments
 (0)