Skip to content

Commit b2404ae

Browse files
committed
---
yaml --- r: 110367 b: refs/heads/try c: 78af0f7 h: refs/heads/master i: 110365: 6bad2bf 110363: 5870c20 110359: 800aa69 110351: 0504179 110335: 34abb45 v: v3
1 parent e98c3c6 commit b2404ae

File tree

34 files changed

+123
-170
lines changed

34 files changed

+123
-170
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: e415c25bcd81dc1f9a5a3d25d9b48ed2d545336b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: c7fac4471201977fdb1c0c0a26c87287e12dc644
5-
refs/heads/try: f503f6c0b90e69425952ddc3ee3c6022be769ace
5+
refs/heads/try: 78af0f76368a521299b8bb2b9884d1a1eaaa9ca1
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/doc/guide-runtime.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,7 @@ into the pool of schedulers in order to spawn a new task.
216216

217217
With two implementations of the runtime available, a choice obviously needs to
218218
be made to see which will be used. The compiler itself will always by-default
219-
link to one of these runtimes. At the time of this writing, the default runtime
220-
is `libgreen` but in the future this will become `libnative`.
219+
link to one of these runtimes.
221220

222221
Having a default decision made in the compiler is done out of necessity and
223222
convenience. The compiler's decision of runtime to link to is *not* an

