Skip to content

Commit 444b5cc

Browse files
committed
---
yaml --- r: 129515 b: refs/heads/snap-stage3 c: bbc6633 h: refs/heads/master i: 129513: caa74b3 129511: 714446c v: v3
1 parent 6bb9ab7 commit 444b5cc

File tree

11 files changed

+41
-271
lines changed

11 files changed

+41
-271
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: 16d538cba0cc5b5830e7c17663e985d13ece8e0c
4+
refs/heads/snap-stage3: bbc66332fe8b966770290f784045b9757d66d126
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
74+
$ ./configure --build=i686-pc-mingw32
7575
$ make && make install
7676

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

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

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

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

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

209209
#[cfg(not(jemalloc), unix)]
210210
mod imp {
211-
use core::cmp;
212211
use core::mem;
213212
use core::ptr;
214213
use libc;
@@ -249,7 +248,7 @@ mod imp {
249248
pub unsafe fn reallocate(ptr: *mut u8, size: uint, align: uint,
250249
old_size: uint) -> *mut u8 {
251250
let new_ptr = allocate(size, align);
252-
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);
253252
deallocate(ptr, old_size, align);
254253
return new_ptr;
255254
}

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

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,13 +1717,6 @@ pub trait StrSlice<'a> {
17171717
fn utf16_units(&self) -> Utf16CodeUnits<'a>;
17181718
}
17191719

1720-
#[inline(never)]
1721-
fn slice_error_fail(s: &str, begin: uint, end: uint) -> ! {
1722-
assert!(begin <= end);
1723-
fail!("index {} and/or {} in `{}` do not lie on character boundary",
1724-
begin, end, s);
1725-
}
1726-
17271720
impl<'a> StrSlice<'a> for &'a str {
17281721
#[inline]
17291722
fn contains<'a>(&self, needle: &'a str) -> bool {
@@ -1827,34 +1820,22 @@ impl<'a> StrSlice<'a> for &'a str {
18271820

18281821
#[inline]
18291822
fn slice(&self, begin: uint, end: uint) -> &'a str {
1830-
// is_char_boundary checks that the index is in [0, .len()]
1831-
if begin <= end &&
1832-
self.is_char_boundary(begin) &&
1833-
self.is_char_boundary(end) {
1834-
unsafe { raw::slice_unchecked(*self, begin, end) }
1835-
} else {
1836-
slice_error_fail(*self, begin, end)
1837-
}
1823+
assert!(self.is_char_boundary(begin) && self.is_char_boundary(end),
1824+
"index {} and/or {} in `{}` do not lie on character boundary", begin,
1825+
end, *self);
1826+
unsafe { raw::slice_bytes(*self, begin, end) }
18381827
}
18391828

18401829
#[inline]
18411830
fn slice_from(&self, begin: uint) -> &'a str {
1842-
// is_char_boundary checks that the index is in [0, .len()]
1843-
if self.is_char_boundary(begin) {
1844-
unsafe { raw::slice_unchecked(*self, begin, self.len()) }
1845-
} else {
1846-
slice_error_fail(*self, begin, self.len())
1847-
}
1831+
self.slice(begin, self.len())
18481832
}
18491833

18501834
#[inline]
18511835
fn slice_to(&self, end: uint) -> &'a str {
1852-
// is_char_boundary checks that the index is in [0, .len()]
1853-
if self.is_char_boundary(end) {
1854-
unsafe { raw::slice_unchecked(*self, 0, end) }
1855-
} else {
1856-
slice_error_fail(*self, 0, end)
1857-
}
1836+
assert!(self.is_char_boundary(end), "index {} in `{}` does not lie on \
1837+
a character boundary", end, *self);
1838+
unsafe { raw::slice_bytes(*self, 0, end) }
18581839
}
18591840

18601841
fn slice_chars(&self, begin: uint, end: uint) -> &'a str {
@@ -1929,10 +1910,9 @@ impl<'a> StrSlice<'a> for &'a str {
19291910
#[inline]
19301911
fn is_char_boundary(&self, index: uint) -> bool {
19311912
if index == self.len() { return true; }
1932-
match self.as_bytes().get(index) {
1933-
None => false,
1934-
Some(&b) => b < 128u8 || b >= 192u8,
1935-
}
1913+
if index > self.len() { return false; }
1914+
let b = self.as_bytes()[index];
1915+
return b < 128u8 || b >= 192u8;
19361916
}
19371917

19381918
#[inline]

