Skip to content

Commit 4b3b02f

Browse files
committed
Auto merge of #22940 - Manishearth:rollup, r=Manishearth
2 parents 1576142 + 6988157 commit 4b3b02f

32 files changed

+589
-326
lines changed

src/libcore/lib.rs

+1-3
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 `uint`. These three arguments dictate
42+
//! `fmt::Arguments`, a `&str`, and a `usize`. 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,14 +88,12 @@ mod int_macros;
8888
#[macro_use]
8989
mod uint_macros;
9090

91-
#[path = "num/int.rs"] pub mod int;
9291
#[path = "num/isize.rs"] pub mod isize;
9392
#[path = "num/i8.rs"] pub mod i8;
9493
#[path = "num/i16.rs"] pub mod i16;
9594
#[path = "num/i32.rs"] pub mod i32;
9695
#[path = "num/i64.rs"] pub mod i64;
9796

98-
#[path = "num/uint.rs"] pub mod uint;
9997
#[path = "num/usize.rs"] pub mod usize;
10098
#[path = "num/u8.rs"] pub mod u8;
10199
#[path = "num/u16.rs"] pub mod u16;

src/libcore/num/int.rs

-21
This file was deleted.

src/libcore/num/uint.rs

-20
This file was deleted.

src/libcoretest/iter.rs

