Skip to content

Commit b4a43f3

Browse files
committed
Kill more isizes
1 parent 105bfd3 commit b4a43f3

File tree

197 files changed

+806
-807
lines changed

Some content is hidden

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

197 files changed

+806
-807
lines changed

src/doc/intro.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ Let's see an example. This Rust code will not compile:
424424
use std::thread::Thread;
425425
426426
fn main() {
427-
let mut numbers = vec![1is, 2, 3];
427+
let mut numbers = vec![1, 2, 3];
428428
429429
for i in 0..3 {
430430
Thread::spawn(move || {
@@ -478,7 +478,7 @@ use std::thread::Thread;
478478
use std::sync::{Arc,Mutex};
479479
480480
fn main() {
481-
let numbers = Arc::new(Mutex::new(vec![1is, 2, 3]));
481+
let numbers = Arc::new(Mutex::new(vec![1, 2, 3]));
482482
483483
for i in 0us..3 {
484484
let number = numbers.clone();
@@ -539,7 +539,7 @@ safety check that makes this an error about moved values:
539539
use std::thread::Thread;
540540
541541
fn main() {
542-
let vec = vec![1is, 2, 3];
542+
let vec = vec![1, 2, 3];
543543
544544
for i in 0us..3 {
545545
Thread::spawn(move || {

src/libcollections/dlist.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ impl<T> DList<T> {
333333
///
334334
/// let mut dl = DList::new();
335335
///
336-
/// dl.push_front(2is);
336+
/// dl.push_front(2);
337337
/// assert_eq!(dl.len(), 1);
338338
///
339339
/// dl.push_front(1);
@@ -360,10 +360,10 @@ impl<T> DList<T> {
360360
///
361361
/// let mut dl = DList::new();
362362
///
363-
/// dl.push_front(2is);
363+
/// dl.push_front(2);
364364
/// dl.push_front(1);
365365
/// assert_eq!(dl.len(), 2);
366-
/// assert_eq!(dl.front(), Some(&1is));
366+
/// assert_eq!(dl.front(), Some(&1));
367367
///
368368
/// dl.clear();
369369
/// assert_eq!(dl.len(), 0);
@@ -388,7 +388,7 @@ impl<T> DList<T> {
388388
/// assert_eq!(dl.front(), None);
389389
///
390390
/// dl.push_front(1);
391-
/// assert_eq!(dl.front(), Some(&1is));
391+
/// assert_eq!(dl.front(), Some(&1));
392392
///
393393
/// ```
394394
#[inline]
@@ -409,13 +409,13 @@ impl<T> DList<T> {
409409
/// assert_eq!(dl.front(), None);
410410
///
411411
/// dl.push_front(1);
412-
/// assert_eq!(dl.front(), Some(&1is));
412+
/// assert_eq!(dl.front(), Some(&1));
413413
///
414414
/// match dl.front_mut() {
415415
/// None => {},
416-
/// Some(x) => *x = 5is,
416+
/// Some(x) => *x = 5,
417417
/// }
418-
/// assert_eq!(dl.front(), Some(&5is));
418+
/// assert_eq!(dl.front(), Some(&5));
419419
///
420420
/// ```
421421
#[inline]
@@ -436,7 +436,7 @@ impl<T> DList<T> {
436436
/// assert_eq!(dl.back(), None);
437437
///
438438
/// dl.push_back(1);
439-
/// assert_eq!(dl.back(), Some(&1is));
439+
/// assert_eq!(dl.back(), Some(&1));
440440
///
441441
/// ```
442442
#[inline]
@@ -457,13 +457,13 @@ impl<T> DList<T> {
457457
/// assert_eq!(dl.back(), None);
458458
///
459459
/// dl.push_back(1);
460-
/// assert_eq!(dl.back(), Some(&1is));
460+
/// assert_eq!(dl.back(), Some(&1));
461461
///
462462
/// match dl.back_mut() {
463463
/// None => {},
464-
/// Some(x) => *x = 5is,
464+
/// Some(x) => *x = 5,
465465
/// }
466-
/// assert_eq!(dl.back(), Some(&5is));
466+
/// assert_eq!(dl.back(), Some(&5));
467467
///
468468
/// ```
469469
#[inline]
@@ -483,8 +483,8 @@ impl<T> DList<T> {
483483
///
484484
/// let mut dl = DList::new();
485485
///
486-
/// dl.push_front(2is);
487-
/// assert_eq!(dl.front().unwrap(), &2is);
486+
/// dl.push_front(2);
487+
/// assert_eq!(dl.front().unwrap(), &2);
488488
///
489489
/// dl.push_front(1);
490490
/// assert_eq!(dl.front().unwrap(), &1);
@@ -508,7 +508,7 @@ impl<T> DList<T> {
508508
/// let mut d = DList::new();
509509
/// assert_eq!(d.pop_front(), None);
510510
///
511-
/// d.push_front(1is);
511+
/// d.push_front(1);
512512
/// d.push_front(3);
513513
/// assert_eq!(d.pop_front(), Some(3));
514514
/// assert_eq!(d.pop_front(), Some(1));
@@ -568,7 +568,7 @@ impl<T> DList<T> {
568568
///
569569
/// let mut d = DList::new();
570570
///
571-
/// d.push_front(1is);
571+
/// d.push_front(1);
572572
/// d.push_front(2);
573573
/// d.push_front(3);
574574
///

src/libcoretest/hash/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ fn test_writer_hasher() {
5050
assert_eq!(hash(&5u16), 5);
5151
assert_eq!(hash(&5u32), 5);
5252
assert_eq!(hash(&5u64), 5);
53-
assert_eq!(hash(&5u), 5);
53+
assert_eq!(hash(&5us), 5);
5454

5555
assert_eq!(hash(&5i8), 5);
5656
assert_eq!(hash(&5i16), 5);
5757
assert_eq!(hash(&5i32), 5);
5858
assert_eq!(hash(&5i64), 5);
59-
assert_eq!(hash(&5), 5);
59+
assert_eq!(hash(&5is), 5);
6060

6161
assert_eq!(hash(&false), 0);
6262
assert_eq!(hash(&true), 1);
@@ -76,12 +76,12 @@ fn test_writer_hasher() {
7676
// FIXME (#18248) Add tests for hashing Rc<str> and Rc<[T]>
7777

7878
unsafe {
79-
let ptr: *const i32 = mem::transmute(5is);
79+
let ptr: *const i32 = mem::transmute(5us);
8080
assert_eq!(hash(&ptr), 5);
8181
}
8282

8383
unsafe {
84-
let ptr: *mut i32 = mem::transmute(5is);
84+
let ptr: *mut i32 = mem::transmute(5us);
8585
assert_eq!(hash(&ptr), 5);
8686
}
8787
}

src/libcoretest/iter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ fn test_iterator_size_hint() {
375375
assert_eq!(c.clone().enumerate().size_hint(), (uint::MAX, None));
376376
assert_eq!(c.clone().chain(vi.clone().map(|&i| i)).size_hint(), (uint::MAX, None));
377377
assert_eq!(c.clone().zip(vi.clone()).size_hint(), (10, Some(10)));
378-
assert_eq!(c.clone().scan(0i, |_,_| Some(0)).size_hint(), (0, None));
378+
assert_eq!(c.clone().scan(0, |_,_| Some(0)).size_hint(), (0, None));
379379
assert_eq!(c.clone().filter(|_| false).size_hint(), (0, None));
380380
assert_eq!(c.clone().map(|_| 0).size_hint(), (uint::MAX, None));
381381
assert_eq!(c.filter_map(|_| Some(0)).size_hint(), (0, None));
@@ -389,7 +389,7 @@ fn test_iterator_size_hint() {
389389
assert_eq!(vi.clone().enumerate().size_hint(), (10, Some(10)));
390390
assert_eq!(vi.clone().chain(v2.iter()).size_hint(), (13, Some(13)));
391391
assert_eq!(vi.clone().zip(v2.iter()).size_hint(), (3, Some(3)));
392-
assert_eq!(vi.clone().scan(0i, |_,_| Some(0)).size_hint(), (0, Some(10)));
392+
assert_eq!(vi.clone().scan(0, |_,_| Some(0)).size_hint(), (0, Some(10)));
393393
assert_eq!(vi.clone().filter(|_| false).size_hint(), (0, Some(10)));
394394
assert_eq!(vi.clone().map(|&i| i+1).size_hint(), (10, Some(10)));
395395
assert_eq!(vi.filter_map(|_| Some(0)).size_hint(), (0, Some(10)));

src/libcoretest/option.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ fn test_ord() {
223223
/* FIXME(#20575)
224224
#[test]
225225
fn test_collect() {
226-
let v: Option<Vec<int>> = (0..0).map(|_| Some(0i)).collect();
226+
let v: Option<Vec<int>> = (0..0).map(|_| Some(0)).collect();
227227
assert!(v == Some(vec![]));
228228
229229
let v: Option<Vec<int>> = (0..3).map(|x| Some(x)).collect();

src/libstd/collections/hash/set.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@ mod test_set {
11981198

11991199
#[test]
12001200
fn test_drain() {
1201-
let mut s: HashSet<int> = (1is..100).collect();
1201+
let mut s: HashSet<i32> = (1..100).collect();
12021202

12031203
// try this a bunch of times to make sure we don't screw up internal state.
12041204
for _ in 0..20 {
@@ -1217,7 +1217,7 @@ mod test_set {
12171217
for _ in s.iter() { panic!("s should be empty!"); }
12181218

12191219
// reset to try again.
1220-
s.extend(1is..100);
1220+
s.extend(1..100);
12211221
}
12221222
}
12231223
}

src/libstd/old_io/fs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,7 @@ mod test {
11011101
let dir = &tmpdir.join("di_readdir");
11021102
check!(mkdir(dir, old_io::USER_RWX));
11031103
let prefix = "foo";
1104-
for n in 0is..3 {
1104+
for n in 0..3 {
11051105
let f = dir.join(format!("{}.txt", n));
11061106
let mut w = check!(File::create(&f));
11071107
let msg_str = format!("{}{}", prefix, n);

src/libstd/old_io/net/tcp.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,7 @@ mod test {
11601160
tx.send(TcpStream::connect(addr).unwrap()).unwrap();
11611161
});
11621162
let _l = rx.recv().unwrap();
1163-
for i in 0is..1001 {
1163+
for i in 0i32..1001 {
11641164
match a.accept() {
11651165
Ok(..) => break,
11661166
Err(ref e) if e.kind == TimedOut => {}
@@ -1260,7 +1260,7 @@ mod test {
12601260
assert_eq!(s.read(&mut [0]).err().unwrap().kind, TimedOut);
12611261

12621262
s.set_timeout(Some(20));
1263-
for i in 0is..1001 {
1263+
for i in 0i32..1001 {
12641264
match s.write(&[0; 128 * 1024]) {
12651265
Ok(()) | Err(IoError { kind: ShortWrite(..), .. }) => {},
12661266
Err(IoError { kind: TimedOut, .. }) => break,
@@ -1318,7 +1318,7 @@ mod test {
13181318

13191319
let mut s = a.accept().unwrap();
13201320
s.set_write_timeout(Some(20));
1321-
for i in 0is..1001 {
1321+
for i in 0i32..1001 {
13221322
match s.write(&[0; 128 * 1024]) {
13231323
Ok(()) | Err(IoError { kind: ShortWrite(..), .. }) => {},
13241324
Err(IoError { kind: TimedOut, .. }) => break,

src/libsyntax/parse/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ pub fn byte_lit(lit: &str) -> (u8, usize) {
573573
if lit.len() == 1 {
574574
(lit.as_bytes()[0], 1)
575575
} else {
576-
assert!(lit.as_bytes()[0] == b'\\', err(0is));
576+
assert!(lit.as_bytes()[0] == b'\\', err(0));
577577
let b = match lit.as_bytes()[1] {
578578
b'"' => b'"',
579579
b'n' => b'\n',

src/libsyntax/print/pp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ pub fn mk_printer(out: Box<old_io::Writer+'static>, linewidth: usize) -> Printer
167167
let n: usize = 3 * linewidth;
168168
debug!("mk_printer {}", linewidth);
169169
let token: Vec<Token> = repeat(Token::Eof).take(n).collect();
170-
let size: Vec<isize> = repeat(0is).take(n).collect();
170+
let size: Vec<isize> = repeat(0).take(n).collect();
171171
let scan_stack: Vec<usize> = repeat(0us).take(n).collect();
172172
Printer {
173173
out: out,

src/libsyntax/util/small_vector.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,14 @@ mod test {
195195
let v: SmallVector<isize> = SmallVector::zero();
196196
assert_eq!(0, v.len());
197197

198-
assert_eq!(1, SmallVector::one(1is).len());
199-
assert_eq!(5, SmallVector::many(vec!(1is, 2, 3, 4, 5)).len());
198+
assert_eq!(1, SmallVector::one(1).len());
199+
assert_eq!(5, SmallVector::many(vec![1, 2, 3, 4, 5]).len());
200200
}
201201

202202
#[test]
203203
fn test_push_get() {
204204
let mut v = SmallVector::zero();
205-
v.push(1is);
205+
v.push(1);
206206
assert_eq!(1, v.len());
207207
assert_eq!(&1, v.get(0));
208208
v.push(2);
@@ -215,7 +215,7 @@ mod test {
215215

216216
#[test]
217217
fn test_from_iter() {
218-
let v: SmallVector<isize> = (vec![1is, 2, 3]).into_iter().collect();
218+
let v: SmallVector<isize> = (vec![1, 2, 3]).into_iter().collect();
219219
assert_eq!(3, v.len());
220220
assert_eq!(&1, v.get(0));
221221
assert_eq!(&2, v.get(1));
@@ -228,11 +228,11 @@ mod test {
228228
let v: Vec<isize> = v.into_iter().collect();
229229
assert_eq!(Vec::new(), v);
230230

231-
let v = SmallVector::one(1is);
232-
assert_eq!(vec!(1is), v.into_iter().collect::<Vec<_>>());
231+
let v = SmallVector::one(1);
232+
assert_eq!(vec![1], v.into_iter().collect::<Vec<_>>());
233233

234-
let v = SmallVector::many(vec!(1is, 2is, 3is));
235-
assert_eq!(vec!(1is, 2is, 3is), v.into_iter().collect::<Vec<_>>());
234+
let v = SmallVector::many(vec![1, 2, 3]);
235+
assert_eq!(vec!(1, 2, 3), v.into_iter().collect::<Vec<_>>());
236236
}
237237

238238
#[test]
@@ -244,12 +244,12 @@ mod test {
244244
#[test]
245245
#[should_fail]
246246
fn test_expect_one_many() {
247-
SmallVector::many(vec!(1is, 2)).expect_one("");
247+
SmallVector::many(vec!(1, 2)).expect_one("");
248248
}
249249

250250
#[test]
251251
fn test_expect_one_one() {
252-
assert_eq!(1is, SmallVector::one(1is).expect_one(""));
253-
assert_eq!(1is, SmallVector::many(vec!(1is)).expect_one(""));
252+
assert_eq!(1, SmallVector::one(1).expect_one(""));
253+
assert_eq!(1, SmallVector::many(vec!(1)).expect_one(""));
254254
}
255255
}

src/test/bench/shootout-meteor.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ impl<'a, T> Iterator for ListIterator<'a, T> {
104104
// corresponding mirrored piece), with, as minimum coordinates, (0,
105105
// 0). If all is false, only generate half of the possibilities (used
106106
// to break the symmetry of the board).
107-
fn transform(piece: Vec<(isize, isize)> , all: bool) -> Vec<Vec<(isize, isize)>> {
108-
let mut res: Vec<Vec<(isize, isize)>> =
107+
fn transform(piece: Vec<(i32, i32)> , all: bool) -> Vec<Vec<(i32, i32)>> {
108+
let mut res: Vec<Vec<(i32, i32)>> =
109109
// rotations
110110
iterate(piece, |rot| rot.iter().map(|&(y, x)| (x + y, -y)).collect())
111111
.take(if all {6} else {3})
@@ -133,7 +133,7 @@ fn transform(piece: Vec<(isize, isize)> , all: bool) -> Vec<Vec<(isize, isize)>>
133133
// Takes a piece with minimum coordinate (0, 0) (as generated by
134134
// transform). Returns the corresponding mask if p translated by (dy,
135135
// dx) is on the board.
136-
fn mask(dy: isize, dx: isize, id: usize, p: &Vec<(isize, isize)>) -> Option<u64> {
136+
fn mask(dy: i32, dx: i32, id: usize, p: &Vec<(i32, i32)>) -> Option<u64> {
137137
let mut m = 1 << (50 + id);
138138
for &(y, x) in p.iter() {
139139
let x = x + dx + (y + (dy % 2)) / 2;
@@ -164,12 +164,12 @@ fn make_masks() -> Vec<Vec<Vec<u64> > > {
164164
// To break the central symmetry of the problem, every
165165
// transformation must be taken except for one piece (piece 3
166166
// here).
167-
let transforms: Vec<Vec<Vec<(isize, isize)>>> =
167+
let transforms: Vec<Vec<Vec<(i32, i32)>>> =
168168
pieces.into_iter().enumerate()
169169
.map(|(id, p)| transform(p, id != 3))
170170
.collect();
171171

172-
(0is..50).map(|yx| {
172+
(0i32..50).map(|yx| {
173173
transforms.iter().enumerate().map(|(id, t)| {
174174
t.iter().filter_map(|p| mask(yx / 5, yx % 5, id, p)).collect()
175175
}).collect()

src/test/compile-fail/array-not-vector.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99
// except according to those terms.
1010

1111
fn main() {
12-
let _x: isize = [1is, 2, 3];
12+
let _x: i32 = [1i32, 2, 3];
1313
//~^ ERROR mismatched types
14-
//~| expected `isize`
15-
//~| found `[isize; 3]`
16-
//~| expected isize
14+
//~| expected `i32`
15+
//~| found `[i32; 3]`
16+
//~| expected i32
1717
//~| found array of 3 elements
1818

19-
let x: &[isize] = &[1, 2, 3];
20-
let _y: &isize = x;
19+
let x: &[i32] = &[1i32, 2, 3];
20+
let _y: &i32 = x;
2121
//~^ ERROR mismatched types
22-
//~| expected `&isize`
23-
//~| found `&[isize]`
24-
//~| expected isize
22+
//~| expected `&i32`
23+
//~| found `&[i32]`
24+
//~| expected i32
2525
//~| found slice
2626
}

src/test/compile-fail/array-old-syntax-1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
// Test that the old fixed length array syntax is a parsing error.
1212

1313
fn main() {
14-
let _x: [isize, ..3] = [0is, 1, 2]; //~ ERROR
14+
let _x: [isize, ..3] = [0, 1, 2]; //~ ERROR
1515
}

src/test/compile-fail/array-old-syntax-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
// Test that the old repeating array syntax gives an error.
1212

1313
fn main() {
14-
let _ = [0is, ..3]; //~ ERROR
14+
let _ = [0, ..3]; //~ ERROR
1515
}

0 commit comments

Comments
 (0)