branches/try/src/libcollections/hashmap.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1600,12 +1600,12 @@ mod test_map {
16001600

16011601
#[deriving(Hash, Eq, TotalEq)]
16021602
struct Dropable {
1603-
k: uint
1603+
k: int
16041604
}
16051605

16061606

16071607
impl Dropable {
1608-
fn new(k: uint) -> Dropable {
1608+
fn new(k: int) -> Dropable {
16091609
local_data::get_mut(drop_vector,
16101610
|v| { v.unwrap().as_mut_slice()[k] += 1; });
16111611

@@ -1628,24 +1628,24 @@ mod test_map {
16281628
let mut m = HashMap::new();
16291629

16301630
local_data::get(drop_vector, |v| {
1631-
for i in range(0u, 200) {
1631+
for i in range(0, 200) {
16321632
assert_eq!(v.unwrap().as_slice()[i], 0);
16331633
}
16341634
});
16351635

1636-
for i in range(0u, 100) {
1636+
for i in range(0, 100) {
16371637
let d1 = Dropable::new(i);
16381638
let d2 = Dropable::new(i+100);
16391639
m.insert(d1, d2);
16401640
}
16411641

16421642
local_data::get(drop_vector, |v| {
1643-
for i in range(0u, 200) {
1643+
for i in range(0, 200) {
16441644
assert_eq!(v.unwrap().as_slice()[i], 1);
16451645
}
16461646
});
16471647

1648-
for i in range(0u, 50) {
1648+
for i in range(0, 50) {
16491649
let k = Dropable::new(i);
16501650
let v = m.pop(&k);
16511651

@@ -1658,20 +1658,20 @@ mod test_map {
16581658
}
16591659

16601660
local_data::get(drop_vector, |v| {
1661-
for i in range(0u, 50) {
1661+
for i in range(0, 50) {
16621662
assert_eq!(v.unwrap().as_slice()[i], 0);
16631663
assert_eq!(v.unwrap().as_slice()[i+100], 0);
16641664
}
16651665

1666-
for i in range(50u, 100) {
1666+
for i in range(50, 100) {
16671667
assert_eq!(v.unwrap().as_slice()[i], 1);
16681668
assert_eq!(v.unwrap().as_slice()[i+100], 1);
16691669
}
16701670
});
16711671
}
16721672

16731673
local_data::get(drop_vector, |v| {
1674-
for i in range(0u, 200) {
1674+
for i in range(0, 200) {
16751675
assert_eq!(v.unwrap().as_slice()[i], 0);
16761676
}
16771677
});

branches/try/src/libnative/io/timer_other.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ mod imp {
296296
}
297297

298298
pub fn fd_set(set: &mut fd_set, fd: i32) {
299-
set.fds_bits[(fd / 32) as uint] |= 1 << (fd % 32);
299+
set.fds_bits[fd / 32] |= 1 << (fd % 32);
300300
}
301301

302302
extern {
@@ -323,7 +323,7 @@ mod imp {
323323
}
324324

325325
pub fn fd_set(set: &mut fd_set, fd: i32) {
326-
set.fds_bits[(fd / 64) as uint] |= (1 << (fd % 64)) as u64;
326+
set.fds_bits[fd / 64] |= (1 << (fd % 64)) as u64;
327327
}
328328

329329
extern {

branches/try/src/libnative/io/timer_win32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ fn helper(input: libc::HANDLE, messages: Receiver<Req>) {
7878
}
7979
} else {
8080
let remove = {
81-
match &chans[idx as uint - 1] {
81+
match &chans[idx - 1] {
8282
&(ref c, oneshot) => !c.try_send(()) || oneshot
8383
}
8484
};

branches/try/src/libnum/complex.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ use std::num::{Zero,One,ToStrRadix};
2525
#[deriving(Eq,Clone)]
2626
pub struct Cmplx<T> {
2727
/// Real portion of the complex number
28-
pub re: T,
28+
re: T,
2929
/// Imaginary portion of the complex number
30-
pub im: T
30+
im: T
3131
}
3232

3333
pub type Complex32 = Cmplx<f32>;

branches/try/src/librand/isaac.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ impl IsaacRng {
103103
if use_rsl {
104104
macro_rules! memloop (
105105
($arr:expr) => {{
106-
for i in range_step(0, RAND_SIZE as uint, 8) {
106+
for i in range_step(0u32, RAND_SIZE, 8) {
107107
a+=$arr[i ]; b+=$arr[i+1];
108108
c+=$arr[i+2]; d+=$arr[i+3];
109109
e+=$arr[i+4]; f+=$arr[i+5];
@@ -120,7 +120,7 @@ impl IsaacRng {
120120
memloop!(self.rsl);
121121
memloop!(self.mem);
122122
} else {
123-
for i in range_step(0, RAND_SIZE as uint, 8) {
123+
for i in range_step(0u32, RAND_SIZE, 8) {
124124
mix!();
125125
self.mem[i ]=a; self.mem[i+1]=b;
126126
self.mem[i+2]=c; self.mem[i+3]=d;
@@ -143,7 +143,7 @@ impl IsaacRng {
143143
static MIDPOINT: uint = RAND_SIZE as uint / 2;
144144

145145
macro_rules! ind (($x:expr) => {
146-
self.mem[(($x >> 2) & (RAND_SIZE - 1)) as uint]
146+
self.mem[($x >> 2) & (RAND_SIZE - 1)]
147147
});
148148
macro_rules! rngstep(
149149
($j:expr, $shift:expr) => {{
@@ -188,7 +188,7 @@ impl Rng for IsaacRng {
188188
self.isaac();
189189
}
190190
self.cnt -= 1;
191-
self.rsl[self.cnt as uint]
191+
self.rsl[self.cnt]
192192
}
193193
}
194194

branches/try/src/librustc/middle/ty.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2602,13 +2602,6 @@ pub fn type_is_integral(ty: t) -> bool {
26022602
}
26032603
}
26042604

2605-
pub fn type_is_uint(ty: t) -> bool {
2606-
match get(ty).sty {
2607-
ty_infer(IntVar(_)) | ty_uint(ast::TyU) => true,
2608-
_ => false
2609-
}
2610-
}
2611-
26122605
pub fn type_is_char(ty: t) -> bool {
26132606
match get(ty).sty {
26142607
ty_char => true,
@@ -4365,7 +4358,7 @@ pub fn is_binopable(cx: &ctxt, ty: t, op: ast::BinOp) -> bool {
43654358
/*bot*/ [t, t, t, t, t, t, t, t],
43664359
/*raw ptr*/ [f, f, f, f, t, t, f, f]];
43674360

4368-
return tbl[tycat(cx, ty) as uint ][opcat(op) as uint];
4361+
return tbl[tycat(cx, ty)][opcat(op)];
43694362
}
43704363

43714364
pub fn ty_params_to_tys(tcx: &ctxt, generics: &ast::Generics) -> Vec<t> {

branches/try/src/librustc/middle/typeck/check/mod.rs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3151,7 +3151,7 @@ fn check_expr_with_unifier(fcx: &FnCtxt,
31513151
lvalue_pref, |base_t, _| ty::index(base_t));
31523152
match field_ty {
31533153
Some(mt) => {
3154-
check_expr_has_type(fcx, idx, ty::mk_uint());
3154+
require_integral(fcx, idx.span, idx_t);
31553155
fcx.write_ty(id, mt.ty);
31563156
fcx.write_autoderef_adjustment(base.id, autoderefs);
31573157
}
@@ -3195,15 +3195,6 @@ fn check_expr_with_unifier(fcx: &FnCtxt,
31953195
unifier();
31963196
}
31973197
3198-
pub fn require_uint(fcx: &FnCtxt, sp: Span, t: ty::t) {
3199-
if !type_is_uint(fcx, sp, t) {
3200-
fcx.type_error_message(sp, |actual| {
3201-
format!("mismatched types: expected `uint` type but found `{}`",
3202-
actual)
3203-
}, t, None);
3204-
}
3205-
}
3206-
32073198
pub fn require_integral(fcx: &FnCtxt, sp: Span, t: ty::t) {
32083199
if !type_is_integral(fcx, sp, t) {
32093200
fcx.type_error_message(sp, |actual| {
@@ -3863,11 +3854,6 @@ pub fn type_is_integral(fcx: &FnCtxt, sp: Span, typ: ty::t) -> bool {
38633854
return ty::type_is_integral(typ_s);
38643855
}
38653856

3866-
pub fn type_is_uint(fcx: &FnCtxt, sp: Span, typ: ty::t) -> bool {
3867-
let typ_s = structurally_resolved_type(fcx, sp, typ);
3868-
return ty::type_is_uint(typ_s);
3869-
}
3870-
38713857
pub fn type_is_scalar(fcx: &FnCtxt, sp: Span, typ: ty::t) -> bool {
38723858
let typ_s = structurally_resolved_type(fcx, sp, typ);
38733859
return ty::type_is_scalar(typ_s);

branches/try/src/librustuv/net.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ mod test {
791791
Ok(10) => {} e => fail!("{:?}", e),
792792
}
793793
for i in range(0, 10u8) {
794-
assert_eq!(buf[i as uint], i + 1);
794+
assert_eq!(buf[i], i + 1);
795795
}
796796
}
797797
Err(e) => fail!("{:?}", e)
@@ -827,7 +827,7 @@ mod test {
827827
Ok(10) => {} e => fail!("{:?}", e),
828828
}
829829
for i in range(0, 10u8) {
830-
assert_eq!(buf[i as uint], i + 1);
830+
assert_eq!(buf[i], i + 1);
831831
}
832832
}
833833
Err(e) => fail!("{:?}", e)
@@ -859,7 +859,7 @@ mod test {
859859
e => fail!("{:?}", e),
860860
}
861861
for i in range(0, 10u8) {
862-
assert_eq!(buf[i as uint], i + 1);
862+
assert_eq!(buf[i], i + 1);
863863
}
864864
}
865865
Err(e) => fail!("{:?}", e)
@@ -891,7 +891,7 @@ mod test {
891891
e => fail!("{:?}", e),
892892
}
893893
for i in range(0, 10u8) {
894-
assert_eq!(buf[i as uint], i + 1);
894+
assert_eq!(buf[i], i + 1);
895895
}
896896
}
897897
Err(e) => fail!("{:?}", e)

branches/try/src/libserialize/base64.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ impl<'a> ToBase64 for &'a [u8] {
9999
(self[i + 2] as u32);
100100

101101
// This 24-bit number gets separated into four 6-bit numbers.
102-
v.push(bytes[((n >> 18) & 63) as uint]);
103-
v.push(bytes[((n >> 12) & 63) as uint]);
104-
v.push(bytes[((n >> 6 ) & 63) as uint]);
105-
v.push(bytes[(n & 63) as uint]);
102+
v.push(bytes[(n >> 18) & 63]);
103+
v.push(bytes[(n >> 12) & 63]);
104+
v.push(bytes[(n >> 6 ) & 63]);
105+
v.push(bytes[n & 63]);
106106

107107
cur_length += 4;
108108
i += 3;
@@ -125,8 +125,8 @@ impl<'a> ToBase64 for &'a [u8] {
125125
0 => (),
126126
1 => {
127127
let n = (self[i] as u32) << 16;
128-
v.push(bytes[((n >> 18) & 63) as uint]);
129-
v.push(bytes[((n >> 12) & 63) as uint]);
128+
v.push(bytes[(n >> 18) & 63]);
129+
v.push(bytes[(n >> 12) & 63]);
130130
if config.pad {
131131
v.push('=' as u8);
132132
v.push('=' as u8);
@@ -135,9 +135,9 @@ impl<'a> ToBase64 for &'a [u8] {
135135
2 => {
136136
let n = (self[i] as u32) << 16 |
137137
(self[i + 1u] as u32) << 8;
138-
v.push(bytes[((n >> 18) & 63) as uint]);
139-
v.push(bytes[((n >> 12) & 63) as uint]);
140-
v.push(bytes[((n >> 6 ) & 63) as uint]);
138+
v.push(bytes[(n >> 18) & 63]);
139+
v.push(bytes[(n >> 12) & 63]);
140+
v.push(bytes[(n >> 6 ) & 63]);
141141
if config.pad {
142142
v.push('=' as u8);
143143
}

branches/try/src/libserialize/hex.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ impl<'a> ToHex for &'a [u8] {
4141
fn to_hex(&self) -> ~str {
4242
let mut v = slice::with_capacity(self.len() * 2);
4343
for &byte in self.iter() {
44-
v.push(CHARS[(byte >> 4) as uint]);
45-
v.push(CHARS[(byte & 0xf) as uint]);
44+
v.push(CHARS[byte >> 4]);
45+
v.push(CHARS[byte & 0xf]);
4646
}
4747

4848
unsafe {

branches/try/src/libstd/ascii.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,19 @@ impl Ascii {
4343
/// Convert to lowercase.
4444
#[inline]
4545
pub fn to_lower(self) -> Ascii {
46-
Ascii{chr: ASCII_LOWER_MAP[self.chr as uint]}
46+
Ascii{chr: ASCII_LOWER_MAP[self.chr]}
4747
}
4848

4949
/// Convert to uppercase.
5050
#[inline]
5151
pub fn to_upper(self) -> Ascii {
52-
Ascii{chr: ASCII_UPPER_MAP[self.chr as uint]}
52+
Ascii{chr: ASCII_UPPER_MAP[self.chr]}
5353
}
5454

5555
/// Compares two ascii characters of equality, ignoring case.
5656
#[inline]
5757
pub fn eq_ignore_case(self, other: Ascii) -> bool {
58-
ASCII_LOWER_MAP[self.chr as uint] == ASCII_LOWER_MAP[other.chr as uint]
58+
ASCII_LOWER_MAP[self.chr] == ASCII_LOWER_MAP[other.chr]
5959
}
6060

6161
// the following methods are like ctype, and the implementation is inspired by musl
@@ -370,12 +370,8 @@ impl<'a> StrAsciiExt for &'a str {
370370

371371
#[inline]
372372
fn eq_ignore_ascii_case(&self, other: &str) -> bool {
373-
self.len() == other.len() &&
374-
self.as_bytes().iter().zip(other.as_bytes().iter()).all(
375-
|(byte_self, byte_other)| {
376-
ASCII_LOWER_MAP[*byte_self as uint] ==
377-
ASCII_LOWER_MAP[*byte_other as uint]
378-
})
373+
self.len() == other.len() && self.as_bytes().iter().zip(other.as_bytes().iter()).all(
374+
|(byte_self, byte_other)| ASCII_LOWER_MAP[*byte_self] == ASCII_LOWER_MAP[*byte_other])
379375
}
380376
}
381377

@@ -396,15 +392,15 @@ unsafe fn str_map_bytes(string: ~str, map: &'static [u8]) -> ~str {
396392
let mut bytes = string.into_bytes();
397393

398394
for b in bytes.mut_iter() {
399-
*b = map[*b as uint];
395+
*b = map[*b];
400396
}
401397

402398
str::raw::from_utf8_owned(bytes)
403399
}
404400

405401
#[inline]
406402
unsafe fn str_copy_map_bytes(string: &str, map: &'static [u8]) -> ~str {
407-
let bytes = string.bytes().map(|b| map[b as uint]).collect::<~[_]>();
403+
let bytes = string.bytes().map(|b| map[b]).collect::<~[_]>();
408404

409405
str::raw::from_utf8_owned(bytes)
410406
}

branches/try/src/libstd/comm/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ pub use comm::select::{Select, Handle};
254254
macro_rules! test (
255255
{ fn $name:ident() $b:block $(#[$a:meta])*} => (
256256
mod $name {
257-
#![allow(unused_imports)]
257+
#[allow(unused_imports)];
258258

259259
use native;
260260
use comm::*;

branches/try/src/libstd/hash/sip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ mod tests {
432432
assert!(f == i && f == v);
433433

434434
buf.push(t as u8);
435-
state_inc.write_u8(t as u8);
435+
state_inc.write_u8(t);
436436

437437
t += 1;
438438
}

branches/try/src/libstd/io/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use sync::atomics::{AtomicUint, INIT_ATOMIC_UINT, Relaxed};
2121
macro_rules! iotest (
2222
{ fn $name:ident() $b:block $(#[$a:meta])* } => (
2323
mod $name {
24-
#![allow(unused_imports)]
24+
#[allow(unused_imports)];
2525

2626
use super::super::*;
2727
use super::*;

0 commit comments

Comments
 (0)