+7-7
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::uint;
15+
use core::usize;
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(), (uint::MAX, None));
295+
assert_eq!(it.size_hint(), (usize::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(), (uint::MAX, None));
368+
assert_eq!(c.size_hint(), (usize::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(), (uint::MAX, None));
376-
assert_eq!(c.clone().chain(vi.clone().cloned()).size_hint(), (uint::MAX, 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));
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(), (uint::MAX, None));
380+
assert_eq!(c.clone().map(|_| 0).size_hint(), (usize::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!((uint::MAX - 1..uint::MAX).size_hint(), (1, Some(1)));
756+
assert_eq!((usize::MAX - 1..usize::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
}

src/libcoretest/num/int.rs

-11
This file was deleted.

src/libcoretest/num/int_macros.rs

+2-2
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::int;
15+
use core::isize;
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!(int::MIN.checked_div(-1) == None);
156+
assert!(isize::MIN.checked_div(-1) == None);
157157
}
158158

159159
#[test]

src/libcoretest/num/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ mod i8;
2121
mod i16;
2222
mod i32;
2323
mod i64;
24-
mod int;
2524

2625
#[macro_use]
2726
mod uint_macros;
@@ -30,7 +29,6 @@ mod u8;
3029
mod u16;
3130
mod u32;
3231
mod u64;
33-
mod uint;
3432

3533
/// Helper function for testing numeric operations
3634
pub fn test_num<T>(ten: T, two: T) where

src/libcoretest/num/uint.rs

-11
This file was deleted.

src/libgetopts/lib.rs

+1-1
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::uint::MAX,
966+
t("\nMary had a little lamb\nLittle lamb\n", ::std::usize::MAX,
967967
&["Mary had a little lamb\nLittle lamb".to_string()]);
968968
}
969969

src/liblibc/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,6 @@ pub mod types {
11151115
pub mod posix88 {
11161116
pub type off_t = i64;
11171117
pub type dev_t = u32;
1118-
pub type ino_t = u32;
11191118
pub type pid_t = i32;
11201119
pub type uid_t = u32;
11211120
pub type gid_t = u32;

src/librand/rand_impls.rs

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

1818
use {Rand,Rng};
1919

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

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

src/librustc/lint/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for Context<'a, 'tcx> {
612612
}
613613

614614
fn visit_trait_item(&mut self, m: &ast::TraitItem) {
615-
run_lints!(self, check_trait_method, m);
615+
run_lints!(self, check_trait_item, m);
616616
visit::walk_trait_item(self, m);
617617
}
618618

src/librustc/lint/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ pub trait LintPass {
144144
fn check_fn(&mut self, _: &Context,
145145
_: FnKind, _: &ast::FnDecl, _: &ast::Block, _: Span, _: ast::NodeId) { }
146146
fn check_ty_method(&mut self, _: &Context, _: &ast::TypeMethod) { }
147-
fn check_trait_method(&mut self, _: &Context, _: &ast::TraitItem) { }
147+
fn check_trait_item(&mut self, _: &Context, _: &ast::TraitItem) { }
148148
fn check_struct_def(&mut self, _: &Context,
149149
_: &ast::StructDef, _: ast::Ident, _: &ast::Generics, _: ast::NodeId) { }
150150
fn check_struct_def_post(&mut self, _: &Context,

src/librustc/middle/liveness.rs

+20-20
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
//! enclosing function. On the way down the tree, it identifies those AST
5252
//! nodes and variable IDs that will be needed for the liveness analysis
5353
//! and assigns them contiguous IDs. The liveness id for an AST node is
54-
//! called a `live_node` (it's a newtype'd uint) and the id for a variable
55-
//! is called a `variable` (another newtype'd uint).
54+
//! called a `live_node` (it's a newtype'd usize) and the id for a variable
55+
//! is called a `variable` (another newtype'd usize).
5656
//!
5757
//! On the way back up the tree, as we are about to exit from a function
5858
//! declaration we allocate a `liveness` instance. Now that we know
@@ -118,7 +118,7 @@ use middle::ty::ClosureTyper;
118118
use lint;
119119
use util::nodemap::NodeMap;
120120

121-
use std::{fmt, old_io, uint};
121+
use std::{fmt, old_io, usize};
122122
use std::rc::Rc;
123123
use std::iter::repeat;
124124
use syntax::ast::{self, NodeId, Expr};
@@ -138,17 +138,17 @@ enum LoopKind<'a> {
138138
}
139139

140140
#[derive(Copy, PartialEq)]
141-
struct Variable(uint);
141+
struct Variable(usize);
142142

143143
#[derive(Copy, PartialEq)]
144-
struct LiveNode(uint);
144+
struct LiveNode(usize);
145145

146146
impl Variable {
147-
fn get(&self) -> uint { let Variable(v) = *self; v }
147+
fn get(&self) -> usize { let Variable(v) = *self; v }
148148
}
149149

150150
impl LiveNode {
151-
fn get(&self) -> uint { let LiveNode(v) = *self; v }
151+
fn get(&self) -> usize { let LiveNode(v) = *self; v }
152152
}
153153

154154
impl Clone for LiveNode {
@@ -232,11 +232,11 @@ impl fmt::Debug for Variable {
232232

233233
impl LiveNode {
234234
fn is_valid(&self) -> bool {
235-
self.get() != uint::MAX
235+
self.get() != usize::MAX
236236
}
237237
}
238238

239-
fn invalid_node() -> LiveNode { LiveNode(uint::MAX) }
239+
fn invalid_node() -> LiveNode { LiveNode(usize::MAX) }
240240

241241
struct CaptureInfo {
242242
ln: LiveNode,
@@ -260,8 +260,8 @@ enum VarKind {
260260
struct IrMaps<'a, 'tcx: 'a> {
261261
tcx: &'a ty::ctxt<'tcx>,
262262

263-
num_live_nodes: uint,
264-
num_vars: uint,
263+
num_live_nodes: usize,
264+
num_vars: usize,
265265
live_node_map: NodeMap<LiveNode>,
266266
variable_map: NodeMap<Variable>,
267267
capture_info_map: NodeMap<Rc<Vec<CaptureInfo>>>,
@@ -540,9 +540,9 @@ struct Specials {
540540
clean_exit_var: Variable
541541
}
542542

543-
static ACC_READ: uint = 1;
544-
static ACC_WRITE: uint = 2;
545-
static ACC_USE: uint = 4;
543+
static ACC_READ: u32 = 1;
544+
static ACC_WRITE: u32 = 2;
545+
static ACC_USE: u32 = 4;
546546

547547
struct Liveness<'a, 'tcx: 'a> {
548548
ir: &'a mut IrMaps<'a, 'tcx>,
@@ -631,7 +631,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
631631
succ
632632
}
633633

634-
fn idx(&self, ln: LiveNode, var: Variable) -> uint {
634+
fn idx(&self, ln: LiveNode, var: Variable) -> usize {
635635
ln.get() * self.ir.num_vars + var.get()
636636
}
637637

@@ -670,7 +670,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
670670
}
671671

672672
fn indices2<F>(&mut self, ln: LiveNode, succ_ln: LiveNode, mut op: F) where
673-
F: FnMut(&mut Liveness<'a, 'tcx>, uint, uint),
673+
F: FnMut(&mut Liveness<'a, 'tcx>, usize, usize),
674674
{
675675
let node_base_idx = self.idx(ln, Variable(0));
676676
let succ_base_idx = self.idx(succ_ln, Variable(0));
@@ -684,7 +684,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
684684
ln: LiveNode,
685685
mut test: F)
686686
-> old_io::IoResult<()> where
687-
F: FnMut(uint) -> LiveNode,
687+
F: FnMut(usize) -> LiveNode,
688688
{
689689
let node_base_idx = self.idx(ln, Variable(0));
690690
for var_idx in 0..self.ir.num_vars {
@@ -807,7 +807,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
807807
}
808808

809809
// Either read, write, or both depending on the acc bitset
810-
fn acc(&mut self, ln: LiveNode, var: Variable, acc: uint) {
810+
fn acc(&mut self, ln: LiveNode, var: Variable, acc: u32) {
811811
debug!("{:?} accesses[{:x}] {:?}: {}",
812812
ln, acc, var, self.ln_str(ln));
813813

@@ -1283,7 +1283,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
12831283
}
12841284

12851285
// see comment on propagate_through_lvalue()
1286-
fn write_lvalue(&mut self, expr: &Expr, succ: LiveNode, acc: uint)
1286+
fn write_lvalue(&mut self, expr: &Expr, succ: LiveNode, acc: u32)
12871287
-> LiveNode {
12881288
match expr.node {
12891289
ast::ExprPath(..) => {
@@ -1298,7 +1298,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
12981298
}
12991299
}
13001300

1301-
fn access_path(&mut self, expr: &Expr, succ: LiveNode, acc: uint)
1301+
fn access_path(&mut self, expr: &Expr, succ: LiveNode, acc: u32)
13021302
-> LiveNode {
13031303
match self.ir.tcx.def_map.borrow()[expr.id].full_def() {
13041304
DefLocal(nid) => {

0 commit comments

Comments
 (0)