branches/snap-stage3/src/librustc/back/link.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,13 @@ pub mod write {
536536
llvm::LLVMPassManagerBuilderPopulateFunctionPassManager(builder, fpm);
537537
llvm::LLVMPassManagerBuilderPopulateModulePassManager(builder, mpm);
538538
llvm::LLVMPassManagerBuilderDispose(builder);
539+
540+
match opt {
541+
llvm::CodeGenLevelDefault | llvm::CodeGenLevelAggressive => {
542+
"mergefunc".with_c_str(|s| llvm::LLVMRustAddPass(mpm, s));
543+
}
544+
_ => {}
545+
};
539546
}
540547
}
541548

branches/snap-stage3/src/libstd/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ macro_rules! fail(
9696
macro_rules! assert(
9797
($cond:expr) => (
9898
if !$cond {
99-
fail!(concat!("assertion failed: ", stringify!($cond)))
99+
fail!("assertion failed: {:s}", stringify!($cond))
100100
}
101101
);
102102
($cond:expr, $($arg:expr),+) => (

branches/snap-stage3/src/libunicode/u_char.rs

Lines changed: 10 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,7 @@ use tables::{derived_property, property, general_category, conversions, charwidt
2020

2121
/// Returns whether the specified `char` is considered a Unicode alphabetic
2222
/// code point
23-
pub fn is_alphabetic(c: char) -> bool {
24-
match c {
25-
'a' .. 'z' | 'A' .. 'Z' => true,
26-
c if c > '\x7f' => derived_property::Alphabetic(c),
27-
_ => false
28-
}
29-
}
23+
pub fn is_alphabetic(c: char) -> bool { derived_property::Alphabetic(c) }
3024

3125
/// Returns whether the specified `char` satisfies the 'XID_Start' Unicode property
3226
///
@@ -50,27 +44,15 @@ pub fn is_XID_continue(c: char) -> bool { derived_property::XID_Continue(c) }
5044
/// This is defined according to the terms of the Unicode Derived Core Property 'Lowercase'.
5145
///
5246
#[inline]
53-
pub fn is_lowercase(c: char) -> bool {
54-
match c {
55-
'a' .. 'z' => true,
56-
c if c > '\x7f' => derived_property::Lowercase(c),
57-
_ => false
58-
}
59-
}
47+
pub fn is_lowercase(c: char) -> bool { derived_property::Lowercase(c) }
6048

6149
///
6250
/// Indicates whether a `char` is in upper case
6351
///
6452
/// This is defined according to the terms of the Unicode Derived Core Property 'Uppercase'.
6553
///
6654
#[inline]
67-
pub fn is_uppercase(c: char) -> bool {
68-
match c {
69-
'A' .. 'Z' => true,
70-
c if c > '\x7f' => derived_property::Uppercase(c),
71-
_ => false
72-
}
73-
}
55+
pub fn is_uppercase(c: char) -> bool { derived_property::Uppercase(c) }
7456

7557
///
7658
/// Indicates whether a `char` is whitespace
@@ -79,11 +61,10 @@ pub fn is_uppercase(c: char) -> bool {
7961
///
8062
#[inline]
8163
pub fn is_whitespace(c: char) -> bool {
82-
match c {
83-
' ' | '\x09' .. '\x0d' => true,
84-
c if c > '\x7f' => property::White_Space(c),
85-
_ => false
86-
}
64+
// As an optimization ASCII whitespace characters are checked separately
65+
c == ' '
66+
|| ('\x09' <= c && c <= '\x0d')
67+
|| property::White_Space(c)
8768
}
8869

8970
///
@@ -94,8 +75,8 @@ pub fn is_whitespace(c: char) -> bool {
9475
///
9576
#[inline]
9677
pub fn is_alphanumeric(c: char) -> bool {
97-
is_alphabetic(c)
98-
|| is_digit(c)
78+
derived_property::Alphabetic(c)
79+
|| general_category::N(c)
9980
}
10081

10182
///
@@ -110,11 +91,7 @@ pub fn is_control(c: char) -> bool { general_category::Cc(c) }
11091
/// Indicates whether the `char` is numeric (Nd, Nl, or No)
11192
#[inline]
11293
pub fn is_digit(c: char) -> bool {
113-
match c {
114-
'0' .. '9' => true,
115-
c if c > '\x7f' => general_category::N(c),
116-
_ => false
117-
}
94+
general_category::N(c)
11895
}
11996

12097
/// Convert a char to its uppercase equivalent

branches/snap-stage3/src/test/run-pass/cast-in-array-size.rs

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

0 commit comments

Comments
 (0)