Skip to content

Commit ccad6e4

Browse files
committed
---
yaml --- r: 193277 b: refs/heads/beta c: 2fc6224 h: refs/heads/master i: 193275: ada8813 v: v3
1 parent c701972 commit ccad6e4

Some content is hidden

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

42 files changed

+220
-471
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: 85bdb313064eb799b8f0ed4946ff5443c8b9487d
34+
refs/heads/beta: 2fc62244113d01e9524ed712210ba52e8471e2a9
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: de8a23bbc3a7b9cbd7574b5b91a34af59bf030e6

branches/beta/configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ then
875875
| cut -d ' ' -f 2)
876876

877877
case $CFG_CLANG_VERSION in
878-
(3.2* | 3.3* | 3.4* | 3.5* | 3.6*)
878+
(3.0svn | 3.0 | 3.1* | 3.2* | 3.3* | 3.4* | 3.5* | 3.6*)
879879
step_msg "found ok version of CLANG: $CFG_CLANG_VERSION"
880880
if [ -z "$CC" ]
881881
then

branches/beta/src/libcollections/str.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,9 +1455,9 @@ pub trait StrExt: Index<RangeFull, Output = str> {
14551455
///
14561456
/// `is_cjk` determines behavior for characters in the Ambiguous category: if `is_cjk` is
14571457
/// `true`, these are 2 columns wide; otherwise, they are 1. In CJK locales, `is_cjk` should be
1458-
/// `true`, else it should be `false`.
1459-
/// [Unicode Standard Annex #11](http://www.unicode.org/reports/tr11/) recommends that these
1460-
/// characters be treated as 1 column (i.e., `is_cjk = false`) if the locale is unknown.
1458+
/// `true`, else it should be `false`. [Unicode Standard Annex
1459+
/// #11](http://www.unicode.org/reports/tr11/) recommends that these characters be treated as 1
1460+
/// column (i.e., `is_cjk` = `false`) if the locale is unknown.
14611461
#[unstable(feature = "collections",
14621462
reason = "this functionality may only be provided by libunicode")]
14631463
fn width(&self, is_cjk: bool) -> usize {

branches/beta/src/libcore/fmt/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ impl Display for char {
700700
impl<T> Pointer for *const T {
701701
fn fmt(&self, f: &mut Formatter) -> Result {
702702
f.flags |= 1 << (FlagV1::Alternate as u32);
703-
let ret = LowerHex::fmt(&(*self as usize), f);
703+
let ret = LowerHex::fmt(&(*self as u32), f);
704704
f.flags &= !(1 << (FlagV1::Alternate as u32));
705705
ret
706706
}

branches/beta/src/libcore/iter.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ use num::{ToPrimitive, Int};
6868
use ops::{Add, Deref, FnMut};
6969
use option::Option;
7070
use option::Option::{Some, None};
71-
use marker::Sized;
71+
use marker::{Send, Sized, Sync};
7272
use usize;
7373

7474
/// An interface for dealing with "external iterators". These types of iterators
@@ -1783,6 +1783,10 @@ pub struct Peekable<I: Iterator> {
17831783
peeked: Option<I::Item>,
17841784
}
17851785

1786+
// FIXME: after #22828 being fixed, the following unsafe impl should be removed
1787+
unsafe impl<I: Iterator> Sync for Peekable<I> where I: Sync, I::Item: Sync {}
1788+
unsafe impl<I: Iterator> Send for Peekable<I> where I: Send, I::Item: Send {}
1789+
17861790
impl<I: Iterator + Clone> Clone for Peekable<I> where I::Item: Clone {
17871791
fn clone(&self) -> Peekable<I> {
17881792
Peekable {

branches/beta/src/libcore/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
//! distribution.
4040
//!
4141
//! * `rust_begin_unwind` - This function takes three arguments, a
42-
//! `fmt::Arguments`, a `&str`, and a `usize`. These three arguments dictate
42+
//! `fmt::Arguments`, a `&str`, and a `uint`. These three arguments dictate
4343
//! the panic message, the file at which panic was invoked, and the line.
4444
//! It is up to consumers of this core library to define this panic
4545
//! function; it is only required to never return.
@@ -88,12 +88,14 @@ mod int_macros;
8888
#[macro_use]
8989
mod uint_macros;
9090

91+
#[path = "num/int.rs"] pub mod int;
9192
#[path = "num/isize.rs"] pub mod isize;
9293
#[path = "num/i8.rs"] pub mod i8;
9394
#[path = "num/i16.rs"] pub mod i16;
9495
#[path = "num/i32.rs"] pub mod i32;
9596
#[path = "num/i64.rs"] pub mod i64;
9697

98+
#[path = "num/uint.rs"] pub mod uint;
9799
#[path = "num/usize.rs"] pub mod usize;
98100
#[path = "num/u8.rs"] pub mod u8;
99101
#[path = "num/u16.rs"] pub mod u16;

branches/beta/src/libcore/num/int.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
//! Deprecated: replaced by `isize`.
12+
//!
13+
//! The rollout of the new type will gradually take place over the
14+
//! alpha cycle along with the development of clearer conventions
15+
//! around integer types.
16+
17+
#![unstable(feature = "core")]
18+
#![deprecated(since = "1.0.0", reason = "replaced by isize")]
19+
20+
#[cfg(target_pointer_width = "32")] int_module! { int, 32 }
21+
#[cfg(target_pointer_width = "64")] int_module! { int, 64 }

branches/beta/src/libcore/num/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,10 +372,9 @@ pub trait Int
372372
#[unstable(feature = "core",
373373
reason = "pending integer conventions")]
374374
#[inline]
375-
fn pow(self, mut exp: u32) -> Self {
375+
fn pow(self, mut exp: uint) -> Self {
376376
let mut base = self;
377377
let mut acc: Self = Int::one();
378-
379378
while exp > 0 {
380379
if (exp & 1) == 1 {
381380
acc = acc * base;

branches/beta/src/libcore/num/uint.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
//! Deprecated: replaced by `usize`.
12+
//!
13+
//! The rollout of the new type will gradually take place over the
14+
//! alpha cycle along with the development of clearer conventions
15+
//! around integer types.
16+
17+
#![unstable(feature = "core")]
18+
#![deprecated(since = "1.0.0", reason = "replaced by usize")]
19+
20+
uint_module! { uint, int, ::int::BITS }

branches/beta/src/libcoretest/iter.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use core::iter::*;
1212
use core::iter::order::*;
1313
use core::iter::MinMaxResult::*;
1414
use core::num::SignedInt;
15-
use core::usize;
15+
use core::uint;
1616
use core::cmp;
1717

1818
use test::Bencher;
@@ -292,7 +292,7 @@ fn test_unfoldr() {
292292
fn test_cycle() {
293293
let cycle_len = 3;
294294
let it = count(0, 1).take(cycle_len).cycle();
295-
assert_eq!(it.size_hint(), (usize::MAX, None));
295+
assert_eq!(it.size_hint(), (uint::MAX, None));
296296
for (i, x) in it.take(100).enumerate() {
297297
assert_eq!(i % cycle_len, x);
298298
}
@@ -365,19 +365,19 @@ fn test_iterator_size_hint() {
365365
let v2 = &[10, 11, 12];
366366
let vi = v.iter();
367367

368-
assert_eq!(c.size_hint(), (usize::MAX, None));
368+
assert_eq!(c.size_hint(), (uint::MAX, None));
369369
assert_eq!(vi.clone().size_hint(), (10, Some(10)));
370370

371371
assert_eq!(c.clone().take(5).size_hint(), (5, Some(5)));
372372
assert_eq!(c.clone().skip(5).size_hint().1, None);
373373
assert_eq!(c.clone().take_while(|_| false).size_hint(), (0, None));
374374
assert_eq!(c.clone().skip_while(|_| false).size_hint(), (0, None));
375-
assert_eq!(c.clone().enumerate().size_hint(), (usize::MAX, None));
376-
assert_eq!(c.clone().chain(vi.clone().cloned()).size_hint(), (usize::MAX, None));
375+
assert_eq!(c.clone().enumerate().size_hint(), (uint::MAX, None));
376+
assert_eq!(c.clone().chain(vi.clone().cloned()).size_hint(), (uint::MAX, None));
377377
assert_eq!(c.clone().zip(vi.clone()).size_hint(), (10, Some(10)));
378378
assert_eq!(c.clone().scan(0, |_,_| Some(0)).size_hint(), (0, None));
379379
assert_eq!(c.clone().filter(|_| false).size_hint(), (0, None));
380-
assert_eq!(c.clone().map(|_| 0).size_hint(), (usize::MAX, None));
380+
assert_eq!(c.clone().map(|_| 0).size_hint(), (uint::MAX, None));
381381
assert_eq!(c.filter_map(|_| Some(0)).size_hint(), (0, None));
382382

383383
assert_eq!(vi.clone().take(5).size_hint(), (5, Some(5)));
@@ -753,7 +753,7 @@ fn test_range() {
753753

754754
assert_eq!((0..100).size_hint(), (100, Some(100)));
755755
// this test is only meaningful when sizeof uint < sizeof u64
756-
assert_eq!((usize::MAX - 1..usize::MAX).size_hint(), (1, Some(1)));
756+
assert_eq!((uint::MAX - 1..uint::MAX).size_hint(), (1, Some(1)));
757757
assert_eq!((-10..-1).size_hint(), (9, Some(9)));
758758
assert_eq!((-1..-10).size_hint(), (0, Some(0)));
759759
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -8,9 +8,4 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![allow(dead_code)]
12-
13-
#[static_assert]
14-
static E: i32 = 1; //~ ERROR can only have static_assert on a static with type `bool`
15-
16-
fn main() {}
11+
int_module!(int, int);

branches/beta/src/libcoretest/num/int_macros.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ macro_rules! int_module { ($T:ty, $T_i:ident) => (
1212
#[cfg(test)]
1313
mod tests {
1414
use core::$T_i::*;
15-
use core::isize;
15+
use core::int;
1616
use core::num::{FromStrRadix, Int, SignedInt};
1717
use core::ops::{Shl, Shr, Not, BitXor, BitAnd, BitOr};
1818
use num;
@@ -153,7 +153,7 @@ mod tests {
153153
fn test_signed_checked_div() {
154154
assert!(10.checked_div(2) == Some(5));
155155
assert!(5.checked_div(0) == None);
156-
assert!(isize::MIN.checked_div(-1) == None);
156+
assert!(int::MIN.checked_div(-1) == None);
157157
}
158158

159159
#[test]
@@ -201,17 +201,6 @@ mod tests {
201201
assert_eq!(FromStrRadix::from_str_radix("Z", 35).ok(), None::<$T>);
202202
assert_eq!(FromStrRadix::from_str_radix("-9", 2).ok(), None::<$T>);
203203
}
204-
205-
#[test]
206-
fn test_pow() {
207-
let mut r = 2 as $T;
208-
209-
assert_eq!(r.pow(2u32), 4 as $T);
210-
assert_eq!(r.pow(0u32), 1 as $T);
211-
r = -2 as $T;
212-
assert_eq!(r.pow(2u32), 4 as $T);
213-
assert_eq!(r.pow(3u32), -8 as $T);
214-
}
215204
}
216205

217206
)}

branches/beta/src/libcoretest/num/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ mod i8;
2121
mod i16;
2222
mod i32;
2323
mod i64;
24+
mod int;
2425

2526
#[macro_use]
2627
mod uint_macros;
@@ -29,6 +30,7 @@ mod u8;
2930
mod u16;
3031
mod u32;
3132
mod u64;
33+
mod uint;
3234

3335
/// Helper function for testing numeric operations
3436
pub fn test_num<T>(ten: T, two: T) where
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
uint_module!(uint, uint);

branches/beta/src/libgetopts/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ fn test_split_within() {
963963
"little lamb".to_string(),
964964
"Little lamb".to_string()
965965
]);
966-
t("\nMary had a little lamb\nLittle lamb\n", ::std::usize::MAX,
966+
t("\nMary had a little lamb\nLittle lamb\n", ::std::uint::MAX,
967967
&["Mary had a little lamb\nLittle lamb".to_string()]);
968968
}
969969

branches/beta/src/librand/rand_impls.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@
1212
1313
use core::prelude::*;
1414
use core::char;
15-
use core::isize;
16-
use core::usize;
15+
use core::int;
16+
use core::uint;
1717

1818
use {Rand,Rng};
1919

20-
impl Rand for isize {
20+
impl Rand for int {
2121
#[inline]
22-
fn rand<R: Rng>(rng: &mut R) -> isize {
23-
if isize::BITS == 32 {
24-
rng.gen::<i32>() as isize
22+
fn rand<R: Rng>(rng: &mut R) -> int {
23+
if int::BITS == 32 {
24+
rng.gen::<i32>() as int
2525
} else {
26-
rng.gen::<i64>() as isize
26+
rng.gen::<i64>() as int
2727
}
2828
}
2929
}
@@ -56,13 +56,13 @@ impl Rand for i64 {
5656
}
5757
}
5858

59-
impl Rand for usize {
59+
impl Rand for uint {
6060
#[inline]
61-
fn rand<R: Rng>(rng: &mut R) -> usize {
62-
if usize::BITS == 32 {
63-
rng.gen::<u32>() as usize
61+
fn rand<R: Rng>(rng: &mut R) -> uint {
62+
if uint::BITS == 32 {
63+
rng.gen::<u32>() as uint
6464
} else {
65-
rng.gen::<u64>() as usize
65+
rng.gen::<u64>() as uint
6666
}
6767
}
6868
}

0 commit comments

Comments
 (0)