From 54f16b818b58f6d6e81891b041fc751986e75155 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 24 Mar 2015 13:26:16 -0700 Subject: rustc: Remove support for int/uint This commit removes all parsing, resolve, and compiler support for the old and long-deprecated int/uint types. --- src/libsyntax/ast.rs | 42 +++--------------- src/libsyntax/ast_util.rs | 8 ++-- src/libsyntax/attr.rs | 8 ++-- src/libsyntax/ext/build.rs | 4 +- src/libsyntax/ext/deriving/generic/mod.rs | 2 +- src/libsyntax/ext/quote.rs | 4 +- src/libsyntax/feature_gate.rs | 71 +++---------------------------- src/libsyntax/parse/mod.rs | 8 ++-- 8 files changed, 28 insertions(+), 119 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index fec67c7aef4..f815e8e7843 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -1249,29 +1249,15 @@ pub enum ImplItem_ { MacImplItem(Mac), } -#[derive(Clone, Eq, RustcEncodable, RustcDecodable, Hash, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)] pub enum IntTy { - TyIs(bool /* is this deprecated `int`? */), + TyIs, TyI8, TyI16, TyI32, TyI64, } -impl PartialEq for IntTy { - fn eq(&self, other: &IntTy) -> bool { - match (*self, *other) { - // true/false need to compare the same, so this can't be derived - (TyIs(_), TyIs(_)) | - (TyI8, TyI8) | - (TyI16, TyI16) | - (TyI32, TyI32) | - (TyI64, TyI64) => true, - _ => false - } - } -} - impl fmt::Debug for IntTy { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::Display::fmt(self, f) @@ -1287,41 +1273,25 @@ impl fmt::Display for IntTy { impl IntTy { pub fn suffix_len(&self) -> usize { match *self { - TyIs(true) /* i */ => 1, - TyIs(false) /* is */ | TyI8 => 2, + TyIs | TyI8 => 2, TyI16 | TyI32 | TyI64 => 3, } } } -#[derive(Clone, Eq, RustcEncodable, RustcDecodable, Hash, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)] pub enum UintTy { - TyUs(bool /* is this deprecated uint? */), + TyUs, TyU8, TyU16, TyU32, TyU64, } -impl PartialEq for UintTy { - fn eq(&self, other: &UintTy) -> bool { - match (*self, *other) { - // true/false need to compare the same, so this can't be derived - (TyUs(_), TyUs(_)) | - (TyU8, TyU8) | - (TyU16, TyU16) | - (TyU32, TyU32) | - (TyU64, TyU64) => true, - _ => false - } - } -} - impl UintTy { pub fn suffix_len(&self) -> usize { match *self { - TyUs(true) /* u */ => 1, - TyUs(false) /* us */ | TyU8 => 2, + TyUs | TyU8 => 2, TyU16 | TyU32 | TyU64 => 3, } } diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index cec824e79ff..b7aa2aebbfa 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -140,7 +140,7 @@ pub fn is_path(e: P) -> bool { /// We want to avoid "45int" and "-3int" in favor of "45" and "-3" pub fn int_ty_to_string(t: IntTy, val: Option) -> String { let s = match t { - TyIs(_) => "isize", + TyIs => "isize", TyI8 => "i8", TyI16 => "i16", TyI32 => "i32", @@ -160,7 +160,7 @@ pub fn int_ty_max(t: IntTy) -> u64 { match t { TyI8 => 0x80, TyI16 => 0x8000, - TyIs(_) | TyI32 => 0x80000000, // actually ni about TyIs + TyIs | TyI32 => 0x80000000, // actually ni about TyIs TyI64 => 0x8000000000000000 } } @@ -169,7 +169,7 @@ pub fn int_ty_max(t: IntTy) -> u64 { /// We want to avoid "42u" in favor of "42us". "42uint" is right out. pub fn uint_ty_to_string(t: UintTy, val: Option) -> String { let s = match t { - TyUs(_) => "usize", + TyUs => "usize", TyU8 => "u8", TyU16 => "u16", TyU32 => "u32", @@ -186,7 +186,7 @@ pub fn uint_ty_max(t: UintTy) -> u64 { match t { TyU8 => 0xff, TyU16 => 0xffff, - TyUs(_) | TyU32 => 0xffffffff, // actually ni about TyUs + TyUs | TyU32 => 0xffffffff, // actually ni about TyUs TyU64 => 0xffffffffffffffff } } diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index 1c7930b9bc9..2d8484e95bb 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -565,10 +565,8 @@ fn int_type_of_word(s: &str) -> Option { "u32" => Some(UnsignedInt(ast::TyU32)), "i64" => Some(SignedInt(ast::TyI64)), "u64" => Some(UnsignedInt(ast::TyU64)), - "int" => Some(SignedInt(ast::TyIs(true))), - "uint" => Some(UnsignedInt(ast::TyUs(true))), - "isize" => Some(SignedInt(ast::TyIs(false))), - "usize" => Some(UnsignedInt(ast::TyUs(false))), + "isize" => Some(SignedInt(ast::TyIs)), + "usize" => Some(UnsignedInt(ast::TyUs)), _ => None } } @@ -612,7 +610,7 @@ impl IntType { SignedInt(ast::TyI16) | UnsignedInt(ast::TyU16) | SignedInt(ast::TyI32) | UnsignedInt(ast::TyU32) | SignedInt(ast::TyI64) | UnsignedInt(ast::TyU64) => true, - SignedInt(ast::TyIs(_)) | UnsignedInt(ast::TyUs(_)) => false + SignedInt(ast::TyIs) | UnsignedInt(ast::TyUs) => false } } } diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index d916651b056..5d0853761ee 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -696,10 +696,10 @@ impl<'a> AstBuilder for ExtCtxt<'a> { self.expr(sp, ast::ExprLit(P(respan(sp, lit)))) } fn expr_usize(&self, span: Span, i: usize) -> P { - self.expr_lit(span, ast::LitInt(i as u64, ast::UnsignedIntLit(ast::TyUs(false)))) + self.expr_lit(span, ast::LitInt(i as u64, ast::UnsignedIntLit(ast::TyUs))) } fn expr_int(&self, sp: Span, i: isize) -> P { - self.expr_lit(sp, ast::LitInt(i as u64, ast::SignedIntLit(ast::TyIs(false), + self.expr_lit(sp, ast::LitInt(i as u64, ast::SignedIntLit(ast::TyIs, ast::Sign::new(i)))) } fn expr_u32(&self, sp: Span, u: u32) -> P { diff --git a/src/libsyntax/ext/deriving/generic/mod.rs b/src/libsyntax/ext/deriving/generic/mod.rs index 58b6d96607d..59c5bada417 100644 --- a/src/libsyntax/ext/deriving/generic/mod.rs +++ b/src/libsyntax/ext/deriving/generic/mod.rs @@ -1051,7 +1051,7 @@ impl<'a> MethodDef<'a> { let arms: Vec = variants.iter().enumerate() .map(|(index, variant)| { let pat = variant_to_pat(cx, sp, type_ident, &**variant); - let lit = ast::LitInt(index as u64, ast::UnsignedIntLit(ast::TyUs(false))); + let lit = ast::LitInt(index as u64, ast::UnsignedIntLit(ast::TyUs)); cx.arm(sp, vec![pat], cx.expr_lit(sp, lit)) }).collect(); diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs index a25a6451918..f734d0c6132 100644 --- a/src/libsyntax/ext/quote.rs +++ b/src/libsyntax/ext/quote.rs @@ -275,13 +275,13 @@ pub mod rt { ); } - impl_to_source_int! { signed, int, ast::TyIs(false) } + impl_to_source_int! { signed, isize, ast::TyIs } impl_to_source_int! { signed, i8, ast::TyI8 } impl_to_source_int! { signed, i16, ast::TyI16 } impl_to_source_int! { signed, i32, ast::TyI32 } impl_to_source_int! { signed, i64, ast::TyI64 } - impl_to_source_int! { unsigned, uint, ast::TyUs(false) } + impl_to_source_int! { unsigned, usize, ast::TyUs } impl_to_source_int! { unsigned, u8, ast::TyU8 } impl_to_source_int! { unsigned, u16, ast::TyU16 } impl_to_source_int! { unsigned, u32, ast::TyU32 } diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 60f81dac1e9..5e80966a617 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -108,9 +108,6 @@ const KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[ // OIBIT specific features ("optin_builtin_traits", "1.0.0", Active), - // int and uint are now deprecated - ("int_uint", "1.0.0", Active), - // macro reexport needs more discussion and stabilization ("macro_reexport", "1.0.0", Active), @@ -360,7 +357,6 @@ struct Context<'a> { features: Vec<&'static str>, span_handler: &'a SpanHandler, cm: &'a CodeMap, - do_warnings: bool, } impl<'a> Context<'a> { @@ -371,12 +367,6 @@ impl<'a> Context<'a> { emit_feature_err(self.span_handler, feature, span, explain); } } - - fn warn_feature(&self, feature: &str, span: Span, explain: &str) { - if !self.has_feature(feature) && self.do_warnings { - emit_feature_warn(self.span_handler, feature, span, explain); - } - } fn has_feature(&self, feature: &str) -> bool { self.features.iter().any(|&n| n == feature) } @@ -624,35 +614,6 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> { visit::walk_foreign_item(self, i) } - fn visit_ty(&mut self, t: &ast::Ty) { - match t.node { - ast::TyPath(None, ref p) => { - match &*p.segments { - - [ast::PathSegment { identifier, .. }] => { - let name = token::get_ident(identifier); - let msg = if name == "int" { - Some("the `int` type is deprecated; \ - use `isize` or a fixed-sized integer") - } else if name == "uint" { - Some("the `uint` type is deprecated; \ - use `usize` or a fixed-sized integer") - } else { - None - }; - - if let Some(msg) = msg { - self.context.warn_feature("int_uint", t.span, msg) - } - } - _ => {} - } - } - _ => {} - } - visit::walk_ty(self, t); - } - fn visit_expr(&mut self, e: &ast::Expr) { match e.node { ast::ExprBox(..) | ast::ExprUnary(ast::UnOp::UnUniq, _) => { @@ -661,25 +622,6 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> { "box expression syntax is experimental; \ you can call `Box::new` instead."); } - ast::ExprLit(ref lit) => { - match lit.node { - ast::LitInt(_, ty) => { - let msg = if let ast::SignedIntLit(ast::TyIs(true), _) = ty { - Some("the `i` and `is` suffixes on integers are deprecated; \ - use `isize` or one of the fixed-sized suffixes") - } else if let ast::UnsignedIntLit(ast::TyUs(true)) = ty { - Some("the `u` and `us` suffixes on integers are deprecated; \ - use `usize` or one of the fixed-sized suffixes") - } else { - None - }; - if let Some(msg) = msg { - self.context.warn_feature("int_uint", e.span, msg); - } - } - _ => {} - } - } _ => {} } visit::walk_expr(self, e); @@ -722,8 +664,8 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> { } } -fn check_crate_inner(cm: &CodeMap, span_handler: &SpanHandler, krate: &ast::Crate, - do_warnings: bool, +fn check_crate_inner(cm: &CodeMap, span_handler: &SpanHandler, + krate: &ast::Crate, check: F) -> Features where F: FnOnce(&mut Context, &ast::Crate) @@ -731,7 +673,6 @@ fn check_crate_inner(cm: &CodeMap, span_handler: &SpanHandler, krate: &ast::C let mut cx = Context { features: Vec::new(), span_handler: span_handler, - do_warnings: do_warnings, cm: cm, }; @@ -812,14 +753,14 @@ fn check_crate_inner(cm: &CodeMap, span_handler: &SpanHandler, krate: &ast::C pub fn check_crate_macros(cm: &CodeMap, span_handler: &SpanHandler, krate: &ast::Crate) -> Features { - check_crate_inner(cm, span_handler, krate, true, + check_crate_inner(cm, span_handler, krate, |ctx, krate| visit::walk_crate(&mut MacroVisitor { context: ctx }, krate)) } -pub fn check_crate(cm: &CodeMap, span_handler: &SpanHandler, krate: &ast::Crate, - do_warnings: bool) -> Features +pub fn check_crate(cm: &CodeMap, span_handler: &SpanHandler, krate: &ast::Crate) + -> Features { - check_crate_inner(cm, span_handler, krate, do_warnings, + check_crate_inner(cm, span_handler, krate, |ctx, krate| visit::walk_crate(&mut PostExpansionVisitor { context: ctx }, krate)) } diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index 4e851761212..bea42a88bf5 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -700,18 +700,18 @@ pub fn integer_lit(s: &str, suffix: Option<&str>, sd: &SpanHandler, sp: Span) -> if let Some(suf) = suffix { if suf.is_empty() { sd.span_bug(sp, "found empty literal suffix in Some")} ty = match suf { - "isize" => ast::SignedIntLit(ast::TyIs(false), ast::Plus), + "isize" => ast::SignedIntLit(ast::TyIs, ast::Plus), "i8" => ast::SignedIntLit(ast::TyI8, ast::Plus), "i16" => ast::SignedIntLit(ast::TyI16, ast::Plus), "i32" => ast::SignedIntLit(ast::TyI32, ast::Plus), "i64" => ast::SignedIntLit(ast::TyI64, ast::Plus), - "usize" => ast::UnsignedIntLit(ast::TyUs(false)), + "usize" => ast::UnsignedIntLit(ast::TyUs), "u8" => ast::UnsignedIntLit(ast::TyU8), "u16" => ast::UnsignedIntLit(ast::TyU16), "u32" => ast::UnsignedIntLit(ast::TyU32), "u64" => ast::UnsignedIntLit(ast::TyU64), - "i" | "is" => ast::SignedIntLit(ast::TyIs(true), ast::Plus), - "u" | "us" => ast::UnsignedIntLit(ast::TyUs(true)), + "is" => ast::SignedIntLit(ast::TyIs, ast::Plus), + "us" => ast::UnsignedIntLit(ast::TyUs), _ => { // i and u look like widths, so lets // give an error message along those lines -- cgit 1.4.1-3-g733a5 From 3902190ac4d64962b2c1ac9a6ae88777b7112f82 Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Tue, 10 Feb 2015 10:04:39 +0100 Subject: Switch drop-flag to `u8` to allow special tags to instrument state. Refactored code so that the drop-flag values for initialized (`DTOR_NEEDED`) versus dropped (`DTOR_DONE`) are given explicit names. Add `mem::dropped()` (which with `DTOR_DONE == 0` is semantically the same as `mem::zeroed`, but the point is that it abstracts away from the particular choice of value for `DTOR_DONE`). Filling-drop needs to use something other than `ptr::read_and_zero`, so I added such a function: `ptr::read_and_drop`. But, libraries should not use it if they can otherwise avoid it. Fixes to tests to accommodate filling-drop. --- src/liballoc/arc.rs | 5 +- src/liballoc/rc.rs | 6 +- src/libcollections/btree/node.rs | 6 +- src/libcollections/vec.rs | 4 +- src/libcore/intrinsics.rs | 24 +++++++- src/libcore/mem.rs | 57 +++++++++++++++++++ src/libcore/ptr.rs | 15 +++++ src/librustc_trans/trans/_match.rs | 2 +- src/librustc_trans/trans/adt.rs | 98 +++++++++++++++++++++++++-------- src/librustc_trans/trans/base.rs | 23 +++++--- src/librustc_trans/trans/cleanup.rs | 2 +- src/librustc_trans/trans/datum.rs | 4 +- src/librustc_trans/trans/glue.rs | 47 ++++++++++++++-- src/librustc_trans/trans/intrinsic.rs | 9 ++- src/librustc_typeck/check/mod.rs | 2 +- src/libstd/collections/hash/table.rs | 2 +- src/libsyntax/fold.rs | 2 +- src/libsyntax/ptr.rs | 4 +- src/test/run-pass/intrinsic-move-val.rs | 4 +- 19 files changed, 258 insertions(+), 58 deletions(-) (limited to 'src/libsyntax') diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index b5d16d29272..e107d19a87c 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -354,7 +354,8 @@ impl Drop for Arc { // more than once (but it is guaranteed to be zeroed after the first if // it's run more than once) let ptr = *self._ptr; - if ptr.is_null() { return } + // if ptr.is_null() { return } + if ptr.is_null() || ptr as usize == mem::POST_DROP_USIZE { return } // Because `fetch_sub` is already atomic, we do not need to synchronize // with other threads unless we are going to delete the object. This @@ -485,7 +486,7 @@ impl Drop for Weak { let ptr = *self._ptr; // see comments above for why this check is here - if ptr.is_null() { return } + if ptr.is_null() || ptr as usize == mem::POST_DROP_USIZE { return } // If we find out that we were the last weak pointer, then its time to // deallocate the data entirely. See the discussion in Arc::drop() about diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index eb3c5c16726..e0d7e32ecf5 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -160,7 +160,7 @@ use core::default::Default; use core::fmt; use core::hash::{Hasher, Hash}; use core::marker; -use core::mem::{min_align_of, size_of, forget}; +use core::mem::{self, min_align_of, size_of, forget}; use core::nonzero::NonZero; use core::ops::{Deref, Drop}; use core::option::Option; @@ -407,7 +407,7 @@ impl Drop for Rc { fn drop(&mut self) { unsafe { let ptr = *self._ptr; - if !ptr.is_null() { + if !ptr.is_null() && ptr as usize != mem::POST_DROP_USIZE { self.dec_strong(); if self.strong() == 0 { ptr::read(&**self); // destroy the contained object @@ -718,7 +718,7 @@ impl Drop for Weak { fn drop(&mut self) { unsafe { let ptr = *self._ptr; - if !ptr.is_null() { + if !ptr.is_null() && ptr as usize != mem::POST_DROP_USIZE { self.dec_weak(); // the weak count starts at 1, and will only go to zero if all // the strong pointers have disappeared. diff --git a/src/libcollections/btree/node.rs b/src/libcollections/btree/node.rs index 23eafa41d8a..bf57d745a0d 100644 --- a/src/libcollections/btree/node.rs +++ b/src/libcollections/btree/node.rs @@ -280,9 +280,11 @@ impl Drop for RawItems { #[unsafe_destructor] impl Drop for Node { fn drop(&mut self) { - if self.keys.is_null() { + if self.keys.is_null() || + (unsafe { self.keys.get() as *const K as usize == mem::POST_DROP_USIZE }) + { // Since we have #[unsafe_no_drop_flag], we have to watch - // out for a null value being stored in self.keys. (Using + // out for the sentinel value being stored in self.keys. (Using // null is technically a violation of the `Unique` // requirements, though.) return; diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index e71077c96c7..cf0163f3ef4 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -1694,7 +1694,7 @@ impl Drop for Vec { fn drop(&mut self) { // This is (and should always remain) a no-op if the fields are // zeroed (when moving out, because of #[unsafe_no_drop_flag]). - if self.cap != 0 { + if self.cap != 0 && self.cap != mem::POST_DROP_USIZE { unsafe { for x in &*self { ptr::read(x); @@ -1977,7 +1977,7 @@ impl<'a, T> ExactSizeIterator for Drain<'a, T> {} #[stable(feature = "rust1", since = "1.0.0")] impl<'a, T> Drop for Drain<'a, T> { fn drop(&mut self) { - // self.ptr == self.end == null if drop has already been called, + // self.ptr == self.end == mem::POST_DROP_USIZE if drop has already been called, // so we can use #[unsafe_no_drop_flag]. // destroy the remaining elements diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs index 1f1044b0b21..eb74a41db55 100644 --- a/src/libcore/intrinsics.rs +++ b/src/libcore/intrinsics.rs @@ -191,13 +191,35 @@ extern "rust-intrinsic" { /// crate it is invoked in. pub fn type_id() -> u64; + /// Create a value initialized to so that its drop flag, + /// if any, says that it has been dropped. + /// + /// `init_dropped` is unsafe because it returns a datum with all + /// of its bytes set to the drop flag, which generally does not + /// correspond to a valid value. + /// + /// This intrinsic is likely to be deprecated in the future when + /// Rust moves to non-zeroing dynamic drop (and thus removes the + /// embedded drop flags that are being established by this + /// intrinsic). + #[cfg(not(stage0))] + pub fn init_dropped() -> T; + /// Create a value initialized to zero. /// /// `init` is unsafe because it returns a zeroed-out datum, - /// which is unsafe unless T is Copy. + /// which is unsafe unless T is `Copy`. Also, even if T is + /// `Copy`, an all-zero value may not correspond to any legitimate + /// state for the type in question. pub fn init() -> T; /// Create an uninitialized value. + /// + /// `uninit` is unsafe because there is no guarantee of what its + /// contents are. In particular its drop-flag may be set to any + /// state, which means it may claim either dropped or + /// undropped. In the general case one must use `ptr::write` to + /// initialize memory previous set to the result of `uninit`. pub fn uninit() -> T; /// Move a value out of scope without running drop glue. diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs index 1e6fb51a8a5..e5b6c3f3472 100644 --- a/src/libcore/mem.rs +++ b/src/libcore/mem.rs @@ -158,6 +158,29 @@ pub unsafe fn zeroed() -> T { intrinsics::init() } +/// Create a value initialized to an unspecified series of bytes. +/// +/// The byte sequence usually indicates that the value at the memory +/// in question has been dropped. Thus, *if* T carries a drop flag, +/// any associated destructor will not be run when the value falls out +/// of scope. +/// +/// Some code at one time used the `zeroed` function above to +/// accomplish this goal. +/// +/// This function is expected to be deprecated with the transition +/// to non-zeroing drop. +#[inline] +#[unstable(feature = "filling_drop")] +pub unsafe fn dropped() -> T { + let mut x: T = uninitialized(); + let p: *mut u8 = transmute(&mut x as *mut T); + for i in 0..size_of::() { + *p.offset(i as isize) = POST_DROP_U8; + } + x +} + /// Create an uninitialized value. /// /// Care must be taken when using this function, if the type `T` has a destructor and the value @@ -291,6 +314,40 @@ pub fn replace(dest: &mut T, mut src: T) -> T { #[stable(feature = "rust1", since = "1.0.0")] pub fn drop(_x: T) { } +macro_rules! repeat_u8_as_u32 { + ($name:expr) => { (($name as u32) << 24 | + ($name as u32) << 16 | + ($name as u32) << 8 | + ($name as u32)) } +} +macro_rules! repeat_u8_as_u64 { + ($name:expr) => { ((repeat_u8_as_u32!($name) as u64) << 32 | + (repeat_u8_as_u32!($name) as u64)) } +} + +// NOTE: Keep synchronized with values used in librustc_trans::trans::adt. +// +// In particular, the POST_DROP_U8 marker must never equal the +// DTOR_NEEDED_U8 marker. +// +// For a while pnkfelix was using 0xc1 here. +// But having the sign bit set is a pain, so 0x1d is probably better. +// +// And of course, 0x00 brings back the old world of zero'ing on drop. +#[cfg(not(stage0))] pub const POST_DROP_U8: u8 = 0x0; +#[cfg(not(stage0))] pub const POST_DROP_U32: u32 = repeat_u8_as_u32!(POST_DROP_U8); +#[cfg(not(stage0))] pub const POST_DROP_U64: u64 = repeat_u8_as_u64!(POST_DROP_U8); + +#[cfg(target_pointer_width = "32")] +#[cfg(not(stage0))] pub const POST_DROP_USIZE: usize = POST_DROP_U32 as usize; +#[cfg(target_pointer_width = "64")] +#[cfg(not(stage0))] pub const POST_DROP_USIZE: usize = POST_DROP_U64 as usize; + +#[cfg(stage0)] pub const POST_DROP_U8: u8 = 0; +#[cfg(stage0)] pub const POST_DROP_U32: u32 = 0; +#[cfg(stage0)] pub const POST_DROP_U64: u64 = 0; +#[cfg(stage0)] pub const POST_DROP_USIZE: usize = 0; + /// Interprets `src` as `&U`, and then reads `src` without moving the contained value. /// /// This function will unsafely assume the pointer `src` is valid for `sizeof(U)` bytes by diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index 9b3ee3ef5e0..7a9c9274f3b 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -230,6 +230,21 @@ pub unsafe fn read_and_zero(dest: *mut T) -> T { tmp } +/// Variant of read_and_zero that writes the specific drop-flag byte +/// (which may be more apropriate than zero). +#[inline(always)] +#[unstable(feature = "core", + reason = "may play a larger role in std::ptr future extensions")] +pub unsafe fn read_and_drop(dest: *mut T) -> T { + // Copy the data out from `dest`: + let tmp = read(&*dest); + + // Now mark `dest` as dropped: + write_bytes(dest, mem::POST_DROP_U8, 1); + + tmp +} + /// Overwrites a memory location with the given value without reading or /// dropping the old value. /// diff --git a/src/librustc_trans/trans/_match.rs b/src/librustc_trans/trans/_match.rs index c48b63cdcb6..d583eef0e0f 100644 --- a/src/librustc_trans/trans/_match.rs +++ b/src/librustc_trans/trans/_match.rs @@ -1528,7 +1528,7 @@ pub fn store_local<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, let scope = cleanup::var_scope(tcx, p_id); bcx = mk_binding_alloca( bcx, p_id, &path1.node, scope, (), - |(), bcx, llval, ty| { zero_mem(bcx, llval, ty); bcx }); + |(), bcx, llval, ty| { drop_done_fill_mem(bcx, llval, ty); bcx }); }); bcx } diff --git a/src/librustc_trans/trans/adt.rs b/src/librustc_trans/trans/adt.rs index 61214f65c87..9f90b5cea5f 100644 --- a/src/librustc_trans/trans/adt.rs +++ b/src/librustc_trans/trans/adt.rs @@ -81,14 +81,18 @@ pub enum Repr<'tcx> { /// Structs with destructors need a dynamic destroyedness flag to /// avoid running the destructor too many times; this is included /// in the `Struct` if present. - Univariant(Struct<'tcx>, bool), + /// (The flag if nonzero, represents the initialization value to use; + /// if zero, then use no flag at all.) + Univariant(Struct<'tcx>, u8), /// General-case enums: for each case there is a struct, and they /// all start with a field for the discriminant. /// /// Types with destructors need a dynamic destroyedness flag to /// avoid running the destructor too many times; the last argument /// indicates whether such a flag is present. - General(IntType, Vec>, bool), + /// (The flag, if nonzero, represents the initialization value to use; + /// if zero, then use no flag at all.) + General(IntType, Vec>, u8), /// Two cases distinguished by a nullable pointer: the case with discriminant /// `nndiscr` must have single field which is known to be nonnull due to its type. /// The other case is known to be zero sized. Hence we represent the enum @@ -151,11 +155,59 @@ pub fn represent_type<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, repr } +macro_rules! repeat_u8_as_u32 { + ($name:expr) => { (($name as u32) << 24 | + ($name as u32) << 16 | + ($name as u32) << 8 | + ($name as u32)) } +} +macro_rules! repeat_u8_as_u64 { + ($name:expr) => { ((repeat_u8_as_u32!($name) as u64) << 32 | + (repeat_u8_as_u32!($name) as u64)) } +} + +pub const DTOR_NEEDED: u8 = 0x1; +pub const DTOR_NEEDED_U32: u32 = repeat_u8_as_u32!(DTOR_NEEDED); +pub const DTOR_NEEDED_U64: u64 = repeat_u8_as_u64!(DTOR_NEEDED); +#[allow(dead_code)] +pub fn dtor_needed_usize(ccx: &CrateContext) -> usize { + match &ccx.tcx().sess.target.target.target_pointer_width[..] { + "32" => DTOR_NEEDED_U32 as usize, + "64" => DTOR_NEEDED_U64 as usize, + tws => panic!("Unsupported target word size for int: {}", tws), + } +} + +pub const DTOR_DONE: u8 = 0x0; +pub const DTOR_DONE_U32: u32 = repeat_u8_as_u32!(DTOR_DONE); +pub const DTOR_DONE_U64: u64 = repeat_u8_as_u64!(DTOR_DONE); +#[allow(dead_code)] +pub fn dtor_done_usize(ccx: &CrateContext) -> usize { + match &ccx.tcx().sess.target.target.target_pointer_width[..] { + "32" => DTOR_DONE_U32 as usize, + "64" => DTOR_DONE_U64 as usize, + tws => panic!("Unsupported target word size for int: {}", tws), + } +} + +fn dtor_to_init_u8(dtor: bool) -> u8 { + if dtor { DTOR_NEEDED } else { 0 } +} + +pub trait GetDtorType<'tcx> { fn dtor_type(&self) -> Ty<'tcx>; } +impl<'tcx> GetDtorType<'tcx> for ty::ctxt<'tcx> { + fn dtor_type(&self) -> Ty<'tcx> { self.types.u8 } +} + +fn dtor_active(flag: u8) -> bool { + flag != 0 +} + fn represent_type_uncached<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, t: Ty<'tcx>) -> Repr<'tcx> { match t.sty { ty::ty_tup(ref elems) => { - Univariant(mk_struct(cx, &elems[..], false, t), false) + Univariant(mk_struct(cx, &elems[..], false, t), 0) } ty::ty_struct(def_id, substs) => { let fields = ty::lookup_struct_fields(cx.tcx(), def_id); @@ -165,15 +217,15 @@ fn represent_type_uncached<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, }).collect::>(); let packed = ty::lookup_packed(cx.tcx(), def_id); let dtor = ty::ty_dtor(cx.tcx(), def_id).has_drop_flag(); - if dtor { ftys.push(cx.tcx().types.bool); } + if dtor { ftys.push(cx.tcx().dtor_type()); } - Univariant(mk_struct(cx, &ftys[..], packed, t), dtor) + Univariant(mk_struct(cx, &ftys[..], packed, t), dtor_to_init_u8(dtor)) } ty::ty_closure(def_id, substs) => { let typer = NormalizingClosureTyper::new(cx.tcx()); let upvars = typer.closure_upvars(def_id, substs).unwrap(); let upvar_types = upvars.iter().map(|u| u.ty).collect::>(); - Univariant(mk_struct(cx, &upvar_types[..], false, t), false) + Univariant(mk_struct(cx, &upvar_types[..], false, t), 0) } ty::ty_enum(def_id, substs) => { let cases = get_cases(cx.tcx(), def_id, substs); @@ -186,9 +238,9 @@ fn represent_type_uncached<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, // Uninhabitable; represent as unit // (Typechecking will reject discriminant-sizing attrs.) assert_eq!(hint, attr::ReprAny); - let ftys = if dtor { vec!(cx.tcx().types.bool) } else { vec!() }; + let ftys = if dtor { vec!(cx.tcx().dtor_type()) } else { vec!() }; return Univariant(mk_struct(cx, &ftys[..], false, t), - dtor); + dtor_to_init_u8(dtor)); } if !dtor && cases.iter().all(|c| c.tys.len() == 0) { @@ -218,9 +270,9 @@ fn represent_type_uncached<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, // (Typechecking will reject discriminant-sizing attrs.) assert_eq!(hint, attr::ReprAny); let mut ftys = cases[0].tys.clone(); - if dtor { ftys.push(cx.tcx().types.bool); } + if dtor { ftys.push(cx.tcx().dtor_type()); } return Univariant(mk_struct(cx, &ftys[..], false, t), - dtor); + dtor_to_init_u8(dtor)); } if !dtor && cases.len() == 2 && hint == attr::ReprAny { @@ -266,7 +318,7 @@ fn represent_type_uncached<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, let fields : Vec<_> = cases.iter().map(|c| { let mut ftys = vec!(ty_of_inttype(cx.tcx(), min_ity)); ftys.push_all(&c.tys); - if dtor { ftys.push(cx.tcx().types.bool); } + if dtor { ftys.push(cx.tcx().dtor_type()); } mk_struct(cx, &ftys, false, t) }).collect(); @@ -319,13 +371,13 @@ fn represent_type_uncached<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, let fields : Vec<_> = cases.iter().map(|c| { let mut ftys = vec!(ty_of_inttype(cx.tcx(), ity)); ftys.push_all(&c.tys); - if dtor { ftys.push(cx.tcx().types.bool); } + if dtor { ftys.push(cx.tcx().dtor_type()); } mk_struct(cx, &ftys[..], false, t) }).collect(); ensure_enum_fits_in_address_space(cx, &fields[..], t); - General(ity, fields, dtor) + General(ity, fields, dtor_to_init_u8(dtor)) } _ => cx.sess().bug(&format!("adt::represent_type called on non-ADT type: {}", ty_to_string(cx.tcx(), t))) @@ -830,18 +882,18 @@ pub fn trans_set_discr<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, r: &Repr<'tcx>, val) } General(ity, ref cases, dtor) => { - if dtor { + if dtor_active(dtor) { let ptr = trans_field_ptr(bcx, r, val, discr, cases[discr as uint].fields.len() - 2); - Store(bcx, C_u8(bcx.ccx(), 1), ptr); + Store(bcx, C_u8(bcx.ccx(), DTOR_NEEDED as usize), ptr); } Store(bcx, C_integral(ll_inttype(bcx.ccx(), ity), discr as u64, true), GEPi(bcx, val, &[0, 0])) } Univariant(ref st, dtor) => { assert_eq!(discr, 0); - if dtor { - Store(bcx, C_u8(bcx.ccx(), 1), + if dtor_active(dtor) { + Store(bcx, C_u8(bcx.ccx(), DTOR_NEEDED as usize), GEPi(bcx, val, &[0, st.fields.len() - 1])); } } @@ -875,10 +927,10 @@ pub fn num_args(r: &Repr, discr: Disr) -> uint { CEnum(..) => 0, Univariant(ref st, dtor) => { assert_eq!(discr, 0); - st.fields.len() - (if dtor { 1 } else { 0 }) + st.fields.len() - (if dtor_active(dtor) { 1 } else { 0 }) } General(_, ref cases, dtor) => { - cases[discr as uint].fields.len() - 1 - (if dtor { 1 } else { 0 }) + cases[discr as uint].fields.len() - 1 - (if dtor_active(dtor) { 1 } else { 0 }) } RawNullablePointer { nndiscr, ref nullfields, .. } => { if discr == nndiscr { 1 } else { nullfields.len() } @@ -992,17 +1044,17 @@ pub fn trans_drop_flag_ptr<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>, r: &Repr<'tcx -> datum::DatumBlock<'blk, 'tcx, datum::Expr> { let tcx = bcx.tcx(); - let ptr_ty = ty::mk_imm_ptr(bcx.tcx(), tcx.types.bool); + let ptr_ty = ty::mk_imm_ptr(bcx.tcx(), tcx.dtor_type()); match *r { - Univariant(ref st, true) => { + Univariant(ref st, dtor) if dtor_active(dtor) => { let flag_ptr = GEPi(bcx, val, &[0, st.fields.len() - 1]); datum::immediate_rvalue_bcx(bcx, flag_ptr, ptr_ty).to_expr_datumblock() } - General(_, _, true) => { + General(_, _, dtor) if dtor_active(dtor) => { let fcx = bcx.fcx; let custom_cleanup_scope = fcx.push_custom_cleanup_scope(); let scratch = unpack_datum!(bcx, datum::lvalue_scratch_datum( - bcx, tcx.types.bool, "drop_flag", + bcx, tcx.dtor_type(), "drop_flag", cleanup::CustomScope(custom_cleanup_scope), (), |_, bcx, _| bcx )); bcx = fold_variants(bcx, r, val, |variant_cx, st, value| { diff --git a/src/librustc_trans/trans/base.rs b/src/librustc_trans/trans/base.rs index 2f944e49b15..aee163973fd 100644 --- a/src/librustc_trans/trans/base.rs +++ b/src/librustc_trans/trans/base.rs @@ -1146,20 +1146,27 @@ pub fn memcpy_ty<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, } } -pub fn zero_mem<'blk, 'tcx>(cx: Block<'blk, 'tcx>, llptr: ValueRef, t: Ty<'tcx>) { +pub fn drop_done_fill_mem<'blk, 'tcx>(cx: Block<'blk, 'tcx>, llptr: ValueRef, t: Ty<'tcx>) { if cx.unreachable.get() { return; } - let _icx = push_ctxt("zero_mem"); + let _icx = push_ctxt("drop_done_fill_mem"); let bcx = cx; - memzero(&B(bcx), llptr, t); + memfill(&B(bcx), llptr, t, adt::DTOR_DONE); } -// Always use this function instead of storing a zero constant to the memory -// in question. If you store a zero constant, LLVM will drown in vreg +pub fn init_zero_mem<'blk, 'tcx>(cx: Block<'blk, 'tcx>, llptr: ValueRef, t: Ty<'tcx>) { + if cx.unreachable.get() { return; } + let _icx = push_ctxt("init_zero_mem"); + let bcx = cx; + memfill(&B(bcx), llptr, t, 0); +} + +// Always use this function instead of storing a constant byte to the memory +// in question. e.g. if you store a zero constant, LLVM will drown in vreg // allocation for large data structures, and the generated code will be // awful. (A telltale sign of this is large quantities of // `mov [byte ptr foo],0` in the generated code.) -fn memzero<'a, 'tcx>(b: &Builder<'a, 'tcx>, llptr: ValueRef, ty: Ty<'tcx>) { - let _icx = push_ctxt("memzero"); +fn memfill<'a, 'tcx>(b: &Builder<'a, 'tcx>, llptr: ValueRef, ty: Ty<'tcx>, byte: u8) { + let _icx = push_ctxt("memfill"); let ccx = b.ccx; let llty = type_of::type_of(ccx, ty); @@ -1172,7 +1179,7 @@ fn memzero<'a, 'tcx>(b: &Builder<'a, 'tcx>, llptr: ValueRef, ty: Ty<'tcx>) { let llintrinsicfn = ccx.get_intrinsic(&intrinsic_key); let llptr = b.pointercast(llptr, Type::i8(ccx).ptr_to()); - let llzeroval = C_u8(ccx, 0); + let llzeroval = C_u8(ccx, byte as usize); let size = machine::llsize_of(ccx, llty); let align = C_i32(ccx, type_of::align_of(ccx, ty) as i32); let volatile = C_bool(ccx, false); diff --git a/src/librustc_trans/trans/cleanup.rs b/src/librustc_trans/trans/cleanup.rs index ad07f3953cc..c7897f9b62e 100644 --- a/src/librustc_trans/trans/cleanup.rs +++ b/src/librustc_trans/trans/cleanup.rs @@ -1015,7 +1015,7 @@ impl<'tcx> Cleanup<'tcx> for DropValue<'tcx> { glue::drop_ty(bcx, self.val, self.ty, debug_loc) }; if self.zero { - base::zero_mem(bcx, self.val, self.ty); + base::drop_done_fill_mem(bcx, self.val, self.ty); } bcx } diff --git a/src/librustc_trans/trans/datum.rs b/src/librustc_trans/trans/datum.rs index 15738d1e61a..399b7eb102e 100644 --- a/src/librustc_trans/trans/datum.rs +++ b/src/librustc_trans/trans/datum.rs @@ -307,8 +307,8 @@ impl KindOps for Lvalue { -> Block<'blk, 'tcx> { let _icx = push_ctxt("::post_store"); if bcx.fcx.type_needs_drop(ty) { - // cancel cleanup of affine values by zeroing out - let () = zero_mem(bcx, val, ty); + // cancel cleanup of affine values by drop-filling the memory + let () = drop_done_fill_mem(bcx, val, ty); bcx } else { bcx diff --git a/src/librustc_trans/trans/glue.rs b/src/librustc_trans/trans/glue.rs index b2de8435f64..7eb4c6f8ca5 100644 --- a/src/librustc_trans/trans/glue.rs +++ b/src/librustc_trans/trans/glue.rs @@ -21,6 +21,7 @@ use middle::lang_items::ExchangeFreeFnLangItem; use middle::subst; use middle::subst::{Subst, Substs}; use trans::adt; +use trans::adt::GetDtorType; // for tcx.dtor_type() use trans::base::*; use trans::build::*; use trans::callee; @@ -39,6 +40,7 @@ use util::ppaux; use arena::TypedArena; use libc::c_uint; +use session::config::NoDebugInfo; use syntax::ast; pub fn trans_exchange_free_dyn<'blk, 'tcx>(cx: Block<'blk, 'tcx>, @@ -231,9 +233,31 @@ fn trans_struct_drop_flag<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>, Load(bcx, llval) }; let drop_flag = unpack_datum!(bcx, adt::trans_drop_flag_ptr(bcx, &*repr, struct_data)); - with_cond(bcx, load_ty(bcx, drop_flag.val, bcx.tcx().types.bool), |cx| { + let loaded = load_ty(bcx, drop_flag.val, bcx.tcx().dtor_type()); + let drop_flag_llty = type_of(bcx.fcx.ccx, bcx.tcx().dtor_type()); + let init_val = C_integral(drop_flag_llty, adt::DTOR_NEEDED as u64, false); + + let bcx = if bcx.tcx().sess.opts.debuginfo == NoDebugInfo { + bcx + } else { + let drop_flag_llty = type_of(bcx.fcx.ccx, bcx.tcx().dtor_type()); + let done_val = C_integral(drop_flag_llty, adt::DTOR_DONE as u64, false); + let not_init = ICmp(bcx, llvm::IntNE, loaded, init_val, DebugLoc::None); + let not_done = ICmp(bcx, llvm::IntNE, loaded, done_val, DebugLoc::None); + let drop_flag_neither_initialized_nor_cleared = + And(bcx, not_init, not_done, DebugLoc::None); + with_cond(bcx, drop_flag_neither_initialized_nor_cleared, |cx| { + let llfn = cx.ccx().get_intrinsic(&("llvm.debugtrap")); + Call(cx, llfn, &[], None, DebugLoc::None); + cx + }) + }; + + let drop_flag_dtor_needed = ICmp(bcx, llvm::IntEQ, loaded, init_val, DebugLoc::None); + with_cond(bcx, drop_flag_dtor_needed, |cx| { trans_struct_drop(cx, t, v0, dtor_did, class_did, substs) }) + } fn trans_struct_drop<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, @@ -395,13 +419,24 @@ fn make_drop_glue<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, v0: ValueRef, t: Ty<'tcx>) -> Block<'blk, 'tcx> { // NB: v0 is an *alias* of type t here, not a direct value. let _icx = push_ctxt("make_drop_glue"); + + // Only drop the value when it ... well, we used to check for + // non-null, (and maybe we need to continue doing so), but we now + // must definitely check for special bit-patterns corresponding to + // the special dtor markings. + + let inttype = Type::int(bcx.ccx()); + let dropped_pattern = C_integral(inttype, adt::dtor_done_usize(bcx.fcx.ccx) as u64, false); + match t.sty { ty::ty_uniq(content_ty) => { if !type_is_sized(bcx.tcx(), content_ty) { let llval = GEPi(bcx, v0, &[0, abi::FAT_PTR_ADDR]); let llbox = Load(bcx, llval); - let not_null = IsNotNull(bcx, llbox); - with_cond(bcx, not_null, |bcx| { + let llbox_as_usize = PtrToInt(bcx, llbox, Type::int(bcx.ccx())); + let drop_flag_not_dropped_already = + ICmp(bcx, llvm::IntNE, llbox_as_usize, dropped_pattern, DebugLoc::None); + with_cond(bcx, drop_flag_not_dropped_already, |bcx| { let bcx = drop_ty(bcx, v0, content_ty, DebugLoc::None); let info = GEPi(bcx, v0, &[0, abi::FAT_PTR_EXTRA]); let info = Load(bcx, info); @@ -420,8 +455,10 @@ fn make_drop_glue<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, v0: ValueRef, t: Ty<'tcx>) } else { let llval = v0; let llbox = Load(bcx, llval); - let not_null = IsNotNull(bcx, llbox); - with_cond(bcx, not_null, |bcx| { + let llbox_as_usize = PtrToInt(bcx, llbox, inttype); + let drop_flag_not_dropped_already = + ICmp(bcx, llvm::IntNE, llbox_as_usize, dropped_pattern, DebugLoc::None); + with_cond(bcx, drop_flag_not_dropped_already, |bcx| { let bcx = drop_ty(bcx, llbox, content_ty, DebugLoc::None); trans_exchange_free_ty(bcx, llbox, content_ty, DebugLoc::None) }) diff --git a/src/librustc_trans/trans/intrinsic.rs b/src/librustc_trans/trans/intrinsic.rs index f714c5800c5..ee0274b1827 100644 --- a/src/librustc_trans/trans/intrinsic.rs +++ b/src/librustc_trans/trans/intrinsic.rs @@ -359,11 +359,18 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>, &ccx.link_meta().crate_hash); C_u64(ccx, hash) } + (_, "init_dropped") => { + let tp_ty = *substs.types.get(FnSpace, 0); + if !return_type_is_void(ccx, tp_ty) { + drop_done_fill_mem(bcx, llresult, tp_ty); + } + C_nil(ccx) + } (_, "init") => { let tp_ty = *substs.types.get(FnSpace, 0); if !return_type_is_void(ccx, tp_ty) { // Just zero out the stack slot. (See comment on base::memzero for explanation) - zero_mem(bcx, llresult, tp_ty); + init_zero_mem(bcx, llresult, tp_ty); } C_nil(ccx) } diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 1e38a7d2d9f..d24ec16cc21 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -5384,7 +5384,7 @@ pub fn check_intrinsic_type(ccx: &CrateCtxt, it: &ast::ForeignItem) { "breakpoint" => (0, Vec::new(), ty::mk_nil(tcx)), "size_of" | "pref_align_of" | "min_align_of" => (1, Vec::new(), ccx.tcx.types.uint), - "init" => (1, Vec::new(), param(ccx, 0)), + "init" | "init_dropped" => (1, Vec::new(), param(ccx, 0)), "uninit" => (1, Vec::new(), param(ccx, 0)), "forget" => (1, vec!( param(ccx, 0) ), ty::mk_nil(tcx)), "transmute" => (2, vec!( param(ccx, 0) ), param(ccx, 1)), diff --git a/src/libstd/collections/hash/table.rs b/src/libstd/collections/hash/table.rs index 052bcfd7e16..710f0fe19db 100644 --- a/src/libstd/collections/hash/table.rs +++ b/src/libstd/collections/hash/table.rs @@ -985,7 +985,7 @@ impl Clone for RawTable { #[unsafe_destructor] impl Drop for RawTable { fn drop(&mut self) { - if self.capacity == 0 { + if self.capacity == 0 || self.capacity == mem::POST_DROP_USIZE { return; } diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index 105a61d0857..d4451cc7b71 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -40,7 +40,7 @@ impl MoveMap for Vec { for p in &mut self { unsafe { // FIXME(#5016) this shouldn't need to zero to be safe. - ptr::write(p, f(ptr::read_and_zero(p))); + ptr::write(p, f(ptr::read_and_drop(p))); } } self diff --git a/src/libsyntax/ptr.rs b/src/libsyntax/ptr.rs index ca3a1848c3a..7e0bcd3e1dc 100644 --- a/src/libsyntax/ptr.rs +++ b/src/libsyntax/ptr.rs @@ -71,8 +71,8 @@ impl P { { unsafe { let p = &mut *self.ptr; - // FIXME(#5016) this shouldn't need to zero to be safe. - ptr::write(p, f(ptr::read_and_zero(p))); + // FIXME(#5016) this shouldn't need to drop-fill to be safe. + ptr::write(p, f(ptr::read_and_drop(p))); } self } diff --git a/src/test/run-pass/intrinsic-move-val.rs b/src/test/run-pass/intrinsic-move-val.rs index 89aea93e7b3..cd517bcad30 100644 --- a/src/test/run-pass/intrinsic-move-val.rs +++ b/src/test/run-pass/intrinsic-move-val.rs @@ -14,7 +14,7 @@ #![feature(box_syntax)] #![feature(intrinsics)] -use std::mem::transmute; +use std::mem::{self, transmute}; mod rusti { extern "rust-intrinsic" { @@ -30,6 +30,6 @@ pub fn main() { let mut z: *const uint = transmute(&x); rusti::move_val_init(&mut y, x); assert_eq!(*y, 1); - assert_eq!(*z, 0); // `x` is nulled out, not directly visible + assert_eq!(*z, mem::POST_DROP_USIZE); // `x` is nulled out, not directly visible } } -- cgit 1.4.1-3-g733a5 From 43bfaa4a336095eb5697fb2df50909fd3c72ed14 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 25 Mar 2015 17:06:52 -0700 Subject: Mass rename uint/int to usize/isize Now that support has been removed, all lingering use cases are renamed. --- src/compiletest/compiletest.rs | 1 - src/compiletest/errors.rs | 8 +- src/compiletest/header.rs | 10 +- src/compiletest/runtest.rs | 12 +- src/doc/reference.md | 7 +- src/doc/trpl/ffi.md | 4 +- src/doc/trpl/more-strings.md | 2 +- src/libcore/atomic.rs | 44 ++-- src/libcore/fmt/float.rs | 4 +- src/libcore/intrinsics.rs | 2 +- src/libcore/lib.rs | 1 - src/libcore/macros.rs | 2 +- src/libcore/num/f32.rs | 12 +- src/libcore/num/f64.rs | 12 +- src/libcore/num/mod.rs | 100 ++++---- src/libcore/num/wrapping.rs | 10 +- src/libcore/panicking.rs | 6 +- src/libcore/result.rs | 38 +-- src/libcore/str/mod.rs | 2 +- src/libcoretest/any.rs | 24 +- src/libcoretest/cell.rs | 8 +- src/libcoretest/cmp.rs | 2 +- src/libcoretest/iter.rs | 76 +++--- src/libcoretest/mem.rs | 26 +- src/libcoretest/nonzero.rs | 2 +- src/libcoretest/ops.rs | 2 +- src/libcoretest/option.rs | 48 ++-- src/libcoretest/ptr.rs | 28 +-- src/libcoretest/result.rs | 58 ++--- src/libgetopts/lib.rs | 13 +- src/libgraphviz/lib.rs | 1 - src/liblog/lib.rs | 9 +- src/librand/chacha.rs | 8 +- src/librand/distributions/mod.rs | 18 +- src/librand/distributions/range.rs | 8 +- src/librand/lib.rs | 17 +- src/librand/reseeding.rs | 10 +- src/librbml/lib.rs | 279 ++++++++++----------- src/librustc/lib.rs | 1 - src/librustc/metadata/common.rs | 218 ++++++++-------- src/librustc/metadata/csearch.rs | 2 +- src/librustc/metadata/cstore.rs | 2 +- src/librustc/metadata/decoder.rs | 22 +- src/librustc/metadata/encoder.rs | 10 +- src/librustc/metadata/loader.rs | 8 +- src/librustc/metadata/tydecode.rs | 50 ++-- src/librustc/middle/astconv_util.rs | 6 +- src/librustc/middle/astencode.rs | 36 +-- src/librustc/middle/check_match.rs | 18 +- src/librustc/middle/const_eval.rs | 26 +- src/librustc/middle/dataflow.rs | 56 ++--- src/librustc/middle/dead.rs | 2 +- src/librustc/middle/dependency_format.rs | 2 +- src/librustc/middle/expr_use_visitor.rs | 4 +- src/librustc/middle/fast_reject.rs | 4 +- src/librustc/middle/graph.rs | 20 +- src/librustc/middle/infer/error_reporting.rs | 4 +- src/librustc/middle/infer/mod.rs | 2 +- .../middle/infer/region_inference/graphviz.rs | 2 +- src/librustc/middle/infer/region_inference/mod.rs | 66 ++--- src/librustc/middle/infer/type_variable.rs | 14 +- src/librustc/middle/infer/unify.rs | 18 +- src/librustc/middle/intrinsicck.rs | 4 +- src/librustc/middle/lang_items.rs | 14 +- src/librustc/middle/mem_categorization.rs | 12 +- src/librustc/middle/region.rs | 4 +- src/librustc/middle/subst.rs | 38 +-- src/librustc/middle/traits/fulfill.rs | 2 +- src/librustc/middle/traits/mod.rs | 4 +- src/librustc/middle/traits/project.rs | 16 +- src/librustc/middle/traits/select.rs | 12 +- src/librustc/middle/traits/util.rs | 10 +- src/librustc/middle/ty.rs | 184 +++++++------- src/librustc/middle/ty_walk.rs | 6 +- src/librustc/session/config.rs | 10 +- src/librustc/session/mod.rs | 4 +- src/librustc/util/common.rs | 6 +- src/librustc/util/lev_distance.rs | 2 +- src/librustc/util/snapshot_vec.rs | 14 +- src/librustc_back/abi.rs | 8 +- src/librustc_back/archive.rs | 2 +- src/librustc_back/lib.rs | 1 - src/librustc_back/sha2.rs | 34 +-- src/librustc_back/svh.rs | 2 +- src/librustc_back/tempdir.rs | 2 +- src/librustc_borrowck/borrowck/check_loans.rs | 4 +- src/librustc_borrowck/borrowck/mod.rs | 16 +- src/librustc_borrowck/borrowck/move_data.rs | 12 +- src/librustc_borrowck/graphviz.rs | 2 +- src/librustc_borrowck/lib.rs | 1 - src/librustc_driver/lib.rs | 5 +- src/librustc_driver/test.rs | 128 +++++----- src/librustc_lint/builtin.rs | 2 +- src/librustc_lint/lib.rs | 1 - src/librustc_llvm/archive_ro.rs | 2 +- src/librustc_llvm/lib.rs | 15 +- src/librustc_privacy/lib.rs | 3 +- src/librustc_resolve/lib.rs | 15 +- src/librustc_resolve/resolve_imports.rs | 2 +- src/librustc_trans/back/link.rs | 12 +- src/librustc_trans/back/lto.rs | 4 +- src/librustc_trans/back/write.rs | 2 +- src/librustc_trans/lib.rs | 1 - src/librustc_trans/save/mod.rs | 2 +- src/librustc_trans/save/span_utils.rs | 8 +- src/librustc_trans/trans/_match.rs | 48 ++-- src/librustc_trans/trans/adt.rs | 22 +- src/librustc_trans/trans/base.rs | 4 +- src/librustc_trans/trans/build.rs | 16 +- src/librustc_trans/trans/builder.rs | 18 +- src/librustc_trans/trans/cabi_aarch64.rs | 12 +- src/librustc_trans/trans/cabi_arm.rs | 18 +- src/librustc_trans/trans/cabi_mips.rs | 18 +- src/librustc_trans/trans/cabi_powerpc.rs | 18 +- src/librustc_trans/trans/cabi_x86_64.rs | 22 +- src/librustc_trans/trans/cleanup.rs | 24 +- src/librustc_trans/trans/common.rs | 10 +- src/librustc_trans/trans/consts.rs | 6 +- src/librustc_trans/trans/context.rs | 40 +-- src/librustc_trans/trans/controlflow.rs | 2 +- src/librustc_trans/trans/debuginfo.rs | 24 +- src/librustc_trans/trans/expr.rs | 14 +- src/librustc_trans/trans/intrinsic.rs | 8 +- src/librustc_trans/trans/machine.rs | 2 +- src/librustc_trans/trans/meth.rs | 10 +- src/librustc_trans/trans/tvec.rs | 4 +- src/librustc_trans/trans/type_.rs | 14 +- src/librustc_trans/trans/value.rs | 2 +- src/librustc_typeck/astconv.rs | 14 +- src/librustc_typeck/check/dropck.rs | 4 +- src/librustc_typeck/check/method/mod.rs | 4 +- src/librustc_typeck/check/method/probe.rs | 24 +- src/librustc_typeck/check/mod.rs | 64 ++--- src/librustc_typeck/check/regionck.rs | 6 +- src/librustc_typeck/check/wf.rs | 2 +- src/librustc_typeck/check/writeback.rs | 2 +- src/librustc_typeck/lib.rs | 5 +- src/librustc_typeck/rscope.rs | 32 +-- src/librustc_typeck/variance.rs | 22 +- src/librustdoc/clean/mod.rs | 22 +- src/librustdoc/html/markdown.rs | 2 +- src/librustdoc/html/render.rs | 8 +- src/librustdoc/html/toc.rs | 2 +- src/librustdoc/lib.rs | 9 +- src/librustdoc/markdown.rs | 4 +- src/librustdoc/test.rs | 4 +- src/libserialize/hex.rs | 12 +- src/libserialize/json.rs | 196 +++++++-------- src/libserialize/lib.rs | 1 - src/libserialize/serialize.rs | 86 +++---- src/libstd/collections/hash/map.rs | 24 +- src/libstd/fs/tempdir.rs | 2 +- src/libstd/io/buffered.rs | 4 +- src/libstd/lib.rs | 1 - src/libstd/num/f32.rs | 42 ++-- src/libstd/num/f64.rs | 42 ++-- src/libstd/num/strconv.rs | 52 ++-- src/libstd/old_io/buffered.rs | 30 +-- src/libstd/old_io/comm_adapters.rs | 6 +- src/libstd/old_io/extensions.rs | 30 +-- src/libstd/old_io/fs.rs | 18 +- src/libstd/old_io/mem.rs | 32 +-- src/libstd/old_io/mod.rs | 86 +++---- src/libstd/old_io/net/addrinfo.rs | 8 +- src/libstd/old_io/net/ip.rs | 4 +- src/libstd/old_io/net/pipe.rs | 2 +- src/libstd/old_io/net/tcp.rs | 28 +-- src/libstd/old_io/net/udp.rs | 6 +- src/libstd/old_io/pipe.rs | 2 +- src/libstd/old_io/process.rs | 36 +-- src/libstd/old_io/result.rs | 2 +- src/libstd/old_io/stdio.rs | 18 +- src/libstd/old_io/tempfile.rs | 2 +- src/libstd/old_io/util.rs | 28 +-- src/libstd/old_path/posix.rs | 2 +- src/libstd/old_path/windows.rs | 26 +- src/libstd/os.rs | 54 ++-- src/libstd/rand/mod.rs | 48 ++-- src/libstd/rand/reader.rs | 2 +- src/libstd/rt/args.rs | 8 +- src/libstd/rt/libunwind.rs | 14 +- src/libstd/rt/mod.rs | 14 +- src/libstd/rt/unwind.rs | 14 +- src/libstd/rt/util.rs | 2 +- src/libstd/sync/mpsc/mod.rs | 8 +- src/libstd/sync/mpsc/shared.rs | 2 +- src/libstd/sync/rwlock.rs | 2 +- src/libstd/sync/semaphore.rs | 4 +- src/libstd/sys/common/backtrace.rs | 8 +- src/libstd/sys/common/helper_thread.rs | 14 +- src/libstd/sys/common/mod.rs | 12 +- src/libstd/sys/common/net.rs | 58 ++--- src/libstd/sys/common/stack.rs | 50 ++-- src/libstd/sys/common/thread_info.rs | 6 +- src/libstd/sys/common/thread_local.rs | 14 +- src/libstd/sys/common/wtf8.rs | 34 +-- src/libstd/sys/unix/backtrace.rs | 10 +- src/libstd/sys/unix/c.rs | 6 +- src/libstd/sys/unix/fs.rs | 18 +- src/libstd/sys/unix/os.rs | 8 +- src/libstd/sys/unix/pipe.rs | 4 +- src/libstd/sys/unix/process.rs | 10 +- src/libstd/sys/unix/stack_overflow.rs | 6 +- src/libstd/sys/unix/sync.rs | 24 +- src/libstd/sys/unix/tcp.rs | 2 +- src/libstd/sys/unix/timer.rs | 12 +- src/libstd/sys/unix/tty.rs | 6 +- src/libstd/sys/windows/backtrace.rs | 4 +- src/libstd/sys/windows/fs.rs | 18 +- src/libstd/sys/windows/pipe.rs | 18 +- src/libstd/sys/windows/process.rs | 10 +- src/libstd/sys/windows/stack_overflow.rs | 6 +- src/libstd/sys/windows/tcp.rs | 2 +- src/libstd/sys/windows/thread.rs | 4 +- src/libstd/sys/windows/thread_local.rs | 10 +- src/libstd/sys/windows/timer.rs | 6 +- src/libstd/sys/windows/tty.rs | 10 +- src/libsyntax/ext/quote.rs | 4 +- src/libsyntax/lib.rs | 1 - src/libterm/lib.rs | 1 - src/libterm/terminfo/mod.rs | 4 +- src/libterm/terminfo/parm.rs | 40 +-- src/libterm/terminfo/parser/compiled.rs | 30 +-- src/libterm/terminfo/searcher.rs | 2 +- src/libtest/lib.rs | 43 ++-- src/test/auxiliary/ambig_impl_2_lib.rs | 4 +- src/test/auxiliary/anon_trait_static_method_lib.rs | 2 +- src/test/auxiliary/associated-types-cc-lib.rs | 6 +- src/test/auxiliary/cci_borrow_lib.rs | 2 +- src/test/auxiliary/cci_class.rs | 6 +- src/test/auxiliary/cci_class_2.rs | 6 +- src/test/auxiliary/cci_class_3.rs | 8 +- src/test/auxiliary/cci_class_4.rs | 6 +- src/test/auxiliary/cci_class_5.rs | 6 +- src/test/auxiliary/cci_class_6.rs | 8 +- src/test/auxiliary/cci_class_cast.rs | 6 +- src/test/auxiliary/cci_const.rs | 4 +- src/test/auxiliary/cci_const_block.rs | 4 +- src/test/auxiliary/cci_impl_lib.rs | 6 +- src/test/auxiliary/cci_intrinsic.rs | 2 +- src/test/auxiliary/cci_nested_lib.rs | 8 +- src/test/auxiliary/cci_no_inline_lib.rs | 2 +- src/test/auxiliary/cfg_inner_static.rs | 2 +- src/test/auxiliary/changing-crates-b.rs | 2 +- src/test/auxiliary/crateresolve1-1.rs | 2 +- src/test/auxiliary/crateresolve1-2.rs | 2 +- src/test/auxiliary/crateresolve1-3.rs | 2 +- src/test/auxiliary/crateresolve3-1.rs | 2 +- src/test/auxiliary/crateresolve3-2.rs | 2 +- src/test/auxiliary/crateresolve4a-1.rs | 2 +- src/test/auxiliary/crateresolve4a-2.rs | 2 +- src/test/auxiliary/crateresolve4b-1.rs | 2 +- src/test/auxiliary/crateresolve4b-2.rs | 2 +- src/test/auxiliary/crateresolve5-1.rs | 4 +- src/test/auxiliary/crateresolve5-2.rs | 4 +- src/test/auxiliary/crateresolve7x.rs | 4 +- src/test/auxiliary/crateresolve8-1.rs | 2 +- src/test/auxiliary/crateresolve_calories-1.rs | 2 +- src/test/auxiliary/crateresolve_calories-2.rs | 2 +- src/test/auxiliary/extern_calling_convention.rs | 4 +- src/test/auxiliary/go_trait.rs | 16 +- src/test/auxiliary/impl_privacy_xc_1.rs | 2 +- src/test/auxiliary/impl_privacy_xc_2.rs | 2 +- src/test/auxiliary/inherit_struct_lib.rs | 4 +- src/test/auxiliary/inherited_stability.rs | 2 +- src/test/auxiliary/inner_static.rs | 26 +- src/test/auxiliary/issue-11224.rs | 4 +- src/test/auxiliary/issue-11225-1.rs | 2 +- src/test/auxiliary/issue-11225-2.rs | 2 +- src/test/auxiliary/issue-11529.rs | 2 +- src/test/auxiliary/issue-17718.rs | 8 +- src/test/auxiliary/issue-2414-a.rs | 2 +- src/test/auxiliary/issue-2526.rs | 6 +- src/test/auxiliary/issue-5521.rs | 2 +- src/test/auxiliary/issue-8044.rs | 2 +- src/test/auxiliary/issue-9906.rs | 4 +- src/test/auxiliary/issue13507.rs | 16 +- src/test/auxiliary/issue_11680.rs | 4 +- src/test/auxiliary/issue_17718_const_privacy.rs | 6 +- src/test/auxiliary/issue_19293.rs | 2 +- src/test/auxiliary/issue_2723_a.rs | 2 +- src/test/auxiliary/issue_3979_traits.rs | 6 +- src/test/auxiliary/issue_9188.rs | 10 +- src/test/auxiliary/lang-item-public.rs | 2 +- src/test/auxiliary/linkage-visibility.rs | 6 +- src/test/auxiliary/linkage1.rs | 2 +- src/test/auxiliary/lint_output_format.rs | 6 +- src/test/auxiliary/lint_stability.rs | 16 +- src/test/auxiliary/logging_right_crate.rs | 2 +- src/test/auxiliary/macro_crate_nonterminal.rs | 2 +- src/test/auxiliary/moves_based_on_type_lib.rs | 2 +- src/test/auxiliary/namespaced_enum_emulate_flat.rs | 8 +- src/test/auxiliary/namespaced_enums.rs | 4 +- src/test/auxiliary/nested_item.rs | 8 +- src/test/auxiliary/newtype_struct_xc.rs | 2 +- src/test/auxiliary/noexporttypelib.rs | 2 +- .../plugin_crate_outlive_expansion_phase.rs | 2 +- src/test/auxiliary/priv-impl-prim-ty.rs | 2 +- src/test/auxiliary/privacy_tuple_struct.rs | 6 +- src/test/auxiliary/pub_use_xcrate1.rs | 2 +- src/test/auxiliary/reexported_static_methods.rs | 10 +- ...unded_method_type_parameters_cross_crate_lib.rs | 6 +- src/test/auxiliary/roman_numerals.rs | 2 +- src/test/auxiliary/sepcomp-extern-lib.rs | 2 +- src/test/auxiliary/sepcomp_cci_lib.rs | 4 +- src/test/auxiliary/sepcomp_lib.rs | 6 +- src/test/auxiliary/static-function-pointer-aux.rs | 6 +- src/test/auxiliary/static_fn_inline_xc_aux.rs | 4 +- src/test/auxiliary/static_fn_trait_xc_aux.rs | 4 +- src/test/auxiliary/static_mut_xc.rs | 2 +- src/test/auxiliary/static_priv_by_default.rs | 20 +- .../auxiliary/struct_destructuring_cross_crate.rs | 4 +- src/test/auxiliary/struct_field_privacy.rs | 8 +- src/test/auxiliary/struct_variant_privacy.rs | 2 +- src/test/auxiliary/svh-a-base.rs | 6 +- src/test/auxiliary/svh-a-change-lit.rs | 6 +- src/test/auxiliary/svh-a-change-significant-cfg.rs | 6 +- src/test/auxiliary/svh-a-change-trait-bound.rs | 6 +- src/test/auxiliary/svh-a-change-type-arg.rs | 6 +- src/test/auxiliary/svh-a-change-type-ret.rs | 4 +- src/test/auxiliary/svh-a-change-type-static.rs | 4 +- src/test/auxiliary/svh-a-comment.rs | 6 +- src/test/auxiliary/svh-a-doc.rs | 6 +- src/test/auxiliary/svh-a-macro.rs | 6 +- src/test/auxiliary/svh-a-no-change.rs | 6 +- src/test/auxiliary/svh-a-redundant-cfg.rs | 6 +- src/test/auxiliary/svh-a-whitespace.rs | 6 +- src/test/auxiliary/svh-uta-base.rs | 6 +- src/test/auxiliary/svh-uta-change-use-trait.rs | 6 +- .../auxiliary/syntax_extension_with_dll_deps_1.rs | 2 +- .../trait_bounds_on_structs_and_enums_xc.rs | 4 +- src/test/auxiliary/trait_default_method_xc_aux.rs | 22 +- .../auxiliary/trait_default_method_xc_aux_2.rs | 4 +- src/test/auxiliary/trait_impl_conflict.rs | 2 +- .../auxiliary/trait_inheritance_auto_xc_2_aux.rs | 14 +- .../auxiliary/trait_inheritance_auto_xc_aux.rs | 6 +- .../trait_inheritance_cross_trait_call_xc_aux.rs | 6 +- .../auxiliary/trait_inheritance_overloading_xc.rs | 4 +- src/test/auxiliary/trait_safety_lib.rs | 6 +- src/test/auxiliary/typeid-intrinsic.rs | 8 +- src/test/auxiliary/typeid-intrinsic2.rs | 8 +- src/test/auxiliary/unboxed-closures-cross-crate.rs | 2 +- src/test/auxiliary/xc_private_method_lib.rs | 10 +- src/test/auxiliary/xcrate_address_insignificant.rs | 8 +- src/test/auxiliary/xcrate_static_addresses.rs | 18 +- src/test/auxiliary/xcrate_struct_aliases.rs | 4 +- src/test/auxiliary/xcrate_unit_struct.rs | 6 +- src/test/bench/msgsend-pipes-shared.rs | 8 +- src/test/bench/msgsend-pipes.rs | 10 +- src/test/bench/msgsend-ring-mutex-arcs.rs | 12 +- src/test/bench/noise.rs | 8 +- src/test/bench/shootout-chameneos-redux.rs | 10 +- src/test/bench/shootout-fannkuch-redux.rs | 16 +- src/test/bench/shootout-k-nucleotide-pipes.rs | 16 +- src/test/bench/shootout-nbody.rs | 4 +- src/test/bench/shootout-pfib.rs | 2 +- src/test/bench/shootout-reverse-complement.rs | 20 +- src/test/bench/shootout-spectralnorm.rs | 10 +- src/test/bench/task-perf-alloc-unwind.rs | 4 +- src/test/bench/task-perf-jargon-metal-smoke.rs | 2 +- src/test/codegen/iterate-over-array.rs | 2 +- src/test/codegen/scalar-function-call.rs | 2 +- src/test/codegen/single-return-value.rs | 2 +- src/test/codegen/small-dense-int-switch.rs | 2 +- src/test/codegen/static-method-call-multi.rs | 6 +- src/test/codegen/static-method-call.rs | 6 +- .../codegen/virtual-method-call-struct-return.rs | 4 +- src/test/codegen/virtual-method-call.rs | 4 +- src/test/compile-fail/feature-gate-int-uint.rs | 37 --- src/test/compile-fail/issue-19660.rs | 2 +- src/test/compile-fail/lint-type-limits.rs | 4 +- src/test/debuginfo/basic-types-globals-metadata.rs | 4 +- src/test/debuginfo/basic-types-globals.rs | 4 +- src/test/debuginfo/basic-types-mut-globals.rs | 4 +- src/test/debuginfo/basic-types.rs | 6 +- src/test/debuginfo/borrowed-basic.rs | 8 +- src/test/debuginfo/borrowed-struct.rs | 6 +- src/test/debuginfo/borrowed-unique-basic.rs | 8 +- .../debuginfo/by-value-non-immediate-argument.rs | 6 +- .../by-value-self-argument-in-trait-impl.rs | 14 +- src/test/debuginfo/destructured-fn-argument.rs | 26 +- src/test/debuginfo/destructured-local.rs | 8 +- src/test/debuginfo/function-arg-initialization.rs | 2 +- src/test/debuginfo/function-arguments.rs | 2 +- .../function-prologue-stepping-no-stack-check.rs | 2 +- .../function-prologue-stepping-regular.rs | 2 +- .../gdb-pretty-struct-and-enums-pre-gdb-7-7.rs | 2 +- src/test/debuginfo/gdb-pretty-struct-and-enums.rs | 6 +- src/test/debuginfo/generic-function.rs | 2 +- .../debuginfo/generic-method-on-generic-struct.rs | 6 +- .../generic-static-method-on-struct-and-enum.rs | 10 +- .../generic-trait-generic-static-default-method.rs | 9 +- src/test/debuginfo/issue12886.rs | 2 +- src/test/debuginfo/lexical-scope-in-match.rs | 4 +- .../debuginfo/lexical-scope-in-stack-closure.rs | 2 +- .../debuginfo/lexical-scope-in-unique-closure.rs | 2 +- .../lexical-scopes-in-block-expression.rs | 10 +- src/test/debuginfo/limited-debuginfo.rs | 4 +- src/test/debuginfo/method-on-enum.rs | 6 +- src/test/debuginfo/method-on-generic-struct.rs | 6 +- src/test/debuginfo/method-on-struct.rs | 8 +- src/test/debuginfo/method-on-trait.rs | 14 +- src/test/debuginfo/method-on-tuple-struct.rs | 8 +- src/test/debuginfo/recursive-struct.rs | 2 +- src/test/debuginfo/self-in-default-method.rs | 8 +- .../debuginfo/self-in-generic-default-method.rs | 8 +- .../debuginfo/static-method-on-struct-and-enum.rs | 10 +- .../trait-generic-static-default-method.rs | 6 +- src/test/debuginfo/trait-pointers.rs | 4 +- .../debuginfo/var-captured-in-nested-closure.rs | 4 +- .../debuginfo/var-captured-in-sendable-closure.rs | 6 +- .../debuginfo/var-captured-in-stack-closure.rs | 4 +- src/test/pretty/blank-lines.rs | 2 +- src/test/pretty/block-disambig.rs | 16 +- src/test/pretty/closure-reform-pretty.rs | 6 +- src/test/pretty/disamb-stmt-expr.rs | 4 +- src/test/pretty/do1.rs | 2 +- src/test/pretty/empty-impl.rs | 4 +- src/test/pretty/empty-lines.rs | 2 +- src/test/pretty/for-comment.rs | 2 +- src/test/pretty/path-type-bounds.rs | 2 +- src/test/pretty/record-trailing-comma.rs | 4 +- src/test/pretty/struct-tuple.rs | 4 +- src/test/pretty/trait-safety.rs | 2 +- src/test/pretty/unary-op-disambig.rs | 12 +- src/test/pretty/where-clauses.rs | 2 +- src/test/run-fail/args-panic.rs | 2 +- .../run-fail/bug-2470-bounds-check-overflow-2.rs | 4 +- .../run-fail/bug-2470-bounds-check-overflow-3.rs | 4 +- .../run-fail/bug-2470-bounds-check-overflow.rs | 10 +- src/test/run-fail/bug-811.rs | 6 +- src/test/run-fail/die-macro-expr.rs | 2 +- src/test/run-fail/expr-if-panic-fn.rs | 2 +- src/test/run-fail/expr-match-panic-fn.rs | 2 +- src/test/run-fail/extern-panic.rs | 2 +- src/test/run-fail/if-check-panic.rs | 4 +- src/test/run-fail/issue-2061.rs | 2 +- src/test/run-fail/issue-2444.rs | 2 +- src/test/run-fail/issue-948.rs | 2 +- src/test/run-fail/match-bot-panic.rs | 2 +- src/test/run-fail/match-disc-bot.rs | 2 +- src/test/run-fail/match-wildcards.rs | 2 +- src/test/run-fail/panic-arg.rs | 2 +- src/test/run-fail/result-get-panic.rs | 2 +- src/test/run-fail/rt-set-exit-status-panic2.rs | 4 +- src/test/run-fail/unwind-rec.rs | 4 +- src/test/run-fail/unwind-rec2.rs | 6 +- src/test/run-fail/vec-overrun.rs | 4 +- src/test/run-fail/while-body-panics.rs | 2 +- src/test/run-make/extern-fn-reachable/main.rs | 10 +- .../run-make/intrinsic-unreachable/exit-ret.rs | 2 +- .../intrinsic-unreachable/exit-unreachable.rs | 2 +- src/test/run-make/issue-7349/foo.rs | 8 +- .../run-make/metadata-flag-frobs-symbols/foo.rs | 4 +- src/test/run-make/mixing-deps/both.rs | 2 +- src/test/run-make/mixing-deps/dylib.rs | 2 +- src/test/run-make/mixing-deps/prog.rs | 2 +- src/test/run-make/pretty-expanded/input.rs | 6 +- src/test/run-make/rustdoc-smoke/foo.rs | 4 +- src/test/run-make/save-analysis/foo.rs | 4 +- src/test/run-make/sepcomp-cci-copies/cci_lib.rs | 2 +- src/test/run-make/sepcomp-cci-copies/foo.rs | 6 +- src/test/run-make/sepcomp-separate/foo.rs | 6 +- src/test/run-make/symbols-are-reasonable/lib.rs | 4 +- src/test/run-make/target-specs/foo.rs | 2 +- src/test/run-make/volatile-intrinsics/main.rs | 2 +- src/test/run-pass-fulldeps/issue-16822.rs | 2 +- .../issue-18763-quote-token-tree.rs | 4 +- src/test/run-pass-fulldeps/qquote.rs | 8 +- src/test/run-pass-fulldeps/quote-tokens.rs | 4 +- src/test/run-pass-valgrind/dst-dtor-2.rs | 2 +- src/test/run-pass/alias-uninit-value.rs | 2 +- src/test/run-pass/alloca-from-derived-tydesc.rs | 2 +- src/test/run-pass/anon-trait-static-method.rs | 2 +- src/test/run-pass/argument-passing.rs | 6 +- src/test/run-pass/arith-0.rs | 2 +- src/test/run-pass/arith-1.rs | 6 +- src/test/run-pass/arith-2.rs | 2 +- src/test/run-pass/artificial-block.rs | 2 +- src/test/run-pass/as-precedence.rs | 10 +- src/test/run-pass/asm-in-out-operand.rs | 4 +- src/test/run-pass/asm-out-assign.rs | 2 +- src/test/run-pass/assert-eq-macro-success.rs | 2 +- src/test/run-pass/assign-assign.rs | 4 +- src/test/run-pass/assignability-trait.rs | 10 +- src/test/run-pass/associated-types-basic.rs | 4 +- .../associated-types-binding-in-where-clause.rs | 8 +- .../run-pass/associated-types-constant-type.rs | 18 +- .../associated-types-doubleendediterator-object.rs | 2 +- .../run-pass/associated-types-in-default-method.rs | 6 +- src/test/run-pass/associated-types-in-fn.rs | 6 +- .../run-pass/associated-types-in-impl-generics.rs | 6 +- .../associated-types-in-inherent-method.rs | 6 +- src/test/run-pass/associated-types-issue-20371.rs | 2 +- .../run-pass/associated-types-iterator-binding.rs | 2 +- ...ciated-types-projection-bound-in-supertraits.rs | 4 +- .../associated-types-ref-in-struct-literal.rs | 4 +- .../run-pass/associated-types-resolve-lifetime.rs | 2 +- src/test/run-pass/associated-types-return.rs | 10 +- src/test/run-pass/associated-types-simple.rs | 6 +- src/test/run-pass/associated-types-sugar-path.rs | 8 +- src/test/run-pass/attr-no-drop-flag-size.rs | 2 +- src/test/run-pass/attr-start.rs | 2 +- src/test/run-pass/auto-encode.rs | 12 +- src/test/run-pass/auto-instantiate.rs | 2 +- src/test/run-pass/auto-ref-bounded-ty-param.rs | 2 +- src/test/run-pass/auto-ref.rs | 2 +- src/test/run-pass/autobind.rs | 2 +- .../autoderef-and-borrow-method-receiver.rs | 2 +- src/test/run-pass/autoderef-method-on-trait.rs | 8 +- src/test/run-pass/autoderef-method-priority.rs | 10 +- .../autoderef-method-twice-but-not-thrice.rs | 6 +- src/test/run-pass/autoderef-method-twice.rs | 6 +- src/test/run-pass/autoderef-method.rs | 6 +- .../autoref-intermediate-types-issue-3585.rs | 2 +- .../run-pass/bind-field-short-with-modifiers.rs | 2 +- src/test/run-pass/binops.rs | 10 +- src/test/run-pass/bitwise.rs | 8 +- src/test/run-pass/block-arg-call-as.rs | 2 +- src/test/run-pass/block-fn-coerce.rs | 4 +- src/test/run-pass/borrow-by-val-method-receiver.rs | 2 +- src/test/run-pass/borrow-tuple-fields.rs | 2 +- src/test/run-pass/borrowck-assign-to-subfield.rs | 4 +- src/test/run-pass/borrowck-binding-mutbl.rs | 4 +- .../run-pass/borrowck-borrow-from-expr-block.rs | 8 +- .../borrowck-borrow-of-mut-base-ptr-safe.rs | 10 +- src/test/run-pass/borrowck-field-sensitivity.rs | 4 +- src/test/run-pass/borrowck-freeze-frozen-mut.rs | 2 +- src/test/run-pass/borrowck-lend-args.rs | 8 +- .../borrowck-macro-interaction-issue-6304.rs | 6 +- src/test/run-pass/borrowck-move-by-capture-ok.rs | 2 +- src/test/run-pass/borrowck-mut-uniq.rs | 8 +- src/test/run-pass/borrowck-mut-vec-as-imm-slice.rs | 4 +- src/test/run-pass/borrowck-nested-calls.rs | 6 +- src/test/run-pass/borrowck-pat-enum.rs | 10 +- src/test/run-pass/borrowck-rvalues-mutable.rs | 8 +- .../run-pass/borrowck-scope-of-deref-issue-4666.rs | 6 +- src/test/run-pass/borrowck-uniq-via-ref.rs | 10 +- src/test/run-pass/borrowck-univariant-enum.rs | 2 +- src/test/run-pass/borrowck-use-mut-borrow.rs | 2 +- src/test/run-pass/borrowed-ptr-pattern-3.rs | 2 +- src/test/run-pass/borrowed-ptr-pattern-option.rs | 2 +- src/test/run-pass/break-value.rs | 2 +- src/test/run-pass/bug-7183-generics.rs | 6 +- .../run-pass/builtin-superkinds-capabilities-xc.rs | 2 +- .../run-pass/builtin-superkinds-capabilities.rs | 2 +- src/test/run-pass/builtin-superkinds-simple.rs | 2 +- src/test/run-pass/by-value-self-in-mut-slot.rs | 2 +- src/test/run-pass/c-stack-returning-int64.rs | 4 +- .../run-pass/call-closure-from-overloaded-op.rs | 4 +- .../run-pass/capture-clauses-unboxed-closures.rs | 2 +- src/test/run-pass/cast-in-array-size.rs | 10 +- src/test/run-pass/cast-region-to-uint.rs | 4 +- src/test/run-pass/cast.rs | 2 +- src/test/run-pass/cell-does-not-clone.rs | 2 +- src/test/run-pass/cfgs-on-items.rs | 10 +- src/test/run-pass/check-static-mut-slices.rs | 2 +- src/test/run-pass/check-static-slice.rs | 26 +- .../run-pass/class-cast-to-trait-multiple-types.rs | 24 +- src/test/run-pass/class-cast-to-trait.rs | 6 +- src/test/run-pass/class-dtor.rs | 6 +- src/test/run-pass/class-exports.rs | 2 +- .../class-impl-very-parameterized-trait.rs | 28 +-- .../run-pass/class-implement-trait-cross-crate.rs | 6 +- src/test/run-pass/class-implement-traits.rs | 6 +- src/test/run-pass/class-methods.rs | 8 +- src/test/run-pass/class-poly-methods.rs | 10 +- src/test/run-pass/class-separate-impl.rs | 6 +- src/test/run-pass/class-typarams.rs | 10 +- src/test/run-pass/classes-simple-method.rs | 6 +- src/test/run-pass/classes-simple.rs | 6 +- src/test/run-pass/classes.rs | 6 +- src/test/run-pass/cleanup-arm-conditional.rs | 6 +- .../run-pass/cleanup-rvalue-during-if-and-while.rs | 2 +- .../cleanup-rvalue-temp-during-incomplete-alloc.rs | 6 +- src/test/run-pass/cleanup-shortcircuit.rs | 2 +- src/test/run-pass/clone-with-exterior.rs | 4 +- src/test/run-pass/cmp-default.rs | 4 +- src/test/run-pass/coerce-expect-unsized.rs | 26 +- src/test/run-pass/coerce-match-calls.rs | 4 +- src/test/run-pass/coerce-match.rs | 4 +- src/test/run-pass/coerce-reborrow-imm-ptr-arg.rs | 6 +- src/test/run-pass/coerce-reborrow-imm-ptr-rcvr.rs | 6 +- src/test/run-pass/coerce-reborrow-imm-vec-arg.rs | 6 +- src/test/run-pass/coerce-reborrow-imm-vec-rcvr.rs | 4 +- src/test/run-pass/coerce-reborrow-mut-ptr-arg.rs | 2 +- src/test/run-pass/coerce-reborrow-mut-ptr-rcvr.rs | 2 +- src/test/run-pass/coerce-reborrow-mut-vec-arg.rs | 4 +- src/test/run-pass/coerce-reborrow-mut-vec-rcvr.rs | 2 +- src/test/run-pass/coherence-impl-in-fn.rs | 2 +- src/test/run-pass/coherence-multidispatch-tuple.rs | 8 +- src/test/run-pass/coherence-where-clause.rs | 2 +- src/test/run-pass/comm.rs | 2 +- src/test/run-pass/compare-generic-enums.rs | 4 +- src/test/run-pass/complex.rs | 12 +- src/test/run-pass/conditional-compile.rs | 16 +- src/test/run-pass/const-binops.rs | 34 +-- .../run-pass/const-block-item-macro-codegen.rs | 8 +- src/test/run-pass/const-block-item.rs | 16 +- src/test/run-pass/const-bound.rs | 2 +- src/test/run-pass/const-const.rs | 4 +- src/test/run-pass/const-contents.rs | 8 +- src/test/run-pass/const-cross-crate-const.rs | 4 +- src/test/run-pass/const-deref.rs | 4 +- src/test/run-pass/const-enum-byref-self.rs | 2 +- src/test/run-pass/const-enum-byref.rs | 2 +- src/test/run-pass/const-enum-cast.rs | 8 +- src/test/run-pass/const-enum-ptr.rs | 2 +- src/test/run-pass/const-enum-structlike.rs | 2 +- src/test/run-pass/const-enum-vec-index.rs | 2 +- src/test/run-pass/const-enum-vec-ptr.rs | 2 +- src/test/run-pass/const-enum-vector.rs | 2 +- .../run-pass/const-expr-in-fixed-length-vec.rs | 4 +- src/test/run-pass/const-expr-in-vec-repeat.rs | 2 +- src/test/run-pass/const-fields-and-indexing.rs | 18 +- src/test/run-pass/const-fn-val.rs | 6 +- src/test/run-pass/const-negative.rs | 2 +- src/test/run-pass/const-nullary-univariant-enum.rs | 4 +- src/test/run-pass/const-region-ptrs-noncopy.rs | 2 +- src/test/run-pass/const-region-ptrs.rs | 4 +- src/test/run-pass/const-struct.rs | 2 +- src/test/run-pass/const-tuple-struct.rs | 2 +- src/test/run-pass/const-vec-syntax.rs | 2 +- src/test/run-pass/const-vecs-and-slices.rs | 8 +- src/test/run-pass/const.rs | 2 +- src/test/run-pass/consts-in-patterns.rs | 6 +- src/test/run-pass/dead-code-leading-underscore.rs | 6 +- src/test/run-pass/deep.rs | 4 +- src/test/run-pass/default-method-parsing.rs | 2 +- src/test/run-pass/default-method-simple.rs | 2 +- .../run-pass/default-method-supertrait-vtable.rs | 12 +- src/test/run-pass/deref-mut-on-ref.rs | 4 +- src/test/run-pass/deref-on-ref.rs | 4 +- src/test/run-pass/deref.rs | 4 +- src/test/run-pass/deriving-clone-generic-enum.rs | 2 +- src/test/run-pass/deriving-clone-struct.rs | 4 +- src/test/run-pass/deriving-cmp-shortcircuit.rs | 2 +- .../deriving-encodable-decodable-cell-refcell.rs | 2 +- src/test/run-pass/deriving-encodable-decodable.rs | 14 +- src/test/run-pass/deriving-enum-single-variant.rs | 2 +- src/test/run-pass/deriving-global.rs | 6 +- src/test/run-pass/deriving-hash.rs | 4 +- src/test/run-pass/deriving-in-fn.rs | 2 +- src/test/run-pass/deriving-meta-multiple.rs | 4 +- src/test/run-pass/deriving-meta.rs | 4 +- src/test/run-pass/deriving-rand.rs | 4 +- .../deriving-self-lifetime-totalord-totaleq.rs | 2 +- src/test/run-pass/deriving-self-lifetime.rs | 2 +- src/test/run-pass/deriving-show-2.rs | 12 +- src/test/run-pass/deriving-show.rs | 8 +- src/test/run-pass/deriving-via-extension-enum.rs | 2 +- .../run-pass/deriving-via-extension-hash-enum.rs | 4 +- .../run-pass/deriving-via-extension-hash-struct.rs | 6 +- ...iving-via-extension-struct-like-enum-variant.rs | 2 +- .../deriving-via-extension-struct-tuple.rs | 2 +- src/test/run-pass/deriving-via-extension-struct.rs | 6 +- .../run-pass/deriving-via-extension-type-params.rs | 4 +- src/test/run-pass/die-macro.rs | 2 +- src/test/run-pass/div-mod.rs | 4 +- src/test/run-pass/double-ref.rs | 28 +-- src/test/run-pass/drop-on-empty-block-exit.rs | 2 +- src/test/run-pass/drop-on-ret.rs | 2 +- src/test/run-pass/drop-struct-as-object.rs | 8 +- src/test/run-pass/drop-trait-enum.rs | 2 +- src/test/run-pass/drop-trait.rs | 2 +- src/test/run-pass/dst-deref-mut.rs | 10 +- src/test/run-pass/dst-deref.rs | 8 +- src/test/run-pass/dst-index.rs | 10 +- src/test/run-pass/dst-raw.rs | 6 +- src/test/run-pass/dst-struct-sole.rs | 12 +- src/test/run-pass/dst-struct.rs | 30 +-- src/test/run-pass/dst-trait.rs | 10 +- src/test/run-pass/early-ret-binop-add.rs | 2 +- src/test/run-pass/early-vtbl-resolution.rs | 4 +- src/test/run-pass/empty-mutable-vec.rs | 2 +- src/test/run-pass/empty-tag.rs | 2 +- src/test/run-pass/enum-alignment.rs | 6 +- src/test/run-pass/enum-clike-ffi-as-int.rs | 4 +- src/test/run-pass/enum-discr.rs | 4 +- src/test/run-pass/enum-discrim-manual-sizing.rs | 8 +- src/test/run-pass/enum-disr-val-pretty.rs | 4 +- src/test/run-pass/enum-null-pointer-opt.rs | 30 +-- .../enum-nullable-const-null-with-fields.rs | 2 +- src/test/run-pass/enum-size-variance.rs | 14 +- src/test/run-pass/enum-vec-initializer.rs | 8 +- src/test/run-pass/evec-internal.rs | 10 +- src/test/run-pass/evec-slice.rs | 12 +- src/test/run-pass/explicit-i-suffix.rs | 4 +- src/test/run-pass/explicit-self-closures.rs | 4 +- src/test/run-pass/explicit-self-generic.rs | 4 +- src/test/run-pass/explicit-self-objects-uniq.rs | 2 +- src/test/run-pass/explicit-self.rs | 8 +- src/test/run-pass/export-glob-imports-target.rs | 2 +- src/test/run-pass/expr-block-fn.rs | 2 +- src/test/run-pass/expr-block-generic-unique2.rs | 4 +- src/test/run-pass/expr-block-generic.rs | 4 +- src/test/run-pass/expr-block-slot.rs | 4 +- src/test/run-pass/expr-block.rs | 2 +- src/test/run-pass/expr-copy.rs | 2 +- src/test/run-pass/expr-fn.rs | 14 +- src/test/run-pass/expr-if-generic.rs | 4 +- src/test/run-pass/expr-if-struct.rs | 4 +- src/test/run-pass/expr-match-generic-unique2.rs | 4 +- src/test/run-pass/expr-match-generic.rs | 4 +- src/test/run-pass/expr-match-struct.rs | 4 +- src/test/run-pass/exterior.rs | 2 +- src/test/run-pass/extern-call-direct.rs | 2 +- .../run-pass/extern-compare-with-return-type.rs | 12 +- src/test/run-pass/fact.rs | 4 +- src/test/run-pass/fixup-deref-mut.rs | 6 +- src/test/run-pass/fn-bare-assign.rs | 4 +- src/test/run-pass/fn-bare-size.rs | 2 +- src/test/run-pass/fn-bare-spawn.rs | 2 +- src/test/run-pass/fn-item-type-cast.rs | 6 +- src/test/run-pass/fn-item-type-coerce.rs | 6 +- src/test/run-pass/fn-lval.rs | 4 +- src/test/run-pass/fn-pattern-expected-type-2.rs | 2 +- src/test/run-pass/fn-pattern-expected-type.rs | 2 +- src/test/run-pass/for-destruct.rs | 2 +- src/test/run-pass/for-loop-goofiness.rs | 2 +- src/test/run-pass/for-loop-no-std.rs | 2 +- src/test/run-pass/for-loop-panic.rs | 2 +- src/test/run-pass/foreach-nested.rs | 8 +- src/test/run-pass/foreach-put-structured.rs | 10 +- src/test/run-pass/foreach-simple-outer-slot.rs | 6 +- src/test/run-pass/foreign-call-no-runtime.rs | 2 +- src/test/run-pass/foreign-fn-linkname.rs | 4 +- src/test/run-pass/format-no-std.rs | 2 +- src/test/run-pass/fsu-moves-and-copies.rs | 16 +- src/test/run-pass/fun-call-variants.rs | 8 +- src/test/run-pass/fun-indirect-call.rs | 6 +- src/test/run-pass/func-arg-incomplete-pattern.rs | 10 +- src/test/run-pass/func-arg-ref-pattern.rs | 8 +- src/test/run-pass/func-arg-wild-pattern.rs | 2 +- src/test/run-pass/functional-struct-upd.rs | 4 +- src/test/run-pass/generic-alias-unique.rs | 2 +- .../generic-default-type-params-cross-crate.rs | 8 +- src/test/run-pass/generic-default-type-params.rs | 10 +- src/test/run-pass/generic-derived-type.rs | 2 +- src/test/run-pass/generic-exterior-unique.rs | 4 +- src/test/run-pass/generic-fn-infer.rs | 2 +- src/test/run-pass/generic-fn-twice.rs | 2 +- src/test/run-pass/generic-fn.rs | 4 +- src/test/run-pass/generic-object.rs | 8 +- src/test/run-pass/generic-recursive-tag.rs | 10 +- src/test/run-pass/generic-tag-match.rs | 2 +- src/test/run-pass/generic-tag-values.rs | 6 +- src/test/run-pass/generic-tag.rs | 4 +- src/test/run-pass/generic-temporary.rs | 10 +- src/test/run-pass/generic-type.rs | 2 +- src/test/run-pass/generic-unique.rs | 2 +- src/test/run-pass/global-scope.rs | 4 +- src/test/run-pass/guards-not-exhaustive.rs | 4 +- src/test/run-pass/guards.rs | 6 +- src/test/run-pass/hashmap-memory.rs | 8 +- .../run-pass/hrtb-binder-levels-in-object-types.rs | 4 +- .../hrtb-debruijn-object-types-in-closures.rs | 2 +- src/test/run-pass/hrtb-fn-like-trait-object.rs | 2 +- src/test/run-pass/hrtb-fn-like-trait.rs | 2 +- .../hrtb-precedence-of-plus-where-clause.rs | 8 +- src/test/run-pass/hrtb-precedence-of-plus.rs | 6 +- src/test/run-pass/hrtb-resolve-lifetime.rs | 2 +- .../hrtb-trait-object-passed-to-closure.rs | 6 +- src/test/run-pass/hrtb-unboxed-closure-trait.rs | 4 +- src/test/run-pass/hygiene-dodging-1.rs | 2 +- src/test/run-pass/hygienic-labels-in-let.rs | 8 +- src/test/run-pass/if-bot.rs | 2 +- src/test/run-pass/if-check.rs | 4 +- src/test/run-pass/if-let.rs | 6 +- src/test/run-pass/ignore-all-the-things.rs | 4 +- src/test/run-pass/impl-implicit-trait.rs | 2 +- src/test/run-pass/import.rs | 2 +- src/test/run-pass/import8.rs | 2 +- src/test/run-pass/infer-fn-tail-expr.rs | 2 +- src/test/run-pass/infinite-loops.rs | 2 +- src/test/run-pass/init-res-into-things.rs | 4 +- src/test/run-pass/instantiable.rs | 2 +- src/test/run-pass/int.rs | 2 +- .../run-pass/integer-literal-suffix-inference.rs | 4 +- .../run-pass/into-iterator-type-inference-shift.rs | 2 +- src/test/run-pass/intrinsic-alignment.rs | 4 +- src/test/run-pass/intrinsic-move-val.rs | 2 +- src/test/run-pass/intrinsic-return-address.rs | 6 +- src/test/run-pass/intrinsic-uninit.rs | 2 +- src/test/run-pass/intrinsic-unreachable.rs | 2 +- src/test/run-pass/issue-10392.rs | 4 +- src/test/run-pass/issue-10682.rs | 2 +- src/test/run-pass/issue-10734.rs | 2 +- src/test/run-pass/issue-10806.rs | 10 +- src/test/run-pass/issue-11085.rs | 8 +- src/test/run-pass/issue-1112.rs | 2 +- src/test/run-pass/issue-11205.rs | 2 +- src/test/run-pass/issue-11267.rs | 6 +- src/test/run-pass/issue-11552.rs | 2 +- src/test/run-pass/issue-11577.rs | 4 +- src/test/run-pass/issue-11677.rs | 2 +- src/test/run-pass/issue-11736.rs | 2 +- src/test/run-pass/issue-11881.rs | 2 +- src/test/run-pass/issue-12860.rs | 6 +- src/test/run-pass/issue-12909.rs | 4 +- src/test/run-pass/issue-13027.rs | 6 +- src/test/run-pass/issue-13167.rs | 2 +- src/test/run-pass/issue-13204.rs | 2 +- src/test/run-pass/issue-13264.rs | 4 +- src/test/run-pass/issue-13405.rs | 4 +- src/test/run-pass/issue-13494.rs | 2 +- src/test/run-pass/issue-13703.rs | 2 +- src/test/run-pass/issue-13763.rs | 4 +- src/test/run-pass/issue-13775.rs | 2 +- src/test/run-pass/issue-13837.rs | 4 +- src/test/run-pass/issue-13867.rs | 2 +- src/test/run-pass/issue-14254.rs | 18 +- src/test/run-pass/issue-14308.rs | 2 +- src/test/run-pass/issue-14589.rs | 2 +- src/test/run-pass/issue-14837.rs | 2 +- src/test/run-pass/issue-14865.rs | 2 +- src/test/run-pass/issue-14919.rs | 10 +- src/test/run-pass/issue-14933.rs | 2 +- src/test/run-pass/issue-14936.rs | 4 +- src/test/run-pass/issue-15043.rs | 8 +- src/test/run-pass/issue-15104.rs | 2 +- src/test/run-pass/issue-15129.rs | 2 +- src/test/run-pass/issue-15261.rs | 4 +- src/test/run-pass/issue-15444.rs | 4 +- src/test/run-pass/issue-15689-1.rs | 2 +- src/test/run-pass/issue-15689-2.rs | 2 +- src/test/run-pass/issue-15734.rs | 22 +- src/test/run-pass/issue-15763.rs | 34 +-- src/test/run-pass/issue-15793.rs | 2 +- src/test/run-pass/issue-16151.rs | 2 +- src/test/run-pass/issue-16452.rs | 2 +- src/test/run-pass/issue-16492.rs | 6 +- src/test/run-pass/issue-1660.rs | 2 +- src/test/run-pass/issue-16643.rs | 2 +- src/test/run-pass/issue-16648.rs | 2 +- src/test/run-pass/issue-16774.rs | 8 +- src/test/run-pass/issue-17068.rs | 2 +- src/test/run-pass/issue-17302.rs | 4 +- src/test/run-pass/issue-17503.rs | 6 +- src/test/run-pass/issue-17662.rs | 4 +- src/test/run-pass/issue-17718-parse-const.rs | 2 +- .../run-pass/issue-17718-static-unsafe-interior.rs | 14 +- src/test/run-pass/issue-17718.rs | 18 +- src/test/run-pass/issue-17897.rs | 2 +- src/test/run-pass/issue-18412.rs | 8 +- src/test/run-pass/issue-18539.rs | 2 +- src/test/run-pass/issue-1866.rs | 2 +- src/test/run-pass/issue-18738.rs | 2 +- src/test/run-pass/issue-19358.rs | 2 +- src/test/run-pass/issue-19850.rs | 2 +- src/test/run-pass/issue-20414.rs | 4 +- src/test/run-pass/issue-2074.rs | 4 +- src/test/run-pass/issue-21384.rs | 2 +- src/test/run-pass/issue-2185.rs | 20 +- src/test/run-pass/issue-21891.rs | 6 +- src/test/run-pass/issue-2190-1.rs | 4 +- src/test/run-pass/issue-2214.rs | 8 +- src/test/run-pass/issue-2288.rs | 2 +- src/test/run-pass/issue-2312.rs | 2 +- src/test/run-pass/issue-2428.rs | 4 +- src/test/run-pass/issue-2445-b.rs | 8 +- src/test/run-pass/issue-2445.rs | 4 +- src/test/run-pass/issue-2463.rs | 2 +- src/test/run-pass/issue-2487-a.rs | 4 +- src/test/run-pass/issue-2550.rs | 4 +- src/test/run-pass/issue-2611-3.rs | 2 +- src/test/run-pass/issue-2631-b.rs | 2 +- src/test/run-pass/issue-2633-2.rs | 2 +- src/test/run-pass/issue-2642.rs | 2 +- src/test/run-pass/issue-2708.rs | 6 +- src/test/run-pass/issue-2718.rs | 14 +- src/test/run-pass/issue-2748-b.rs | 2 +- src/test/run-pass/issue-2804-2.rs | 2 +- src/test/run-pass/issue-2804.rs | 4 +- src/test/run-pass/issue-2895.rs | 12 +- src/test/run-pass/issue-2935.rs | 2 +- src/test/run-pass/issue-2936.rs | 10 +- src/test/run-pass/issue-3026.rs | 2 +- src/test/run-pass/issue-3220.rs | 2 +- src/test/run-pass/issue-3563-2.rs | 4 +- src/test/run-pass/issue-3563-3.rs | 24 +- src/test/run-pass/issue-3683.rs | 8 +- src/test/run-pass/issue-3794.rs | 2 +- src/test/run-pass/issue-3847.rs | 4 +- src/test/run-pass/issue-3874.rs | 4 +- src/test/run-pass/issue-3979-generics.rs | 10 +- src/test/run-pass/issue-3979-xcrate.rs | 6 +- src/test/run-pass/issue-3979.rs | 12 +- src/test/run-pass/issue-3991.rs | 2 +- src/test/run-pass/issue-4036.rs | 2 +- src/test/run-pass/issue-4107.rs | 6 +- src/test/run-pass/issue-4241.rs | 20 +- src/test/run-pass/issue-4252.rs | 2 +- src/test/run-pass/issue-4464.rs | 2 +- src/test/run-pass/issue-4545.rs | 2 +- src/test/run-pass/issue-4734.rs | 4 +- src/test/run-pass/issue-4735.rs | 4 +- src/test/run-pass/issue-4759.rs | 4 +- src/test/run-pass/issue-4830.rs | 2 +- src/test/run-pass/issue-5192.rs | 2 +- src/test/run-pass/issue-5239-2.rs | 2 +- src/test/run-pass/issue-5243.rs | 2 +- .../issue-5321-immediates-with-bare-self.rs | 2 +- src/test/run-pass/issue-5530.rs | 8 +- src/test/run-pass/issue-5554.rs | 2 +- src/test/run-pass/issue-5688.rs | 4 +- src/test/run-pass/issue-5708.rs | 4 +- src/test/run-pass/issue-5718.rs | 4 +- src/test/run-pass/issue-5884.rs | 4 +- src/test/run-pass/issue-5900.rs | 2 +- src/test/run-pass/issue-5917.rs | 2 +- src/test/run-pass/issue-5997.rs | 2 +- src/test/run-pass/issue-6128.rs | 8 +- src/test/run-pass/issue-6130.rs | 4 +- src/test/run-pass/issue-6153.rs | 2 +- src/test/run-pass/issue-6157.rs | 10 +- src/test/run-pass/issue-6334.rs | 14 +- src/test/run-pass/issue-6341.rs | 2 +- src/test/run-pass/issue-6344-let.rs | 2 +- src/test/run-pass/issue-6344-match.rs | 2 +- src/test/run-pass/issue-6449.rs | 2 +- src/test/run-pass/issue-6470.rs | 2 +- src/test/run-pass/issue-6557.rs | 2 +- src/test/run-pass/issue-6892.rs | 8 +- src/test/run-pass/issue-6898.rs | 12 +- src/test/run-pass/issue-7563.rs | 4 +- src/test/run-pass/issue-7575.rs | 4 +- src/test/run-pass/issue-7660.rs | 4 +- src/test/run-pass/issue-7663.rs | 8 +- src/test/run-pass/issue-8044.rs | 2 +- src/test/run-pass/issue-8351-1.rs | 2 +- src/test/run-pass/issue-8351-2.rs | 2 +- src/test/run-pass/issue-8709.rs | 2 +- src/test/run-pass/issue-8783.rs | 2 +- src/test/run-pass/issue-8827.rs | 4 +- src/test/run-pass/issue-8851.rs | 8 +- src/test/run-pass/issue-8860.rs | 8 +- src/test/run-pass/issue-9047.rs | 2 +- src/test/run-pass/issue-9129.rs | 2 +- src/test/run-pass/issue-9188.rs | 2 +- src/test/run-pass/issue-9382.rs | 4 +- src/test/run-pass/issue-9719.rs | 12 +- src/test/run-pass/issue-979.rs | 4 +- src/test/run-pass/issue-9942.rs | 2 +- src/test/run-pass/item-attributes.rs | 14 +- src/test/run-pass/iter-range.rs | 6 +- src/test/run-pass/ivec-pass-by-value.rs | 2 +- src/test/run-pass/keyword-changes-2012-07-31.rs | 2 +- .../run-pass/kindck-implicit-close-over-mut-var.rs | 2 +- src/test/run-pass/kinds-in-metadata.rs | 2 +- src/test/run-pass/lambda-infer-unresolved.rs | 4 +- src/test/run-pass/lambda-var-hygiene.rs | 2 +- src/test/run-pass/lang-item-public.rs | 2 +- src/test/run-pass/large-records.rs | 24 +- src/test/run-pass/last-use-is-capture.rs | 2 +- src/test/run-pass/lazy-and-or.rs | 4 +- src/test/run-pass/lazy-init.rs | 4 +- src/test/run-pass/leak-unique-as-tydesc.rs | 2 +- src/test/run-pass/let-assignability.rs | 2 +- src/test/run-pass/linear-for-loop.rs | 2 +- src/test/run-pass/link-section.rs | 8 +- src/test/run-pass/linkage-visibility.rs | 2 +- src/test/run-pass/linkage1.rs | 4 +- ...mel-case-types-non-uppercase-statics-unicode.rs | 2 +- ...int-non-camel-case-with-trailing-underscores.rs | 2 +- ...-non-uppercase-statics-lowercase-mut-statics.rs | 2 +- src/test/run-pass/list.rs | 2 +- .../liveness-assign-imm-local-after-loop.rs | 2 +- .../liveness-assign-imm-local-after-ret.rs | 2 +- src/test/run-pass/liveness-move-in-loop.rs | 2 +- .../log-knows-the-names-of-variants-in-std.rs | 2 +- src/test/run-pass/logging-only-prints-once.rs | 2 +- src/test/run-pass/logging-right-crate.rs | 2 +- src/test/run-pass/long-while.rs | 2 +- src/test/run-pass/macro-2.rs | 2 +- src/test/run-pass/macro-crate-use.rs | 2 +- src/test/run-pass/macro-interpolation.rs | 2 +- src/test/run-pass/macro-method-issue-4621.rs | 2 +- src/test/run-pass/macro-pat.rs | 2 +- src/test/run-pass/macro-path.rs | 2 +- src/test/run-pass/macro-stmt.rs | 2 +- src/test/run-pass/match-arm-statics.rs | 4 +- src/test/run-pass/match-bot-2.rs | 2 +- src/test/run-pass/match-bot.rs | 4 +- src/test/run-pass/match-enum-struct-0.rs | 2 +- src/test/run-pass/match-enum-struct-1.rs | 2 +- src/test/run-pass/match-implicit-copy-unique.rs | 2 +- src/test/run-pass/match-in-macro.rs | 2 +- src/test/run-pass/match-join.rs | 6 +- src/test/run-pass/match-naked-record-expr.rs | 2 +- src/test/run-pass/match-naked-record.rs | 2 +- src/test/run-pass/match-pattern-lit.rs | 2 +- src/test/run-pass/match-pattern-no-type-params.rs | 2 +- src/test/run-pass/match-pattern-simple.rs | 2 +- src/test/run-pass/match-phi.rs | 2 +- src/test/run-pass/match-range-static.rs | 4 +- src/test/run-pass/match-ref-binding-mut.rs | 2 +- src/test/run-pass/match-ref-binding.rs | 2 +- src/test/run-pass/match-static-const-rename.rs | 4 +- src/test/run-pass/match-struct-0.rs | 2 +- src/test/run-pass/match-tag.rs | 10 +- .../run-pass/match-value-binding-in-guard-3291.rs | 2 +- src/test/run-pass/match-vec-alternatives.rs | 10 +- src/test/run-pass/max-min-classes.rs | 12 +- src/test/run-pass/method-attributes.rs | 2 +- .../method-normalize-bounds-issue-20604.rs | 2 +- src/test/run-pass/method-projection.rs | 16 +- src/test/run-pass/method-self-arg.rs | 2 +- .../method-two-trait-defer-resolution-2.rs | 10 +- ...od-two-traits-distinguished-via-where-clause.rs | 4 +- src/test/run-pass/mid-path-type-params.rs | 10 +- src/test/run-pass/mod-inside-fn.rs | 4 +- src/test/run-pass/mod-view-items.rs | 2 +- src/test/run-pass/mod_dir_implicit_aux/mod.rs | 2 +- src/test/run-pass/mod_dir_simple/test.rs | 2 +- src/test/run-pass/mod_file_aux.rs | 2 +- .../module-qualified-struct-destructure.rs | 4 +- src/test/run-pass/monad.rs | 2 +- .../monomorphized-callees-with-ty-params-3314.rs | 4 +- src/test/run-pass/move-1-unique.rs | 8 +- src/test/run-pass/move-2-unique.rs | 2 +- src/test/run-pass/move-2.rs | 2 +- src/test/run-pass/move-3-unique.rs | 8 +- src/test/run-pass/move-4-unique.rs | 2 +- src/test/run-pass/move-4.rs | 2 +- src/test/run-pass/move-arg-2-unique.rs | 2 +- src/test/run-pass/move-arg-2.rs | 2 +- src/test/run-pass/move-arg.rs | 2 +- src/test/run-pass/move-scalar.rs | 4 +- src/test/run-pass/multidispatch1.rs | 8 +- src/test/run-pass/multidispatch2.rs | 6 +- src/test/run-pass/mut-function-arguments.rs | 4 +- src/test/run-pass/mut-in-ident-patterns.rs | 10 +- src/test/run-pass/mut-vstore-expr.rs | 2 +- src/test/run-pass/mutable-alias-vec.rs | 6 +- src/test/run-pass/mutual-recursion-group.rs | 2 +- src/test/run-pass/namespaced-enum-emulate-flat.rs | 8 +- src/test/run-pass/namespaced-enum-glob-import.rs | 4 +- src/test/run-pass/namespaced-enums.rs | 4 +- src/test/run-pass/native-print-no-runtime.rs | 2 +- src/test/run-pass/nested-class.rs | 8 +- src/test/run-pass/nested-exhaustive-match.rs | 2 +- .../run-pass/nested-function-names-issue-8587.rs | 12 +- src/test/run-pass/nested-matchs.rs | 8 +- src/test/run-pass/nested-pattern.rs | 6 +- src/test/run-pass/nested_item_main.rs | 2 +- src/test/run-pass/new-box-syntax.rs | 10 +- src/test/run-pass/new-box.rs | 4 +- src/test/run-pass/new-impl-syntax.rs | 4 +- src/test/run-pass/new-style-constants.rs | 2 +- src/test/run-pass/new-style-fixed-length-vec.rs | 2 +- src/test/run-pass/new-unsafe-pointers.rs | 4 +- src/test/run-pass/newlambdas.rs | 2 +- src/test/run-pass/newtype-struct-drop-run.rs | 2 +- src/test/run-pass/newtype-temporary.rs | 2 +- src/test/run-pass/newtype.rs | 6 +- src/test/run-pass/no-std-xcrate2.rs | 2 +- src/test/run-pass/non-legacy-modes.rs | 4 +- src/test/run-pass/nullable-pointer-ffi-compat.rs | 6 +- .../run-pass/nullable-pointer-iotareduction.rs | 12 +- src/test/run-pass/nullable-pointer-size.rs | 8 +- src/test/run-pass/nullary-or-pattern.rs | 2 +- src/test/run-pass/object-one-type-two-traits.rs | 8 +- .../run-pass/objects-coerce-freeze-borrored.rs | 14 +- ...ects-owned-object-borrowed-method-headerless.rs | 6 +- .../run-pass/objects-owned-object-owned-method.rs | 6 +- src/test/run-pass/opeq.rs | 2 +- src/test/run-pass/operator-multidispatch.rs | 8 +- src/test/run-pass/operator-overloading.rs | 10 +- src/test/run-pass/option-unwrap.rs | 2 +- src/test/run-pass/or-pattern.rs | 4 +- src/test/run-pass/order-drop-with-match.rs | 4 +- src/test/run-pass/out-pointer-aliasing.rs | 4 +- src/test/run-pass/output-slot-variants.rs | 12 +- src/test/run-pass/over-constrained-vregs.rs | 2 +- src/test/run-pass/overloaded-autoderef-count.rs | 12 +- src/test/run-pass/overloaded-autoderef-vtable.rs | 4 +- src/test/run-pass/overloaded-autoderef.rs | 4 +- .../run-pass/overloaded-calls-object-one-arg.rs | 2 +- .../run-pass/overloaded-calls-object-two-args.rs | 2 +- .../run-pass/overloaded-calls-object-zero-args.rs | 2 +- src/test/run-pass/overloaded-deref-count.rs | 6 +- src/test/run-pass/overloaded-deref.rs | 4 +- src/test/run-pass/overloaded-index-autoderef.rs | 24 +- src/test/run-pass/overloaded-index-in-field.rs | 20 +- src/test/run-pass/overloaded-index.rs | 24 +- src/test/run-pass/packed-struct-borrow-element.rs | 2 +- src/test/run-pass/packed-struct-match.rs | 2 +- src/test/run-pass/panic-in-dtor-drops-fields.rs | 2 +- .../run-pass/parameterized-trait-with-bounds.rs | 2 +- src/test/run-pass/path.rs | 2 +- src/test/run-pass/pattern-bound-var-in-for-each.rs | 2 +- src/test/run-pass/pattern-in-closure.rs | 6 +- src/test/run-pass/pred-not-bool.rs | 2 +- src/test/run-pass/preempt.rs | 6 +- src/test/run-pass/private-class-field.rs | 8 +- src/test/run-pass/private-method.rs | 6 +- src/test/run-pass/ptr-coercion.rs | 22 +- src/test/run-pass/pure-sum.rs | 8 +- src/test/run-pass/range.rs | 2 +- src/test/run-pass/ranges-precedence.rs | 4 +- src/test/run-pass/rcvr-borrowed-to-region.rs | 8 +- src/test/run-pass/rcvr-borrowed-to-slice.rs | 8 +- src/test/run-pass/readalias.rs | 2 +- src/test/run-pass/realloc-16687.rs | 28 +-- src/test/run-pass/rec-align-u32.rs | 12 +- src/test/run-pass/rec-align-u64.rs | 28 +-- src/test/run-pass/rec-extend.rs | 2 +- src/test/run-pass/rec-tup.rs | 6 +- src/test/run-pass/rec.rs | 6 +- src/test/run-pass/record-pat.rs | 10 +- .../regions-addr-of-interior-of-unique-box.rs | 6 +- src/test/run-pass/regions-addr-of-ret.rs | 2 +- src/test/run-pass/regions-borrow-at.rs | 2 +- src/test/run-pass/regions-borrow-evec-fixed.rs | 2 +- src/test/run-pass/regions-borrow-evec-uniq.rs | 2 +- src/test/run-pass/regions-borrow-uniq.rs | 2 +- src/test/run-pass/regions-bot.rs | 2 +- ...gions-close-over-type-parameter-successfully.rs | 8 +- src/test/run-pass/regions-creating-enums2.rs | 2 +- src/test/run-pass/regions-creating-enums5.rs | 2 +- src/test/run-pass/regions-dependent-addr-of.rs | 26 +- src/test/run-pass/regions-dependent-autoslice.rs | 4 +- src/test/run-pass/regions-dependent-let-ref.rs | 2 +- .../regions-early-bound-lifetime-in-assoc-fn.rs | 2 +- .../run-pass/regions-early-bound-trait-param.rs | 26 +- .../regions-early-bound-used-in-bound-method.rs | 8 +- .../run-pass/regions-early-bound-used-in-bound.rs | 2 +- .../regions-early-bound-used-in-type-param.rs | 2 +- src/test/run-pass/regions-escape-into-other-fn.rs | 4 +- src/test/run-pass/regions-expl-self.rs | 2 +- src/test/run-pass/regions-fn-subtyping-2.rs | 4 +- src/test/run-pass/regions-fn-subtyping.rs | 12 +- src/test/run-pass/regions-infer-borrow-scope.rs | 4 +- src/test/run-pass/regions-infer-call-2.rs | 6 +- src/test/run-pass/regions-infer-call.rs | 4 +- .../regions-infer-contravariance-due-to-ret.rs | 6 +- .../regions-infer-reborrow-ref-mut-recurse.rs | 6 +- .../regions-infer-region-in-fn-but-not-type.rs | 4 +- .../run-pass/regions-infer-static-from-proc.rs | 4 +- .../regions-lifetime-nonfree-late-bound.rs | 8 +- ...gions-lifetime-static-items-enclosing-scopes.rs | 2 +- src/test/run-pass/regions-link-fn-args.rs | 2 +- src/test/run-pass/regions-mock-tcx.rs | 6 +- src/test/run-pass/regions-mock-trans.rs | 2 +- src/test/run-pass/regions-nullary-variant.rs | 4 +- src/test/run-pass/regions-params.rs | 4 +- .../run-pass/regions-reassign-let-bound-pointer.rs | 2 +- .../regions-reassign-match-bound-pointer.rs | 2 +- ...d-regions-on-closures-to-inference-variables.rs | 10 +- src/test/run-pass/regions-self-impls.rs | 6 +- src/test/run-pass/regions-self-in-enums.rs | 4 +- src/test/run-pass/regions-simple.rs | 4 +- ...ons-variance-contravariant-use-contravariant.rs | 4 +- .../regions-variance-covariant-use-covariant.rs | 2 +- src/test/run-pass/repeat-expr-in-static.rs | 4 +- src/test/run-pass/resolve-issue-2428.rs | 4 +- src/test/run-pass/resource-assign-is-not-copy.rs | 4 +- src/test/run-pass/resource-destruct.rs | 6 +- src/test/run-pass/ret-bang.rs | 2 +- src/test/run-pass/ret-none.rs | 2 +- src/test/run-pass/return-from-closure.rs | 6 +- src/test/run-pass/running-with-no-runtime.rs | 6 +- src/test/run-pass/segfault-no-out-of-stack.rs | 2 +- src/test/run-pass/self-impl.rs | 4 +- .../run-pass/self-in-mut-slot-default-method.rs | 6 +- .../run-pass/self-in-mut-slot-immediate-value.rs | 2 +- src/test/run-pass/self-shadowing-import.rs | 2 +- src/test/run-pass/self-type-param.rs | 2 +- src/test/run-pass/send-resource.rs | 4 +- src/test/run-pass/send_str_hashmap.rs | 2 +- src/test/run-pass/send_str_treemap.rs | 2 +- src/test/run-pass/sendable-class.rs | 4 +- src/test/run-pass/sendfn-is-a-block.rs | 2 +- src/test/run-pass/sendfn-spawn-with-fn-arg.rs | 4 +- src/test/run-pass/sepcomp-cci.rs | 6 +- src/test/run-pass/sepcomp-extern.rs | 8 +- src/test/run-pass/sepcomp-fns-backwards.rs | 8 +- src/test/run-pass/sepcomp-fns.rs | 6 +- src/test/run-pass/sepcomp-statics.rs | 12 +- src/test/run-pass/sepcomp-unwind.rs | 2 +- src/test/run-pass/shadow.rs | 10 +- src/test/run-pass/shift.rs | 62 ++--- src/test/run-pass/signal-exit-status.rs | 2 +- src/test/run-pass/signed-shift-const-eval.rs | 2 +- src/test/run-pass/simple-generic-match.rs | 2 +- src/test/run-pass/simple-match-generic-tag.rs | 4 +- src/test/run-pass/size-and-align.rs | 6 +- src/test/run-pass/slice-2.rs | 40 +-- src/test/run-pass/slice-panic-1.rs | 2 +- src/test/run-pass/slice-panic-2.rs | 4 +- src/test/run-pass/slice.rs | 2 +- src/test/run-pass/smallest-hello-world.rs | 4 +- src/test/run-pass/spawn-fn.rs | 4 +- src/test/run-pass/spawn-types.rs | 4 +- src/test/run-pass/spawn.rs | 2 +- src/test/run-pass/spawn2.rs | 2 +- src/test/run-pass/stable-addr-of.rs | 4 +- src/test/run-pass/static-function-pointer-xc.rs | 2 +- src/test/run-pass/static-function-pointer.rs | 8 +- src/test/run-pass/static-impl.rs | 18 +- .../static-method-in-trait-with-tps-intracrate.rs | 10 +- src/test/run-pass/static-method-xcrate.rs | 2 +- src/test/run-pass/static-methods-in-traits.rs | 12 +- src/test/run-pass/static-mut-xc.rs | 6 +- src/test/run-pass/struct-aliases.rs | 4 +- src/test/run-pass/struct-like-variant-construct.rs | 4 +- src/test/run-pass/struct-like-variant-match.rs | 4 +- src/test/run-pass/struct-new-as-field-name.rs | 2 +- src/test/run-pass/struct-order-of-eval-1.rs | 2 +- src/test/run-pass/struct-partial-move-1.rs | 4 +- src/test/run-pass/struct-partial-move-2.rs | 4 +- src/test/run-pass/struct-pattern-matching.rs | 4 +- src/test/run-pass/struct-return.rs | 10 +- .../run-pass/struct-variant-field-visibility.rs | 2 +- src/test/run-pass/structured-compare.rs | 2 +- src/test/run-pass/super-fast-paren-parsing.rs | 2 +- src/test/run-pass/supported-cast.rs | 60 ++--- src/test/run-pass/swap-2.rs | 2 +- src/test/run-pass/swap-overlapping.rs | 4 +- src/test/run-pass/tag-align-dyn-u64.rs | 2 +- src/test/run-pass/tag-align-dyn-variants.rs | 6 +- src/test/run-pass/tag-align-u64.rs | 2 +- src/test/run-pass/tag-variant-disr-val.rs | 6 +- src/test/run-pass/tag.rs | 2 +- src/test/run-pass/tail-cps.rs | 4 +- src/test/run-pass/tail-direct.rs | 4 +- src/test/run-pass/task-comm-0.rs | 4 +- src/test/run-pass/task-comm-11.rs | 2 +- src/test/run-pass/task-comm-12.rs | 4 +- src/test/run-pass/task-comm-13.rs | 4 +- src/test/run-pass/task-comm-14.rs | 4 +- src/test/run-pass/task-comm-15.rs | 2 +- src/test/run-pass/task-comm-16.rs | 10 +- src/test/run-pass/task-comm-3.rs | 10 +- src/test/run-pass/task-comm-4.rs | 4 +- src/test/run-pass/task-comm-5.rs | 8 +- src/test/run-pass/task-comm-6.rs | 8 +- src/test/run-pass/task-comm-7.rs | 14 +- src/test/run-pass/task-comm-9.rs | 12 +- src/test/run-pass/task-spawn-move-and-copy.rs | 8 +- src/test/run-pass/tcp-accept-stress.rs | 4 +- src/test/run-pass/terminate-in-initializer.rs | 10 +- src/test/run-pass/threads.rs | 2 +- src/test/run-pass/trailing-comma.rs | 10 +- .../trait-bounds-impl-comparison-duplicates.rs | 2 +- src/test/run-pass/trait-bounds-in-arc.rs | 16 +- src/test/run-pass/trait-bounds.rs | 4 +- src/test/run-pass/trait-coercion-generic.rs | 4 +- src/test/run-pass/trait-coercion.rs | 4 +- .../run-pass/trait-default-method-bound-subst2.rs | 2 +- .../run-pass/trait-default-method-bound-subst3.rs | 2 +- .../run-pass/trait-default-method-bound-subst4.rs | 10 +- src/test/run-pass/trait-default-method-bound.rs | 4 +- src/test/run-pass/trait-default-method-xc.rs | 8 +- src/test/run-pass/trait-generic.rs | 4 +- src/test/run-pass/trait-impl.rs | 4 +- src/test/run-pass/trait-inheritance-auto-xc.rs | 8 +- src/test/run-pass/trait-inheritance-auto.rs | 14 +- .../trait-inheritance-call-bound-inherited.rs | 12 +- .../trait-inheritance-call-bound-inherited2.rs | 16 +- ...-inheritance-cast-without-call-to-supertrait.rs | 10 +- src/test/run-pass/trait-inheritance-cast.rs | 10 +- .../trait-inheritance-cross-trait-call-xc.rs | 4 +- .../run-pass/trait-inheritance-cross-trait-call.rs | 10 +- src/test/run-pass/trait-inheritance-diamond.rs | 16 +- .../trait-inheritance-multiple-inheritors.rs | 12 +- .../run-pass/trait-inheritance-multiple-params.rs | 12 +- src/test/run-pass/trait-inheritance-num0.rs | 2 +- src/test/run-pass/trait-inheritance-num2.rs | 16 +- src/test/run-pass/trait-inheritance-num5.rs | 4 +- .../trait-inheritance-overloading-simple.rs | 4 +- .../trait-inheritance-overloading-xc-exe.rs | 2 +- src/test/run-pass/trait-inheritance-overloading.rs | 4 +- src/test/run-pass/trait-inheritance-self.rs | 2 +- src/test/run-pass/trait-inheritance-simple.rs | 14 +- src/test/run-pass/trait-inheritance-static.rs | 6 +- src/test/run-pass/trait-inheritance-static2.rs | 6 +- src/test/run-pass/trait-inheritance-subst.rs | 4 +- src/test/run-pass/trait-inheritance-subst2.rs | 4 +- src/test/run-pass/trait-inheritance-visibility.rs | 4 +- src/test/run-pass/trait-inheritance2.rs | 14 +- src/test/run-pass/trait-object-generics.rs | 4 +- src/test/run-pass/trait-region-pointer-simple.rs | 6 +- src/test/run-pass/trait-safety-ok-cc.rs | 8 +- src/test/run-pass/trait-safety-ok.rs | 10 +- src/test/run-pass/trait-to-str.rs | 2 +- src/test/run-pass/trait-with-bounds-default.rs | 4 +- src/test/run-pass/traits-conditional-model-fn.rs | 8 +- src/test/run-pass/traits-default-method-mut.rs | 2 +- src/test/run-pass/traits-default-method-self.rs | 2 +- src/test/run-pass/traits-default-method-trivial.rs | 2 +- .../traits-multidispatch-infer-convert-target.rs | 2 +- .../transmute-non-immediate-to-immediate.rs | 2 +- src/test/run-pass/tup.rs | 4 +- src/test/run-pass/tuple-index-fat-types.rs | 6 +- src/test/run-pass/tuple-index.rs | 2 +- src/test/run-pass/tuple-struct-construct.rs | 2 +- .../run-pass/tuple-struct-constructor-pointer.rs | 8 +- src/test/run-pass/tuple-struct-destructuring.rs | 2 +- src/test/run-pass/tuple-struct-matching.rs | 2 +- src/test/run-pass/tuple-struct-trivial.rs | 2 +- src/test/run-pass/tydesc-name.rs | 4 +- src/test/run-pass/type-id-higher-rank.rs | 28 +-- src/test/run-pass/type-in-nested-module.rs | 2 +- src/test/run-pass/type-namespace.rs | 4 +- src/test/run-pass/type-param-constraints.rs | 4 +- src/test/run-pass/type-params-in-for-each.rs | 6 +- src/test/run-pass/type-ptr.rs | 4 +- src/test/run-pass/type-sizes.rs | 36 +-- .../typeck-macro-interaction-issue-8852.rs | 2 +- src/test/run-pass/typeid-intrinsic.rs | 12 +- src/test/run-pass/ufcs-explicit-self.rs | 16 +- src/test/run-pass/uint.rs | 2 +- src/test/run-pass/unary-minus-suffix-inference.rs | 4 +- src/test/run-pass/unboxed-closures-all-traits.rs | 14 +- .../run-pass/unboxed-closures-call-fn-autoderef.rs | 6 +- .../unboxed-closures-call-sugar-autoderef.rs | 4 +- ...unboxed-closures-call-sugar-object-autoderef.rs | 2 +- .../run-pass/unboxed-closures-call-sugar-object.rs | 2 +- src/test/run-pass/unboxed-closures-drop.rs | 30 +-- src/test/run-pass/unboxed-closures-extern-fn-hr.rs | 10 +- src/test/run-pass/unboxed-closures-extern-fn.rs | 8 +- ...res-infer-argument-types-from-expected-bound.rs | 4 +- ...fer-argument-types-from-expected-object-type.rs | 4 +- ...types-with-bound-regions-from-expected-bound.rs | 4 +- .../run-pass/unboxed-closures-monomorphization.rs | 2 +- src/test/run-pass/unboxed-closures-move-mutable.rs | 2 +- src/test/run-pass/unboxed-closures-prelude.rs | 6 +- src/test/run-pass/unboxed-closures-simple.rs | 2 +- .../run-pass/unboxed-closures-single-word-env.rs | 12 +- .../run-pass/unboxed-closures-unique-type-id.rs | 2 +- src/test/run-pass/unfold-cross-crate.rs | 2 +- src/test/run-pass/unify-return-ty.rs | 2 +- src/test/run-pass/uniq-self-in-mut-slot.rs | 2 +- src/test/run-pass/unique-autoderef-field.rs | 2 +- src/test/run-pass/unique-containing-tag.rs | 2 +- src/test/run-pass/unique-decl.rs | 4 +- src/test/run-pass/unique-destructure.rs | 2 +- src/test/run-pass/unique-fn-arg-move.rs | 2 +- src/test/run-pass/unique-fn-arg-mut.rs | 2 +- src/test/run-pass/unique-fn-arg.rs | 2 +- src/test/run-pass/unique-fn-ret.rs | 2 +- src/test/run-pass/unique-in-tag.rs | 2 +- src/test/run-pass/unique-object-move.rs | 2 +- src/test/run-pass/unique-pat-2.rs | 6 +- src/test/run-pass/unique-pat-3.rs | 2 +- src/test/run-pass/unique-rec.rs | 2 +- src/test/run-pass/unique-send-2.rs | 2 +- src/test/run-pass/unnamed_argument_mode.rs | 6 +- src/test/run-pass/unsafe-pointer-assignability.rs | 2 +- src/test/run-pass/unsized2.rs | 6 +- src/test/run-pass/use-import-export.rs | 4 +- src/test/run-pass/use-trait-before-def.rs | 4 +- src/test/run-pass/use-uninit-match.rs | 4 +- src/test/run-pass/use-uninit-match2.rs | 4 +- src/test/run-pass/use.rs | 2 +- src/test/run-pass/utf8.rs | 20 +- src/test/run-pass/utf8_idents.rs | 2 +- src/test/run-pass/variant-structs-trivial.rs | 4 +- src/test/run-pass/vec-concat.rs | 6 +- src/test/run-pass/vec-dst.rs | 8 +- src/test/run-pass/vec-fixed-length.rs | 2 +- src/test/run-pass/vec-late-init.rs | 2 +- src/test/run-pass/vec-macro-no-std.rs | 2 +- .../vec-matching-legal-tail-element-borrow.rs | 2 +- src/test/run-pass/vec-matching.rs | 2 +- src/test/run-pass/vec-repeat-with-cast.rs | 2 +- src/test/run-pass/vec-slice-drop.rs | 4 +- src/test/run-pass/vec-to_str.rs | 2 +- src/test/run-pass/vec.rs | 4 +- src/test/run-pass/vector-no-ann-2.rs | 2 +- src/test/run-pass/warn-ctypes-inhibit.rs | 2 +- src/test/run-pass/weird-exprs.rs | 4 +- .../run-pass/wf-bound-region-in-object-type.rs | 6 +- .../run-pass/where-clause-early-bound-lifetimes.rs | 4 +- src/test/run-pass/where-clause-region-outlives.rs | 2 +- src/test/run-pass/where-clauses-cross-crate.rs | 2 +- src/test/run-pass/where-clauses-lifetimes.rs | 2 +- src/test/run-pass/where-clauses.rs | 2 +- src/test/run-pass/while-flow-graph.rs | 2 +- src/test/run-pass/while-let.rs | 2 +- src/test/run-pass/while-loop-constraints-2.rs | 6 +- src/test/run-pass/while-prelude-drop.rs | 2 +- src/test/run-pass/while-with-break.rs | 4 +- src/test/run-pass/while.rs | 4 +- src/test/run-pass/writealias.rs | 2 +- src/test/run-pass/x86stdcall.rs | 4 +- src/test/run-pass/x86stdcall2.rs | 2 +- src/test/run-pass/yield2.rs | 2 +- src/test/run-pass/zero-size-type-destructors.rs | 2 +- 1391 files changed, 5183 insertions(+), 5241 deletions(-) delete mode 100644 src/test/compile-fail/feature-gate-int-uint.rs (limited to 'src/libsyntax') diff --git a/src/compiletest/compiletest.rs b/src/compiletest/compiletest.rs index 1ee5917ac9c..6511bbd8475 100644 --- a/src/compiletest/compiletest.rs +++ b/src/compiletest/compiletest.rs @@ -12,7 +12,6 @@ #![feature(box_syntax)] #![feature(collections)] -#![feature(int_uint)] #![feature(old_io)] #![feature(old_path)] #![feature(rustc_private)] diff --git a/src/compiletest/errors.rs b/src/compiletest/errors.rs index 2b0e7985229..4b2a3e0283d 100644 --- a/src/compiletest/errors.rs +++ b/src/compiletest/errors.rs @@ -15,13 +15,13 @@ use std::io::prelude::*; use std::path::Path; pub struct ExpectedError { - pub line: uint, + pub line: usize, pub kind: String, pub msg: String, } #[derive(PartialEq, Debug)] -enum WhichLine { ThisLine, FollowPrevious(uint), AdjustBackward(uint) } +enum WhichLine { ThisLine, FollowPrevious(usize), AdjustBackward(usize) } /// Looks for either "//~| KIND MESSAGE" or "//~^^... KIND MESSAGE" /// The former is a "follow" that inherits its target from the preceding line; @@ -58,8 +58,8 @@ pub fn load_errors(testfile: &Path) -> Vec { }).collect() } -fn parse_expected(last_nonfollow_error: Option, - line_num: uint, +fn parse_expected(last_nonfollow_error: Option, + line_num: usize, line: &str) -> Option<(WhichLine, ExpectedError)> { let start = match line.find("//~") { Some(i) => i, None => return None }; let (follow, adjusts) = if line.char_at(start + 3) == '|' { diff --git a/src/compiletest/header.rs b/src/compiletest/header.rs index 461b5af6204..9612c0e06a3 100644 --- a/src/compiletest/header.rs +++ b/src/compiletest/header.rs @@ -357,7 +357,7 @@ pub fn parse_name_value_directive(line: &str, directive: &str) } } -pub fn gdb_version_to_int(version_string: &str) -> int { +pub fn gdb_version_to_int(version_string: &str) -> isize { let error_string = format!( "Encountered GDB version string with unexpected format: {}", version_string); @@ -369,17 +369,17 @@ pub fn gdb_version_to_int(version_string: &str) -> int { panic!("{}", error_string); } - let major: int = components[0].parse().ok().expect(&error_string); - let minor: int = components[1].parse().ok().expect(&error_string); + let major: isize = components[0].parse().ok().expect(&error_string); + let minor: isize = components[1].parse().ok().expect(&error_string); return major * 1000 + minor; } -pub fn lldb_version_to_int(version_string: &str) -> int { +pub fn lldb_version_to_int(version_string: &str) -> isize { let error_string = format!( "Encountered LLDB version string with unexpected format: {}", version_string); let error_string = error_string; - let major: int = version_string.parse().ok().expect(&error_string); + let major: isize = version_string.parse().ok().expect(&error_string); return major; } diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs index 1666124b46a..23267c3e934 100644 --- a/src/compiletest/runtest.rs +++ b/src/compiletest/runtest.rs @@ -758,7 +758,7 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path) struct DebuggerCommands { commands: Vec, check_lines: Vec, - breakpoint_lines: Vec, + breakpoint_lines: Vec, } fn parse_debugger_commands(file_path: &Path, debugger_prefix: &str) @@ -1036,7 +1036,7 @@ fn is_compiler_error_or_warning(line: &str) -> bool { scan_string(line, "warning", &mut i)); } -fn scan_until_char(haystack: &str, needle: char, idx: &mut uint) -> bool { +fn scan_until_char(haystack: &str, needle: char, idx: &mut usize) -> bool { if *idx >= haystack.len() { return false; } @@ -1048,7 +1048,7 @@ fn scan_until_char(haystack: &str, needle: char, idx: &mut uint) -> bool { return true; } -fn scan_char(haystack: &str, needle: char, idx: &mut uint) -> bool { +fn scan_char(haystack: &str, needle: char, idx: &mut usize) -> bool { if *idx >= haystack.len() { return false; } @@ -1060,7 +1060,7 @@ fn scan_char(haystack: &str, needle: char, idx: &mut uint) -> bool { return true; } -fn scan_integer(haystack: &str, idx: &mut uint) -> bool { +fn scan_integer(haystack: &str, idx: &mut usize) -> bool { let mut i = *idx; while i < haystack.len() { let ch = haystack.char_at(i); @@ -1076,7 +1076,7 @@ fn scan_integer(haystack: &str, idx: &mut uint) -> bool { return true; } -fn scan_string(haystack: &str, needle: &str, idx: &mut uint) -> bool { +fn scan_string(haystack: &str, needle: &str, idx: &mut usize) -> bool { let mut haystack_i = *idx; let mut needle_i = 0; while needle_i < needle.len() { @@ -1725,7 +1725,7 @@ fn disassemble_extract(config: &Config, _props: &TestProps, } -fn count_extracted_lines(p: &Path) -> uint { +fn count_extracted_lines(p: &Path) -> usize { let mut x = Vec::new(); File::open(&p.with_extension("ll")).unwrap().read_to_end(&mut x).unwrap(); let x = str::from_utf8(&x).unwrap(); diff --git a/src/doc/reference.md b/src/doc/reference.md index 32088b2ab67..1f043424f31 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -2440,9 +2440,6 @@ The currently implemented features of the reference compiler are: * `intrinsics` - Allows use of the "rust-intrinsics" ABI. Compiler intrinsics are inherently unstable and no promise about them is made. -* `int_uint` - Allows the use of the `int` and `uint` types, which are deprecated. - Use `isize` and `usize` instead. - * `lang_items` - Allows use of the `#[lang]` attribute. Like `intrinsics`, lang items are inherently unstable and no promise about them is made. @@ -2759,7 +2756,7 @@ The following are examples of structure expressions: ``` # struct Point { x: f64, y: f64 } # struct TuplePoint(f64, f64); -# mod game { pub struct User<'a> { pub name: &'a str, pub age: u32, pub score: uint } } +# mod game { pub struct User<'a> { pub name: &'a str, pub age: u32, pub score: usize } } # struct Cookie; fn some_fn(t: T) {} Point {x: 10.0, y: 20.0}; TuplePoint(10.0, 20.0); @@ -3402,7 +3399,7 @@ subpattern`. For example: #![feature(box_patterns)] #![feature(box_syntax)] -enum List { Nil, Cons(uint, Box) } +enum List { Nil, Cons(u32, Box) } fn is_sorted(list: &List) -> bool { match *list { diff --git a/src/doc/trpl/ffi.md b/src/doc/trpl/ffi.md index 695279e2d5b..b65d90f52a4 100644 --- a/src/doc/trpl/ffi.md +++ b/src/doc/trpl/ffi.md @@ -401,7 +401,7 @@ Unsafe functions, on the other hand, advertise it to the world. An unsafe functi this: ``` -unsafe fn kaboom(ptr: *const int) -> int { *ptr } +unsafe fn kaboom(ptr: *const i32) -> i32 { *ptr } ``` This function can only be called from an `unsafe` block or another `unsafe` function. @@ -423,7 +423,7 @@ extern { fn main() { println!("You have readline version {} installed.", - rl_readline_version as int); + rl_readline_version as i32); } ``` diff --git a/src/doc/trpl/more-strings.md b/src/doc/trpl/more-strings.md index c46f84caa86..17a463842e7 100644 --- a/src/doc/trpl/more-strings.md +++ b/src/doc/trpl/more-strings.md @@ -129,7 +129,7 @@ need, and it can make your lifetimes more complex. To write a function that's generic over types of strings, use `&str`. ``` -fn some_string_length(x: &str) -> uint { +fn some_string_length(x: &str) -> usize { x.len() } diff --git a/src/libcore/atomic.rs b/src/libcore/atomic.rs index c316236a804..4bbbfbaace9 100644 --- a/src/libcore/atomic.rs +++ b/src/libcore/atomic.rs @@ -1064,7 +1064,7 @@ pub fn fence(order: Ordering) { reason = "renamed to AtomicIsize")] #[allow(missing_docs)] pub struct AtomicInt { - v: UnsafeCell, + v: UnsafeCell, } #[allow(deprecated)] @@ -1075,7 +1075,7 @@ unsafe impl Sync for AtomicInt {} reason = "renamed to AtomicUsize")] #[allow(missing_docs)] pub struct AtomicUint { - v: UnsafeCell, + v: UnsafeCell, } #[allow(deprecated)] @@ -1097,52 +1097,52 @@ pub const ATOMIC_UINT_INIT: AtomicUint = #[allow(missing_docs, deprecated)] impl AtomicInt { #[inline] - pub fn new(v: int) -> AtomicInt { + pub fn new(v: isize) -> AtomicInt { AtomicInt {v: UnsafeCell::new(v)} } #[inline] - pub fn load(&self, order: Ordering) -> int { + pub fn load(&self, order: Ordering) -> isize { unsafe { atomic_load(self.v.get(), order) } } #[inline] - pub fn store(&self, val: int, order: Ordering) { + pub fn store(&self, val: isize, order: Ordering) { unsafe { atomic_store(self.v.get(), val, order); } } #[inline] - pub fn swap(&self, val: int, order: Ordering) -> int { + pub fn swap(&self, val: isize, order: Ordering) -> isize { unsafe { atomic_swap(self.v.get(), val, order) } } #[inline] - pub fn compare_and_swap(&self, old: int, new: int, order: Ordering) -> int { + pub fn compare_and_swap(&self, old: isize, new: isize, order: Ordering) -> isize { unsafe { atomic_compare_and_swap(self.v.get(), old, new, order) } } #[inline] - pub fn fetch_add(&self, val: int, order: Ordering) -> int { + pub fn fetch_add(&self, val: isize, order: Ordering) -> isize { unsafe { atomic_add(self.v.get(), val, order) } } #[inline] - pub fn fetch_sub(&self, val: int, order: Ordering) -> int { + pub fn fetch_sub(&self, val: isize, order: Ordering) -> isize { unsafe { atomic_sub(self.v.get(), val, order) } } #[inline] - pub fn fetch_and(&self, val: int, order: Ordering) -> int { + pub fn fetch_and(&self, val: isize, order: Ordering) -> isize { unsafe { atomic_and(self.v.get(), val, order) } } #[inline] - pub fn fetch_or(&self, val: int, order: Ordering) -> int { + pub fn fetch_or(&self, val: isize, order: Ordering) -> isize { unsafe { atomic_or(self.v.get(), val, order) } } #[inline] - pub fn fetch_xor(&self, val: int, order: Ordering) -> int { + pub fn fetch_xor(&self, val: isize, order: Ordering) -> isize { unsafe { atomic_xor(self.v.get(), val, order) } } } @@ -1150,52 +1150,52 @@ impl AtomicInt { #[allow(missing_docs, deprecated)] impl AtomicUint { #[inline] - pub fn new(v: uint) -> AtomicUint { + pub fn new(v: usize) -> AtomicUint { AtomicUint { v: UnsafeCell::new(v) } } #[inline] - pub fn load(&self, order: Ordering) -> uint { + pub fn load(&self, order: Ordering) -> usize { unsafe { atomic_load(self.v.get(), order) } } #[inline] - pub fn store(&self, val: uint, order: Ordering) { + pub fn store(&self, val: usize, order: Ordering) { unsafe { atomic_store(self.v.get(), val, order); } } #[inline] - pub fn swap(&self, val: uint, order: Ordering) -> uint { + pub fn swap(&self, val: usize, order: Ordering) -> usize { unsafe { atomic_swap(self.v.get(), val, order) } } #[inline] - pub fn compare_and_swap(&self, old: uint, new: uint, order: Ordering) -> uint { + pub fn compare_and_swap(&self, old: usize, new: usize, order: Ordering) -> usize { unsafe { atomic_compare_and_swap(self.v.get(), old, new, order) } } #[inline] - pub fn fetch_add(&self, val: uint, order: Ordering) -> uint { + pub fn fetch_add(&self, val: usize, order: Ordering) -> usize { unsafe { atomic_add(self.v.get(), val, order) } } #[inline] - pub fn fetch_sub(&self, val: uint, order: Ordering) -> uint { + pub fn fetch_sub(&self, val: usize, order: Ordering) -> usize { unsafe { atomic_sub(self.v.get(), val, order) } } #[inline] - pub fn fetch_and(&self, val: uint, order: Ordering) -> uint { + pub fn fetch_and(&self, val: usize, order: Ordering) -> usize { unsafe { atomic_and(self.v.get(), val, order) } } #[inline] - pub fn fetch_or(&self, val: uint, order: Ordering) -> uint { + pub fn fetch_or(&self, val: usize, order: Ordering) -> usize { unsafe { atomic_or(self.v.get(), val, order) } } #[inline] - pub fn fetch_xor(&self, val: uint, order: Ordering) -> uint { + pub fn fetch_xor(&self, val: usize, order: Ordering) -> usize { unsafe { atomic_xor(self.v.get(), val, order) } } } diff --git a/src/libcore/fmt/float.rs b/src/libcore/fmt/float.rs index 0df04c296c8..ee2951602c7 100644 --- a/src/libcore/fmt/float.rs +++ b/src/libcore/fmt/float.rs @@ -125,7 +125,7 @@ pub fn float_to_str_bytes_common( // otherwise as well. let mut buf = [0; 1536]; let mut end = 0; - let radix_gen: T = cast(radix as int).unwrap(); + let radix_gen: T = cast(radix as isize).unwrap(); let (num, exp) = match exp_format { ExpNone => (num, 0), @@ -235,7 +235,7 @@ pub fn float_to_str_bytes_common( let extra_digit = ascii2value(buf[end - 1]); end -= 1; if extra_digit >= radix / 2 { // -> need to round - let mut i: int = end as int - 1; + let mut i: isize = end as isize - 1; loop { // If reached left end of number, have to // insert additional digit: diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs index 1f1044b0b21..e2e5d26d6f7 100644 --- a/src/libcore/intrinsics.rs +++ b/src/libcore/intrinsics.rs @@ -315,7 +315,7 @@ extern "rust-intrinsic" { /// # #![feature(core)] /// use std::ptr; /// - /// unsafe fn from_buf_raw(ptr: *const T, elts: uint) -> Vec { + /// unsafe fn from_buf_raw(ptr: *const T, elts: usize) -> Vec { /// let mut dst = Vec::with_capacity(elts); /// dst.set_len(elts); /// ptr::copy(dst.as_mut_ptr(), ptr, elts); diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index a2b13584270..dc1aef034eb 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -63,7 +63,6 @@ #![allow(raw_pointer_derive)] #![deny(missing_docs)] -#![feature(int_uint)] #![feature(intrinsics, lang_items)] #![feature(on_unimplemented)] #![feature(simd, unsafe_destructor)] diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs index 40e32f4171a..d5a7c1d6b26 100644 --- a/src/libcore/macros.rs +++ b/src/libcore/macros.rs @@ -218,7 +218,7 @@ macro_rules! writeln { /// Match arms: /// /// ``` -/// fn foo(x: Option) { +/// fn foo(x: Option) { /// match x { /// Some(n) if n >= 0 => println!("Some(Non-negative)"), /// Some(n) if n < 0 => println!("Some(Negative)"), diff --git a/src/libcore/num/f32.rs b/src/libcore/num/f32.rs index d211b0f9928..5b660970b86 100644 --- a/src/libcore/num/f32.rs +++ b/src/libcore/num/f32.rs @@ -193,12 +193,12 @@ impl Float for f32 { #[inline] #[unstable(feature = "core")] #[deprecated(since = "1.0.0")] - fn mantissa_digits(_: Option) -> uint { MANTISSA_DIGITS as uint } + fn mantissa_digits(_: Option) -> usize { MANTISSA_DIGITS as usize } #[inline] #[unstable(feature = "core")] #[deprecated(since = "1.0.0")] - fn digits(_: Option) -> uint { DIGITS as uint } + fn digits(_: Option) -> usize { DIGITS as usize } #[inline] #[unstable(feature = "core")] @@ -208,22 +208,22 @@ impl Float for f32 { #[inline] #[unstable(feature = "core")] #[deprecated(since = "1.0.0")] - fn min_exp(_: Option) -> int { MIN_EXP as int } + fn min_exp(_: Option) -> isize { MIN_EXP as isize } #[inline] #[unstable(feature = "core")] #[deprecated(since = "1.0.0")] - fn max_exp(_: Option) -> int { MAX_EXP as int } + fn max_exp(_: Option) -> isize { MAX_EXP as isize } #[inline] #[unstable(feature = "core")] #[deprecated(since = "1.0.0")] - fn min_10_exp(_: Option) -> int { MIN_10_EXP as int } + fn min_10_exp(_: Option) -> isize { MIN_10_EXP as isize } #[inline] #[unstable(feature = "core")] #[deprecated(since = "1.0.0")] - fn max_10_exp(_: Option) -> int { MAX_10_EXP as int } + fn max_10_exp(_: Option) -> isize { MAX_10_EXP as isize } #[inline] #[unstable(feature = "core")] diff --git a/src/libcore/num/f64.rs b/src/libcore/num/f64.rs index 1421fdd72f2..729b9422d5c 100644 --- a/src/libcore/num/f64.rs +++ b/src/libcore/num/f64.rs @@ -200,12 +200,12 @@ impl Float for f64 { #[inline] #[unstable(feature = "core")] #[deprecated(since = "1.0.0")] - fn mantissa_digits(_: Option) -> uint { MANTISSA_DIGITS as uint } + fn mantissa_digits(_: Option) -> usize { MANTISSA_DIGITS as usize } #[inline] #[unstable(feature = "core")] #[deprecated(since = "1.0.0")] - fn digits(_: Option) -> uint { DIGITS as uint } + fn digits(_: Option) -> usize { DIGITS as usize } #[inline] #[unstable(feature = "core")] @@ -215,22 +215,22 @@ impl Float for f64 { #[inline] #[unstable(feature = "core")] #[deprecated(since = "1.0.0")] - fn min_exp(_: Option) -> int { MIN_EXP as int } + fn min_exp(_: Option) -> isize { MIN_EXP as isize } #[inline] #[unstable(feature = "core")] #[deprecated(since = "1.0.0")] - fn max_exp(_: Option) -> int { MAX_EXP as int } + fn max_exp(_: Option) -> isize { MAX_EXP as isize } #[inline] #[unstable(feature = "core")] #[deprecated(since = "1.0.0")] - fn min_10_exp(_: Option) -> int { MIN_10_EXP as int } + fn min_10_exp(_: Option) -> isize { MIN_10_EXP as isize } #[inline] #[unstable(feature = "core")] #[deprecated(since = "1.0.0")] - fn max_10_exp(_: Option) -> int { MAX_10_EXP as int } + fn max_10_exp(_: Option) -> isize { MAX_10_EXP as isize } #[inline] #[unstable(feature = "core")] diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 0eec875afc3..38f067ccb8c 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -52,8 +52,8 @@ pub trait Int + BitAnd + BitOr + BitXor - + Shl - + Shr + + Shl + + Shr + WrappingOps + OverflowingOps { @@ -565,7 +565,7 @@ uint_impl! { u64 = u64, 64, intrinsics::u64_mul_with_overflow } #[cfg(target_pointer_width = "32")] -uint_impl! { uint = u32, 32, +uint_impl! { usize = u32, 32, intrinsics::ctpop32, intrinsics::ctlz32, intrinsics::cttz32, @@ -575,7 +575,7 @@ uint_impl! { uint = u32, 32, intrinsics::u32_mul_with_overflow } #[cfg(target_pointer_width = "64")] -uint_impl! { uint = u64, 64, +uint_impl! { usize = u64, 64, intrinsics::ctpop64, intrinsics::ctlz64, intrinsics::cttz64, @@ -680,13 +680,13 @@ int_impl! { i64 = i64, u64, 64, intrinsics::i64_mul_with_overflow } #[cfg(target_pointer_width = "32")] -int_impl! { int = i32, u32, 32, +int_impl! { isize = i32, u32, 32, intrinsics::i32_add_with_overflow, intrinsics::i32_sub_with_overflow, intrinsics::i32_mul_with_overflow } #[cfg(target_pointer_width = "64")] -int_impl! { int = i64, u64, 64, +int_impl! { isize = i64, u64, 64, intrinsics::i64_add_with_overflow, intrinsics::i64_sub_with_overflow, intrinsics::i64_mul_with_overflow } @@ -752,7 +752,7 @@ signed_int_impl! { i8 } signed_int_impl! { i16 } signed_int_impl! { i32 } signed_int_impl! { i64 } -signed_int_impl! { int } +signed_int_impl! { isize } // `Int` + `SignedInt` implemented for signed integers macro_rules! int_impl { @@ -1232,7 +1232,7 @@ impl i64 { #[cfg(target_pointer_width = "32")] #[lang = "isize"] impl isize { - int_impl! { int = i32, u32, 32, + int_impl! { isize = i32, u32, 32, intrinsics::i32_add_with_overflow, intrinsics::i32_sub_with_overflow, intrinsics::i32_mul_with_overflow } @@ -1241,7 +1241,7 @@ impl isize { #[cfg(target_pointer_width = "64")] #[lang = "isize"] impl isize { - int_impl! { int = i64, u64, 64, + int_impl! { isize = i64, u64, 64, intrinsics::i64_add_with_overflow, intrinsics::i64_sub_with_overflow, intrinsics::i64_mul_with_overflow } @@ -1746,7 +1746,7 @@ impl u64 { #[cfg(target_pointer_width = "32")] #[lang = "usize"] impl usize { - uint_impl! { uint = u32, 32, + uint_impl! { usize = u32, 32, intrinsics::ctpop32, intrinsics::ctlz32, intrinsics::cttz32, @@ -1759,7 +1759,7 @@ impl usize { #[cfg(target_pointer_width = "64")] #[lang = "usize"] impl usize { - uint_impl! { uint = u64, 64, + uint_impl! { usize = u64, 64, intrinsics::ctpop64, intrinsics::ctlz64, intrinsics::cttz64, @@ -1772,11 +1772,11 @@ impl usize { /// A generic trait for converting a value to a number. #[unstable(feature = "core", reason = "trait is likely to be removed")] pub trait ToPrimitive { - /// Converts the value of `self` to an `int`. + /// Converts the value of `self` to an `isize`. #[inline] #[unstable(feature = "core")] #[deprecated(since = "1.0.0", reason = "use to_isize")] - fn to_int(&self) -> Option { + fn to_int(&self) -> Option { self.to_i64().and_then(|x| x.to_isize()) } @@ -1807,11 +1807,11 @@ pub trait ToPrimitive { /// Converts the value of `self` to an `i64`. fn to_i64(&self) -> Option; - /// Converts the value of `self` to an `uint`. + /// Converts the value of `self` to an `usize`. #[inline] #[unstable(feature = "core")] #[deprecated(since = "1.0.0", reason = "use to_usize")] - fn to_uint(&self) -> Option { + fn to_uint(&self) -> Option { self.to_u64().and_then(|x| x.to_usize()) } @@ -1893,7 +1893,7 @@ macro_rules! impl_to_primitive_int { ($T:ty) => ( impl ToPrimitive for $T { #[inline] - fn to_int(&self) -> Option { impl_to_primitive_int_to_int!($T, int, *self) } + fn to_int(&self) -> Option { impl_to_primitive_int_to_int!($T, isize, *self) } #[inline] fn to_isize(&self) -> Option { impl_to_primitive_int_to_int!($T, isize, *self) } #[inline] @@ -1906,7 +1906,7 @@ macro_rules! impl_to_primitive_int { fn to_i64(&self) -> Option { impl_to_primitive_int_to_int!($T, i64, *self) } #[inline] - fn to_uint(&self) -> Option { impl_to_primitive_int_to_uint!($T, uint, *self) } + fn to_uint(&self) -> Option { impl_to_primitive_int_to_uint!($T, usize, *self) } #[inline] fn to_usize(&self) -> Option { impl_to_primitive_int_to_uint!($T, usize, *self) } #[inline] @@ -1967,9 +1967,9 @@ macro_rules! impl_to_primitive_uint { ($T:ty) => ( impl ToPrimitive for $T { #[inline] - fn to_int(&self) -> Option { impl_to_primitive_uint_to_int!(int, *self) } + fn to_int(&self) -> Option { impl_to_primitive_uint_to_int!(isize, *self) } #[inline] - fn to_isize(&self) -> Option { impl_to_primitive_uint_to_int!(isize, *self) } + fn to_isize(&self) -> Option { impl_to_primitive_uint_to_int!(isize, *self) } #[inline] fn to_i8(&self) -> Option { impl_to_primitive_uint_to_int!(i8, *self) } #[inline] @@ -1980,9 +1980,11 @@ macro_rules! impl_to_primitive_uint { fn to_i64(&self) -> Option { impl_to_primitive_uint_to_int!(i64, *self) } #[inline] - fn to_uint(&self) -> Option { impl_to_primitive_uint_to_uint!($T, uint, *self) } + fn to_uint(&self) -> Option { impl_to_primitive_uint_to_uint!($T, usize, *self) } #[inline] - fn to_usize(&self) -> Option { impl_to_primitive_uint_to_uint!($T, usize, *self) } + fn to_usize(&self) -> Option { + impl_to_primitive_uint_to_uint!($T, usize, *self) + } #[inline] fn to_u8(&self) -> Option { impl_to_primitive_uint_to_uint!($T, u8, *self) } #[inline] @@ -2026,9 +2028,9 @@ macro_rules! impl_to_primitive_float { ($T:ident) => ( impl ToPrimitive for $T { #[inline] - fn to_int(&self) -> Option { Some(*self as int) } + fn to_int(&self) -> Option { Some(*self as isize) } #[inline] - fn to_isize(&self) -> Option { Some(*self as isize) } + fn to_isize(&self) -> Option { Some(*self as isize) } #[inline] fn to_i8(&self) -> Option { Some(*self as i8) } #[inline] @@ -2039,9 +2041,9 @@ macro_rules! impl_to_primitive_float { fn to_i64(&self) -> Option { Some(*self as i64) } #[inline] - fn to_uint(&self) -> Option { Some(*self as uint) } + fn to_uint(&self) -> Option { Some(*self as usize) } #[inline] - fn to_usize(&self) -> Option { Some(*self as usize) } + fn to_usize(&self) -> Option { Some(*self as usize) } #[inline] fn to_u8(&self) -> Option { Some(*self as u8) } #[inline] @@ -2065,12 +2067,12 @@ impl_to_primitive_float! { f64 } /// A generic trait for converting a number to a value. #[unstable(feature = "core", reason = "trait is likely to be removed")] pub trait FromPrimitive : ::marker::Sized { - /// Convert an `int` to return an optional value of this type. If the + /// Convert an `isize` to return an optional value of this type. If the /// value cannot be represented by this value, the `None` is returned. #[inline] #[unstable(feature = "core")] #[deprecated(since = "1.0.0", reason = "use from_isize")] - fn from_int(n: int) -> Option { + fn from_int(n: isize) -> Option { FromPrimitive::from_i64(n as i64) } @@ -2106,12 +2108,12 @@ pub trait FromPrimitive : ::marker::Sized { /// type cannot be represented by this value, the `None` is returned. fn from_i64(n: i64) -> Option; - /// Convert an `uint` to return an optional value of this type. If the + /// Convert an `usize` to return an optional value of this type. If the /// type cannot be represented by this value, the `None` is returned. #[inline] #[unstable(feature = "core")] #[deprecated(since = "1.0.0", reason = "use from_usize")] - fn from_uint(n: uint) -> Option { + fn from_uint(n: usize) -> Option { FromPrimitive::from_u64(n as u64) } @@ -2165,7 +2167,7 @@ pub trait FromPrimitive : ::marker::Sized { /// A utility function that just calls `FromPrimitive::from_int`. #[unstable(feature = "core", reason = "likely to be removed")] #[deprecated(since = "1.0.0", reason = "use from_isize")] -pub fn from_int(n: int) -> Option { +pub fn from_int(n: isize) -> Option { FromPrimitive::from_isize(n) } @@ -2202,7 +2204,7 @@ pub fn from_i64(n: i64) -> Option { /// A utility function that just calls `FromPrimitive::from_uint`. #[unstable(feature = "core", reason = "likely to be removed")] #[deprecated(since = "1.0.0", reason = "use from_uint")] -pub fn from_uint(n: uint) -> Option { +pub fn from_uint(n: usize) -> Option { FromPrimitive::from_usize(n) } @@ -2252,13 +2254,13 @@ macro_rules! impl_from_primitive { ($T:ty, $to_ty:ident) => ( #[allow(deprecated)] impl FromPrimitive for $T { - #[inline] fn from_int(n: int) -> Option<$T> { n.$to_ty() } + #[inline] fn from_int(n: isize) -> Option<$T> { n.$to_ty() } #[inline] fn from_i8(n: i8) -> Option<$T> { n.$to_ty() } #[inline] fn from_i16(n: i16) -> Option<$T> { n.$to_ty() } #[inline] fn from_i32(n: i32) -> Option<$T> { n.$to_ty() } #[inline] fn from_i64(n: i64) -> Option<$T> { n.$to_ty() } - #[inline] fn from_uint(n: uint) -> Option<$T> { n.$to_ty() } + #[inline] fn from_uint(n: usize) -> Option<$T> { n.$to_ty() } #[inline] fn from_u8(n: u8) -> Option<$T> { n.$to_ty() } #[inline] fn from_u16(n: u16) -> Option<$T> { n.$to_ty() } #[inline] fn from_u32(n: u32) -> Option<$T> { n.$to_ty() } @@ -2270,12 +2272,12 @@ macro_rules! impl_from_primitive { ) } -impl_from_primitive! { int, to_int } +impl_from_primitive! { isize, to_int } impl_from_primitive! { i8, to_i8 } impl_from_primitive! { i16, to_i16 } impl_from_primitive! { i32, to_i32 } impl_from_primitive! { i64, to_i64 } -impl_from_primitive! { uint, to_uint } +impl_from_primitive! { usize, to_uint } impl_from_primitive! { u8, to_u8 } impl_from_primitive! { u16, to_u16 } impl_from_primitive! { u32, to_u32 } @@ -2327,12 +2329,12 @@ impl_num_cast! { u8, to_u8 } impl_num_cast! { u16, to_u16 } impl_num_cast! { u32, to_u32 } impl_num_cast! { u64, to_u64 } -impl_num_cast! { uint, to_uint } +impl_num_cast! { usize, to_uint } impl_num_cast! { i8, to_i8 } impl_num_cast! { i16, to_i16 } impl_num_cast! { i32, to_i32 } impl_num_cast! { i64, to_i64 } -impl_num_cast! { int, to_int } +impl_num_cast! { isize, to_int } impl_num_cast! { f32, to_f32 } impl_num_cast! { f64, to_f64 } @@ -2392,12 +2394,12 @@ pub trait Float #[deprecated(since = "1.0.0", reason = "use `std::f32::MANTISSA_DIGITS` or \ `std::f64::MANTISSA_DIGITS` as appropriate")] - fn mantissa_digits(unused_self: Option) -> uint; + fn mantissa_digits(unused_self: Option) -> usize; /// Returns the number of base-10 digits of precision that this type supports. #[unstable(feature = "core")] #[deprecated(since = "1.0.0", reason = "use `std::f32::DIGITS` or `std::f64::DIGITS` as appropriate")] - fn digits(unused_self: Option) -> uint; + fn digits(unused_self: Option) -> usize; /// Returns the difference between 1.0 and the smallest representable number larger than 1.0. #[unstable(feature = "core")] #[deprecated(since = "1.0.0", @@ -2407,22 +2409,22 @@ pub trait Float #[unstable(feature = "core")] #[deprecated(since = "1.0.0", reason = "use `std::f32::MIN_EXP` or `std::f64::MIN_EXP` as appropriate")] - fn min_exp(unused_self: Option) -> int; + fn min_exp(unused_self: Option) -> isize; /// Returns the maximum binary exponent that this type can represent. #[unstable(feature = "core")] #[deprecated(since = "1.0.0", reason = "use `std::f32::MAX_EXP` or `std::f64::MAX_EXP` as appropriate")] - fn max_exp(unused_self: Option) -> int; + fn max_exp(unused_self: Option) -> isize; /// Returns the minimum base-10 exponent that this type can represent. #[unstable(feature = "core")] #[deprecated(since = "1.0.0", reason = "use `std::f32::MIN_10_EXP` or `std::f64::MIN_10_EXP` as appropriate")] - fn min_10_exp(unused_self: Option) -> int; + fn min_10_exp(unused_self: Option) -> isize; /// Returns the maximum base-10 exponent that this type can represent. #[unstable(feature = "core")] #[deprecated(since = "1.0.0", reason = "use `std::f32::MAX_10_EXP` or `std::f64::MAX_10_EXP` as appropriate")] - fn max_10_exp(unused_self: Option) -> int; + fn max_10_exp(unused_self: Option) -> isize; /// Returns the smallest finite value that this type can represent. #[unstable(feature = "core")] #[deprecated(since = "1.0.0", @@ -2625,7 +2627,7 @@ macro_rules! from_str_radix_float_impl { let mut prev_sig = sig; let mut cs = src.chars().enumerate(); // Exponent prefix and exponent index offset - let mut exp_info = None::<(char, uint)>; + let mut exp_info = None::<(char, usize)>; // Parse the integer part of the significand for (i, c) in cs.by_ref() { @@ -2636,9 +2638,9 @@ macro_rules! from_str_radix_float_impl { // add/subtract current digit depending on sign if is_positive { - sig = sig + ((digit as int) as $T); + sig = sig + ((digit as isize) as $T); } else { - sig = sig - ((digit as int) as $T); + sig = sig - ((digit as isize) as $T); } // Detect overflow by comparing to last value, except @@ -2719,9 +2721,9 @@ macro_rules! from_str_radix_float_impl { // Parse the exponent as decimal integer let src = &src[offset..]; let (is_positive, exp) = match src.slice_shift_char() { - Some(('-', src)) => (false, src.parse::()), - Some(('+', src)) => (true, src.parse::()), - Some((_, _)) => (true, src.parse::()), + Some(('-', src)) => (false, src.parse::()), + Some(('+', src)) => (true, src.parse::()), + Some((_, _)) => (true, src.parse::()), None => return Err(PFE { kind: Invalid }), }; diff --git a/src/libcore/num/wrapping.rs b/src/libcore/num/wrapping.rs index f8fc4ef27a1..7e02c71a2a0 100644 --- a/src/libcore/num/wrapping.rs +++ b/src/libcore/num/wrapping.rs @@ -64,7 +64,7 @@ macro_rules! wrapping_impl { )*) } -wrapping_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 } +wrapping_impl! { usize u8 u16 u32 u64 isize i8 i16 i32 i64 } #[unstable(feature = "core", reason = "may be removed, renamed, or relocated")] #[derive(PartialEq,Eq,PartialOrd,Ord,Clone,Copy)] @@ -132,20 +132,20 @@ impl> BitAnd for Wrapping { } } -impl> Shl for Wrapping { +impl> Shl for Wrapping { type Output = Wrapping; #[inline(always)] - fn shl(self, other: uint) -> Wrapping { + fn shl(self, other: usize) -> Wrapping { Wrapping(self.0 << other) } } -impl> Shr for Wrapping { +impl> Shr for Wrapping { type Output = Wrapping; #[inline(always)] - fn shr(self, other: uint) -> Wrapping { + fn shr(self, other: usize) -> Wrapping { Wrapping(self.0 >> other) } } diff --git a/src/libcore/panicking.rs b/src/libcore/panicking.rs index 377b5b57ae1..d6e00df1fd7 100644 --- a/src/libcore/panicking.rs +++ b/src/libcore/panicking.rs @@ -16,7 +16,7 @@ //! interface for panicking is: //! //! ```ignore -//! fn panic_impl(fmt: fmt::Arguments, &(&'static str, uint)) -> !; +//! fn panic_impl(fmt: fmt::Arguments, &(&'static str, usize)) -> !; //! ``` //! //! This definition allows for panicking with any general message, but it does not @@ -58,8 +58,8 @@ pub fn panic_fmt(fmt: fmt::Arguments, file_line: &(&'static str, u32)) -> ! { #[allow(improper_ctypes)] extern { #[lang = "panic_fmt"] - fn panic_impl(fmt: fmt::Arguments, file: &'static str, line: uint) -> !; + fn panic_impl(fmt: fmt::Arguments, file: &'static str, line: usize) -> !; } let (file, line) = *file_line; - unsafe { panic_impl(fmt, file, line as uint) } + unsafe { panic_impl(fmt, file, line as usize) } } diff --git a/src/libcore/result.rs b/src/libcore/result.rs index 62e1bcd827a..c17a1349370 100644 --- a/src/libcore/result.rs +++ b/src/libcore/result.rs @@ -60,22 +60,22 @@ //! that make working with it more succinct. //! //! ``` -//! let good_result: Result = Ok(10); -//! let bad_result: Result = Err(10); +//! let good_result: Result = Ok(10); +//! let bad_result: Result = Err(10); //! //! // The `is_ok` and `is_err` methods do what they say. //! assert!(good_result.is_ok() && !good_result.is_err()); //! assert!(bad_result.is_err() && !bad_result.is_ok()); //! //! // `map` consumes the `Result` and produces another. -//! let good_result: Result = good_result.map(|i| i + 1); -//! let bad_result: Result = bad_result.map(|i| i - 1); +//! let good_result: Result = good_result.map(|i| i + 1); +//! let bad_result: Result = bad_result.map(|i| i - 1); //! //! // Use `and_then` to continue the computation. -//! let good_result: Result = good_result.and_then(|i| Ok(i == 11)); +//! let good_result: Result = good_result.and_then(|i| Ok(i == 11)); //! //! // Use `or_else` to handle the error. -//! let bad_result: Result = bad_result.or_else(|i| Ok(11)); +//! let bad_result: Result = bad_result.or_else(|i| Ok(11)); //! //! // Consume the result and return the contents with `unwrap`. //! let final_awesome_result = good_result.unwrap(); @@ -182,8 +182,8 @@ //! //! struct Info { //! name: String, -//! age: int, -//! rating: int +//! age: i32, +//! rating: i32, //! } //! //! fn write_info(info: &Info) -> Result<(), IoError> { @@ -208,8 +208,8 @@ //! //! struct Info { //! name: String, -//! age: int, -//! rating: int +//! age: i32, +//! rating: i32, //! } //! //! fn write_info(info: &Info) -> Result<(), IoError> { @@ -282,10 +282,10 @@ impl Result { /// # Examples /// /// ``` - /// let x: Result = Ok(-3); + /// let x: Result = Ok(-3); /// assert_eq!(x.is_ok(), true); /// - /// let x: Result = Err("Some error message"); + /// let x: Result = Err("Some error message"); /// assert_eq!(x.is_ok(), false); /// ``` #[inline] @@ -302,10 +302,10 @@ impl Result { /// # Examples /// /// ``` - /// let x: Result = Ok(-3); + /// let x: Result = Ok(-3); /// assert_eq!(x.is_err(), false); /// - /// let x: Result = Err("Some error message"); + /// let x: Result = Err("Some error message"); /// assert_eq!(x.is_err(), true); /// ``` #[inline] @@ -392,18 +392,18 @@ impl Result { /// Convert from `Result` to `Result<&mut T, &mut E>` /// /// ``` - /// fn mutate(r: &mut Result) { + /// fn mutate(r: &mut Result) { /// match r.as_mut() { /// Ok(&mut ref mut v) => *v = 42, /// Err(&mut ref mut e) => *e = 0, /// } /// } /// - /// let mut x: Result = Ok(2); + /// let mut x: Result = Ok(2); /// mutate(&mut x); /// assert_eq!(x.unwrap(), 42); /// - /// let mut x: Result = Err(13); + /// let mut x: Result = Err(13); /// mutate(&mut x); /// assert_eq!(x.unwrap_err(), 0); /// ``` @@ -486,8 +486,8 @@ impl Result { /// while !buffer.is_empty() { /// let line: IoResult = buffer.read_line(); /// // Convert the string line to a number using `map` and `from_str` - /// let val: IoResult = line.map(|line| { - /// line.trim_right().parse::().unwrap_or(0) + /// let val: IoResult = line.map(|line| { + /// line.trim_right().parse::().unwrap_or(0) /// }); /// // Add the value if there were no errors, otherwise add 0 /// sum += val.unwrap_or(0); diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index a629e0308e9..1f8e73e9ddc 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -1704,7 +1704,7 @@ impl StrExt for str { #[inline] unsafe fn slice_unchecked(&self, begin: usize, end: usize) -> &str { mem::transmute(Slice { - data: self.as_ptr().offset(begin as int), + data: self.as_ptr().offset(begin as isize), len: end - begin, }) } diff --git a/src/libcoretest/any.rs b/src/libcoretest/any.rs index 39f5d237a2b..eeaaa3e217e 100644 --- a/src/libcoretest/any.rs +++ b/src/libcoretest/any.rs @@ -37,9 +37,9 @@ fn any_referenced() { fn any_owning() { let (a, b, c) = (box 5_usize as Box, box TEST as Box, box Test as Box); - assert!(a.is::()); - assert!(!b.is::()); - assert!(!c.is::()); + assert!(a.is::()); + assert!(!b.is::()); + assert!(!c.is::()); assert!(!a.is::<&'static str>()); assert!(b.is::<&'static str>()); @@ -54,7 +54,7 @@ fn any_owning() { fn any_downcast_ref() { let a = &5_usize as &Any; - match a.downcast_ref::() { + match a.downcast_ref::() { Some(&5) => {} x => panic!("Unexpected value {:?}", x) } @@ -71,10 +71,10 @@ fn any_downcast_mut() { let mut b: Box<_> = box 7_usize; let a_r = &mut a as &mut Any; - let tmp: &mut uint = &mut *b; + let tmp: &mut usize = &mut *b; let b_r = tmp as &mut Any; - match a_r.downcast_mut::() { + match a_r.downcast_mut::() { Some(x) => { assert_eq!(*x, 5); *x = 612; @@ -82,7 +82,7 @@ fn any_downcast_mut() { x => panic!("Unexpected value {:?}", x) } - match b_r.downcast_mut::() { + match b_r.downcast_mut::() { Some(x) => { assert_eq!(*x, 7); *x = 413; @@ -100,12 +100,12 @@ fn any_downcast_mut() { x => panic!("Unexpected value {:?}", x) } - match a_r.downcast_mut::() { + match a_r.downcast_mut::() { Some(&mut 612) => {} x => panic!("Unexpected value {:?}", x) } - match b_r.downcast_mut::() { + match b_r.downcast_mut::() { Some(&mut 413) => {} x => panic!("Unexpected value {:?}", x) } @@ -115,8 +115,8 @@ fn any_downcast_mut() { fn any_fixed_vec() { let test = [0_usize; 8]; let test = &test as &Any; - assert!(test.is::<[uint; 8]>()); - assert!(!test.is::<[uint; 10]>()); + assert!(test.is::<[usize; 8]>()); + assert!(!test.is::<[usize; 10]>()); } @@ -126,6 +126,6 @@ fn bench_downcast_ref(b: &mut Bencher) { let mut x = 0; let mut y = &mut x as &mut Any; test::black_box(&mut y); - test::black_box(y.downcast_ref::() == Some(&0)); + test::black_box(y.downcast_ref::() == Some(&0)); }); } diff --git a/src/libcoretest/cell.rs b/src/libcoretest/cell.rs index 3397cbb18fa..fff3cc14ead 100644 --- a/src/libcoretest/cell.rs +++ b/src/libcoretest/cell.rs @@ -134,19 +134,19 @@ fn clone_ref_updates_flag() { #[test] fn as_unsafe_cell() { - let c1: Cell = Cell::new(0); + let c1: Cell = Cell::new(0); c1.set(1); assert_eq!(1, unsafe { *c1.as_unsafe_cell().get() }); - let c2: Cell = Cell::new(0); + let c2: Cell = Cell::new(0); unsafe { *c2.as_unsafe_cell().get() = 1; } assert_eq!(1, c2.get()); - let r1: RefCell = RefCell::new(0); + let r1: RefCell = RefCell::new(0); *r1.borrow_mut() = 1; assert_eq!(1, unsafe { *r1.as_unsafe_cell().get() }); - let r2: RefCell = RefCell::new(0); + let r2: RefCell = RefCell::new(0); unsafe { *r2.as_unsafe_cell().get() = 1; } assert_eq!(1, *r2.borrow()); } diff --git a/src/libcoretest/cmp.rs b/src/libcoretest/cmp.rs index 2e5c6fe5a2f..9ed1508c3eb 100644 --- a/src/libcoretest/cmp.rs +++ b/src/libcoretest/cmp.rs @@ -114,7 +114,7 @@ fn test_user_defined_eq() { // Our type. struct SketchyNum { - num : int + num : isize } // Our implementation of `PartialEq` to support `==` and `!=`. diff --git a/src/libcoretest/iter.rs b/src/libcoretest/iter.rs index 52cc2519add..15938a5dcb4 100644 --- a/src/libcoretest/iter.rs +++ b/src/libcoretest/iter.rs @@ -19,7 +19,7 @@ use test::Bencher; #[test] fn test_lt() { - let empty: [int; 0] = []; + let empty: [isize; 0] = []; let xs = [1,2,3]; let ys = [1,2,0]; @@ -73,7 +73,7 @@ fn test_multi_iter() { #[test] fn test_counter_from_iter() { let it = count(0, 5).take(10); - let xs: Vec = FromIterator::from_iter(it); + let xs: Vec = FromIterator::from_iter(it); assert_eq!(xs, [0, 5, 10, 15, 20, 25, 30, 35, 40, 45]); } @@ -104,7 +104,7 @@ fn test_iterator_chain() { fn test_filter_map() { let it = count(0, 1).take(10) .filter_map(|x| if x % 2 == 0 { Some(x*x) } else { None }); - assert_eq!(it.collect::>(), [0*0, 2*2, 4*4, 6*6, 8*8]); + assert_eq!(it.collect::>(), [0*0, 2*2, 4*4, 6*6, 8*8]); } #[test] @@ -224,8 +224,8 @@ fn test_iterator_take_short() { #[test] fn test_iterator_scan() { // test the type inference - fn add(old: &mut int, new: &uint) -> Option { - *old += *new as int; + fn add(old: &mut isize, new: &usize) -> Option { + *old += *new as isize; Some(*old as f64) } let xs = [0, 1, 2, 3, 4]; @@ -261,7 +261,7 @@ fn test_inspect() { let ys = xs.iter() .cloned() .inspect(|_| n += 1) - .collect::>(); + .collect::>(); assert_eq!(n, xs.len()); assert_eq!(&xs[..], &ys[..]); @@ -269,7 +269,7 @@ fn test_inspect() { #[test] fn test_unfoldr() { - fn count(st: &mut uint) -> Option { + fn count(st: &mut usize) -> Option { if *st < 10 { let ret = Some(*st); *st += 1; @@ -398,14 +398,14 @@ fn test_iterator_size_hint() { #[test] fn test_collect() { let a = vec![1, 2, 3, 4, 5]; - let b: Vec = a.iter().cloned().collect(); + let b: Vec = a.iter().cloned().collect(); assert!(a == b); } #[test] fn test_all() { // FIXME (#22405): Replace `Box::new` with `box` here when/if possible. - let v: Box<[int]> = Box::new([1, 2, 3, 4, 5]); + let v: Box<[isize]> = Box::new([1, 2, 3, 4, 5]); assert!(v.iter().all(|&x| x < 10)); assert!(!v.iter().all(|&x| x % 2 == 0)); assert!(!v.iter().all(|&x| x > 100)); @@ -415,7 +415,7 @@ fn test_all() { #[test] fn test_any() { // FIXME (#22405): Replace `Box::new` with `box` here when/if possible. - let v: Box<[int]> = Box::new([1, 2, 3, 4, 5]); + let v: Box<[isize]> = Box::new([1, 2, 3, 4, 5]); assert!(v.iter().any(|&x| x < 10)); assert!(v.iter().any(|&x| x % 2 == 0)); assert!(!v.iter().any(|&x| x > 100)); @@ -424,7 +424,7 @@ fn test_any() { #[test] fn test_find() { - let v: &[int] = &[1, 3, 9, 27, 103, 14, 11]; + let v: &[isize] = &[1, 3, 9, 27, 103, 14, 11]; assert_eq!(*v.iter().find(|&&x| x & 1 == 0).unwrap(), 14); assert_eq!(*v.iter().find(|&&x| x % 3 == 0).unwrap(), 3); assert!(v.iter().find(|&&x| x % 12 == 0).is_none()); @@ -448,13 +448,13 @@ fn test_count() { #[test] fn test_max_by() { - let xs: &[int] = &[-3, 0, 1, 5, -10]; + let xs: &[isize] = &[-3, 0, 1, 5, -10]; assert_eq!(*xs.iter().max_by(|x| x.abs()).unwrap(), -10); } #[test] fn test_min_by() { - let xs: &[int] = &[-3, 0, 1, 5, -10]; + let xs: &[isize] = &[-3, 0, 1, 5, -10]; assert_eq!(*xs.iter().min_by(|x| x.abs()).unwrap(), 0); } @@ -473,7 +473,7 @@ fn test_rev() { let mut it = xs.iter(); it.next(); it.next(); - assert!(it.rev().cloned().collect::>() == + assert!(it.rev().cloned().collect::>() == vec![16, 14, 12, 10, 8, 6]); } @@ -572,8 +572,8 @@ fn test_double_ended_chain() { #[test] fn test_rposition() { - fn f(xy: &(int, char)) -> bool { let (_x, y) = *xy; y == 'b' } - fn g(xy: &(int, char)) -> bool { let (_x, y) = *xy; y == 'd' } + fn f(xy: &(isize, char)) -> bool { let (_x, y) = *xy; y == 'b' } + fn g(xy: &(isize, char)) -> bool { let (_x, y) = *xy; y == 'd' } let v = [(0, 'a'), (1, 'b'), (2, 'c'), (3, 'b')]; assert_eq!(v.iter().rposition(f), Some(3)); @@ -598,7 +598,7 @@ fn test_rposition_panic() { #[cfg(test)] -fn check_randacc_iter(a: T, len: uint) where +fn check_randacc_iter(a: T, len: usize) where A: PartialEq, T: Clone + RandomAccessIterator + Iterator, { @@ -684,7 +684,7 @@ fn test_random_access_zip() { #[test] fn test_random_access_take() { let xs = [1, 2, 3, 4, 5]; - let empty: &[int] = &[]; + let empty: &[isize] = &[]; check_randacc_iter(xs.iter().take(3), 3); check_randacc_iter(xs.iter().take(20), xs.len()); check_randacc_iter(xs.iter().take(0), 0); @@ -694,7 +694,7 @@ fn test_random_access_take() { #[test] fn test_random_access_skip() { let xs = [1, 2, 3, 4, 5]; - let empty: &[int] = &[]; + let empty: &[isize] = &[]; check_randacc_iter(xs.iter().skip(2), xs.len() - 2); check_randacc_iter(empty.iter().skip(2), 0); } @@ -726,7 +726,7 @@ fn test_random_access_map() { #[test] fn test_random_access_cycle() { let xs = [1, 2, 3, 4, 5]; - let empty: &[int] = &[]; + let empty: &[isize] = &[]; check_randacc_iter(xs.iter().cycle().take(27), 27); check_randacc_iter(empty.iter().cycle(), 0); } @@ -755,7 +755,7 @@ fn test_range() { assert_eq!((200..200).rev().count(), 0); assert_eq!((0..100).size_hint(), (100, Some(100))); - // this test is only meaningful when sizeof uint < sizeof u64 + // this test is only meaningful when sizeof usize < sizeof u64 assert_eq!((usize::MAX - 1..usize::MAX).size_hint(), (1, Some(1))); assert_eq!((-10..-1).size_hint(), (9, Some(9))); assert_eq!((-1..-10).size_hint(), (0, Some(0))); @@ -763,34 +763,34 @@ fn test_range() { #[test] fn test_range_inclusive() { - assert!(range_inclusive(0, 5).collect::>() == + assert!(range_inclusive(0, 5).collect::>() == vec![0, 1, 2, 3, 4, 5]); - assert!(range_inclusive(0, 5).rev().collect::>() == + assert!(range_inclusive(0, 5).rev().collect::>() == vec![5, 4, 3, 2, 1, 0]); assert_eq!(range_inclusive(200, -5).count(), 0); assert_eq!(range_inclusive(200, -5).rev().count(), 0); - assert_eq!(range_inclusive(200, 200).collect::>(), [200]); - assert_eq!(range_inclusive(200, 200).rev().collect::>(), [200]); + assert_eq!(range_inclusive(200, 200).collect::>(), [200]); + assert_eq!(range_inclusive(200, 200).rev().collect::>(), [200]); } #[test] fn test_range_step() { - assert_eq!((0..20).step_by(5).collect::>(), [0, 5, 10, 15]); - assert_eq!((20..0).step_by(-5).collect::>(), [20, 15, 10, 5]); - assert_eq!((20..0).step_by(-6).collect::>(), [20, 14, 8, 2]); + assert_eq!((0..20).step_by(5).collect::>(), [0, 5, 10, 15]); + assert_eq!((20..0).step_by(-5).collect::>(), [20, 15, 10, 5]); + assert_eq!((20..0).step_by(-6).collect::>(), [20, 14, 8, 2]); assert_eq!((200..255).step_by(50).collect::>(), [200, 250]); - assert_eq!((200..-5).step_by(1).collect::>(), []); - assert_eq!((200..200).step_by(1).collect::>(), []); + assert_eq!((200..-5).step_by(1).collect::>(), []); + assert_eq!((200..200).step_by(1).collect::>(), []); } #[test] fn test_range_step_inclusive() { - assert_eq!(range_step_inclusive(0, 20, 5).collect::>(), [0, 5, 10, 15, 20]); - assert_eq!(range_step_inclusive(20, 0, -5).collect::>(), [20, 15, 10, 5, 0]); - assert_eq!(range_step_inclusive(20, 0, -6).collect::>(), [20, 14, 8, 2]); + assert_eq!(range_step_inclusive(0, 20, 5).collect::>(), [0, 5, 10, 15, 20]); + assert_eq!(range_step_inclusive(20, 0, -5).collect::>(), [20, 15, 10, 5, 0]); + assert_eq!(range_step_inclusive(20, 0, -6).collect::>(), [20, 14, 8, 2]); assert_eq!(range_step_inclusive(200, 255, 50).collect::>(), [200, 250]); - assert_eq!(range_step_inclusive(200, -5, 1).collect::>(), []); - assert_eq!(range_step_inclusive(200, 200, 1).collect::>(), [200]); + assert_eq!(range_step_inclusive(200, -5, 1).collect::>(), []); + assert_eq!(range_step_inclusive(200, 200, 1).collect::>(), [200]); } #[test] @@ -811,7 +811,7 @@ fn test_peekable_is_empty() { #[test] fn test_min_max() { - let v: [int; 0] = []; + let v: [isize; 0] = []; assert_eq!(v.iter().min_max(), NoElements); let v = [1]; @@ -829,7 +829,7 @@ fn test_min_max() { #[test] fn test_min_max_result() { - let r: MinMaxResult = NoElements; + let r: MinMaxResult = NoElements; assert_eq!(r.into_option(), None); let r = OneElement(1); @@ -876,7 +876,7 @@ fn test_fuse() { #[bench] fn bench_rposition(b: &mut Bencher) { - let it: Vec = (0..300).collect(); + let it: Vec = (0..300).collect(); b.iter(|| { it.iter().rposition(|&x| x <= 150); }); diff --git a/src/libcoretest/mem.rs b/src/libcoretest/mem.rs index 17d6b684c50..fae36787c3d 100644 --- a/src/libcoretest/mem.rs +++ b/src/libcoretest/mem.rs @@ -21,15 +21,15 @@ fn size_of_basic() { #[test] #[cfg(target_pointer_width = "32")] fn size_of_32() { - assert_eq!(size_of::(), 4); - assert_eq!(size_of::<*const uint>(), 4); + assert_eq!(size_of::(), 4); + assert_eq!(size_of::<*const usize>(), 4); } #[test] #[cfg(target_pointer_width = "64")] fn size_of_64() { - assert_eq!(size_of::(), 8); - assert_eq!(size_of::<*const uint>(), 8); + assert_eq!(size_of::(), 8); + assert_eq!(size_of::<*const usize>(), 8); } #[test] @@ -50,15 +50,15 @@ fn align_of_basic() { #[test] #[cfg(target_pointer_width = "32")] fn align_of_32() { - assert_eq!(align_of::(), 4); - assert_eq!(align_of::<*const uint>(), 4); + assert_eq!(align_of::(), 4); + assert_eq!(align_of::<*const usize>(), 4); } #[test] #[cfg(target_pointer_width = "64")] fn align_of_64() { - assert_eq!(align_of::(), 8); - assert_eq!(align_of::<*const uint>(), 8); + assert_eq!(align_of::(), 8); + assert_eq!(align_of::<*const usize>(), 8); } #[test] @@ -93,12 +93,12 @@ fn test_transmute_copy() { #[test] fn test_transmute() { trait Foo { fn dummy(&self) { } } - impl Foo for int {} + impl Foo for isize {} let a = box 100isize as Box; unsafe { let x: ::core::raw::TraitObject = transmute(a); - assert!(*(x.data as *const int) == 100); + assert!(*(x.data as *const isize) == 100); let _x: Box = transmute(x); } @@ -112,15 +112,15 @@ fn test_transmute() { // Static/dynamic method dispatch struct Struct { - field: int + field: isize } trait Trait { - fn method(&self) -> int; + fn method(&self) -> isize; } impl Trait for Struct { - fn method(&self) -> int { + fn method(&self) -> isize { self.field } } diff --git a/src/libcoretest/nonzero.rs b/src/libcoretest/nonzero.rs index f60570eaaf4..7a367ddeec8 100644 --- a/src/libcoretest/nonzero.rs +++ b/src/libcoretest/nonzero.rs @@ -43,7 +43,7 @@ fn test_match_on_nonzero_option() { #[test] fn test_match_option_empty_vec() { - let a: Option> = Some(vec![]); + let a: Option> = Some(vec![]); match a { None => panic!("unexpected None while matching on Some(vec![])"), _ => {} diff --git a/src/libcoretest/ops.rs b/src/libcoretest/ops.rs index 0183e6a93cf..33674a3abd8 100644 --- a/src/libcoretest/ops.rs +++ b/src/libcoretest/ops.rs @@ -14,7 +14,7 @@ use core::ops::{Range, RangeFull, RangeFrom, RangeTo}; // Overhead of dtors struct HasDtor { - _x: int + _x: isize } impl Drop for HasDtor { diff --git a/src/libcoretest/option.rs b/src/libcoretest/option.rs index fe0b10e9119..1a7d8f83d70 100644 --- a/src/libcoretest/option.rs +++ b/src/libcoretest/option.rs @@ -17,10 +17,10 @@ use core::clone::Clone; fn test_get_ptr() { unsafe { let x: Box<_> = box 0; - let addr_x: *const int = mem::transmute(&*x); + let addr_x: *const isize = mem::transmute(&*x); let opt = Some(x); let y = opt.unwrap(); - let addr_y: *const int = mem::transmute(&*y); + let addr_y: *const isize = mem::transmute(&*y); assert_eq!(addr_x, addr_y); } } @@ -41,7 +41,7 @@ fn test_get_resource() { use core::cell::RefCell; struct R { - i: Rc>, + i: Rc>, } #[unsafe_destructor] @@ -53,7 +53,7 @@ fn test_get_resource() { } } - fn r(i: Rc>) -> R { + fn r(i: Rc>) -> R { R { i: i } @@ -89,44 +89,44 @@ fn test_option_too_much_dance() { #[test] fn test_and() { - let x: Option = Some(1); + let x: Option = Some(1); assert_eq!(x.and(Some(2)), Some(2)); - assert_eq!(x.and(None::), None); + assert_eq!(x.and(None::), None); - let x: Option = None; + let x: Option = None; assert_eq!(x.and(Some(2)), None); - assert_eq!(x.and(None::), None); + assert_eq!(x.and(None::), None); } #[test] fn test_and_then() { - let x: Option = Some(1); + let x: Option = Some(1); assert_eq!(x.and_then(|x| Some(x + 1)), Some(2)); - assert_eq!(x.and_then(|_| None::), None); + assert_eq!(x.and_then(|_| None::), None); - let x: Option = None; + let x: Option = None; assert_eq!(x.and_then(|x| Some(x + 1)), None); - assert_eq!(x.and_then(|_| None::), None); + assert_eq!(x.and_then(|_| None::), None); } #[test] fn test_or() { - let x: Option = Some(1); + let x: Option = Some(1); assert_eq!(x.or(Some(2)), Some(1)); assert_eq!(x.or(None), Some(1)); - let x: Option = None; + let x: Option = None; assert_eq!(x.or(Some(2)), Some(2)); assert_eq!(x.or(None), None); } #[test] fn test_or_else() { - let x: Option = Some(1); + let x: Option = Some(1); assert_eq!(x.or_else(|| Some(2)), Some(1)); assert_eq!(x.or_else(|| None), Some(1)); - let x: Option = None; + let x: Option = None; assert_eq!(x.or_else(|| Some(2)), Some(2)); assert_eq!(x.or_else(|| None), None); } @@ -141,7 +141,7 @@ fn test_unwrap() { #[test] #[should_panic] fn test_unwrap_panic1() { - let x: Option = None; + let x: Option = None; x.unwrap(); } @@ -154,19 +154,19 @@ fn test_unwrap_panic2() { #[test] fn test_unwrap_or() { - let x: Option = Some(1); + let x: Option = Some(1); assert_eq!(x.unwrap_or(2), 1); - let x: Option = None; + let x: Option = None; assert_eq!(x.unwrap_or(2), 2); } #[test] fn test_unwrap_or_else() { - let x: Option = Some(1); + let x: Option = Some(1); assert_eq!(x.unwrap_or_else(|| 2), 1); - let x: Option = None; + let x: Option = None; assert_eq!(x.unwrap_or_else(|| 2), 2); } @@ -223,13 +223,13 @@ fn test_ord() { /* FIXME(#20575) #[test] fn test_collect() { - let v: Option> = (0..0).map(|_| Some(0)).collect(); + let v: Option> = (0..0).map(|_| Some(0)).collect(); assert!(v == Some(vec![])); - let v: Option> = (0..3).map(|x| Some(x)).collect(); + let v: Option> = (0..3).map(|x| Some(x)).collect(); assert!(v == Some(vec![0, 1, 2])); - let v: Option> = (0..3).map(|x| { + let v: Option> = (0..3).map(|x| { if x > 1 { None } else { Some(x) } }).collect(); assert!(v == None); diff --git a/src/libcoretest/ptr.rs b/src/libcoretest/ptr.rs index 4f5f269d437..bdb56c9f867 100644 --- a/src/libcoretest/ptr.rs +++ b/src/libcoretest/ptr.rs @@ -16,12 +16,12 @@ use std::iter::repeat; fn test() { unsafe { struct Pair { - fst: int, - snd: int + fst: isize, + snd: isize }; let mut p = Pair {fst: 10, snd: 20}; let pptr: *mut Pair = &mut p; - let iptr: *mut int = mem::transmute(pptr); + let iptr: *mut isize = mem::transmute(pptr); assert_eq!(*iptr, 10); *iptr = 30; assert_eq!(*iptr, 30); @@ -55,13 +55,13 @@ fn test() { #[test] fn test_is_null() { - let p: *const int = null(); + let p: *const isize = null(); assert!(p.is_null()); let q = unsafe { p.offset(1) }; assert!(!q.is_null()); - let mp: *mut int = null_mut(); + let mp: *mut isize = null_mut(); assert!(mp.is_null()); let mq = unsafe { mp.offset(1) }; @@ -71,22 +71,22 @@ fn test_is_null() { #[test] fn test_as_ref() { unsafe { - let p: *const int = null(); + let p: *const isize = null(); assert_eq!(p.as_ref(), None); - let q: *const int = &2; + let q: *const isize = &2; assert_eq!(q.as_ref().unwrap(), &2); - let p: *mut int = null_mut(); + let p: *mut isize = null_mut(); assert_eq!(p.as_ref(), None); - let q: *mut int = &mut 2; + let q: *mut isize = &mut 2; assert_eq!(q.as_ref().unwrap(), &2); // Lifetime inference let u = 2isize; { - let p = &u as *const int; + let p = &u as *const isize; assert_eq!(p.as_ref().unwrap(), &2); } } @@ -95,16 +95,16 @@ fn test_as_ref() { #[test] fn test_as_mut() { unsafe { - let p: *mut int = null_mut(); + let p: *mut isize = null_mut(); assert!(p.as_mut() == None); - let q: *mut int = &mut 2; + let q: *mut isize = &mut 2; assert!(q.as_mut().unwrap() == &mut 2); // Lifetime inference let mut u = 2isize; { - let p = &mut u as *mut int; + let p = &mut u as *mut isize; assert!(p.as_mut().unwrap() == &mut 2); } } @@ -143,7 +143,7 @@ fn test_ptr_subtraction() { let ptr = xs.as_ptr(); while idx >= 0 { - assert_eq!(*(ptr.offset(idx as int)), idx as int); + assert_eq!(*(ptr.offset(idx as isize)), idx as isize); idx = idx - 1; } diff --git a/src/libcoretest/result.rs b/src/libcoretest/result.rs index 1c175ba99f7..ac8c2b953ae 100644 --- a/src/libcoretest/result.rs +++ b/src/libcoretest/result.rs @@ -8,8 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub fn op1() -> Result { Ok(666) } -pub fn op2() -> Result { Err("sadface") } +pub fn op1() -> Result { Ok(666) } +pub fn op2() -> Result { Err("sadface") } #[test] pub fn test_and() { @@ -24,13 +24,13 @@ pub fn test_and() { #[test] pub fn test_and_then() { - assert_eq!(op1().and_then(|i| Ok::(i + 1)).unwrap(), 667); - assert_eq!(op1().and_then(|_| Err::("bad")).unwrap_err(), + assert_eq!(op1().and_then(|i| Ok::(i + 1)).unwrap(), 667); + assert_eq!(op1().and_then(|_| Err::("bad")).unwrap_err(), "bad"); - assert_eq!(op2().and_then(|i| Ok::(i + 1)).unwrap_err(), + assert_eq!(op2().and_then(|i| Ok::(i + 1)).unwrap_err(), "sadface"); - assert_eq!(op2().and_then(|_| Err::("bad")).unwrap_err(), + assert_eq!(op2().and_then(|_| Err::("bad")).unwrap_err(), "sadface"); } @@ -45,53 +45,53 @@ pub fn test_or() { #[test] pub fn test_or_else() { - assert_eq!(op1().or_else(|_| Ok::(667)).unwrap(), 666); - assert_eq!(op1().or_else(|e| Err::(e)).unwrap(), 666); + assert_eq!(op1().or_else(|_| Ok::(667)).unwrap(), 666); + assert_eq!(op1().or_else(|e| Err::(e)).unwrap(), 666); - assert_eq!(op2().or_else(|_| Ok::(667)).unwrap(), 667); - assert_eq!(op2().or_else(|e| Err::(e)).unwrap_err(), + assert_eq!(op2().or_else(|_| Ok::(667)).unwrap(), 667); + assert_eq!(op2().or_else(|e| Err::(e)).unwrap_err(), "sadface"); } #[test] pub fn test_impl_map() { - assert!(Ok::(1).map(|x| x + 1) == Ok(2)); - assert!(Err::(1).map(|x| x + 1) == Err(1)); + assert!(Ok::(1).map(|x| x + 1) == Ok(2)); + assert!(Err::(1).map(|x| x + 1) == Err(1)); } #[test] pub fn test_impl_map_err() { - assert!(Ok::(1).map_err(|x| x + 1) == Ok(1)); - assert!(Err::(1).map_err(|x| x + 1) == Err(2)); + assert!(Ok::(1).map_err(|x| x + 1) == Ok(1)); + assert!(Err::(1).map_err(|x| x + 1) == Err(2)); } /* FIXME(#20575) #[test] fn test_collect() { - let v: Result, ()> = (0..0).map(|_| Ok::(0)).collect(); + let v: Result, ()> = (0..0).map(|_| Ok::(0)).collect(); assert!(v == Ok(vec![])); - let v: Result, ()> = (0..3).map(|x| Ok::(x)).collect(); + let v: Result, ()> = (0..3).map(|x| Ok::(x)).collect(); assert!(v == Ok(vec![0, 1, 2])); - let v: Result, int> = (0..3).map(|x| { + let v: Result, isize> = (0..3).map(|x| { if x > 1 { Err(x) } else { Ok(x) } }).collect(); assert!(v == Err(2)); // test that it does not take more elements than it needs - let mut functions: [Box Result<(), int>>; 3] = + let mut functions: [Box Result<(), isize>>; 3] = [box || Ok(()), box || Err(1), box || panic!()]; - let v: Result, int> = functions.iter_mut().map(|f| (*f)()).collect(); + let v: Result, isize> = functions.iter_mut().map(|f| (*f)()).collect(); assert!(v == Err(1)); } */ #[test] pub fn test_fmt_default() { - let ok: Result = Ok(100); - let err: Result = Err("Err"); + let ok: Result = Ok(100); + let err: Result = Err("Err"); let s = format!("{:?}", ok); assert_eq!(s, "Ok(100)"); @@ -101,8 +101,8 @@ pub fn test_fmt_default() { #[test] pub fn test_unwrap_or() { - let ok: Result = Ok(100); - let ok_err: Result = Err("Err"); + let ok: Result = Ok(100); + let ok_err: Result = Err("Err"); assert_eq!(ok.unwrap_or(50), 100); assert_eq!(ok_err.unwrap_or(50), 50); @@ -110,7 +110,7 @@ pub fn test_unwrap_or() { #[test] pub fn test_unwrap_or_else() { - fn handler(msg: &'static str) -> int { + fn handler(msg: &'static str) -> isize { if msg == "I got this." { 50 } else { @@ -118,8 +118,8 @@ pub fn test_unwrap_or_else() { } } - let ok: Result = Ok(100); - let ok_err: Result = Err("I got this."); + let ok: Result = Ok(100); + let ok_err: Result = Err("I got this."); assert_eq!(ok.unwrap_or_else(handler), 100); assert_eq!(ok_err.unwrap_or_else(handler), 50); @@ -128,7 +128,7 @@ pub fn test_unwrap_or_else() { #[test] #[should_panic] pub fn test_unwrap_or_else_panic() { - fn handler(msg: &'static str) -> int { + fn handler(msg: &'static str) -> isize { if msg == "I got this." { 50 } else { @@ -136,6 +136,6 @@ pub fn test_unwrap_or_else_panic() { } } - let bad_err: Result = Err("Unrecoverable mess."); - let _ : int = bad_err.unwrap_or_else(handler); + let bad_err: Result = Err("Unrecoverable mess."); + let _ : isize = bad_err.unwrap_or_else(handler); } diff --git a/src/libgetopts/lib.rs b/src/libgetopts/lib.rs index 206fdd243c7..9a5dde8e45e 100644 --- a/src/libgetopts/lib.rs +++ b/src/libgetopts/lib.rs @@ -92,7 +92,6 @@ html_playground_url = "http://play.rust-lang.org/")] #![deny(missing_docs)] -#![feature(int_uint)] #![feature(staged_api)] #![feature(str_words)] #![feature(str_char)] @@ -311,7 +310,7 @@ impl Matches { } /// Returns the number of times an option was matched. - pub fn opt_count(&self, nm: &str) -> uint { + pub fn opt_count(&self, nm: &str) -> usize { self.opt_vals(nm).len() } @@ -389,7 +388,7 @@ fn is_arg(arg: &str) -> bool { arg.len() > 1 && arg.as_bytes()[0] == b'-' } -fn find_opt(opts: &[Opt], nm: Name) -> Option { +fn find_opt(opts: &[Opt], nm: Name) -> Option { // Search main options. let pos = opts.iter().position(|opt| opt.name == nm); if pos.is_some() { @@ -587,7 +586,7 @@ pub fn getopts(args: &[String], optgrps: &[OptGroup]) -> Result { let opts: Vec = optgrps.iter().map(|x| x.long_to_short()).collect(); let n_opts = opts.len(); - fn f(_x: uint) -> Vec { return Vec::new(); } + fn f(_x: usize) -> Vec { return Vec::new(); } let mut vals: Vec<_> = (0..n_opts).map(f).collect(); let mut free: Vec = Vec::new(); @@ -873,7 +872,7 @@ enum LengthLimit { /// /// Panics during iteration if the string contains a non-whitespace /// sequence longer than the limit. -fn each_split_within(ss: &str, lim: uint, mut it: F) -> bool where +fn each_split_within(ss: &str, lim: usize, mut it: F) -> bool where F: FnMut(&str) -> bool { // Just for fun, let's write this as a state machine: @@ -892,7 +891,7 @@ fn each_split_within(ss: &str, lim: uint, mut it: F) -> bool where lim = fake_i; } - let mut machine = |cont: &mut bool, (i, c): (uint, char)| -> bool { + let mut machine = |cont: &mut bool, (i, c): (usize, char)| -> bool { let whitespace = if c.is_whitespace() { Ws } else { Cr }; let limit = if (i - slice_start + 1) <= lim { UnderLim } else { OverLim }; @@ -954,7 +953,7 @@ fn each_split_within(ss: &str, lim: uint, mut it: F) -> bool where #[test] fn test_split_within() { - fn t(s: &str, i: uint, u: &[String]) { + fn t(s: &str, i: usize, u: &[String]) { let mut v = Vec::new(); each_split_within(s, i, |s| { v.push(s.to_string()); true }); assert!(v.iter().zip(u.iter()).all(|(a,b)| a == b)); diff --git a/src/libgraphviz/lib.rs b/src/libgraphviz/lib.rs index ccf4a3f48d9..b3a3f266a5e 100644 --- a/src/libgraphviz/lib.rs +++ b/src/libgraphviz/lib.rs @@ -281,7 +281,6 @@ #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", html_root_url = "http://doc.rust-lang.org/nightly/")] -#![feature(int_uint)] #![feature(collections)] #![feature(into_cow)] diff --git a/src/liblog/lib.rs b/src/liblog/lib.rs index 7ccd5401fde..1cfac4d8668 100644 --- a/src/liblog/lib.rs +++ b/src/liblog/lib.rs @@ -172,7 +172,6 @@ #![feature(alloc)] #![feature(staged_api)] #![feature(box_syntax)] -#![feature(int_uint)] #![feature(core)] #![feature(std_misc)] @@ -246,7 +245,7 @@ pub struct LogLevel(pub u32); impl fmt::Display for LogLevel { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { let LogLevel(level) = *self; - match LOG_LEVEL_NAMES.get(level as uint - 1) { + match LOG_LEVEL_NAMES.get(level as usize - 1) { Some(ref name) => fmt::Display::fmt(name, fmt), None => fmt::Display::fmt(&level, fmt) } @@ -289,7 +288,7 @@ pub fn log(level: u32, loc: &'static LogLocation, args: fmt::Arguments) { // is one. unsafe { let _g = LOCK.lock(); - match FILTER as uint { + match FILTER as usize { 0 => {} 1 => panic!("cannot log after main thread has exited"), n => { @@ -383,8 +382,8 @@ pub fn mod_enabled(level: u32, module: &str) -> bool { let _g = LOCK.lock(); unsafe { - assert!(DIRECTIVES as uint != 0); - assert!(DIRECTIVES as uint != 1, + assert!(DIRECTIVES as usize != 0); + assert!(DIRECTIVES as usize != 1, "cannot log after the main thread has exited"); enabled(level, module, (*DIRECTIVES).iter()) diff --git a/src/librand/chacha.rs b/src/librand/chacha.rs index d54f1837074..91abb548d2e 100644 --- a/src/librand/chacha.rs +++ b/src/librand/chacha.rs @@ -15,9 +15,9 @@ use core::num::Int; use core::num::wrapping::WrappingOps; use {Rng, SeedableRng, Rand}; -const KEY_WORDS : uint = 8; // 8 words for the 256-bit key -const STATE_WORDS : uint = 16; -const CHACHA_ROUNDS: uint = 20; // Cryptographically secure from 8 upwards as of this writing +const KEY_WORDS : usize = 8; // 8 words for the 256-bit key +const STATE_WORDS : usize = 16; +const CHACHA_ROUNDS: usize = 20; // Cryptographically secure from 8 upwards as of this writing /// A random number generator that uses the ChaCha20 algorithm [1]. /// @@ -32,7 +32,7 @@ const CHACHA_ROUNDS: uint = 20; // Cryptographically secure from 8 upwards as of pub struct ChaChaRng { buffer: [u32; STATE_WORDS], // Internal buffer of output state: [u32; STATE_WORDS], // Initial state - index: uint, // Index into state + index: usize, // Index into state } static EMPTY: ChaChaRng = ChaChaRng { diff --git a/src/librand/distributions/mod.rs b/src/librand/distributions/mod.rs index 5cafb8d2e5e..f42960b9c3b 100644 --- a/src/librand/distributions/mod.rs +++ b/src/librand/distributions/mod.rs @@ -76,7 +76,7 @@ impl IndependentSample for RandSample { /// A value with a particular weight for use with `WeightedChoice`. pub struct Weighted { /// The numerical weight of this item - pub weight: uint, + pub weight: usize, /// The actual item which is being weighted pub item: T, } @@ -88,7 +88,7 @@ pub struct Weighted { /// /// The `Clone` restriction is a limitation of the `Sample` and /// `IndependentSample` traits. Note that `&T` is (cheaply) `Clone` for -/// all `T`, as is `uint`, so one can store references or indices into +/// all `T`, as is `usize`, so one can store references or indices into /// another vector. /// /// # Examples @@ -110,7 +110,7 @@ pub struct Weighted { /// ``` pub struct WeightedChoice<'a, T:'a> { items: &'a mut [Weighted], - weight_range: Range + weight_range: Range } impl<'a, T: Clone> WeightedChoice<'a, T> { @@ -119,7 +119,7 @@ impl<'a, T: Clone> WeightedChoice<'a, T> { /// Panics if: /// - `v` is empty /// - the total weight is 0 - /// - the total weight is larger than a `uint` can contain. + /// - the total weight is larger than a `usize` can contain. pub fn new(items: &'a mut [Weighted]) -> WeightedChoice<'a, T> { // strictly speaking, this is subsumed by the total weight == 0 case assert!(!items.is_empty(), "WeightedChoice::new called with no items"); @@ -133,7 +133,7 @@ impl<'a, T: Clone> WeightedChoice<'a, T> { running_total = match running_total.checked_add(item.weight) { Some(n) => n, None => panic!("WeightedChoice::new called with a total weight \ - larger than a uint can contain") + larger than a usize can contain") }; item.weight = running_total; @@ -238,7 +238,7 @@ fn ziggurat( // this may be slower than it would be otherwise.) // FIXME: investigate/optimise for the above. let bits: u64 = rng.gen(); - let i = (bits & 0xff) as uint; + let i = (bits & 0xff) as usize; let f = (bits >> 11) as f64 / SCALE; // u is either U(-1, 1) or U(0, 1) depending on if this is a @@ -270,7 +270,7 @@ mod tests { use super::{RandSample, WeightedChoice, Weighted, Sample, IndependentSample}; #[derive(PartialEq, Debug)] - struct ConstRand(uint); + struct ConstRand(usize); impl Rand for ConstRand { fn rand(_: &mut R) -> ConstRand { ConstRand(0) @@ -352,7 +352,7 @@ mod tests { #[test] #[should_panic] fn test_weighted_choice_no_items() { - WeightedChoice::::new(&mut []); + WeightedChoice::::new(&mut []); } #[test] #[should_panic] fn test_weighted_choice_zero_weight() { @@ -361,7 +361,7 @@ mod tests { } #[test] #[should_panic] fn test_weighted_choice_weight_overflows() { - let x = (-1) as uint / 2; // x + x + 2 is the overflow + let x = (-1) as usize / 2; // x + x + 2 is the overflow WeightedChoice::new(&mut [Weighted { weight: x, item: 0 }, Weighted { weight: 1, item: 1 }, Weighted { weight: x, item: 2 }, diff --git a/src/librand/distributions/range.rs b/src/librand/distributions/range.rs index a682fa85841..2c200b4ea41 100644 --- a/src/librand/distributions/range.rs +++ b/src/librand/distributions/range.rs @@ -138,12 +138,12 @@ integer_impl! { i8, u8 } integer_impl! { i16, u16 } integer_impl! { i32, u32 } integer_impl! { i64, u64 } -integer_impl! { int, uint } +integer_impl! { isize, usize } integer_impl! { u8, u8 } integer_impl! { u16, u16 } integer_impl! { u32, u32 } integer_impl! { u64, u64 } -integer_impl! { uint, uint } +integer_impl! { usize, usize } macro_rules! float_impl { ($ty:ty) => { @@ -204,8 +204,8 @@ mod tests { )* }} } - t!(i8, i16, i32, i64, int, - u8, u16, u32, u64, uint) + t!(i8, i16, i32, i64, isize, + u8, u16, u32, u64, usize) } #[test] diff --git a/src/librand/lib.rs b/src/librand/lib.rs index 9f6399ff12d..97106908cde 100644 --- a/src/librand/lib.rs +++ b/src/librand/lib.rs @@ -24,7 +24,6 @@ html_favicon_url = "http://www.rust-lang.org/favicon.ico", html_root_url = "http://doc.rust-lang.org/nightly/", html_playground_url = "http://play.rust-lang.org/")] -#![feature(int_uint)] #![feature(no_std)] #![no_std] #![unstable(feature = "rand")] @@ -99,8 +98,8 @@ pub trait Rng : Sized { /// See `Closed01` for the closed interval `[0,1]`, and /// `Open01` for the open interval `(0,1)`. fn next_f32(&mut self) -> f32 { - const MANTISSA_BITS: uint = 24; - const IGNORED_BITS: uint = 8; + const MANTISSA_BITS: usize = 24; + const IGNORED_BITS: usize = 8; const SCALE: f32 = (1u64 << MANTISSA_BITS) as f32; // using any more than `MANTISSA_BITS` bits will @@ -121,8 +120,8 @@ pub trait Rng : Sized { /// See `Closed01` for the closed interval `[0,1]`, and /// `Open01` for the open interval `(0,1)`. fn next_f64(&mut self) -> f64 { - const MANTISSA_BITS: uint = 53; - const IGNORED_BITS: uint = 11; + const MANTISSA_BITS: usize = 53; + const IGNORED_BITS: usize = 11; const SCALE: f64 = (1u64 << MANTISSA_BITS) as f64; (self.next_u64() >> IGNORED_BITS) as f64 / SCALE @@ -189,7 +188,7 @@ pub trait Rng : Sized { /// use std::rand::{thread_rng, Rng}; /// /// let mut rng = thread_rng(); - /// let x: uint = rng.gen(); + /// let x: usize = rng.gen(); /// println!("{}", x); /// println!("{:?}", rng.gen::<(f64, bool)>()); /// ``` @@ -208,7 +207,7 @@ pub trait Rng : Sized { /// use std::rand::{thread_rng, Rng}; /// /// let mut rng = thread_rng(); - /// let x = rng.gen_iter::().take(10).collect::>(); + /// let x = rng.gen_iter::().take(10).collect::>(); /// println!("{:?}", x); /// println!("{:?}", rng.gen_iter::<(f64, bool)>().take(5) /// .collect::>()); @@ -236,7 +235,7 @@ pub trait Rng : Sized { /// use std::rand::{thread_rng, Rng}; /// /// let mut rng = thread_rng(); - /// let n: uint = rng.gen_range(0, 10); + /// let n: usize = rng.gen_range(0, 10); /// println!("{}", n); /// let m: f64 = rng.gen_range(-40.0f64, 1.3e5f64); /// println!("{}", m); @@ -257,7 +256,7 @@ pub trait Rng : Sized { /// let mut rng = thread_rng(); /// println!("{}", rng.gen_weighted_bool(3)); /// ``` - fn gen_weighted_bool(&mut self, n: uint) -> bool { + fn gen_weighted_bool(&mut self, n: usize) -> bool { n <= 1 || self.gen_range(0, n) == 0 } diff --git a/src/librand/reseeding.rs b/src/librand/reseeding.rs index 95dd986d2e3..ab4939f57d4 100644 --- a/src/librand/reseeding.rs +++ b/src/librand/reseeding.rs @@ -18,14 +18,14 @@ use core::default::Default; /// How many bytes of entropy the underling RNG is allowed to generate /// before it is reseeded. -const DEFAULT_GENERATION_THRESHOLD: uint = 32 * 1024; +const DEFAULT_GENERATION_THRESHOLD: usize = 32 * 1024; /// A wrapper around any RNG which reseeds the underlying RNG after it /// has generated a certain number of random bytes. pub struct ReseedingRng { rng: R, - generation_threshold: uint, - bytes_generated: uint, + generation_threshold: usize, + bytes_generated: usize, /// Controls the behaviour when reseeding the RNG. pub reseeder: Rsdr, } @@ -38,7 +38,7 @@ impl> ReseedingRng { /// * `rng`: the random number generator to use. /// * `generation_threshold`: the number of bytes of entropy at which to reseed the RNG. /// * `reseeder`: the reseeding object to use. - pub fn new(rng: R, generation_threshold: uint, reseeder: Rsdr) -> ReseedingRng { + pub fn new(rng: R, generation_threshold: usize, reseeder: Rsdr) -> ReseedingRng { ReseedingRng { rng: rng, generation_threshold: generation_threshold, @@ -213,7 +213,7 @@ mod test { assert_eq!(string1, string2); } - const FILL_BYTES_V_LEN: uint = 13579; + const FILL_BYTES_V_LEN: usize = 13579; #[test] fn test_rng_fill_bytes() { let mut v = repeat(0).take(FILL_BYTES_V_LEN).collect::>(); diff --git a/src/librbml/lib.rs b/src/librbml/lib.rs index 1ffc6001af5..fd35c9c6be9 100644 --- a/src/librbml/lib.rs +++ b/src/librbml/lib.rs @@ -27,7 +27,7 @@ //! where the tag number is ORed with 0xf000. (E.g. tag 0x123 = `f1 23`) //! //! **Lengths** encode the length of the following data. -//! It is a variable-length unsigned int, and one of the following forms: +//! It is a variable-length unsigned isize, and one of the following forms: //! //! - `80` through `fe` for lengths up to 0x7e; //! - `40 ff` through `7f ff` for lengths up to 0x3fff; @@ -125,7 +125,6 @@ #![feature(io)] #![feature(core)] -#![feature(int_uint)] #![feature(rustc_private)] #![feature(staged_api)] @@ -146,8 +145,8 @@ use std::fmt; #[derive(Clone, Copy)] pub struct Doc<'a> { pub data: &'a [u8], - pub start: uint, - pub end: uint, + pub start: usize, + pub end: usize, } impl<'doc> Doc<'doc> { @@ -155,7 +154,7 @@ impl<'doc> Doc<'doc> { Doc { data: data, start: 0, end: data.len() } } - pub fn get<'a>(&'a self, tag: uint) -> Doc<'a> { + pub fn get<'a>(&'a self, tag: usize) -> Doc<'a> { reader::get_doc(*self, tag) } @@ -173,7 +172,7 @@ impl<'doc> Doc<'doc> { } pub struct TaggedDoc<'a> { - tag: uint, + tag: usize, pub doc: Doc<'a>, } @@ -208,8 +207,8 @@ pub enum EbmlEncoderTag { EsOpaque = 0x17, } -const NUM_TAGS: uint = 0x1000; -const NUM_IMPLICIT_TAGS: uint = 0x0e; +const NUM_TAGS: usize = 0x1000; +const NUM_IMPLICIT_TAGS: usize = 0x0e; static TAG_IMPLICIT_LEN: [i8; NUM_IMPLICIT_TAGS] = [ 1, 2, 4, 8, // EsU* @@ -222,8 +221,8 @@ static TAG_IMPLICIT_LEN: [i8; NUM_IMPLICIT_TAGS] = [ #[derive(Debug)] pub enum Error { - IntTooBig(uint), - InvalidTag(uint), + IntTooBig(usize), + InvalidTag(usize), Expected(String), IoError(std::io::Error), ApplicationError(String) @@ -270,16 +269,16 @@ pub mod reader { #[derive(Copy)] pub struct Res { - pub val: uint, - pub next: uint + pub val: usize, + pub next: usize } - pub fn tag_at(data: &[u8], start: uint) -> DecodeResult { - let v = data[start] as uint; + pub fn tag_at(data: &[u8], start: usize) -> DecodeResult { + let v = data[start] as usize; if v < 0xf0 { Ok(Res { val: v, next: start + 1 }) } else if v > 0xf0 { - Ok(Res { val: ((v & 0xf) << 8) | data[start + 1] as uint, next: start + 2 }) + Ok(Res { val: ((v & 0xf) << 8) | data[start + 1] as usize, next: start + 2 }) } else { // every tag starting with byte 0xf0 is an overlong form, which is prohibited. Err(InvalidTag(v)) @@ -287,33 +286,33 @@ pub mod reader { } #[inline(never)] - fn vuint_at_slow(data: &[u8], start: uint) -> DecodeResult { + fn vuint_at_slow(data: &[u8], start: usize) -> DecodeResult { let a = data[start]; if a & 0x80 != 0 { - return Ok(Res {val: (a & 0x7f) as uint, next: start + 1}); + return Ok(Res {val: (a & 0x7f) as usize, next: start + 1}); } if a & 0x40 != 0 { - return Ok(Res {val: ((a & 0x3f) as uint) << 8 | - (data[start + 1] as uint), + return Ok(Res {val: ((a & 0x3f) as usize) << 8 | + (data[start + 1] as usize), next: start + 2}); } if a & 0x20 != 0 { - return Ok(Res {val: ((a & 0x1f) as uint) << 16 | - (data[start + 1] as uint) << 8 | - (data[start + 2] as uint), + return Ok(Res {val: ((a & 0x1f) as usize) << 16 | + (data[start + 1] as usize) << 8 | + (data[start + 2] as usize), next: start + 3}); } if a & 0x10 != 0 { - return Ok(Res {val: ((a & 0x0f) as uint) << 24 | - (data[start + 1] as uint) << 16 | - (data[start + 2] as uint) << 8 | - (data[start + 3] as uint), + return Ok(Res {val: ((a & 0x0f) as usize) << 24 | + (data[start + 1] as usize) << 16 | + (data[start + 2] as usize) << 8 | + (data[start + 3] as usize), next: start + 4}); } - Err(IntTooBig(a as uint)) + Err(IntTooBig(a as usize)) } - pub fn vuint_at(data: &[u8], start: uint) -> DecodeResult { + pub fn vuint_at(data: &[u8], start: usize) -> DecodeResult { if data.len() - start < 4 { return vuint_at_slow(data, start); } @@ -337,7 +336,7 @@ pub mod reader { // most significant bit is set etc. we can replace up to three // "and+branch" with a single table lookup which gives us a measured // speedup of around 2x on x86_64. - static SHIFT_MASK_TABLE: [(uint, u32); 16] = [ + static SHIFT_MASK_TABLE: [(usize, u32); 16] = [ (0, 0x0), (0, 0x0fffffff), (8, 0x1fffff), (8, 0x1fffff), (16, 0x3fff), (16, 0x3fff), (16, 0x3fff), (16, 0x3fff), @@ -346,10 +345,10 @@ pub mod reader { ]; unsafe { - let ptr = data.as_ptr().offset(start as int) as *const u32; + let ptr = data.as_ptr().offset(start as isize) as *const u32; let val = Int::from_be(*ptr); - let i = (val >> 28) as uint; + let i = (val >> 28) as usize; let (shift, mask) = SHIFT_MASK_TABLE[i]; Ok(Res { val: ((val >> shift) & mask) as usize, @@ -360,13 +359,13 @@ pub mod reader { pub fn tag_len_at(data: &[u8], tag: Res) -> DecodeResult { if tag.val < NUM_IMPLICIT_TAGS && TAG_IMPLICIT_LEN[tag.val] >= 0 { - Ok(Res { val: TAG_IMPLICIT_LEN[tag.val] as uint, next: tag.next }) + Ok(Res { val: TAG_IMPLICIT_LEN[tag.val] as usize, next: tag.next }) } else { vuint_at(data, tag.next) } } - pub fn doc_at<'a>(data: &'a [u8], start: uint) -> DecodeResult> { + pub fn doc_at<'a>(data: &'a [u8], start: usize) -> DecodeResult> { let elt_tag = try!(tag_at(data, start)); let elt_size = try!(tag_len_at(data, elt_tag)); let end = elt_size.next + elt_size.val; @@ -376,7 +375,7 @@ pub mod reader { }) } - pub fn maybe_get_doc<'a>(d: Doc<'a>, tg: uint) -> Option> { + pub fn maybe_get_doc<'a>(d: Doc<'a>, tg: usize) -> Option> { let mut pos = d.start; while pos < d.end { let elt_tag = try_or!(tag_at(d.data, pos), None); @@ -390,7 +389,7 @@ pub mod reader { None } - pub fn get_doc<'a>(d: Doc<'a>, tg: uint) -> Doc<'a> { + pub fn get_doc<'a>(d: Doc<'a>, tg: usize) -> Doc<'a> { match maybe_get_doc(d, tg) { Some(d) => d, None => { @@ -401,7 +400,7 @@ pub mod reader { } pub fn docs(d: Doc, mut it: F) -> bool where - F: FnMut(uint, Doc) -> bool, + F: FnMut(usize, Doc) -> bool, { let mut pos = d.start; while pos < d.end { @@ -416,7 +415,7 @@ pub mod reader { return true; } - pub fn tagged_docs(d: Doc, tg: uint, mut it: F) -> bool where + pub fn tagged_docs(d: Doc, tg: usize, mut it: F) -> bool where F: FnMut(Doc) -> bool, { let mut pos = d.start; @@ -475,7 +474,7 @@ pub mod reader { pub struct Decoder<'a> { parent: Doc<'a>, - pos: uint, + pos: usize, } impl<'doc> Decoder<'doc> { @@ -501,7 +500,7 @@ pub mod reader { r_tag, r_doc.start, r_doc.end); - if r_tag != (exp_tag as uint) { + if r_tag != (exp_tag as usize) { return Err(Expected(format!("expected EBML doc with tag {:?} but \ found tag {:?}", exp_tag, r_tag))); } @@ -528,7 +527,7 @@ pub mod reader { Ok(r) } - fn _next_sub(&mut self) -> DecodeResult { + fn _next_sub(&mut self) -> DecodeResult { // empty vector/map optimization if self.parent.is_empty() { return Ok(0); @@ -536,10 +535,10 @@ pub mod reader { let TaggedDoc { tag: r_tag, doc: r_doc } = try!(doc_at(self.parent.data, self.pos)); - let r = if r_tag == (EsSub8 as uint) { - doc_as_u8(r_doc) as uint - } else if r_tag == (EsSub32 as uint) { - doc_as_u32(r_doc) as uint + let r = if r_tag == (EsSub8 as usize) { + doc_as_u8(r_doc) as usize + } else if r_tag == (EsSub32 as usize) { + doc_as_u32(r_doc) as usize } else { return Err(Expected(format!("expected EBML doc with tag {:?} or {:?} but \ found tag {:?}", EsSub8, EsSub32, r_tag))); @@ -568,8 +567,8 @@ pub mod reader { let TaggedDoc { tag: r_tag, doc: r_doc } = try!(doc_at(self.parent.data, self.pos)); - let r = if first_tag as uint <= r_tag && r_tag <= last_tag as uint { - match r_tag - first_tag as uint { + let r = if first_tag as usize <= r_tag && r_tag <= last_tag as usize { + match r_tag - first_tag as usize { 0 => doc_as_u8(r_doc) as u64, 1 => doc_as_u16(r_doc) as u64, 2 => doc_as_u32(r_doc) as u64, @@ -615,12 +614,12 @@ pub mod reader { fn read_u32(&mut self) -> DecodeResult { Ok(try!(self._next_int(EsU8, EsU32)) as u32) } fn read_u16(&mut self) -> DecodeResult { Ok(try!(self._next_int(EsU8, EsU16)) as u16) } fn read_u8(&mut self) -> DecodeResult { Ok(doc_as_u8(try!(self.next_doc(EsU8)))) } - fn read_uint(&mut self) -> DecodeResult { + fn read_uint(&mut self) -> DecodeResult { let v = try!(self._next_int(EsU8, EsU64)); if v > (::std::usize::MAX as u64) { - Err(IntTooBig(v as uint)) + Err(IntTooBig(v as usize)) } else { - Ok(v as uint) + Ok(v as usize) } } @@ -628,13 +627,13 @@ pub mod reader { fn read_i32(&mut self) -> DecodeResult { Ok(try!(self._next_int(EsI8, EsI32)) as i32) } fn read_i16(&mut self) -> DecodeResult { Ok(try!(self._next_int(EsI8, EsI16)) as i16) } fn read_i8(&mut self) -> DecodeResult { Ok(doc_as_u8(try!(self.next_doc(EsI8))) as i8) } - fn read_int(&mut self) -> DecodeResult { + fn read_int(&mut self) -> DecodeResult { let v = try!(self._next_int(EsI8, EsI64)) as i64; if v > (isize::MAX as i64) || v < (isize::MIN as i64) { debug!("FIXME \\#6122: Removing this makes this function miscompile"); - Err(IntTooBig(v as uint)) + Err(IntTooBig(v as usize)) } else { - Ok(v as int) + Ok(v as isize) } } @@ -678,7 +677,7 @@ pub mod reader { fn read_enum_variant(&mut self, _: &[&str], mut f: F) -> DecodeResult - where F: FnMut(&mut Decoder<'doc>, uint) -> DecodeResult, + where F: FnMut(&mut Decoder<'doc>, usize) -> DecodeResult, { debug!("read_enum_variant()"); let idx = try!(self._next_sub()); @@ -687,7 +686,7 @@ pub mod reader { f(self, idx) } - fn read_enum_variant_arg(&mut self, idx: uint, f: F) -> DecodeResult where + fn read_enum_variant_arg(&mut self, idx: usize, f: F) -> DecodeResult where F: FnOnce(&mut Decoder<'doc>) -> DecodeResult, { debug!("read_enum_variant_arg(idx={})", idx); @@ -696,7 +695,7 @@ pub mod reader { fn read_enum_struct_variant(&mut self, _: &[&str], mut f: F) -> DecodeResult - where F: FnMut(&mut Decoder<'doc>, uint) -> DecodeResult, + where F: FnMut(&mut Decoder<'doc>, usize) -> DecodeResult, { debug!("read_enum_struct_variant()"); let idx = try!(self._next_sub()); @@ -707,7 +706,7 @@ pub mod reader { fn read_enum_struct_variant_field(&mut self, name: &str, - idx: uint, + idx: usize, f: F) -> DecodeResult where F: FnOnce(&mut Decoder<'doc>) -> DecodeResult, @@ -716,21 +715,21 @@ pub mod reader { f(self) } - fn read_struct(&mut self, name: &str, _: uint, f: F) -> DecodeResult where + fn read_struct(&mut self, name: &str, _: usize, f: F) -> DecodeResult where F: FnOnce(&mut Decoder<'doc>) -> DecodeResult, { debug!("read_struct(name={})", name); f(self) } - fn read_struct_field(&mut self, name: &str, idx: uint, f: F) -> DecodeResult where + fn read_struct_field(&mut self, name: &str, idx: usize, f: F) -> DecodeResult where F: FnOnce(&mut Decoder<'doc>) -> DecodeResult, { debug!("read_struct_field(name={}, idx={})", name, idx); f(self) } - fn read_tuple(&mut self, tuple_len: uint, f: F) -> DecodeResult where + fn read_tuple(&mut self, tuple_len: usize, f: F) -> DecodeResult where F: FnOnce(&mut Decoder<'doc>) -> DecodeResult, { debug!("read_tuple()"); @@ -744,14 +743,14 @@ pub mod reader { }) } - fn read_tuple_arg(&mut self, idx: uint, f: F) -> DecodeResult where + fn read_tuple_arg(&mut self, idx: usize, f: F) -> DecodeResult where F: FnOnce(&mut Decoder<'doc>) -> DecodeResult, { debug!("read_tuple_arg(idx={})", idx); self.read_seq_elt(idx, f) } - fn read_tuple_struct(&mut self, name: &str, len: uint, f: F) -> DecodeResult where + fn read_tuple_struct(&mut self, name: &str, len: usize, f: F) -> DecodeResult where F: FnOnce(&mut Decoder<'doc>) -> DecodeResult, { debug!("read_tuple_struct(name={})", name); @@ -759,7 +758,7 @@ pub mod reader { } fn read_tuple_struct_arg(&mut self, - idx: uint, + idx: usize, f: F) -> DecodeResult where F: FnOnce(&mut Decoder<'doc>) -> DecodeResult, @@ -786,7 +785,7 @@ pub mod reader { } fn read_seq(&mut self, f: F) -> DecodeResult where - F: FnOnce(&mut Decoder<'doc>, uint) -> DecodeResult, + F: FnOnce(&mut Decoder<'doc>, usize) -> DecodeResult, { debug!("read_seq()"); self.push_doc(EsVec, move |d| { @@ -796,7 +795,7 @@ pub mod reader { }) } - fn read_seq_elt(&mut self, idx: uint, f: F) -> DecodeResult where + fn read_seq_elt(&mut self, idx: usize, f: F) -> DecodeResult where F: FnOnce(&mut Decoder<'doc>) -> DecodeResult, { debug!("read_seq_elt(idx={})", idx); @@ -804,7 +803,7 @@ pub mod reader { } fn read_map(&mut self, f: F) -> DecodeResult where - F: FnOnce(&mut Decoder<'doc>, uint) -> DecodeResult, + F: FnOnce(&mut Decoder<'doc>, usize) -> DecodeResult, { debug!("read_map()"); self.push_doc(EsMap, move |d| { @@ -814,14 +813,14 @@ pub mod reader { }) } - fn read_map_elt_key(&mut self, idx: uint, f: F) -> DecodeResult where + fn read_map_elt_key(&mut self, idx: usize, f: F) -> DecodeResult where F: FnOnce(&mut Decoder<'doc>) -> DecodeResult, { debug!("read_map_elt_key(idx={})", idx); self.push_doc(EsMapKey, f) } - fn read_map_elt_val(&mut self, idx: uint, f: F) -> DecodeResult where + fn read_map_elt_val(&mut self, idx: usize, f: F) -> DecodeResult where F: FnOnce(&mut Decoder<'doc>) -> DecodeResult, { debug!("read_map_elt_val(idx={})", idx); @@ -859,7 +858,7 @@ pub mod writer { relax_limit: u64, // do not move encoded bytes before this position } - fn write_tag(w: &mut W, n: uint) -> EncodeResult { + fn write_tag(w: &mut W, n: usize) -> EncodeResult { if n < 0xf0 { w.write_all(&[n as u8]) } else if 0x100 <= n && n < NUM_TAGS { @@ -870,7 +869,7 @@ pub mod writer { } } - fn write_sized_vuint(w: &mut W, n: uint, size: uint) -> EncodeResult { + fn write_sized_vuint(w: &mut W, n: usize, size: usize) -> EncodeResult { match size { 1 => w.write_all(&[0x80 | (n as u8)]), 2 => w.write_all(&[0x40 | ((n >> 8) as u8), n as u8]), @@ -879,16 +878,16 @@ pub mod writer { 4 => w.write_all(&[0x10 | ((n >> 24) as u8), (n >> 16) as u8, (n >> 8) as u8, n as u8]), _ => Err(io::Error::new(io::ErrorKind::Other, - "int too big", Some(n.to_string()))) + "isize too big", Some(n.to_string()))) } } - fn write_vuint(w: &mut W, n: uint) -> EncodeResult { + fn write_vuint(w: &mut W, n: usize) -> EncodeResult { if n < 0x7f { return write_sized_vuint(w, n, 1); } if n < 0x4000 { return write_sized_vuint(w, n, 2); } if n < 0x200000 { return write_sized_vuint(w, n, 3); } if n < 0x10000000 { return write_sized_vuint(w, n, 4); } - Err(io::Error::new(io::ErrorKind::Other, "int too big", + Err(io::Error::new(io::ErrorKind::Other, "isize too big", Some(n.to_string()))) } @@ -910,7 +909,7 @@ pub mod writer { } } - pub fn start_tag(&mut self, tag_id: uint) -> EncodeResult { + pub fn start_tag(&mut self, tag_id: usize) -> EncodeResult { debug!("Start tag {:?}", tag_id); assert!(tag_id >= NUM_IMPLICIT_TAGS); @@ -932,13 +931,13 @@ pub mod writer { // relax the size encoding for small tags (bigger tags are costly to move). // we should never try to move the stable positions, however. - const RELAX_MAX_SIZE: uint = 0x100; + const RELAX_MAX_SIZE: usize = 0x100; if size <= RELAX_MAX_SIZE && last_size_pos >= self.relax_limit { // we can't alter the buffer in place, so have a temporary buffer let mut buf = [0u8; RELAX_MAX_SIZE]; { let last_size_pos = last_size_pos as usize; - let data = &self.writer.get_ref()[last_size_pos+4..cur_pos as uint]; + let data = &self.writer.get_ref()[last_size_pos+4..cur_pos as usize]; bytes::copy_memory(&mut buf, data); } @@ -955,7 +954,7 @@ pub mod writer { Ok(()) } - pub fn wr_tag(&mut self, tag_id: uint, blk: F) -> EncodeResult where + pub fn wr_tag(&mut self, tag_id: usize, blk: F) -> EncodeResult where F: FnOnce() -> EncodeResult, { try!(self.start_tag(tag_id)); @@ -963,90 +962,90 @@ pub mod writer { self.end_tag() } - pub fn wr_tagged_bytes(&mut self, tag_id: uint, b: &[u8]) -> EncodeResult { + pub fn wr_tagged_bytes(&mut self, tag_id: usize, b: &[u8]) -> EncodeResult { assert!(tag_id >= NUM_IMPLICIT_TAGS); try!(write_tag(self.writer, tag_id)); try!(write_vuint(self.writer, b.len())); self.writer.write_all(b) } - pub fn wr_tagged_u64(&mut self, tag_id: uint, v: u64) -> EncodeResult { + pub fn wr_tagged_u64(&mut self, tag_id: usize, v: u64) -> EncodeResult { let bytes: [u8; 8] = unsafe { mem::transmute(v.to_be()) }; self.wr_tagged_bytes(tag_id, &bytes) } - pub fn wr_tagged_u32(&mut self, tag_id: uint, v: u32) -> EncodeResult{ + pub fn wr_tagged_u32(&mut self, tag_id: usize, v: u32) -> EncodeResult{ let bytes: [u8; 4] = unsafe { mem::transmute(v.to_be()) }; self.wr_tagged_bytes(tag_id, &bytes) } - pub fn wr_tagged_u16(&mut self, tag_id: uint, v: u16) -> EncodeResult { + pub fn wr_tagged_u16(&mut self, tag_id: usize, v: u16) -> EncodeResult { let bytes: [u8; 2] = unsafe { mem::transmute(v.to_be()) }; self.wr_tagged_bytes(tag_id, &bytes) } - pub fn wr_tagged_u8(&mut self, tag_id: uint, v: u8) -> EncodeResult { + pub fn wr_tagged_u8(&mut self, tag_id: usize, v: u8) -> EncodeResult { self.wr_tagged_bytes(tag_id, &[v]) } - pub fn wr_tagged_i64(&mut self, tag_id: uint, v: i64) -> EncodeResult { + pub fn wr_tagged_i64(&mut self, tag_id: usize, v: i64) -> EncodeResult { self.wr_tagged_u64(tag_id, v as u64) } - pub fn wr_tagged_i32(&mut self, tag_id: uint, v: i32) -> EncodeResult { + pub fn wr_tagged_i32(&mut self, tag_id: usize, v: i32) -> EncodeResult { self.wr_tagged_u32(tag_id, v as u32) } - pub fn wr_tagged_i16(&mut self, tag_id: uint, v: i16) -> EncodeResult { + pub fn wr_tagged_i16(&mut self, tag_id: usize, v: i16) -> EncodeResult { self.wr_tagged_u16(tag_id, v as u16) } - pub fn wr_tagged_i8(&mut self, tag_id: uint, v: i8) -> EncodeResult { + pub fn wr_tagged_i8(&mut self, tag_id: usize, v: i8) -> EncodeResult { self.wr_tagged_bytes(tag_id, &[v as u8]) } - pub fn wr_tagged_str(&mut self, tag_id: uint, v: &str) -> EncodeResult { + pub fn wr_tagged_str(&mut self, tag_id: usize, v: &str) -> EncodeResult { self.wr_tagged_bytes(tag_id, v.as_bytes()) } // for auto-serialization - fn wr_tagged_raw_bytes(&mut self, tag_id: uint, b: &[u8]) -> EncodeResult { + fn wr_tagged_raw_bytes(&mut self, tag_id: usize, b: &[u8]) -> EncodeResult { try!(write_tag(self.writer, tag_id)); self.writer.write_all(b) } - fn wr_tagged_raw_u64(&mut self, tag_id: uint, v: u64) -> EncodeResult { + fn wr_tagged_raw_u64(&mut self, tag_id: usize, v: u64) -> EncodeResult { let bytes: [u8; 8] = unsafe { mem::transmute(v.to_be()) }; self.wr_tagged_raw_bytes(tag_id, &bytes) } - fn wr_tagged_raw_u32(&mut self, tag_id: uint, v: u32) -> EncodeResult{ + fn wr_tagged_raw_u32(&mut self, tag_id: usize, v: u32) -> EncodeResult{ let bytes: [u8; 4] = unsafe { mem::transmute(v.to_be()) }; self.wr_tagged_raw_bytes(tag_id, &bytes) } - fn wr_tagged_raw_u16(&mut self, tag_id: uint, v: u16) -> EncodeResult { + fn wr_tagged_raw_u16(&mut self, tag_id: usize, v: u16) -> EncodeResult { let bytes: [u8; 2] = unsafe { mem::transmute(v.to_be()) }; self.wr_tagged_raw_bytes(tag_id, &bytes) } - fn wr_tagged_raw_u8(&mut self, tag_id: uint, v: u8) -> EncodeResult { + fn wr_tagged_raw_u8(&mut self, tag_id: usize, v: u8) -> EncodeResult { self.wr_tagged_raw_bytes(tag_id, &[v]) } - fn wr_tagged_raw_i64(&mut self, tag_id: uint, v: i64) -> EncodeResult { + fn wr_tagged_raw_i64(&mut self, tag_id: usize, v: i64) -> EncodeResult { self.wr_tagged_raw_u64(tag_id, v as u64) } - fn wr_tagged_raw_i32(&mut self, tag_id: uint, v: i32) -> EncodeResult { + fn wr_tagged_raw_i32(&mut self, tag_id: usize, v: i32) -> EncodeResult { self.wr_tagged_raw_u32(tag_id, v as u32) } - fn wr_tagged_raw_i16(&mut self, tag_id: uint, v: i16) -> EncodeResult { + fn wr_tagged_raw_i16(&mut self, tag_id: usize, v: i16) -> EncodeResult { self.wr_tagged_raw_u16(tag_id, v as u16) } - fn wr_tagged_raw_i8(&mut self, tag_id: uint, v: i8) -> EncodeResult { + fn wr_tagged_raw_i8(&mut self, tag_id: usize, v: i8) -> EncodeResult { self.wr_tagged_raw_bytes(tag_id, &[v as u8]) } @@ -1073,11 +1072,11 @@ pub mod writer { impl<'a> Encoder<'a> { // used internally to emit things like the vector length and so on - fn _emit_tagged_sub(&mut self, v: uint) -> EncodeResult { + fn _emit_tagged_sub(&mut self, v: usize) -> EncodeResult { if let Some(v) = v.to_u8() { - self.wr_tagged_raw_u8(EsSub8 as uint, v) + self.wr_tagged_raw_u8(EsSub8 as usize, v) } else if let Some(v) = v.to_u32() { - self.wr_tagged_raw_u32(EsSub32 as uint, v) + self.wr_tagged_raw_u32(EsSub32 as usize, v) } else { Err(io::Error::new(io::ErrorKind::Other, "length or variant id too big", @@ -1088,7 +1087,7 @@ pub mod writer { pub fn emit_opaque(&mut self, f: F) -> EncodeResult where F: FnOnce(&mut Encoder) -> EncodeResult, { - try!(self.start_tag(EsOpaque as uint)); + try!(self.start_tag(EsOpaque as usize)); try!(f(self)); self.end_tag() } @@ -1101,88 +1100,88 @@ pub mod writer { Ok(()) } - fn emit_uint(&mut self, v: uint) -> EncodeResult { + fn emit_uint(&mut self, v: usize) -> EncodeResult { self.emit_u64(v as u64) } fn emit_u64(&mut self, v: u64) -> EncodeResult { match v.to_u32() { Some(v) => self.emit_u32(v), - None => self.wr_tagged_raw_u64(EsU64 as uint, v) + None => self.wr_tagged_raw_u64(EsU64 as usize, v) } } fn emit_u32(&mut self, v: u32) -> EncodeResult { match v.to_u16() { Some(v) => self.emit_u16(v), - None => self.wr_tagged_raw_u32(EsU32 as uint, v) + None => self.wr_tagged_raw_u32(EsU32 as usize, v) } } fn emit_u16(&mut self, v: u16) -> EncodeResult { match v.to_u8() { Some(v) => self.emit_u8(v), - None => self.wr_tagged_raw_u16(EsU16 as uint, v) + None => self.wr_tagged_raw_u16(EsU16 as usize, v) } } fn emit_u8(&mut self, v: u8) -> EncodeResult { - self.wr_tagged_raw_u8(EsU8 as uint, v) + self.wr_tagged_raw_u8(EsU8 as usize, v) } - fn emit_int(&mut self, v: int) -> EncodeResult { + fn emit_int(&mut self, v: isize) -> EncodeResult { self.emit_i64(v as i64) } fn emit_i64(&mut self, v: i64) -> EncodeResult { match v.to_i32() { Some(v) => self.emit_i32(v), - None => self.wr_tagged_raw_i64(EsI64 as uint, v) + None => self.wr_tagged_raw_i64(EsI64 as usize, v) } } fn emit_i32(&mut self, v: i32) -> EncodeResult { match v.to_i16() { Some(v) => self.emit_i16(v), - None => self.wr_tagged_raw_i32(EsI32 as uint, v) + None => self.wr_tagged_raw_i32(EsI32 as usize, v) } } fn emit_i16(&mut self, v: i16) -> EncodeResult { match v.to_i8() { Some(v) => self.emit_i8(v), - None => self.wr_tagged_raw_i16(EsI16 as uint, v) + None => self.wr_tagged_raw_i16(EsI16 as usize, v) } } fn emit_i8(&mut self, v: i8) -> EncodeResult { - self.wr_tagged_raw_i8(EsI8 as uint, v) + self.wr_tagged_raw_i8(EsI8 as usize, v) } fn emit_bool(&mut self, v: bool) -> EncodeResult { - self.wr_tagged_raw_u8(EsBool as uint, v as u8) + self.wr_tagged_raw_u8(EsBool as usize, v as u8) } fn emit_f64(&mut self, v: f64) -> EncodeResult { let bits = unsafe { mem::transmute(v) }; - self.wr_tagged_raw_u64(EsF64 as uint, bits) + self.wr_tagged_raw_u64(EsF64 as usize, bits) } fn emit_f32(&mut self, v: f32) -> EncodeResult { let bits = unsafe { mem::transmute(v) }; - self.wr_tagged_raw_u32(EsF32 as uint, bits) + self.wr_tagged_raw_u32(EsF32 as usize, bits) } fn emit_char(&mut self, v: char) -> EncodeResult { - self.wr_tagged_raw_u32(EsChar as uint, v as u32) + self.wr_tagged_raw_u32(EsChar as usize, v as u32) } fn emit_str(&mut self, v: &str) -> EncodeResult { - self.wr_tagged_str(EsStr as uint, v) + self.wr_tagged_str(EsStr as usize, v) } fn emit_enum(&mut self, _name: &str, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { - try!(self.start_tag(EsEnum as uint)); + try!(self.start_tag(EsEnum as usize)); try!(f(self)); self.end_tag() } fn emit_enum_variant(&mut self, _: &str, - v_id: uint, - _: uint, + v_id: usize, + _: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { @@ -1190,7 +1189,7 @@ pub mod writer { f(self) } - fn emit_enum_variant_arg(&mut self, _: uint, f: F) -> EncodeResult where + fn emit_enum_variant_arg(&mut self, _: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { f(self) @@ -1198,8 +1197,8 @@ pub mod writer { fn emit_enum_struct_variant(&mut self, v_name: &str, - v_id: uint, - cnt: uint, + v_id: usize, + cnt: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { @@ -1208,42 +1207,42 @@ pub mod writer { fn emit_enum_struct_variant_field(&mut self, _: &str, - idx: uint, + idx: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { self.emit_enum_variant_arg(idx, f) } - fn emit_struct(&mut self, _: &str, _len: uint, f: F) -> EncodeResult where + fn emit_struct(&mut self, _: &str, _len: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { f(self) } - fn emit_struct_field(&mut self, _name: &str, _: uint, f: F) -> EncodeResult where + fn emit_struct_field(&mut self, _name: &str, _: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { f(self) } - fn emit_tuple(&mut self, len: uint, f: F) -> EncodeResult where + fn emit_tuple(&mut self, len: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { self.emit_seq(len, f) } - fn emit_tuple_arg(&mut self, idx: uint, f: F) -> EncodeResult where + fn emit_tuple_arg(&mut self, idx: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { self.emit_seq_elt(idx, f) } - fn emit_tuple_struct(&mut self, _: &str, len: uint, f: F) -> EncodeResult where + fn emit_tuple_struct(&mut self, _: &str, len: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { self.emit_seq(len, f) } - fn emit_tuple_struct_arg(&mut self, idx: uint, f: F) -> EncodeResult where + fn emit_tuple_struct_arg(&mut self, idx: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { self.emit_seq_elt(idx, f) @@ -1264,56 +1263,56 @@ pub mod writer { self.emit_enum_variant("Some", 1, 1, f) } - fn emit_seq(&mut self, len: uint, f: F) -> EncodeResult where + fn emit_seq(&mut self, len: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { if len == 0 { // empty vector optimization - return self.wr_tagged_bytes(EsVec as uint, &[]); + return self.wr_tagged_bytes(EsVec as usize, &[]); } - try!(self.start_tag(EsVec as uint)); + try!(self.start_tag(EsVec as usize)); try!(self._emit_tagged_sub(len)); try!(f(self)); self.end_tag() } - fn emit_seq_elt(&mut self, _idx: uint, f: F) -> EncodeResult where + fn emit_seq_elt(&mut self, _idx: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { - try!(self.start_tag(EsVecElt as uint)); + try!(self.start_tag(EsVecElt as usize)); try!(f(self)); self.end_tag() } - fn emit_map(&mut self, len: uint, f: F) -> EncodeResult where + fn emit_map(&mut self, len: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { if len == 0 { // empty map optimization - return self.wr_tagged_bytes(EsMap as uint, &[]); + return self.wr_tagged_bytes(EsMap as usize, &[]); } - try!(self.start_tag(EsMap as uint)); + try!(self.start_tag(EsMap as usize)); try!(self._emit_tagged_sub(len)); try!(f(self)); self.end_tag() } - fn emit_map_elt_key(&mut self, _idx: uint, f: F) -> EncodeResult where + fn emit_map_elt_key(&mut self, _idx: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { - try!(self.start_tag(EsMapKey as uint)); + try!(self.start_tag(EsMapKey as usize)); try!(f(self)); self.end_tag() } - fn emit_map_elt_val(&mut self, _idx: uint, f: F) -> EncodeResult where + fn emit_map_elt_val(&mut self, _idx: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { - try!(self.start_tag(EsMapVal as uint)); + try!(self.start_tag(EsMapVal as usize)); try!(f(self)); self.end_tag() } @@ -1381,7 +1380,7 @@ mod tests { #[test] fn test_option_int() { - fn test_v(v: Option) { + fn test_v(v: Option) { debug!("v == {:?}", v); let mut wr = Cursor::new(Vec::new()); { diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index e8af07e4381..4a7399ec8e4 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -30,7 +30,6 @@ #![feature(collections)] #![feature(core)] #![feature(hash)] -#![feature(int_uint)] #![feature(libc)] #![feature(old_path)] #![feature(quote)] diff --git a/src/librustc/metadata/common.rs b/src/librustc/metadata/common.rs index 081c64ecae8..e4c0eda0448 100644 --- a/src/librustc/metadata/common.rs +++ b/src/librustc/metadata/common.rs @@ -21,82 +21,82 @@ use back::svh::Svh; // 0xf0..0xff: internally used by RBML to encode 0x100..0xfff in two bytes // 0x100..0xfff: free for use, preferred for infrequent tags -pub const tag_items: uint = 0x100; // top-level only +pub const tag_items: usize = 0x100; // top-level only -pub const tag_paths_data_name: uint = 0x20; +pub const tag_paths_data_name: usize = 0x20; -pub const tag_def_id: uint = 0x21; +pub const tag_def_id: usize = 0x21; -pub const tag_items_data: uint = 0x22; +pub const tag_items_data: usize = 0x22; -pub const tag_items_data_item: uint = 0x23; +pub const tag_items_data_item: usize = 0x23; -pub const tag_items_data_item_family: uint = 0x24; +pub const tag_items_data_item_family: usize = 0x24; -pub const tag_items_data_item_type: uint = 0x25; +pub const tag_items_data_item_type: usize = 0x25; -pub const tag_items_data_item_symbol: uint = 0x26; +pub const tag_items_data_item_symbol: usize = 0x26; -pub const tag_items_data_item_variant: uint = 0x27; +pub const tag_items_data_item_variant: usize = 0x27; -pub const tag_items_data_parent_item: uint = 0x28; +pub const tag_items_data_parent_item: usize = 0x28; -pub const tag_items_data_item_is_tuple_struct_ctor: uint = 0x29; +pub const tag_items_data_item_is_tuple_struct_ctor: usize = 0x29; -pub const tag_index: uint = 0x2a; +pub const tag_index: usize = 0x2a; -pub const tag_index_buckets: uint = 0x2b; +pub const tag_index_buckets: usize = 0x2b; -pub const tag_index_buckets_bucket: uint = 0x2c; +pub const tag_index_buckets_bucket: usize = 0x2c; -pub const tag_index_buckets_bucket_elt: uint = 0x2d; +pub const tag_index_buckets_bucket_elt: usize = 0x2d; -pub const tag_index_table: uint = 0x2e; +pub const tag_index_table: usize = 0x2e; -pub const tag_meta_item_name_value: uint = 0x2f; +pub const tag_meta_item_name_value: usize = 0x2f; -pub const tag_meta_item_name: uint = 0x30; +pub const tag_meta_item_name: usize = 0x30; -pub const tag_meta_item_value: uint = 0x31; +pub const tag_meta_item_value: usize = 0x31; -pub const tag_attributes: uint = 0x101; // top-level only +pub const tag_attributes: usize = 0x101; // top-level only -pub const tag_attribute: uint = 0x32; +pub const tag_attribute: usize = 0x32; -pub const tag_meta_item_word: uint = 0x33; +pub const tag_meta_item_word: usize = 0x33; -pub const tag_meta_item_list: uint = 0x34; +pub const tag_meta_item_list: usize = 0x34; // The list of crates that this crate depends on -pub const tag_crate_deps: uint = 0x102; // top-level only +pub const tag_crate_deps: usize = 0x102; // top-level only // A single crate dependency -pub const tag_crate_dep: uint = 0x35; +pub const tag_crate_dep: usize = 0x35; -pub const tag_crate_hash: uint = 0x103; // top-level only -pub const tag_crate_crate_name: uint = 0x104; // top-level only +pub const tag_crate_hash: usize = 0x103; // top-level only +pub const tag_crate_crate_name: usize = 0x104; // top-level only -pub const tag_crate_dep_crate_name: uint = 0x36; -pub const tag_crate_dep_hash: uint = 0x37; +pub const tag_crate_dep_crate_name: usize = 0x36; +pub const tag_crate_dep_hash: usize = 0x37; -pub const tag_mod_impl: uint = 0x38; +pub const tag_mod_impl: usize = 0x38; -pub const tag_item_trait_item: uint = 0x39; +pub const tag_item_trait_item: usize = 0x39; -pub const tag_item_trait_ref: uint = 0x3a; +pub const tag_item_trait_ref: usize = 0x3a; // discriminator value for variants -pub const tag_disr_val: uint = 0x3c; +pub const tag_disr_val: usize = 0x3c; // used to encode ast_map::PathElem -pub const tag_path: uint = 0x3d; -pub const tag_path_len: uint = 0x3e; -pub const tag_path_elem_mod: uint = 0x3f; -pub const tag_path_elem_name: uint = 0x40; -pub const tag_item_field: uint = 0x41; -pub const tag_item_field_origin: uint = 0x42; - -pub const tag_item_variances: uint = 0x43; +pub const tag_path: usize = 0x3d; +pub const tag_path_len: usize = 0x3e; +pub const tag_path_elem_mod: usize = 0x3f; +pub const tag_path_elem_name: usize = 0x40; +pub const tag_item_field: usize = 0x41; +pub const tag_item_field_origin: usize = 0x42; + +pub const tag_item_variances: usize = 0x43; /* trait items contain tag_item_trait_item elements, impl items contain tag_item_impl_item elements, and classes @@ -105,19 +105,19 @@ pub const tag_item_variances: uint = 0x43; both, tag_item_trait_item and tag_item_impl_item have to be two different tags. */ -pub const tag_item_impl_item: uint = 0x44; -pub const tag_item_trait_method_explicit_self: uint = 0x45; +pub const tag_item_impl_item: usize = 0x44; +pub const tag_item_trait_method_explicit_self: usize = 0x45; // Reexports are found within module tags. Each reexport contains def_ids // and names. -pub const tag_items_data_item_reexport: uint = 0x46; -pub const tag_items_data_item_reexport_def_id: uint = 0x47; -pub const tag_items_data_item_reexport_name: uint = 0x48; +pub const tag_items_data_item_reexport: usize = 0x46; +pub const tag_items_data_item_reexport_def_id: usize = 0x47; +pub const tag_items_data_item_reexport_name: usize = 0x48; // used to encode crate_ctxt side tables #[derive(Copy, PartialEq, FromPrimitive)] -#[repr(uint)] +#[repr(usize)] pub enum astencode_tag { // Reserves 0x50 -- 0x6f tag_ast = 0x50, @@ -149,15 +149,15 @@ pub enum astencode_tag { // Reserves 0x50 -- 0x6f tag_table_const_qualif = 0x69, } -pub const tag_item_trait_item_sort: uint = 0x70; +pub const tag_item_trait_item_sort: usize = 0x70; -pub const tag_item_trait_parent_sort: uint = 0x71; +pub const tag_item_trait_parent_sort: usize = 0x71; -pub const tag_item_impl_type_basename: uint = 0x72; +pub const tag_item_impl_type_basename: usize = 0x72; -pub const tag_crate_triple: uint = 0x105; // top-level only +pub const tag_crate_triple: usize = 0x105; // top-level only -pub const tag_dylib_dependency_formats: uint = 0x106; // top-level only +pub const tag_dylib_dependency_formats: usize = 0x106; // top-level only // Language items are a top-level directory (for speed). Hierarchy: // @@ -166,47 +166,47 @@ pub const tag_dylib_dependency_formats: uint = 0x106; // top-level only // - tag_lang_items_item_id: u32 // - tag_lang_items_item_node_id: u32 -pub const tag_lang_items: uint = 0x107; // top-level only -pub const tag_lang_items_item: uint = 0x73; -pub const tag_lang_items_item_id: uint = 0x74; -pub const tag_lang_items_item_node_id: uint = 0x75; -pub const tag_lang_items_missing: uint = 0x76; +pub const tag_lang_items: usize = 0x107; // top-level only +pub const tag_lang_items_item: usize = 0x73; +pub const tag_lang_items_item_id: usize = 0x74; +pub const tag_lang_items_item_node_id: usize = 0x75; +pub const tag_lang_items_missing: usize = 0x76; -pub const tag_item_unnamed_field: uint = 0x77; -pub const tag_items_data_item_visibility: uint = 0x78; +pub const tag_item_unnamed_field: usize = 0x77; +pub const tag_items_data_item_visibility: usize = 0x78; -pub const tag_item_method_tps: uint = 0x79; -pub const tag_item_method_fty: uint = 0x7a; +pub const tag_item_method_tps: usize = 0x79; +pub const tag_item_method_fty: usize = 0x7a; -pub const tag_mod_child: uint = 0x7b; -pub const tag_misc_info: uint = 0x108; // top-level only -pub const tag_misc_info_crate_items: uint = 0x7c; +pub const tag_mod_child: usize = 0x7b; +pub const tag_misc_info: usize = 0x108; // top-level only +pub const tag_misc_info_crate_items: usize = 0x7c; -pub const tag_item_method_provided_source: uint = 0x7d; -pub const tag_item_impl_vtables: uint = 0x7e; +pub const tag_item_method_provided_source: usize = 0x7d; +pub const tag_item_impl_vtables: usize = 0x7e; -pub const tag_impls: uint = 0x109; // top-level only -pub const tag_impls_impl: uint = 0x7f; +pub const tag_impls: usize = 0x109; // top-level only +pub const tag_impls_impl: usize = 0x7f; -pub const tag_items_data_item_inherent_impl: uint = 0x80; -pub const tag_items_data_item_extension_impl: uint = 0x81; +pub const tag_items_data_item_inherent_impl: usize = 0x80; +pub const tag_items_data_item_extension_impl: usize = 0x81; -pub const tag_native_libraries: uint = 0x10a; // top-level only -pub const tag_native_libraries_lib: uint = 0x82; -pub const tag_native_libraries_name: uint = 0x83; -pub const tag_native_libraries_kind: uint = 0x84; +pub const tag_native_libraries: usize = 0x10a; // top-level only +pub const tag_native_libraries_lib: usize = 0x82; +pub const tag_native_libraries_name: usize = 0x83; +pub const tag_native_libraries_kind: usize = 0x84; -pub const tag_plugin_registrar_fn: uint = 0x10b; // top-level only +pub const tag_plugin_registrar_fn: usize = 0x10b; // top-level only -pub const tag_method_argument_names: uint = 0x85; -pub const tag_method_argument_name: uint = 0x86; +pub const tag_method_argument_names: usize = 0x85; +pub const tag_method_argument_name: usize = 0x86; -pub const tag_reachable_extern_fns: uint = 0x10c; // top-level only -pub const tag_reachable_extern_fn_id: uint = 0x87; +pub const tag_reachable_extern_fns: usize = 0x10c; // top-level only +pub const tag_reachable_extern_fn_id: usize = 0x87; -pub const tag_items_data_item_stability: uint = 0x88; +pub const tag_items_data_item_stability: usize = 0x88; -pub const tag_items_data_item_repr: uint = 0x89; +pub const tag_items_data_item_repr: usize = 0x89; #[derive(Clone, Debug)] pub struct LinkMeta { @@ -214,45 +214,45 @@ pub struct LinkMeta { pub crate_hash: Svh, } -pub const tag_struct_fields: uint = 0x10d; // top-level only -pub const tag_struct_field: uint = 0x8a; -pub const tag_struct_field_id: uint = 0x8b; +pub const tag_struct_fields: usize = 0x10d; // top-level only +pub const tag_struct_field: usize = 0x8a; +pub const tag_struct_field_id: usize = 0x8b; -pub const tag_attribute_is_sugared_doc: uint = 0x8c; +pub const tag_attribute_is_sugared_doc: usize = 0x8c; -pub const tag_items_data_region: uint = 0x8e; +pub const tag_items_data_region: usize = 0x8e; -pub const tag_region_param_def: uint = 0x8f; -pub const tag_region_param_def_ident: uint = 0x90; -pub const tag_region_param_def_def_id: uint = 0x91; -pub const tag_region_param_def_space: uint = 0x92; -pub const tag_region_param_def_index: uint = 0x93; +pub const tag_region_param_def: usize = 0x8f; +pub const tag_region_param_def_ident: usize = 0x90; +pub const tag_region_param_def_def_id: usize = 0x91; +pub const tag_region_param_def_space: usize = 0x92; +pub const tag_region_param_def_index: usize = 0x93; -pub const tag_type_param_def: uint = 0x94; +pub const tag_type_param_def: usize = 0x94; -pub const tag_item_generics: uint = 0x95; -pub const tag_method_ty_generics: uint = 0x96; +pub const tag_item_generics: usize = 0x95; +pub const tag_method_ty_generics: usize = 0x96; -pub const tag_predicate: uint = 0x97; -pub const tag_predicate_space: uint = 0x98; -pub const tag_predicate_data: uint = 0x99; +pub const tag_predicate: usize = 0x97; +pub const tag_predicate_space: usize = 0x98; +pub const tag_predicate_data: usize = 0x99; -pub const tag_unsafety: uint = 0x9a; +pub const tag_unsafety: usize = 0x9a; -pub const tag_associated_type_names: uint = 0x9b; -pub const tag_associated_type_name: uint = 0x9c; +pub const tag_associated_type_names: usize = 0x9b; +pub const tag_associated_type_name: usize = 0x9c; -pub const tag_polarity: uint = 0x9d; +pub const tag_polarity: usize = 0x9d; -pub const tag_macro_defs: uint = 0x10e; // top-level only -pub const tag_macro_def: uint = 0x9e; -pub const tag_macro_def_body: uint = 0x9f; +pub const tag_macro_defs: usize = 0x10e; // top-level only +pub const tag_macro_def: usize = 0x9e; +pub const tag_macro_def_body: usize = 0x9f; -pub const tag_paren_sugar: uint = 0xa0; +pub const tag_paren_sugar: usize = 0xa0; -pub const tag_codemap: uint = 0xa1; -pub const tag_codemap_filemap: uint = 0xa2; +pub const tag_codemap: usize = 0xa1; +pub const tag_codemap_filemap: usize = 0xa2; -pub const tag_item_super_predicates: uint = 0xa3; +pub const tag_item_super_predicates: usize = 0xa3; -pub const tag_defaulted_trait: uint = 0xa4; +pub const tag_defaulted_trait: usize = 0xa4; diff --git a/src/librustc/metadata/csearch.rs b/src/librustc/metadata/csearch.rs index ca8ae83ab80..ebc3a6fd52c 100644 --- a/src/librustc/metadata/csearch.rs +++ b/src/librustc/metadata/csearch.rs @@ -46,7 +46,7 @@ pub fn each_lang_item(cstore: &cstore::CStore, cnum: ast::CrateNum, f: F) -> bool where - F: FnMut(ast::NodeId, uint) -> bool, + F: FnMut(ast::NodeId, usize) -> bool, { let crate_data = cstore.get_crate_data(cnum); decoder::each_lang_item(&*crate_data, f) diff --git a/src/librustc/metadata/cstore.rs b/src/librustc/metadata/cstore.rs index f201ff374ea..811aa21a0b7 100644 --- a/src/librustc/metadata/cstore.rs +++ b/src/librustc/metadata/cstore.rs @@ -252,7 +252,7 @@ impl MetadataBlob { let len = (((slice[0] as u32) << 24) | ((slice[1] as u32) << 16) | ((slice[2] as u32) << 8) | - ((slice[3] as u32) << 0)) as uint; + ((slice[3] as u32) << 0)) as usize; if len + 4 <= slice.len() { &slice[4.. len + 4] } else { diff --git a/src/librustc/metadata/decoder.rs b/src/librustc/metadata/decoder.rs index c0bad80ab59..fc0b8543ea6 100644 --- a/src/librustc/metadata/decoder.rs +++ b/src/librustc/metadata/decoder.rs @@ -71,15 +71,15 @@ fn lookup_hash<'a, F>(d: rbml::Doc<'a>, mut eq_fn: F, hash: u64) -> Option Vec { let path_doc = reader::get_doc(item_doc, tag_path); let len_doc = reader::get_doc(path_doc, tag_path_len); - let len = reader::doc_as_u32(len_doc) as uint; + let len = reader::doc_as_u32(len_doc) as usize; let mut result = Vec::with_capacity(len); reader::docs(path_doc, |tag, elt_doc| { @@ -513,13 +513,13 @@ pub enum DefLike { /// Iterates over the language items in the given crate. pub fn each_lang_item(cdata: Cmd, mut f: F) -> bool where - F: FnMut(ast::NodeId, uint) -> bool, + F: FnMut(ast::NodeId, usize) -> bool, { let root = rbml::Doc::new(cdata.data()); let lang_items = reader::get_doc(root, tag_lang_items); reader::tagged_docs(lang_items, tag_lang_items_item, |item_doc| { let id_doc = reader::get_doc(item_doc, tag_lang_items_item_id); - let id = reader::doc_as_u32(id_doc) as uint; + let id = reader::doc_as_u32(id_doc) as usize; let node_id_doc = reader::get_doc(item_doc, tag_lang_items_item_node_id); let node_id = reader::doc_as_u32(node_id_doc) as ast::NodeId; @@ -1194,7 +1194,7 @@ pub fn get_crate_deps(data: &[u8]) -> Vec { let cratedoc = rbml::Doc::new(data); let depsdoc = reader::get_doc(cratedoc, tag_crate_deps); let mut crate_num = 1; - fn docstr(doc: rbml::Doc, tag_: uint) -> String { + fn docstr(doc: rbml::Doc, tag_: usize) -> String { let d = reader::get_doc(doc, tag_); d.as_str_slice().to_string() } @@ -1454,7 +1454,7 @@ pub fn is_typedef(cdata: Cmd, id: ast::NodeId) -> bool { fn doc_generics<'tcx>(base_doc: rbml::Doc, tcx: &ty::ctxt<'tcx>, cdata: Cmd, - tag: uint) + tag: usize) -> ty::Generics<'tcx> { let doc = reader::get_doc(base_doc, tag); @@ -1479,7 +1479,7 @@ fn doc_generics<'tcx>(base_doc: rbml::Doc, let def_id = translate_def_id(cdata, def_id); let doc = reader::get_doc(rp_doc, tag_region_param_def_space); - let space = subst::ParamSpace::from_uint(reader::doc_as_u64(doc) as uint); + let space = subst::ParamSpace::from_uint(reader::doc_as_u64(doc) as usize); let doc = reader::get_doc(rp_doc, tag_region_param_def_index); let index = reader::doc_as_u64(doc) as u32; @@ -1508,7 +1508,7 @@ fn doc_generics<'tcx>(base_doc: rbml::Doc, fn doc_predicates<'tcx>(base_doc: rbml::Doc, tcx: &ty::ctxt<'tcx>, cdata: Cmd, - tag: uint) + tag: usize) -> ty::GenericPredicates<'tcx> { let doc = reader::get_doc(base_doc, tag); @@ -1516,7 +1516,7 @@ fn doc_predicates<'tcx>(base_doc: rbml::Doc, let mut predicates = subst::VecPerParamSpace::empty(); reader::tagged_docs(doc, tag_predicate, |predicate_doc| { let space_doc = reader::get_doc(predicate_doc, tag_predicate_space); - let space = subst::ParamSpace::from_uint(reader::doc_as_u8(space_doc) as uint); + let space = subst::ParamSpace::from_uint(reader::doc_as_u8(space_doc) as usize); let data_doc = reader::get_doc(predicate_doc, tag_predicate_data); let data = parse_predicate_data(data_doc.data, data_doc.start, cdata.cnum, tcx, diff --git a/src/librustc/metadata/encoder.rs b/src/librustc/metadata/encoder.rs index fa8d0b2a56e..d5e8e152ee9 100644 --- a/src/librustc/metadata/encoder.rs +++ b/src/librustc/metadata/encoder.rs @@ -105,7 +105,7 @@ struct entry { fn encode_trait_ref<'a, 'tcx>(rbml_w: &mut Encoder, ecx: &EncodeContext<'a, 'tcx>, trait_ref: &ty::TraitRef<'tcx>, - tag: uint) { + tag: usize) { let ty_str_ctxt = &tyencode::ctxt { diag: ecx.diag, ds: def_to_string, @@ -703,7 +703,7 @@ fn encode_generics<'a, 'tcx>(rbml_w: &mut Encoder, ecx: &EncodeContext<'a, 'tcx>, generics: &ty::Generics<'tcx>, predicates: &ty::GenericPredicates<'tcx>, - tag: uint) + tag: usize) { rbml_w.start_tag(tag); @@ -777,7 +777,7 @@ fn encode_predicates_in_current_doc<'a,'tcx>(rbml_w: &mut Encoder, fn encode_predicates<'a,'tcx>(rbml_w: &mut Encoder, ecx: &EncodeContext<'a,'tcx>, predicates: &ty::GenericPredicates<'tcx>, - tag: uint) + tag: usize) { rbml_w.start_tag(tag); encode_predicates_in_current_doc(rbml_w, ecx, predicates); @@ -1538,7 +1538,7 @@ fn encode_index(rbml_w: &mut Encoder, index: Vec>, mut write_fn: for elt in index { let mut s = SipHasher::new(); elt.val.hash(&mut s); - let h = s.finish() as uint; + let h = s.finish() as usize; (&mut buckets[h % 256]).push(elt); } @@ -1944,7 +1944,7 @@ pub fn encode_metadata(parms: EncodeParams, krate: &ast::Crate) -> Vec { // RBML compacts the encoded bytes whenever appropriate, // so there are some garbages left after the end of the data. - let metalen = wr.seek(SeekFrom::Current(0)).unwrap() as uint; + let metalen = wr.seek(SeekFrom::Current(0)).unwrap() as usize; let mut v = wr.into_inner(); v.truncate(metalen); assert_eq!(v.len(), metalen); diff --git a/src/librustc/metadata/loader.rs b/src/librustc/metadata/loader.rs index 7854db81146..b6053b930e9 100644 --- a/src/librustc/metadata/loader.rs +++ b/src/librustc/metadata/loader.rs @@ -745,7 +745,7 @@ fn get_metadata_section_imp(is_osx: bool, filename: &Path) -> Result Result Result { data: &'a [u8], krate: ast::CrateNum, - pos: uint, + pos: usize, tcx: &'a ty::ctxt<'tcx> } @@ -119,7 +119,7 @@ fn parse_name_(st: &mut PState, is_last: F) -> ast::Name where } pub fn parse_state_from_data<'a, 'tcx>(data: &'a [u8], crate_num: ast::CrateNum, - pos: uint, tcx: &'a ty::ctxt<'tcx>) + pos: usize, tcx: &'a ty::ctxt<'tcx>) -> PState<'a, 'tcx> { PState { data: data, @@ -129,7 +129,7 @@ pub fn parse_state_from_data<'a, 'tcx>(data: &'a [u8], crate_num: ast::CrateNum, } } -fn data_log_string(data: &[u8], pos: uint) -> String { +fn data_log_string(data: &[u8], pos: usize) -> String { let mut buf = String::new(); buf.push_str("<<"); for i in pos..data.len() { @@ -146,7 +146,7 @@ fn data_log_string(data: &[u8], pos: uint) -> String { pub fn parse_ty_closure_data<'tcx, F>(data: &[u8], crate_num: ast::CrateNum, - pos: uint, + pos: usize, tcx: &ty::ctxt<'tcx>, conv: F) -> ty::ClosureTy<'tcx> where @@ -156,7 +156,7 @@ pub fn parse_ty_closure_data<'tcx, F>(data: &[u8], parse_closure_ty(&mut st, conv) } -pub fn parse_ty_data<'tcx, F>(data: &[u8], crate_num: ast::CrateNum, pos: uint, +pub fn parse_ty_data<'tcx, F>(data: &[u8], crate_num: ast::CrateNum, pos: usize, tcx: &ty::ctxt<'tcx>, conv: F) -> Ty<'tcx> where F: FnMut(DefIdSource, ast::DefId) -> ast::DefId, { @@ -165,7 +165,7 @@ pub fn parse_ty_data<'tcx, F>(data: &[u8], crate_num: ast::CrateNum, pos: uint, parse_ty(&mut st, conv) } -pub fn parse_region_data(data: &[u8], crate_num: ast::CrateNum, pos: uint, tcx: &ty::ctxt, +pub fn parse_region_data(data: &[u8], crate_num: ast::CrateNum, pos: usize, tcx: &ty::ctxt, conv: F) -> ty::Region where F: FnMut(DefIdSource, ast::DefId) -> ast::DefId, { @@ -174,7 +174,7 @@ pub fn parse_region_data(data: &[u8], crate_num: ast::CrateNum, pos: uint, tc parse_region(&mut st, conv) } -pub fn parse_bare_fn_ty_data<'tcx, F>(data: &[u8], crate_num: ast::CrateNum, pos: uint, +pub fn parse_bare_fn_ty_data<'tcx, F>(data: &[u8], crate_num: ast::CrateNum, pos: usize, tcx: &ty::ctxt<'tcx>, conv: F) -> ty::BareFnTy<'tcx> where F: FnMut(DefIdSource, ast::DefId) -> ast::DefId, @@ -184,7 +184,7 @@ pub fn parse_bare_fn_ty_data<'tcx, F>(data: &[u8], crate_num: ast::CrateNum, pos parse_bare_fn_ty(&mut st, conv) } -pub fn parse_trait_ref_data<'tcx, F>(data: &[u8], crate_num: ast::CrateNum, pos: uint, +pub fn parse_trait_ref_data<'tcx, F>(data: &[u8], crate_num: ast::CrateNum, pos: usize, tcx: &ty::ctxt<'tcx>, conv: F) -> Rc> where F: FnMut(DefIdSource, ast::DefId) -> ast::DefId, @@ -194,7 +194,7 @@ pub fn parse_trait_ref_data<'tcx, F>(data: &[u8], crate_num: ast::CrateNum, pos: parse_trait_ref(&mut st, conv) } -pub fn parse_substs_data<'tcx, F>(data: &[u8], crate_num: ast::CrateNum, pos: uint, +pub fn parse_substs_data<'tcx, F>(data: &[u8], crate_num: ast::CrateNum, pos: usize, tcx: &ty::ctxt<'tcx>, conv: F) -> subst::Substs<'tcx> where F: FnMut(DefIdSource, ast::DefId) -> ast::DefId, { @@ -204,7 +204,7 @@ pub fn parse_substs_data<'tcx, F>(data: &[u8], crate_num: ast::CrateNum, pos: ui } pub fn parse_bounds_data<'tcx, F>(data: &[u8], crate_num: ast::CrateNum, - pos: uint, tcx: &ty::ctxt<'tcx>, conv: F) + pos: usize, tcx: &ty::ctxt<'tcx>, conv: F) -> ty::ParamBounds<'tcx> where F: FnMut(DefIdSource, ast::DefId) -> ast::DefId, { @@ -213,7 +213,7 @@ pub fn parse_bounds_data<'tcx, F>(data: &[u8], crate_num: ast::CrateNum, } pub fn parse_existential_bounds_data<'tcx, F>(data: &[u8], crate_num: ast::CrateNum, - pos: uint, tcx: &ty::ctxt<'tcx>, conv: F) + pos: usize, tcx: &ty::ctxt<'tcx>, conv: F) -> ty::ExistentialBounds<'tcx> where F: FnMut(DefIdSource, ast::DefId) -> ast::DefId, { @@ -222,7 +222,7 @@ pub fn parse_existential_bounds_data<'tcx, F>(data: &[u8], crate_num: ast::Crate } pub fn parse_builtin_bounds_data(data: &[u8], crate_num: ast::CrateNum, - pos: uint, tcx: &ty::ctxt, conv: F) + pos: usize, tcx: &ty::ctxt, conv: F) -> ty::BuiltinBounds where F: FnMut(DefIdSource, ast::DefId) -> ast::DefId, { @@ -230,7 +230,7 @@ pub fn parse_builtin_bounds_data(data: &[u8], crate_num: ast::CrateNum, parse_builtin_bounds(&mut st, conv) } -fn parse_size(st: &mut PState) -> Option { +fn parse_size(st: &mut PState) -> Option { assert_eq!(next(st), '/'); if peek(st) == '|' { @@ -447,8 +447,8 @@ fn parse_ty_<'a, 'tcx, F>(st: &mut PState<'a, 'tcx>, conv: &mut F) -> Ty<'tcx> w let tcx = st.tcx; match next(st) { 'b' => return tcx.types.bool, - 'i' => { /* eat the s of is */ next(st); return tcx.types.int }, - 'u' => { /* eat the s of us */ next(st); return tcx.types.uint }, + 'i' => { /* eat the s of is */ next(st); return tcx.types.isize }, + 'u' => { /* eat the s of us */ next(st); return tcx.types.usize }, 'M' => { match next(st) { 'b' => return tcx.types.u8, @@ -592,21 +592,21 @@ fn parse_def_(st: &mut PState, source: DefIdSource, conv: &mut F) -> ast::Def return (*conv)(source, scan(st, |c| { c == '|' }, parse_def_id)); } -fn parse_uint(st: &mut PState) -> uint { +fn parse_uint(st: &mut PState) -> usize { let mut n = 0; loop { let cur = peek(st); if cur < '0' || cur > '9' { return n; } st.pos = st.pos + 1; n *= 10; - n += (cur as uint) - ('0' as uint); + n += (cur as usize) - ('0' as usize); }; } fn parse_u32(st: &mut PState) -> u32 { let n = parse_uint(st); let m = n as u32; - assert_eq!(m as uint, n); + assert_eq!(m as usize, n); m } @@ -614,7 +614,7 @@ fn parse_param_space(st: &mut PState) -> subst::ParamSpace { subst::ParamSpace::from_uint(parse_uint(st)) } -fn parse_hex(st: &mut PState) -> uint { +fn parse_hex(st: &mut PState) -> usize { let mut n = 0; loop { let cur = peek(st); @@ -622,8 +622,8 @@ fn parse_hex(st: &mut PState) -> uint { st.pos = st.pos + 1; n *= 16; if '0' <= cur && cur <= '9' { - n += (cur as uint) - ('0' as uint); - } else { n += 10 + (cur as uint) - ('a' as uint); } + n += (cur as usize) - ('0' as usize); + } else { n += 10 + (cur as usize) - ('a' as usize); } }; } @@ -725,14 +725,14 @@ pub fn parse_def_id(buf: &[u8]) -> ast::DefId { let def_part = &buf[colon_idx + 1..len]; let crate_num = match str::from_utf8(crate_part).ok().and_then(|s| { - s.parse::().ok() + s.parse::().ok() }) { Some(cn) => cn as ast::CrateNum, None => panic!("internal error: parse_def_id: crate number expected, found {:?}", crate_part) }; let def_num = match str::from_utf8(def_part).ok().and_then(|s| { - s.parse::().ok() + s.parse::().ok() }) { Some(dn) => dn as ast::NodeId, None => panic!("internal error: parse_def_id: id expected, found {:?}", @@ -742,7 +742,7 @@ pub fn parse_def_id(buf: &[u8]) -> ast::DefId { } pub fn parse_predicate_data<'tcx, F>(data: &[u8], - start: uint, + start: usize, crate_num: ast::CrateNum, tcx: &ty::ctxt<'tcx>, conv: F) @@ -794,7 +794,7 @@ fn parse_projection_predicate_<'a,'tcx, F>( } } -pub fn parse_type_param_def_data<'tcx, F>(data: &[u8], start: uint, +pub fn parse_type_param_def_data<'tcx, F>(data: &[u8], start: usize, crate_num: ast::CrateNum, tcx: &ty::ctxt<'tcx>, conv: F) -> ty::TypeParameterDef<'tcx> where F: FnMut(DefIdSource, ast::DefId) -> ast::DefId, diff --git a/src/librustc/middle/astconv_util.rs b/src/librustc/middle/astconv_util.rs index 0f98b3c33fb..698cf105ae5 100644 --- a/src/librustc/middle/astconv_util.rs +++ b/src/librustc/middle/astconv_util.rs @@ -19,10 +19,10 @@ use middle::ty::{self, Ty}; use syntax::ast; use util::ppaux::Repr; -pub const NO_REGIONS: uint = 1; -pub const NO_TPS: uint = 2; +pub const NO_REGIONS: usize = 1; +pub const NO_TPS: usize = 2; -pub fn check_path_args(tcx: &ty::ctxt, segments: &[ast::PathSegment], flags: uint) { +pub fn check_path_args(tcx: &ty::ctxt, segments: &[ast::PathSegment], flags: usize) { for segment in segments { if (flags & NO_TPS) != 0 { for typ in segment.parameters.types() { diff --git a/src/librustc/middle/astencode.rs b/src/librustc/middle/astencode.rs index 801350e8a1e..0b8469eda39 100644 --- a/src/librustc/middle/astencode.rs +++ b/src/librustc/middle/astencode.rs @@ -93,7 +93,7 @@ pub fn encode_inlined_item(ecx: &e::EncodeContext, let ii = simplify_ast(ii); let id_range = ast_util::compute_id_range_for_inlined_item(&ii); - rbml_w.start_tag(c::tag_ast as uint); + rbml_w.start_tag(c::tag_ast as usize); id_range.encode(rbml_w); encode_ast(rbml_w, &ii); encode_side_tables_for_ii(ecx, rbml_w, &ii); @@ -360,7 +360,7 @@ impl def_id_decoder_helpers for D // but eventually we should add entries to the local codemap as required. fn encode_ast(rbml_w: &mut Encoder, item: &ast::InlinedItem) { - rbml_w.start_tag(c::tag_tree as uint); + rbml_w.start_tag(c::tag_tree as usize); item.encode(rbml_w); rbml_w.end_tag(); } @@ -437,7 +437,7 @@ fn simplify_ast(ii: e::InlinedItemRef) -> ast::InlinedItem { } fn decode_ast(par_doc: rbml::Doc) -> ast::InlinedItem { - let chi_doc = par_doc.get(c::tag_tree as uint); + let chi_doc = par_doc.get(c::tag_tree as usize); let mut d = reader::Decoder::new(chi_doc); Decodable::decode(&mut d).unwrap() } @@ -1150,7 +1150,7 @@ impl<'a> write_tag_and_id for Encoder<'a> { f: F) where F: FnOnce(&mut Encoder<'a>), { - self.start_tag(tag_id as uint); + self.start_tag(tag_id as usize); f(self); self.end_tag(); } @@ -1175,7 +1175,7 @@ impl<'a, 'b, 'c, 'tcx> ast_util::IdVisitingOperation for fn encode_side_tables_for_ii(ecx: &e::EncodeContext, rbml_w: &mut Encoder, ii: &ast::InlinedItem) { - rbml_w.start_tag(c::tag_table as uint); + rbml_w.start_tag(c::tag_table as usize); ast_util::visit_ids_for_inlined_item(ii, &mut SideTableEncodingIdVisitor { ecx: ecx, rbml_w: rbml_w @@ -1323,14 +1323,14 @@ fn encode_side_tables_for_id(ecx: &e::EncodeContext, } trait doc_decoder_helpers { - fn as_int(&self) -> int; + fn as_int(&self) -> isize; fn opt_child(&self, tag: c::astencode_tag) -> Option; } impl<'a> doc_decoder_helpers for rbml::Doc<'a> { - fn as_int(&self) -> int { reader::doc_as_u64(*self) as int } + fn as_int(&self) -> isize { reader::doc_as_u64(*self) as isize } fn opt_child(&self, tag: c::astencode_tag) -> Option> { - reader::maybe_get_doc(*self, tag as uint) + reader::maybe_get_doc(*self, tag as usize) } } @@ -1746,7 +1746,7 @@ impl<'a, 'tcx> rbml_decoder_decoder_helpers<'tcx> for reader::Decoder<'a> { this.read_enum_variant(variants, |this, i| { Ok(match i { 0 => { - let len: uint = + let len: usize = this.read_enum_variant_arg(0, |this| Decodable::decode(this)).unwrap(); ty::UnsizeLength(len) @@ -1755,7 +1755,7 @@ impl<'a, 'tcx> rbml_decoder_decoder_helpers<'tcx> for reader::Decoder<'a> { let uk: ty::UnsizeKind = this.read_enum_variant_arg(0, |this| Ok(this.read_unsize_kind(dcx))).unwrap(); - let idx: uint = + let idx: usize = this.read_enum_variant_arg(1, |this| Decodable::decode(this)).unwrap(); ty::UnsizeStruct(box uk, idx) @@ -1851,7 +1851,7 @@ impl<'a, 'tcx> rbml_decoder_decoder_helpers<'tcx> for reader::Decoder<'a> { fn decode_side_tables(dcx: &DecodeContext, ast_doc: rbml::Doc) { - let tbl_doc = ast_doc.get(c::tag_table as uint); + let tbl_doc = ast_doc.get(c::tag_table as usize); reader::docs(tbl_doc, |tag, entry_doc| { let mut entry_dsr = reader::Decoder::new(entry_doc); let id0: ast::NodeId = Decodable::decode(&mut entry_dsr).unwrap(); @@ -1969,14 +1969,14 @@ fn decode_side_tables(dcx: &DecodeContext, #[cfg(test)] fn encode_item_ast(rbml_w: &mut Encoder, item: &ast::Item) { - rbml_w.start_tag(c::tag_tree as uint); + rbml_w.start_tag(c::tag_tree as usize); (*item).encode(rbml_w); rbml_w.end_tag(); } #[cfg(test)] fn decode_item_ast(par_doc: rbml::Doc) -> ast::Item { - let chi_doc = par_doc.get(c::tag_tree as uint); + let chi_doc = par_doc.get(c::tag_tree as usize); let mut d = reader::Decoder::new(chi_doc); Decodable::decode(&mut d).unwrap() } @@ -2035,7 +2035,7 @@ fn test_basic() { fn test_smalltalk() { let cx = mk_ctxt(); roundtrip(quote_item!(&cx, - fn foo() -> int { 3 + 4 } // first smalltalk program ever executed. + fn foo() -> isize { 3 + 4 } // first smalltalk program ever executed. )); } */ @@ -2044,7 +2044,7 @@ fn test_smalltalk() { fn test_more() { let cx = mk_ctxt(); roundtrip(quote_item!(&cx, - fn foo(x: uint, y: uint) -> uint { + fn foo(x: usize, y: usize) -> usize { let z = x + y; return z; } @@ -2055,15 +2055,15 @@ fn test_more() { fn test_simplification() { let cx = mk_ctxt(); let item = quote_item!(&cx, - fn new_int_alist() -> alist { - fn eq_int(a: int, b: int) -> bool { a == b } + fn new_int_alist() -> alist { + fn eq_int(a: isize, b: isize) -> bool { a == b } return alist {eq_fn: eq_int, data: Vec::new()}; } ).unwrap(); let item_in = e::IIItemRef(&*item); let item_out = simplify_ast(item_in); let item_exp = ast::IIItem(quote_item!(&cx, - fn new_int_alist() -> alist { + fn new_int_alist() -> alist { return alist {eq_fn: eq_int, data: Vec::new()}; } ).unwrap()); diff --git a/src/librustc/middle/check_match.rs b/src/librustc/middle/check_match.rs index 97cd9456098..69da9c252c8 100644 --- a/src/librustc/middle/check_match.rs +++ b/src/librustc/middle/check_match.rs @@ -72,7 +72,7 @@ impl<'a> fmt::Debug for Matrix<'a> { let column_count = m.iter().map(|row| row.len()).max().unwrap_or(0); assert!(m.iter().all(|row| row.len() == column_count)); - let column_widths: Vec = (0..column_count).map(|col| { + let column_widths: Vec = (0..column_count).map(|col| { pretty_printed_matrix.iter().map(|row| row[col].len()).max().unwrap_or(0) }).collect(); @@ -116,9 +116,9 @@ pub enum Constructor { /// Ranges of literal values (2..5). ConstantRange(const_val, const_val), /// Array patterns of length n. - Slice(uint), + Slice(usize), /// Array patterns with a subslice. - SliceWithSubslice(uint, uint) + SliceWithSubslice(usize, usize) } #[derive(Clone, PartialEq)] @@ -498,7 +498,7 @@ impl<'a, 'tcx> Folder for StaticInliner<'a, 'tcx> { /// left_ty: tuple of 3 elements /// pats: [10, 20, _] => (10, 20, _) /// -/// left_ty: struct X { a: (bool, &'static str), b: uint} +/// left_ty: struct X { a: (bool, &'static str), b: usize} /// pats: [(false, "foo"), 42] => X { a: (false, "foo"), b: 42 } fn construct_witness(cx: &MatchCheckCtxt, ctor: &Constructor, pats: Vec<&Pat>, left_ty: Ty) -> P { @@ -580,7 +580,7 @@ fn construct_witness(cx: &MatchCheckCtxt, ctor: &Constructor, } fn missing_constructor(cx: &MatchCheckCtxt, &Matrix(ref rows): &Matrix, - left_ty: Ty, max_slice_length: uint) -> Option { + left_ty: Ty, max_slice_length: usize) -> Option { let used_constructors: Vec = rows.iter() .flat_map(|row| pat_constructors(cx, row[0], left_ty, max_slice_length).into_iter()) .collect(); @@ -594,7 +594,7 @@ fn missing_constructor(cx: &MatchCheckCtxt, &Matrix(ref rows): &Matrix, /// but is instead bounded by the maximum fixed length of slice patterns in /// the column of patterns being analyzed. fn all_constructors(cx: &MatchCheckCtxt, left_ty: Ty, - max_slice_length: uint) -> Vec { + max_slice_length: usize) -> Vec { match left_ty.sty { ty::ty_bool => [true, false].iter().map(|b| ConstantValue(const_bool(*b))).collect(), @@ -741,7 +741,7 @@ fn is_useful_specialized(cx: &MatchCheckCtxt, &Matrix(ref m): &Matrix, /// On the other hand, a wild pattern and an identifier pattern cannot be /// specialized in any way. fn pat_constructors(cx: &MatchCheckCtxt, p: &Pat, - left_ty: Ty, max_slice_length: uint) -> Vec { + left_ty: Ty, max_slice_length: usize) -> Vec { let pat = raw_pat(p); match pat.node { ast::PatIdent(..) => @@ -798,7 +798,7 @@ fn pat_constructors(cx: &MatchCheckCtxt, p: &Pat, /// /// For instance, a tuple pattern (_, 42, Some([])) has the arity of 3. /// A struct pattern's arity is the number of fields it contains, etc. -pub fn constructor_arity(cx: &MatchCheckCtxt, ctor: &Constructor, ty: Ty) -> uint { +pub fn constructor_arity(cx: &MatchCheckCtxt, ctor: &Constructor, ty: Ty) -> usize { match ty.sty { ty::ty_tup(ref fs) => fs.len(), ty::ty_uniq(_) => 1, @@ -850,7 +850,7 @@ fn range_covered_by_constructor(ctor: &Constructor, /// Structure patterns with a partial wild pattern (Foo { a: 42, .. }) have their missing /// fields filled with wild patterns. pub fn specialize<'a>(cx: &MatchCheckCtxt, r: &[&'a Pat], - constructor: &Constructor, col: uint, arity: uint) -> Option> { + constructor: &Constructor, col: usize, arity: usize) -> Option> { let &Pat { id: pat_id, ref node, span: pat_span } = raw_pat(r[col]); diff --git a/src/librustc/middle/const_eval.rs b/src/librustc/middle/const_eval.rs index 8fff93c6b7c..0d9e0d14def 100644 --- a/src/librustc/middle/const_eval.rs +++ b/src/librustc/middle/const_eval.rs @@ -262,8 +262,8 @@ impl ConstEvalErr { CannotCastTo(s) => format!("can't cast this type to {}", s).into_cow(), InvalidOpForBools(_) => "can't do this op on bools".into_cow(), InvalidOpForFloats(_) => "can't do this op on floats".into_cow(), - InvalidOpForIntUint(..) => "can't do this op on an int and uint".into_cow(), - InvalidOpForUintInt(..) => "can't do this op on a uint and int".into_cow(), + InvalidOpForIntUint(..) => "can't do this op on an isize and usize".into_cow(), + InvalidOpForUintInt(..) => "can't do this op on a usize and isize".into_cow(), NegateOnString => "negate on string".into_cow(), NegateOnBoolean => "negate on boolean".into_cow(), NegateOnBinary => "negate on binary literal".into_cow(), @@ -369,7 +369,7 @@ pub fn eval_const_expr_partial<'tcx>(tcx: &ty::ctxt<'tcx>, } ast::ExprBinary(op, ref a, ref b) => { let b_ty = match op.node { - ast::BiShl | ast::BiShr => Some(tcx.types.uint), + ast::BiShl | ast::BiShr => Some(tcx.types.usize), _ => ety }; match (try!(eval_const_expr_partial(tcx, &**a, ety)), @@ -434,8 +434,8 @@ pub fn eval_const_expr_partial<'tcx>(tcx: &ty::ctxt<'tcx>, ast::BiAnd | ast::BiBitAnd => const_int(a & b), ast::BiOr | ast::BiBitOr => const_int(a | b), ast::BiBitXor => const_int(a ^ b), - ast::BiShl => const_int(a << b as uint), - ast::BiShr => const_int(a >> b as uint), + ast::BiShl => const_int(a << b as usize), + ast::BiShr => const_int(a >> b as usize), ast::BiEq => fromb(a == b), ast::BiLt => fromb(a < b), ast::BiLe => fromb(a <= b), @@ -456,8 +456,8 @@ pub fn eval_const_expr_partial<'tcx>(tcx: &ty::ctxt<'tcx>, ast::BiAnd | ast::BiBitAnd => const_uint(a & b), ast::BiOr | ast::BiBitOr => const_uint(a | b), ast::BiBitXor => const_uint(a ^ b), - ast::BiShl => const_uint(a << b as uint), - ast::BiShr => const_uint(a >> b as uint), + ast::BiShl => const_uint(a << b as usize), + ast::BiShr => const_uint(a >> b as usize), ast::BiEq => fromb(a == b), ast::BiLt => fromb(a < b), ast::BiLe => fromb(a <= b), @@ -469,15 +469,15 @@ pub fn eval_const_expr_partial<'tcx>(tcx: &ty::ctxt<'tcx>, // shifts can have any integral type as their rhs (const_int(a), const_uint(b)) => { match op.node { - ast::BiShl => const_int(a << b as uint), - ast::BiShr => const_int(a >> b as uint), + ast::BiShl => const_int(a << b as usize), + ast::BiShr => const_int(a >> b as usize), _ => signal!(e, InvalidOpForIntUint(op.node)), } } (const_uint(a), const_int(b)) => { match op.node { - ast::BiShl => const_uint(a << b as uint), - ast::BiShr => const_uint(a >> b as uint), + ast::BiShl => const_uint(a << b as usize), + ast::BiShr => const_uint(a >> b as usize), _ => signal!(e, InvalidOpForUintInt(op.node)), } } @@ -628,12 +628,12 @@ fn cast_const(val: const_val, ty: Ty) -> Result { } define_casts!{ - ty::ty_int(ast::TyIs) => (int, const_int, i64), + ty::ty_int(ast::TyIs) => (isize, const_int, i64), ty::ty_int(ast::TyI8) => (i8, const_int, i64), ty::ty_int(ast::TyI16) => (i16, const_int, i64), ty::ty_int(ast::TyI32) => (i32, const_int, i64), ty::ty_int(ast::TyI64) => (i64, const_int, i64), - ty::ty_uint(ast::TyUs) => (uint, const_uint, u64), + ty::ty_uint(ast::TyUs) => (usize, const_uint, u64), ty::ty_uint(ast::TyU8) => (u8, const_uint, u64), ty::ty_uint(ast::TyU16) => (u16, const_uint, u64), ty::ty_uint(ast::TyU32) => (u32, const_uint, u64), diff --git a/src/librustc/middle/dataflow.rs b/src/librustc/middle/dataflow.rs index a1ce8d18184..6c7db4ce548 100644 --- a/src/librustc/middle/dataflow.rs +++ b/src/librustc/middle/dataflow.rs @@ -45,11 +45,11 @@ pub struct DataFlowContext<'a, 'tcx: 'a, O> { oper: O, /// number of bits to propagate per id - bits_per_id: uint, + bits_per_id: usize, /// number of words we will use to store bits_per_id. /// equal to bits_per_id/usize::BITS rounded up. - words_per_id: uint, + words_per_id: usize, // mapping from node to cfg node index // FIXME (#6298): Shouldn't this go with CFG? @@ -62,19 +62,19 @@ pub struct DataFlowContext<'a, 'tcx: 'a, O> { // the full vector (see the method `compute_id_range()`). /// bits generated as we exit the cfg node. Updated by `add_gen()`. - gens: Vec, + gens: Vec, /// bits killed as we exit the cfg node. Updated by `add_kill()`. - kills: Vec, + kills: Vec, /// bits that are valid on entry to the cfg node. Updated by /// `propagate()`. - on_entry: Vec, + on_entry: Vec, } pub trait BitwiseOperator { /// Joins two predecessor bits together, typically either `|` or `&` - fn join(&self, succ: uint, pred: uint) -> uint; + fn join(&self, succ: usize, pred: usize) -> usize; } /// Parameterization for the precise form of data flow that is used. @@ -204,7 +204,7 @@ impl<'a, 'tcx, O:DataFlowOperator> DataFlowContext<'a, 'tcx, O> { cfg: &cfg::CFG, oper: O, id_range: IdRange, - bits_per_id: uint) -> DataFlowContext<'a, 'tcx, O> { + bits_per_id: usize) -> DataFlowContext<'a, 'tcx, O> { let words_per_id = (bits_per_id + usize::BITS as usize - 1) / usize::BITS as usize; let num_nodes = cfg.graph.all_nodes().len(); @@ -235,7 +235,7 @@ impl<'a, 'tcx, O:DataFlowOperator> DataFlowContext<'a, 'tcx, O> { } } - pub fn add_gen(&mut self, id: ast::NodeId, bit: uint) { + pub fn add_gen(&mut self, id: ast::NodeId, bit: usize) { //! Indicates that `id` generates `bit` debug!("{} add_gen(id={}, bit={})", self.analysis_name, id, bit); @@ -250,7 +250,7 @@ impl<'a, 'tcx, O:DataFlowOperator> DataFlowContext<'a, 'tcx, O> { } } - pub fn add_kill(&mut self, id: ast::NodeId, bit: uint) { + pub fn add_kill(&mut self, id: ast::NodeId, bit: usize) { //! Indicates that `id` kills `bit` debug!("{} add_kill(id={}, bit={})", self.analysis_name, id, bit); @@ -265,7 +265,7 @@ impl<'a, 'tcx, O:DataFlowOperator> DataFlowContext<'a, 'tcx, O> { } } - fn apply_gen_kill(&self, cfgidx: CFGIndex, bits: &mut [uint]) { + fn apply_gen_kill(&self, cfgidx: CFGIndex, bits: &mut [usize]) { //! Applies the gen and kill sets for `cfgidx` to `bits` debug!("{} apply_gen_kill(cfgidx={:?}, bits={}) [before]", self.analysis_name, cfgidx, mut_bits_to_string(bits)); @@ -281,7 +281,7 @@ impl<'a, 'tcx, O:DataFlowOperator> DataFlowContext<'a, 'tcx, O> { self.analysis_name, cfgidx, mut_bits_to_string(bits)); } - fn compute_id_range(&self, cfgidx: CFGIndex) -> (uint, uint) { + fn compute_id_range(&self, cfgidx: CFGIndex) -> (usize, usize) { let n = cfgidx.node_id(); let start = n * self.words_per_id; let end = start + self.words_per_id; @@ -296,7 +296,7 @@ impl<'a, 'tcx, O:DataFlowOperator> DataFlowContext<'a, 'tcx, O> { pub fn each_bit_on_entry(&self, id: ast::NodeId, mut f: F) -> bool where - F: FnMut(uint) -> bool, + F: FnMut(usize) -> bool, { //! Iterates through each bit that is set on entry to `id`. //! Only useful after `propagate()` has been called. @@ -313,7 +313,7 @@ impl<'a, 'tcx, O:DataFlowOperator> DataFlowContext<'a, 'tcx, O> { } pub fn each_bit_for_node(&self, e: EntryOrExit, cfgidx: CFGIndex, f: F) -> bool where - F: FnMut(uint) -> bool, + F: FnMut(usize) -> bool, { //! Iterates through each bit that is set on entry/exit to `cfgidx`. //! Only useful after `propagate()` has been called. @@ -342,7 +342,7 @@ impl<'a, 'tcx, O:DataFlowOperator> DataFlowContext<'a, 'tcx, O> { } pub fn each_gen_bit(&self, id: ast::NodeId, mut f: F) -> bool where - F: FnMut(uint) -> bool, + F: FnMut(usize) -> bool, { //! Iterates through each bit in the gen set for `id`. if !self.has_bitset_for_nodeid(id) { @@ -368,8 +368,8 @@ impl<'a, 'tcx, O:DataFlowOperator> DataFlowContext<'a, 'tcx, O> { return true; } - fn each_bit(&self, words: &[uint], mut f: F) -> bool where - F: FnMut(uint) -> bool, + fn each_bit(&self, words: &[usize], mut f: F) -> bool where + F: FnMut(usize) -> bool, { //! Helper for iterating over the bits in a bit set. //! Returns false on the first call to `f` that returns false; @@ -505,7 +505,7 @@ impl<'a, 'tcx, O:DataFlowOperator+Clone+'static> DataFlowContext<'a, 'tcx, O> { impl<'a, 'b, 'tcx, O:DataFlowOperator> PropagationContext<'a, 'b, 'tcx, O> { fn walk_cfg(&mut self, cfg: &cfg::CFG, - in_out: &mut [uint]) { + in_out: &mut [usize]) { debug!("DataFlowContext::walk_cfg(in_out={}) {}", bits_to_string(in_out), self.dfcx.analysis_name); assert!(self.dfcx.bits_per_id > 0); @@ -529,7 +529,7 @@ impl<'a, 'b, 'tcx, O:DataFlowOperator> PropagationContext<'a, 'b, 'tcx, O> { }); } - fn reset(&mut self, bits: &mut [uint]) { + fn reset(&mut self, bits: &mut [usize]) { let e = if self.dfcx.oper.initial_value() {usize::MAX} else {0}; for b in bits { *b = e; @@ -537,7 +537,7 @@ impl<'a, 'b, 'tcx, O:DataFlowOperator> PropagationContext<'a, 'b, 'tcx, O> { } fn propagate_bits_into_graph_successors_of(&mut self, - pred_bits: &[uint], + pred_bits: &[usize], cfg: &cfg::CFG, cfgidx: CFGIndex) { cfg.graph.each_outgoing_edge(cfgidx, |_e_idx, edge| { @@ -547,7 +547,7 @@ impl<'a, 'b, 'tcx, O:DataFlowOperator> PropagationContext<'a, 'b, 'tcx, O> { } fn propagate_bits_into_entry_set_for(&mut self, - pred_bits: &[uint], + pred_bits: &[usize], edge: &cfg::CFGEdge) { let source = edge.source(); let cfgidx = edge.target(); @@ -570,11 +570,11 @@ impl<'a, 'b, 'tcx, O:DataFlowOperator> PropagationContext<'a, 'b, 'tcx, O> { } } -fn mut_bits_to_string(words: &mut [uint]) -> String { +fn mut_bits_to_string(words: &mut [usize]) -> String { bits_to_string(words) } -fn bits_to_string(words: &[uint]) -> String { +fn bits_to_string(words: &[usize]) -> String { let mut result = String::new(); let mut sep = '['; @@ -594,8 +594,8 @@ fn bits_to_string(words: &[uint]) -> String { } #[inline] -fn bitwise(out_vec: &mut [uint], - in_vec: &[uint], +fn bitwise(out_vec: &mut [usize], + in_vec: &[usize], op: &Op) -> bool { assert_eq!(out_vec.len(), in_vec.len()); let mut changed = false; @@ -608,7 +608,7 @@ fn bitwise(out_vec: &mut [uint], changed } -fn set_bit(words: &mut [uint], bit: uint) -> bool { +fn set_bit(words: &mut [usize], bit: usize) -> bool { debug!("set_bit: words={} bit={}", mut_bits_to_string(words), bit_str(bit)); let word = bit / usize::BITS as usize; @@ -621,7 +621,7 @@ fn set_bit(words: &mut [uint], bit: uint) -> bool { oldv != newv } -fn bit_str(bit: uint) -> String { +fn bit_str(bit: usize) -> String { let byte = bit >> 8; let lobits = 1 << (bit & 0xFF); format!("[{}:{}-{:02x}]", bit, byte, lobits) @@ -629,9 +629,9 @@ fn bit_str(bit: uint) -> String { struct Union; impl BitwiseOperator for Union { - fn join(&self, a: uint, b: uint) -> uint { a | b } + fn join(&self, a: usize, b: usize) -> usize { a | b } } struct Subtract; impl BitwiseOperator for Subtract { - fn join(&self, a: uint, b: uint) -> uint { a & !b } + fn join(&self, a: usize, b: usize) -> usize { a & !b } } diff --git a/src/librustc/middle/dead.rs b/src/librustc/middle/dead.rs index 6d4d759476e..568375597c0 100644 --- a/src/librustc/middle/dead.rs +++ b/src/librustc/middle/dead.rs @@ -145,7 +145,7 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> { } } - fn handle_tup_field_access(&mut self, lhs: &ast::Expr, idx: uint) { + fn handle_tup_field_access(&mut self, lhs: &ast::Expr, idx: usize) { match ty::expr_ty_adjusted(self.tcx, lhs).sty { ty::ty_struct(id, _) => { let fields = ty::lookup_struct_fields(self.tcx, id); diff --git a/src/librustc/middle/dependency_format.rs b/src/librustc/middle/dependency_format.rs index 40e7610582f..0b688e1e08a 100644 --- a/src/librustc/middle/dependency_format.rs +++ b/src/librustc/middle/dependency_format.rs @@ -172,7 +172,7 @@ fn calculate_type(sess: &session::Session, assert!(src.rlib.is_some()); debug!("adding staticlib: {}", data.name); add_library(sess, cnum, cstore::RequireStatic, &mut formats); - ret[cnum as uint - 1] = Some(cstore::RequireStatic); + ret[cnum as usize - 1] = Some(cstore::RequireStatic); } }); diff --git a/src/librustc/middle/expr_use_visitor.rs b/src/librustc/middle/expr_use_visitor.rs index 97314b57ef6..36c9e582b41 100644 --- a/src/librustc/middle/expr_use_visitor.rs +++ b/src/librustc/middle/expr_use_visitor.rs @@ -823,7 +823,7 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> { /// `deref()` is declared with `&self`, this is an autoref of `x`. fn walk_autoderefs(&mut self, expr: &ast::Expr, - autoderefs: uint) { + autoderefs: usize) { debug!("walk_autoderefs expr={} autoderefs={}", expr.repr(self.tcx()), autoderefs); for i in 0..autoderefs { @@ -855,7 +855,7 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> { fn walk_autoref(&mut self, expr: &ast::Expr, autoref: &ty::AutoRef, - n: uint) { + n: usize) { debug!("walk_autoref expr={}", expr.repr(self.tcx())); match *autoref { diff --git a/src/librustc/middle/fast_reject.rs b/src/librustc/middle/fast_reject.rs index f9bdc5dc313..36065aaca57 100644 --- a/src/librustc/middle/fast_reject.rs +++ b/src/librustc/middle/fast_reject.rs @@ -25,11 +25,11 @@ pub enum SimplifiedType { StrSimplifiedType, VecSimplifiedType, PtrSimplifiedType, - TupleSimplifiedType(uint), + TupleSimplifiedType(usize), TraitSimplifiedType(ast::DefId), StructSimplifiedType(ast::DefId), ClosureSimplifiedType(ast::DefId), - FunctionSimplifiedType(uint), + FunctionSimplifiedType(usize), ParameterSimplifiedType, } diff --git a/src/librustc/middle/graph.rs b/src/librustc/middle/graph.rs index 436f04fc9e9..8673273f9b3 100644 --- a/src/librustc/middle/graph.rs +++ b/src/librustc/middle/graph.rs @@ -62,33 +62,33 @@ impl Debug for Edge { } #[derive(Clone, Copy, PartialEq, Debug)] -pub struct NodeIndex(pub uint); +pub struct NodeIndex(pub usize); #[allow(non_upper_case_globals)] pub const InvalidNodeIndex: NodeIndex = NodeIndex(usize::MAX); #[derive(Copy, PartialEq, Debug)] -pub struct EdgeIndex(pub uint); +pub struct EdgeIndex(pub usize); #[allow(non_upper_case_globals)] pub const InvalidEdgeIndex: EdgeIndex = EdgeIndex(usize::MAX); // Use a private field here to guarantee no more instances are created: #[derive(Copy, Debug)] -pub struct Direction { repr: uint } +pub struct Direction { repr: usize } #[allow(non_upper_case_globals)] pub const Outgoing: Direction = Direction { repr: 0 }; #[allow(non_upper_case_globals)] pub const Incoming: Direction = Direction { repr: 1 }; impl NodeIndex { - fn get(&self) -> uint { let NodeIndex(v) = *self; v } + fn get(&self) -> usize { let NodeIndex(v) = *self; v } /// Returns unique id (unique with respect to the graph holding associated node). - pub fn node_id(&self) -> uint { self.get() } + pub fn node_id(&self) -> usize { self.get() } } impl EdgeIndex { - fn get(&self) -> uint { let EdgeIndex(v) = *self; v } + fn get(&self) -> usize { let EdgeIndex(v) = *self; v } /// Returns unique id (unique with respect to the graph holding associated edge). - pub fn edge_id(&self) -> uint { self.get() } + pub fn edge_id(&self) -> usize { self.get() } } impl Graph { @@ -99,8 +99,8 @@ impl Graph { } } - pub fn with_capacity(num_nodes: uint, - num_edges: uint) -> Graph { + pub fn with_capacity(num_nodes: usize, + num_edges: usize) -> Graph { Graph { nodes: Vec::with_capacity(num_nodes), edges: Vec::with_capacity(num_edges), @@ -275,7 +275,7 @@ impl Graph { // computation. pub fn iterate_until_fixed_point<'a, F>(&'a self, mut op: F) where - F: FnMut(uint, EdgeIndex, &'a Edge) -> bool, + F: FnMut(usize, EdgeIndex, &'a Edge) -> bool, { let mut iteration = 0; let mut changed = true; diff --git a/src/librustc/middle/infer/error_reporting.rs b/src/librustc/middle/infer/error_reporting.rs index 1ca56596a01..de4dbc14694 100644 --- a/src/librustc/middle/infer/error_reporting.rs +++ b/src/librustc/middle/infer/error_reporting.rs @@ -1766,7 +1766,7 @@ fn lifetimes_in_scope(tcx: &ty::ctxt, // LifeGiver is responsible for generating fresh lifetime names struct LifeGiver { taken: HashSet, - counter: Cell, + counter: Cell, generated: RefCell>, } @@ -1806,7 +1806,7 @@ impl LifeGiver { return lifetime; // 0 .. 25 generates a .. z, 26 .. 51 generates aa .. zz, and so on - fn num_to_string(counter: uint) -> String { + fn num_to_string(counter: usize) -> String { let mut s = String::new(); let (n, r) = (counter/26 + 1, counter % 26); let letter: char = from_u32((r+97) as u32).unwrap(); diff --git a/src/librustc/middle/infer/mod.rs b/src/librustc/middle/infer/mod.rs index a38adabee91..097a3b4ce4f 100644 --- a/src/librustc/middle/infer/mod.rs +++ b/src/librustc/middle/infer/mod.rs @@ -811,7 +811,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { ty::mk_var(self.tcx, self.next_ty_var_id(true)) } - pub fn next_ty_vars(&self, n: uint) -> Vec> { + pub fn next_ty_vars(&self, n: usize) -> Vec> { (0..n).map(|_i| self.next_ty_var()).collect() } diff --git a/src/librustc/middle/infer/region_inference/graphviz.rs b/src/librustc/middle/infer/region_inference/graphviz.rs index 5be3310926c..1fcbf80c904 100644 --- a/src/librustc/middle/infer/region_inference/graphviz.rs +++ b/src/librustc/middle/infer/region_inference/graphviz.rs @@ -121,7 +121,7 @@ struct ConstraintGraph<'a, 'tcx: 'a> { tcx: &'a ty::ctxt<'tcx>, graph_name: String, map: &'a FnvHashMap>, - node_ids: FnvHashMap, + node_ids: FnvHashMap, } #[derive(Clone, Hash, PartialEq, Eq, Debug, Copy)] diff --git a/src/librustc/middle/infer/region_inference/mod.rs b/src/librustc/middle/infer/region_inference/mod.rs index 553e3601806..c432d114b6e 100644 --- a/src/librustc/middle/infer/region_inference/mod.rs +++ b/src/librustc/middle/infer/region_inference/mod.rs @@ -86,7 +86,7 @@ pub enum UndoLogEntry { CommitedSnapshot, AddVar(RegionVid), AddConstraint(Constraint), - AddVerify(uint), + AddVerify(usize), AddGiven(ty::FreeRegion, ty::RegionVid), AddCombination(CombineMapType, TwoRegions) } @@ -224,7 +224,7 @@ pub struct RegionVarBindings<'a, 'tcx: 'a> { #[derive(Debug)] pub struct RegionSnapshot { - length: uint, + length: usize, skolemization_count: u32, } @@ -284,7 +284,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { AddVar(vid) => { let mut var_origins = self.var_origins.borrow_mut(); var_origins.pop().unwrap(); - assert_eq!(var_origins.len(), vid.index as uint); + assert_eq!(var_origins.len(), vid.index as usize); } AddConstraint(ref constraint) => { self.constraints.borrow_mut().remove(constraint); @@ -312,7 +312,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { pub fn num_vars(&self) -> u32 { let len = self.var_origins.borrow().len(); // enforce no overflow - assert!(len as u32 as uint == len); + assert!(len as u32 as usize == len); len as u32 } @@ -557,7 +557,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { match *self.values.borrow() { None => { self.tcx.sess.span_bug( - (*self.var_origins.borrow())[rid.index as uint].span(), + (*self.var_origins.borrow())[rid.index as usize].span(), "attempt to resolve region variable before values have \ been computed!") } @@ -629,7 +629,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { let mut result_set = vec!(r0); let mut result_index = 0; while result_index < result_set.len() { - // nb: can't use uint::range() here because result_set grows + // nb: can't use usize::range() here because result_set grows let r = result_set[result_index]; debug!("result_index={}, r={:?}", result_index, r); @@ -746,7 +746,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { (ReInfer(ReVar(v_id)), _) | (_, ReInfer(ReVar(v_id))) => { self.tcx.sess.span_bug( - (*self.var_origins.borrow())[v_id.index as uint].span(), + (*self.var_origins.borrow())[v_id.index as usize].span(), &format!("lub_concrete_regions invoked with \ non-concrete regions: {:?}, {:?}", a, @@ -850,7 +850,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { (ReInfer(ReVar(v_id)), _) | (_, ReInfer(ReVar(v_id))) => { self.tcx.sess.span_bug( - (*self.var_origins.borrow())[v_id.index as uint].span(), + (*self.var_origins.borrow())[v_id.index as usize].span(), &format!("glb_concrete_regions invoked with \ non-concrete regions: {:?}, {:?}", a, @@ -984,7 +984,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { } fn construct_var_data(&self) -> Vec { - (0..self.num_vars() as uint).map(|_| { + (0..self.num_vars() as usize).map(|_| { VarData { // All nodes are initially classified as contracting; during // the expansion phase, we will shift the classification for @@ -1013,14 +1013,14 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { .repr(self.tcx)); match *constraint { ConstrainRegSubVar(a_region, b_vid) => { - let b_data = &mut var_data[b_vid.index as uint]; + let b_data = &mut var_data[b_vid.index as usize]; self.expand_node(a_region, b_vid, b_data) } ConstrainVarSubVar(a_vid, b_vid) => { - match var_data[a_vid.index as uint].value { + match var_data[a_vid.index as usize].value { NoValue | ErrorValue => false, Value(a_region) => { - let b_node = &mut var_data[b_vid.index as uint]; + let b_node = &mut var_data[b_vid.index as usize]; self.expand_node(a_region, b_vid, b_node) } } @@ -1101,16 +1101,16 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { false } ConstrainVarSubVar(a_vid, b_vid) => { - match var_data[b_vid.index as uint].value { + match var_data[b_vid.index as usize].value { NoValue | ErrorValue => false, Value(b_region) => { - let a_data = &mut var_data[a_vid.index as uint]; + let a_data = &mut var_data[a_vid.index as usize]; self.contract_node(a_vid, a_data, b_region) } } } ConstrainVarSubReg(a_vid, b_region) => { - let a_data = &mut var_data[a_vid.index as uint]; + let a_data = &mut var_data[a_vid.index as usize]; self.contract_node(a_vid, a_data, b_region) } } @@ -1250,11 +1250,11 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { // idea is to report errors that derive from independent // regions of the graph, but not those that derive from // overlapping locations. - let mut dup_vec: Vec<_> = repeat(u32::MAX).take(self.num_vars() as uint).collect(); + let mut dup_vec: Vec<_> = repeat(u32::MAX).take(self.num_vars() as usize).collect(); let mut opt_graph = None; - for idx in 0..self.num_vars() as uint { + for idx in 0..self.num_vars() as usize { match var_data[idx].value { Value(_) => { /* Inference successful */ @@ -1311,7 +1311,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { } } - (0..self.num_vars() as uint).map(|idx| var_data[idx].value).collect() + (0..self.num_vars() as usize).map(|idx| var_data[idx].value).collect() } fn construct_graph(&self) -> RegionGraph { @@ -1320,7 +1320,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { let constraints = self.constraints.borrow(); let num_edges = constraints.len(); - let mut graph = graph::Graph::with_capacity(num_vars as uint + 1, + let mut graph = graph::Graph::with_capacity(num_vars as usize + 1, num_edges); for _ in 0..num_vars { @@ -1331,17 +1331,17 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { for (constraint, _) in &*constraints { match *constraint { ConstrainVarSubVar(a_id, b_id) => { - graph.add_edge(NodeIndex(a_id.index as uint), - NodeIndex(b_id.index as uint), + graph.add_edge(NodeIndex(a_id.index as usize), + NodeIndex(b_id.index as usize), *constraint); } ConstrainRegSubVar(_, b_id) => { graph.add_edge(dummy_idx, - NodeIndex(b_id.index as uint), + NodeIndex(b_id.index as usize), *constraint); } ConstrainVarSubReg(a_id, _) => { - graph.add_edge(NodeIndex(a_id.index as uint), + graph.add_edge(NodeIndex(a_id.index as usize), dummy_idx, *constraint); } @@ -1395,7 +1395,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { debug!("pushing SubSupConflict sub: {:?} sup: {:?}", lower_bound.region, upper_bound.region); errors.push(SubSupConflict( - (*self.var_origins.borrow())[node_idx.index as uint].clone(), + (*self.var_origins.borrow())[node_idx.index as usize].clone(), lower_bound.origin.clone(), lower_bound.region, upper_bound.origin.clone(), @@ -1406,7 +1406,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { } self.tcx.sess.span_bug( - (*self.var_origins.borrow())[node_idx.index as uint].span(), + (*self.var_origins.borrow())[node_idx.index as usize].span(), &format!("collect_error_for_expanding_node() could not find error \ for var {:?}, lower_bounds={}, upper_bounds={}", node_idx, @@ -1439,7 +1439,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { Ok(_) => {} Err(_) => { errors.push(SupSupConflict( - (*self.var_origins.borrow())[node_idx.index as uint].clone(), + (*self.var_origins.borrow())[node_idx.index as usize].clone(), upper_bound_1.origin.clone(), upper_bound_1.region, upper_bound_2.origin.clone(), @@ -1451,7 +1451,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { } self.tcx.sess.span_bug( - (*self.var_origins.borrow())[node_idx.index as uint].span(), + (*self.var_origins.borrow())[node_idx.index as usize].span(), &format!("collect_error_for_contracting_node() could not find error \ for var {:?}, upper_bounds={}", node_idx, @@ -1485,12 +1485,12 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { while !state.stack.is_empty() { let node_idx = state.stack.pop().unwrap(); - let classification = var_data[node_idx.index as uint].classification; + let classification = var_data[node_idx.index as usize].classification; // check whether we've visited this node on some previous walk - if dup_vec[node_idx.index as uint] == u32::MAX { - dup_vec[node_idx.index as uint] = orig_node_idx.index; - } else if dup_vec[node_idx.index as uint] != orig_node_idx.index { + if dup_vec[node_idx.index as usize] == u32::MAX { + dup_vec[node_idx.index as usize] = orig_node_idx.index; + } else if dup_vec[node_idx.index as usize] != orig_node_idx.index { state.dup_found = true; } @@ -1518,7 +1518,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { dir: Direction) { debug!("process_edges(source_vid={:?}, dir={:?})", source_vid, dir); - let source_node_index = NodeIndex(source_vid.index as uint); + let source_node_index = NodeIndex(source_vid.index as usize); graph.each_adjacent_edge(source_node_index, dir, |_, edge| { match edge.data { ConstrainVarSubVar(from_vid, to_vid) => { @@ -1603,7 +1603,7 @@ fn normalize(values: &Vec, r: ty::Region) -> ty::Region { } fn lookup(values: &Vec, rid: ty::RegionVid) -> ty::Region { - match values[rid.index as uint] { + match values[rid.index as usize] { Value(r) => r, NoValue => ReEmpty, // No constraints, return ty::ReEmpty ErrorValue => ReStatic, // Previously reported error. diff --git a/src/librustc/middle/infer/type_variable.rs b/src/librustc/middle/infer/type_variable.rs index a856137af09..553ef9afc28 100644 --- a/src/librustc/middle/infer/type_variable.rs +++ b/src/librustc/middle/infer/type_variable.rs @@ -69,11 +69,11 @@ impl<'tcx> TypeVariableTable<'tcx> { } fn relations<'a>(&'a mut self, a: ty::TyVid) -> &'a mut Vec { - relations(self.values.get_mut(a.index as uint)) + relations(self.values.get_mut(a.index as usize)) } pub fn var_diverges<'a>(&'a self, vid: ty::TyVid) -> bool { - self.values.get(vid.index as uint).diverging + self.values.get(vid.index as usize).diverging } /// Records that `a <: b`, `a :> b`, or `a == b`, depending on `dir`. @@ -97,7 +97,7 @@ impl<'tcx> TypeVariableTable<'tcx> { stack: &mut Vec<(Ty<'tcx>, RelationDir, ty::TyVid)>) { let old_value = { - let value_ptr = &mut self.values.get_mut(vid.index as uint).value; + let value_ptr = &mut self.values.get_mut(vid.index as usize).value; mem::replace(value_ptr, Known(ty)) }; @@ -123,7 +123,7 @@ impl<'tcx> TypeVariableTable<'tcx> { } pub fn probe(&self, vid: ty::TyVid) -> Option> { - match self.values.get(vid.index as uint).value { + match self.values.get(vid.index as usize).value { Bounded(..) => None, Known(t) => Some(t) } @@ -206,12 +206,12 @@ impl<'tcx> sv::SnapshotVecDelegate for Delegate<'tcx> { action: UndoEntry) { match action { SpecifyVar(vid, relations) => { - values[vid.index as uint].value = Bounded(relations); + values[vid.index as usize].value = Bounded(relations); } Relate(a, b) => { - relations(&mut (*values)[a.index as uint]).pop(); - relations(&mut (*values)[b.index as uint]).pop(); + relations(&mut (*values)[a.index as usize]).pop(); + relations(&mut (*values)[b.index as usize]).pop(); } } } diff --git a/src/librustc/middle/infer/unify.rs b/src/librustc/middle/infer/unify.rs index 0675cec6f69..8a736d47b5d 100644 --- a/src/librustc/middle/infer/unify.rs +++ b/src/librustc/middle/infer/unify.rs @@ -35,9 +35,9 @@ use util::snapshot_vec as sv; pub trait UnifyKey : Clone + Debug + PartialEq { type Value : UnifyValue; - fn index(&self) -> uint; + fn index(&self) -> usize; - fn from_index(u: uint) -> Self; + fn from_index(u: usize) -> Self; // Given an inference context, returns the unification table // appropriate to this key type. @@ -67,7 +67,7 @@ pub trait UnifyValue : Clone + PartialEq + Debug { #[derive(PartialEq,Clone,Debug)] pub enum VarValue { Redirect(K), - Root(K::Value, uint), + Root(K::Value, usize), } /// Table of unification keys and their values. @@ -89,7 +89,7 @@ pub struct Snapshot { pub struct Node { pub key: K, pub value: K::Value, - pub rank: uint, + pub rank: usize, } #[derive(Copy)] @@ -186,7 +186,7 @@ impl UnificationTable { tcx: &ty::ctxt<'tcx>, node_a: &Node, node_b: &Node) - -> (K, uint) + -> (K, usize) { debug!("unify(node_a(id={:?}, rank={:?}), node_b(id={:?}, rank={:?}))", node_a.key, @@ -358,9 +358,9 @@ impl<'a,'tcx,V,K> InferCtxtMethodsForSimplyUnifiableTypes<'tcx,K,V> for InferCtx impl UnifyKey for ty::IntVid { type Value = Option; - fn index(&self) -> uint { self.index as uint } + fn index(&self) -> usize { self.index as usize } - fn from_index(i: uint) -> ty::IntVid { ty::IntVid { index: i as u32 } } + fn from_index(i: usize) -> ty::IntVid { ty::IntVid { index: i as u32 } } fn unification_table<'v>(infcx: &'v InferCtxt) -> &'v RefCell> { return &infcx.int_unification_table; @@ -391,9 +391,9 @@ impl UnifyValue for Option { } impl UnifyKey for ty::FloatVid { type Value = Option; - fn index(&self) -> uint { self.index as uint } + fn index(&self) -> usize { self.index as usize } - fn from_index(i: uint) -> ty::FloatVid { ty::FloatVid { index: i as u32 } } + fn from_index(i: usize) -> ty::FloatVid { ty::FloatVid { index: i as u32 } } fn unification_table<'v>(infcx: &'v InferCtxt) -> &'v RefCell> { return &infcx.float_unification_table; diff --git a/src/librustc/middle/intrinsicck.rs b/src/librustc/middle/intrinsicck.rs index bd96a8a0f2c..2a4c2534544 100644 --- a/src/librustc/middle/intrinsicck.rs +++ b/src/librustc/middle/intrinsicck.rs @@ -28,8 +28,8 @@ pub fn check_crate(tcx: &ctxt) { let mut visitor = IntrinsicCheckingVisitor { tcx: tcx, param_envs: Vec::new(), - dummy_sized_ty: tcx.types.int, - dummy_unsized_ty: ty::mk_vec(tcx, tcx.types.int, None), + dummy_sized_ty: tcx.types.isize, + dummy_unsized_ty: ty::mk_vec(tcx, tcx.types.isize, None), }; visit::walk_crate(&mut visitor, tcx.map.krate()); } diff --git a/src/librustc/middle/lang_items.rs b/src/librustc/middle/lang_items.rs index 73d31a1f620..b9a82669f65 100644 --- a/src/librustc/middle/lang_items.rs +++ b/src/librustc/middle/lang_items.rs @@ -70,7 +70,7 @@ impl LanguageItems { self.items.iter().enumerate() } - pub fn item_name(index: uint) -> &'static str { + pub fn item_name(index: usize) -> &'static str { let item: Option = FromPrimitive::from_usize(index); match item { $( Some($variant) => $name, )* @@ -79,11 +79,11 @@ impl LanguageItems { } pub fn require(&self, it: LangItem) -> Result { - match self.items[it as uint] { + match self.items[it as usize] { Some(id) => Ok(id), None => { Err(format!("requires `{}` lang_item", - LanguageItems::item_name(it as uint))) + LanguageItems::item_name(it as usize))) } } } @@ -132,7 +132,7 @@ impl LanguageItems { $( #[allow(dead_code)] pub fn $method(&self) -> Option { - self.items[$variant as uint] + self.items[$variant as usize] } )* } @@ -142,7 +142,7 @@ struct LanguageItemCollector<'a> { session: &'a Session, - item_refs: FnvHashMap<&'static str, uint>, + item_refs: FnvHashMap<&'static str, usize>, } impl<'a, 'v> Visitor<'v> for LanguageItemCollector<'a> { @@ -163,7 +163,7 @@ impl<'a> LanguageItemCollector<'a> { pub fn new(session: &'a Session) -> LanguageItemCollector<'a> { let mut item_refs = FnvHashMap(); - $( item_refs.insert($name, $variant as uint); )* + $( item_refs.insert($name, $variant as usize); )* LanguageItemCollector { session: session, @@ -172,7 +172,7 @@ impl<'a> LanguageItemCollector<'a> { } } - pub fn collect_item(&mut self, item_index: uint, + pub fn collect_item(&mut self, item_index: usize, item_def_id: ast::DefId, span: Span) { // Check for duplicates. match self.items.items[item_index] { diff --git a/src/librustc/middle/mem_categorization.rs b/src/librustc/middle/mem_categorization.rs index bdcfc67f92b..e4e6a501693 100644 --- a/src/librustc/middle/mem_categorization.rs +++ b/src/librustc/middle/mem_categorization.rs @@ -94,7 +94,7 @@ pub enum categorization<'tcx> { cat_static_item, cat_upvar(Upvar), // upvar referenced by closure env cat_local(ast::NodeId), // local variable - cat_deref(cmt<'tcx>, uint, PointerKind), // deref of a ptr + cat_deref(cmt<'tcx>, usize, PointerKind), // deref of a ptr cat_interior(cmt<'tcx>, InteriorKind), // something interior: field, tuple, etc cat_downcast(cmt<'tcx>, ast::DefId), // selects a particular enum variant (*1) @@ -135,7 +135,7 @@ pub enum InteriorKind { #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)] pub enum FieldName { NamedField(ast::Name), - PositionalField(uint) + PositionalField(usize) } #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)] @@ -462,7 +462,7 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> { pub fn cat_expr_autoderefd(&self, expr: &ast::Expr, - autoderefs: uint) + autoderefs: usize) -> McResult> { let mut cmt = try!(self.cat_expr_unadjusted(expr)); debug!("cat_expr_autoderefd: autoderefs={}, cmt={}", @@ -868,7 +868,7 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> { pub fn cat_tup_field(&self, node: &N, base_cmt: cmt<'tcx>, - f_idx: uint, + f_idx: usize, f_ty: Ty<'tcx>) -> cmt<'tcx> { Rc::new(cmt_ { @@ -884,7 +884,7 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> { fn cat_deref(&self, node: &N, base_cmt: cmt<'tcx>, - deref_cnt: uint, + deref_cnt: usize, deref_context: DerefKindContext) -> McResult> { let adjustment = match self.typer.adjustments().borrow().get(&node.id()) { @@ -928,7 +928,7 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> { fn cat_deref_common(&self, node: &N, base_cmt: cmt<'tcx>, - deref_cnt: uint, + deref_cnt: usize, deref_ty: Ty<'tcx>, deref_context: DerefKindContext, implicit: bool) diff --git a/src/librustc/middle/region.rs b/src/librustc/middle/region.rs index b4db3aba786..8d2de18fea1 100644 --- a/src/librustc/middle/region.rs +++ b/src/librustc/middle/region.rs @@ -136,7 +136,7 @@ impl DestructionScopeData { RustcDecodable, Debug, Copy)] pub struct BlockRemainder { pub block: ast::NodeId, - pub first_statement_index: uint, + pub first_statement_index: usize, } impl CodeExtent { @@ -284,7 +284,7 @@ impl InnermostDeclaringBlock { struct DeclaringStatementContext { stmt_id: ast::NodeId, block_id: ast::NodeId, - stmt_index: uint, + stmt_index: usize, } impl DeclaringStatementContext { diff --git a/src/librustc/middle/subst.rs b/src/librustc/middle/subst.rs index 684b28d0373..e2ebe2bc0f1 100644 --- a/src/librustc/middle/subst.rs +++ b/src/librustc/middle/subst.rs @@ -98,7 +98,7 @@ impl<'tcx> Substs<'tcx> { } pub fn type_for_def(&self, ty_param_def: &ty::TypeParameterDef) -> Ty<'tcx> { - *self.types.get(ty_param_def.space, ty_param_def.index as uint) + *self.types.get(ty_param_def.space, ty_param_def.index as usize) } pub fn has_regions_escaping_depth(&self, depth: u32) -> bool { @@ -193,7 +193,7 @@ impl ParamSpace { [TypeSpace, SelfSpace, FnSpace] } - pub fn to_uint(self) -> uint { + pub fn to_uint(self) -> usize { match self { TypeSpace => 0, SelfSpace => 1, @@ -201,7 +201,7 @@ impl ParamSpace { } } - pub fn from_uint(u: uint) -> ParamSpace { + pub fn from_uint(u: usize) -> ParamSpace { match u { 0 => TypeSpace, 1 => SelfSpace, @@ -226,8 +226,8 @@ pub struct VecPerParamSpace { // AF(self) = (self.content[..self.type_limit], // self.content[self.type_limit..self.self_limit], // self.content[self.self_limit..]) - type_limit: uint, - self_limit: uint, + type_limit: usize, + self_limit: usize, content: Vec, } @@ -251,7 +251,7 @@ impl fmt::Debug for VecPerParamSpace { } impl VecPerParamSpace { - fn limits(&self, space: ParamSpace) -> (uint, uint) { + fn limits(&self, space: ParamSpace) -> (usize, usize) { match space { TypeSpace => (0, self.type_limit), SelfSpace => (self.type_limit, self.self_limit), @@ -290,7 +290,7 @@ impl VecPerParamSpace { } } - fn new_internal(content: Vec, type_limit: uint, self_limit: uint) + fn new_internal(content: Vec, type_limit: usize, self_limit: usize) -> VecPerParamSpace { VecPerParamSpace { @@ -343,7 +343,7 @@ impl VecPerParamSpace { } } - pub fn truncate(&mut self, space: ParamSpace, len: uint) { + pub fn truncate(&mut self, space: ParamSpace, len: usize) { // FIXME (#15435): slow; O(n^2); could enhance vec to make it O(n). while self.len(space) > len { self.pop(space); @@ -364,7 +364,7 @@ impl VecPerParamSpace { if v.len() == 0 { None } else { Some(&v[0]) } } - pub fn len(&self, space: ParamSpace) -> uint { + pub fn len(&self, space: ParamSpace) -> usize { self.get_slice(space).len() } @@ -384,13 +384,13 @@ impl VecPerParamSpace { pub fn opt_get<'a>(&'a self, space: ParamSpace, - index: uint) + index: usize) -> Option<&'a T> { let v = self.get_slice(space); if index < v.len() { Some(&v[index]) } else { None } } - pub fn get<'a>(&'a self, space: ParamSpace, index: uint) -> &'a T { + pub fn get<'a>(&'a self, space: ParamSpace, index: usize) -> &'a T { &self.get_slice(space)[index] } @@ -441,7 +441,7 @@ impl VecPerParamSpace { } pub fn map_enumerated(&self, pred: P) -> VecPerParamSpace where - P: FnMut((ParamSpace, uint, &T)) -> U, + P: FnMut((ParamSpace, usize, &T)) -> U, { let result = self.iter_enumerated().map(pred).collect(); VecPerParamSpace::new_internal(result, @@ -487,8 +487,8 @@ impl VecPerParamSpace { #[derive(Clone)] pub struct EnumeratedItems<'a,T:'a> { vec: &'a VecPerParamSpace, - space_index: uint, - elem_index: uint + space_index: usize, + elem_index: usize } impl<'a,T> EnumeratedItems<'a,T> { @@ -511,9 +511,9 @@ impl<'a,T> EnumeratedItems<'a,T> { } impl<'a,T> Iterator for EnumeratedItems<'a,T> { - type Item = (ParamSpace, uint, &'a T); + type Item = (ParamSpace, usize, &'a T); - fn next(&mut self) -> Option<(ParamSpace, uint, &'a T)> { + fn next(&mut self) -> Option<(ParamSpace, usize, &'a T)> { let spaces = ParamSpace::all(); if self.space_index < spaces.len() { let space = spaces[self.space_index]; @@ -598,7 +598,7 @@ struct SubstFolder<'a, 'tcx: 'a> { root_ty: Option>, // Depth of type stack - ty_stack_depth: uint, + ty_stack_depth: usize, // Number of region binders we have passed through while doing the substitution region_binders_passed: u32, @@ -626,7 +626,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for SubstFolder<'a, 'tcx> { match self.substs.regions { ErasedRegions => ty::ReStatic, NonerasedRegions(ref regions) => - match regions.opt_get(space, i as uint) { + match regions.opt_get(space, i as usize) { Some(&r) => { self.shift_region_through_binders(r) } @@ -682,7 +682,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for SubstFolder<'a, 'tcx> { impl<'a,'tcx> SubstFolder<'a,'tcx> { fn ty_for_param(&self, p: ty::ParamTy, source_ty: Ty<'tcx>) -> Ty<'tcx> { // Look up the type in the substitutions. It really should be in there. - let opt_ty = self.substs.types.opt_get(p.space, p.idx as uint); + let opt_ty = self.substs.types.opt_get(p.space, p.idx as usize); let ty = match opt_ty { Some(t) => *t, None => { diff --git a/src/librustc/middle/traits/fulfill.rs b/src/librustc/middle/traits/fulfill.rs index c1066aa899e..1b7469b8cb7 100644 --- a/src/librustc/middle/traits/fulfill.rs +++ b/src/librustc/middle/traits/fulfill.rs @@ -54,7 +54,7 @@ pub struct FulfillmentContext<'tcx> { // Remembers the count of trait obligations that we have already // attempted to select. This is used to avoid repeating work // when `select_new_obligations` is called. - attempted_mark: uint, + attempted_mark: usize, // A set of constraints that regionck must validate. Each // constraint has the form `T:'a`, meaning "some type `T` must diff --git a/src/librustc/middle/traits/mod.rs b/src/librustc/middle/traits/mod.rs index 24b201c960f..c72d1b0e972 100644 --- a/src/librustc/middle/traits/mod.rs +++ b/src/librustc/middle/traits/mod.rs @@ -68,7 +68,7 @@ mod util; #[derive(Clone, PartialEq, Eq)] pub struct Obligation<'tcx, T> { pub cause: ObligationCause<'tcx>, - pub recursion_depth: uint, + pub recursion_depth: usize, pub predicate: T, } @@ -482,7 +482,7 @@ impl<'tcx,O> Obligation<'tcx,O> { } fn with_depth(cause: ObligationCause<'tcx>, - recursion_depth: uint, + recursion_depth: usize, trait_ref: O) -> Obligation<'tcx, O> { diff --git a/src/librustc/middle/traits/project.rs b/src/librustc/middle/traits/project.rs index 2232bb7bcdb..1594d8b2e0d 100644 --- a/src/librustc/middle/traits/project.rs +++ b/src/librustc/middle/traits/project.rs @@ -197,7 +197,7 @@ pub fn normalize<'a,'b,'tcx,T>(selcx: &'a mut SelectionContext<'b,'tcx>, /// As `normalize`, but with a custom depth. pub fn normalize_with_depth<'a,'b,'tcx,T>(selcx: &'a mut SelectionContext<'b,'tcx>, cause: ObligationCause<'tcx>, - depth: uint, + depth: usize, value: &T) -> Normalized<'tcx, T> where T : TypeFoldable<'tcx> + HasProjectionTypes + Clone + Repr<'tcx> @@ -214,13 +214,13 @@ struct AssociatedTypeNormalizer<'a,'b:'a,'tcx:'b> { selcx: &'a mut SelectionContext<'b,'tcx>, cause: ObligationCause<'tcx>, obligations: Vec>, - depth: uint, + depth: usize, } impl<'a,'b,'tcx> AssociatedTypeNormalizer<'a,'b,'tcx> { fn new(selcx: &'a mut SelectionContext<'b,'tcx>, cause: ObligationCause<'tcx>, - depth: uint) + depth: usize) -> AssociatedTypeNormalizer<'a,'b,'tcx> { AssociatedTypeNormalizer { @@ -314,7 +314,7 @@ pub fn normalize_projection_type<'a,'b,'tcx>( selcx: &'a mut SelectionContext<'b,'tcx>, projection_ty: ty::ProjectionTy<'tcx>, cause: ObligationCause<'tcx>, - depth: uint) + depth: usize) -> NormalizedTy<'tcx> { opt_normalize_projection_type(selcx, projection_ty.clone(), cause.clone(), depth) @@ -344,7 +344,7 @@ fn opt_normalize_projection_type<'a,'b,'tcx>( selcx: &'a mut SelectionContext<'b,'tcx>, projection_ty: ty::ProjectionTy<'tcx>, cause: ObligationCause<'tcx>, - depth: uint) + depth: usize) -> Option> { debug!("normalize_projection_type(\ @@ -412,7 +412,7 @@ fn opt_normalize_projection_type<'a,'b,'tcx>( fn normalize_to_error<'a,'tcx>(selcx: &mut SelectionContext<'a,'tcx>, projection_ty: ty::ProjectionTy<'tcx>, cause: ObligationCause<'tcx>, - depth: uint) + depth: usize) -> NormalizedTy<'tcx> { let trait_ref = projection_ty.trait_ref.to_poly_trait_ref(); @@ -699,10 +699,10 @@ fn assemble_candidates_from_impls<'cx,'tcx>( // But wait, you say! What about an example like this: // // ``` - // fn bar>(...) { ... } + // fn bar>(...) { ... } // ``` // - // Doesn't the `T : Sometrait` predicate help + // Doesn't the `T : Sometrait` predicate help // resolve `T::Foo`? And of course it does, but in fact // that single predicate is desugared into two predicates // in the compiler: a trait predicate (`T : SomeTrait`) and a diff --git a/src/librustc/middle/traits/select.rs b/src/librustc/middle/traits/select.rs index 0d6a1f7df5e..04f855979e1 100644 --- a/src/librustc/middle/traits/select.rs +++ b/src/librustc/middle/traits/select.rs @@ -110,7 +110,7 @@ pub enum MethodMatchedData { /// The selection process begins by considering all impls, where /// clauses, and so forth that might resolve an obligation. Sometimes /// we'll be able to say definitively that (e.g.) an impl does not -/// apply to the obligation: perhaps it is defined for `uint` but the +/// apply to the obligation: perhaps it is defined for `usize` but the /// obligation is for `int`. In that case, we drop the impl out of the /// list. But the other cases are considered *candidates*. /// @@ -627,7 +627,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { // for example, we are looking for $0:Eq where $0 is some // unconstrained type variable. In that case, we'll get a // candidate which assumes $0 == int, one that assumes $0 == - // uint, etc. This spells an ambiguity. + // usize, etc. This spells an ambiguity. // If there is more than one candidate, first winnow them down // by considering extra conditions (nested obligations and so @@ -2010,7 +2010,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { impl_def_id: ast::DefId, substs: Normalized<'tcx, Substs<'tcx>>, cause: ObligationCause<'tcx>, - recursion_depth: uint, + recursion_depth: usize, skol_map: infer::SkolemizationMap, snapshot: &infer::CombinedSnapshot) -> VtableImplData<'tcx, PredicateObligation<'tcx>> @@ -2142,9 +2142,9 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { /// /// impl Fn(int) for Closure { ... } /// - /// Now imagine our obligation is `Fn(uint) for Closure`. So far + /// Now imagine our obligation is `Fn(usize) for Closure`. So far /// we have matched the self-type `Closure`. At this point we'll - /// compare the `int` to `uint` and generate an error. + /// compare the `int` to `usize` and generate an error. /// /// Note that this checking occurs *after* the impl has selected, /// because these output type parameters should not affect the @@ -2441,7 +2441,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { /// impl. fn impl_or_trait_obligations(&mut self, cause: ObligationCause<'tcx>, - recursion_depth: uint, + recursion_depth: usize, def_id: ast::DefId, // of impl or trait substs: &Substs<'tcx>, // for impl or trait skol_map: infer::SkolemizationMap, diff --git a/src/librustc/middle/traits/util.rs b/src/librustc/middle/traits/util.rs index 965aaf12044..719eff03424 100644 --- a/src/librustc/middle/traits/util.rs +++ b/src/librustc/middle/traits/util.rs @@ -278,7 +278,7 @@ impl<'tcx> fmt::Debug for super::VtableObjectData<'tcx> { /// See `super::obligations_for_generics` pub fn predicates_for_generics<'tcx>(tcx: &ty::ctxt<'tcx>, cause: ObligationCause<'tcx>, - recursion_depth: uint, + recursion_depth: usize, generic_bounds: &ty::InstantiatedPredicates<'tcx>) -> VecPerParamSpace> { @@ -316,7 +316,7 @@ pub fn trait_ref_for_builtin_bound<'tcx>( pub fn predicate_for_trait_ref<'tcx>( cause: ObligationCause<'tcx>, trait_ref: Rc>, - recursion_depth: uint) + recursion_depth: usize) -> Result, ErrorReported> { Ok(Obligation { @@ -330,7 +330,7 @@ pub fn predicate_for_trait_def<'tcx>( tcx: &ty::ctxt<'tcx>, cause: ObligationCause<'tcx>, trait_def_id: ast::DefId, - recursion_depth: uint, + recursion_depth: usize, param_ty: Ty<'tcx>) -> Result, ErrorReported> { @@ -345,7 +345,7 @@ pub fn predicate_for_builtin_bound<'tcx>( tcx: &ty::ctxt<'tcx>, cause: ObligationCause<'tcx>, builtin_bound: ty::BuiltinBound, - recursion_depth: uint, + recursion_depth: usize, param_ty: Ty<'tcx>) -> Result, ErrorReported> { @@ -377,7 +377,7 @@ pub fn upcast<'tcx>(tcx: &ty::ctxt<'tcx>, pub fn get_vtable_index_of_object_method<'tcx>(tcx: &ty::ctxt<'tcx>, object_trait_ref: ty::PolyTraitRef<'tcx>, trait_def_id: ast::DefId, - method_offset_in_trait: uint) -> uint { + method_offset_in_trait: usize) -> usize { // We need to figure the "real index" of the method in a // listing of all the methods of an object. We do this by // iterating down the supertraits of the object's trait until diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index f3a23fba6b5..c6f63e9503e 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -261,8 +261,8 @@ pub struct field_ty { #[derive(Copy, PartialEq, Eq, Hash)] pub struct creader_cache_key { pub cnum: CrateNum, - pub pos: uint, - pub len: uint + pub pos: usize, + pub len: usize } #[derive(Clone, PartialEq, RustcDecodable, RustcEncodable)] @@ -288,18 +288,18 @@ pub enum AutoAdjustment<'tcx> { #[derive(Clone, PartialEq, Debug)] pub enum UnsizeKind<'tcx> { - // [T, ..n] -> [T], the uint field is n. - UnsizeLength(uint), + // [T, ..n] -> [T], the usize field is n. + UnsizeLength(usize), // An unsize coercion applied to the tail field of a struct. - // The uint is the index of the type parameter which is unsized. - UnsizeStruct(Box>, uint), + // The usize is the index of the type parameter which is unsized. + UnsizeStruct(Box>, usize), UnsizeVtable(TyTrait<'tcx>, /* the self type of the trait */ Ty<'tcx>), UnsizeUpcast(Ty<'tcx>), } #[derive(Clone, Debug)] pub struct AutoDerefRef<'tcx> { - pub autoderefs: uint, + pub autoderefs: usize, pub autoref: Option> } @@ -423,7 +423,7 @@ pub fn type_of_adjust<'tcx>(cx: &ctxt<'tcx>, adj: &AutoAdjustment<'tcx>) -> Opti #[derive(Clone, Copy, RustcEncodable, RustcDecodable, PartialEq, PartialOrd, Debug)] pub struct param_index { pub space: subst::ParamSpace, - pub index: uint + pub index: usize } #[derive(Clone, Debug)] @@ -452,10 +452,10 @@ pub struct MethodParam<'tcx> { // instantiated with fresh variables at this point. pub trait_ref: Rc>, - // index of uint in the list of trait items. Note that this is NOT + // index of usize in the list of trait items. Note that this is NOT // the index into the vtable, because the list of trait items // includes associated types. - pub method_num: uint, + pub method_num: usize, /// The impl for the trait from which the method comes. This /// should only be used for certain linting/heuristic purposes @@ -474,13 +474,13 @@ pub struct MethodObject<'tcx> { pub object_trait_id: ast::DefId, // index of the method to be invoked amongst the trait's items - pub method_num: uint, + pub method_num: usize, // index into the actual runtime vtable. // the vtable is formed by concatenating together the method lists of // the base object trait and all supertraits; this is the index into // that vtable - pub vtable_index: uint, + pub vtable_index: usize, } #[derive(Clone)] @@ -511,7 +511,7 @@ pub struct MethodCall { #[derive(Clone, PartialEq, Eq, Hash, Debug, RustcEncodable, RustcDecodable, Copy)] pub enum ExprAdjustment { NoAdjustment, - AutoDeref(uint), + AutoDeref(usize), AutoObject } @@ -530,7 +530,7 @@ impl MethodCall { } } - pub fn autoderef(expr_id: ast::NodeId, autoderef: uint) -> MethodCall { + pub fn autoderef(expr_id: ast::NodeId, autoderef: usize) -> MethodCall { MethodCall { expr_id: expr_id, adjustment: AutoDeref(1 + autoderef) @@ -564,7 +564,7 @@ pub enum vtable_origin<'tcx> { The first argument is the param index (identifying T in the example), and the second is the bound number (identifying baz) */ - vtable_param(param_index, uint), + vtable_param(param_index, usize), /* Vtable automatically generated for a closure. The def ID is the @@ -639,12 +639,12 @@ impl<'tcx> CtxtArenas<'tcx> { pub struct CommonTypes<'tcx> { pub bool: Ty<'tcx>, pub char: Ty<'tcx>, - pub int: Ty<'tcx>, + pub isize: Ty<'tcx>, pub i8: Ty<'tcx>, pub i16: Ty<'tcx>, pub i32: Ty<'tcx>, pub i64: Ty<'tcx>, - pub uint: Ty<'tcx>, + pub usize: Ty<'tcx>, pub u8: Ty<'tcx>, pub u16: Ty<'tcx>, pub u32: Ty<'tcx>, @@ -877,10 +877,10 @@ macro_rules! sty_debug_print { use middle::ty; #[derive(Copy)] struct DebugStat { - total: uint, - region_infer: uint, - ty_infer: uint, - both_infer: uint, + total: usize, + region_infer: usize, + ty_infer: usize, + both_infer: usize, } pub fn go(tcx: &ty::ctxt) { @@ -1024,7 +1024,7 @@ pub fn type_has_late_bound_regions(ty: Ty) -> bool { /// /// So, for example, consider a type like the following, which has two binders: /// -/// for<'a> fn(x: for<'b> fn(&'a int, &'b int)) +/// for<'a> fn(x: for<'b> fn(&'a isize, &'b isize)) /// ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ outer scope /// ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ inner scope /// @@ -1110,7 +1110,7 @@ impl<'tcx> PolyFnSig<'tcx> { pub fn inputs(&self) -> ty::Binder>> { ty::Binder(self.0.inputs.clone()) } - pub fn input(&self, index: uint) -> ty::Binder> { + pub fn input(&self, index: usize) -> ty::Binder> { ty::Binder(self.0.inputs[index]) } pub fn output(&self) -> ty::Binder> { @@ -1132,7 +1132,7 @@ pub struct ParamTy { /// regions (and perhaps later types) in a higher-ranked setting. In /// particular, imagine a type like this: /// -/// for<'a> fn(for<'b> fn(&'b int, &'a int), &'a char) +/// for<'a> fn(for<'b> fn(&'b isize, &'a isize), &'a char) /// ^ ^ | | | /// | | | | | /// | +------------+ 1 | | @@ -1149,11 +1149,11 @@ pub struct ParamTy { /// count the number of binders, inside out. Some examples should help /// clarify what I mean. /// -/// Let's start with the reference type `&'b int` that is the first +/// Let's start with the reference type `&'b isize` that is the first /// argument to the inner function. This region `'b` is assigned a De /// Bruijn index of 1, meaning "the innermost binder" (in this case, a /// fn). The region `'a` that appears in the second argument type (`&'a -/// int`) would then be assigned a De Bruijn index of 2, meaning "the +/// isize`) would then be assigned a De Bruijn index of 2, meaning "the /// second-innermost binder". (These indices are written on the arrays /// in the diagram). /// @@ -1234,14 +1234,14 @@ pub enum BorrowKind { /// implicit closure bindings. It is needed when you the closure /// is borrowing or mutating a mutable referent, e.g.: /// - /// let x: &mut int = ...; + /// let x: &mut isize = ...; /// let y = || *x += 5; /// /// If we were to try to translate this closure into a more explicit /// form, we'd encounter an error with the code as written: /// - /// struct Env { x: & &mut int } - /// let x: &mut int = ...; + /// struct Env { x: & &mut isize } + /// let x: &mut isize = ...; /// let y = (&mut Env { &x }, fn_ptr); // Closure is pair of env and fn /// fn fn_ptr(env: &mut Env) { **env.x += 5; } /// @@ -1249,8 +1249,8 @@ pub enum BorrowKind { /// in an aliasable location. To solve, you'd have to translate with /// an `&mut` borrow: /// - /// struct Env { x: & &mut int } - /// let x: &mut int = ...; + /// struct Env { x: & &mut isize } + /// let x: &mut isize = ...; /// let y = (&mut Env { &mut x }, fn_ptr); // changed from &x to &mut x /// fn fn_ptr(env: &mut Env) { **env.x += 5; } /// @@ -1361,7 +1361,7 @@ pub enum sty<'tcx> { ty_enum(DefId, &'tcx Substs<'tcx>), ty_uniq(Ty<'tcx>), ty_str, - ty_vec(Ty<'tcx>, Option), // Second field is length. + ty_vec(Ty<'tcx>, Option), // Second field is length. ty_ptr(mt<'tcx>), ty_rptr(&'tcx Region, mt<'tcx>), @@ -1491,7 +1491,7 @@ impl<'tcx> PolyTraitRef<'tcx> { } /// Binder is a binder for higher-ranked lifetimes. It is part of the -/// compiler's representation for things like `for<'a> Fn(&'a int)` +/// compiler's representation for things like `for<'a> Fn(&'a isize)` /// (which would be represented by the type `PolyTraitRef == /// Binder`). Note that when we skolemize, instantiate, /// erase, or otherwise "discharge" these bound regions, we change the @@ -1552,9 +1552,9 @@ pub enum type_err<'tcx> { terr_ptr_mutability, terr_ref_mutability, terr_vec_mutability, - terr_tuple_size(expected_found), - terr_fixed_array_size(expected_found), - terr_ty_param_size(expected_found), + terr_tuple_size(expected_found), + terr_fixed_array_size(expected_found), + terr_ty_param_size(expected_found), terr_arg_count, terr_regions_does_not_outlive(Region, Region), terr_regions_not_same(Region, Region), @@ -1571,7 +1571,7 @@ pub enum type_err<'tcx> { terr_cyclic_ty, terr_convergence_mismatch(expected_found), terr_projection_name_mismatched(expected_found), - terr_projection_bounds_length(expected_found), + terr_projection_bounds_length(expected_found), } /// Bounds suitable for a named type parameter like `A` in `fn foo` @@ -1600,7 +1600,7 @@ pub type BuiltinBounds = EnumSet; #[derive(Clone, RustcEncodable, PartialEq, Eq, RustcDecodable, Hash, Debug, Copy)] -#[repr(uint)] +#[repr(usize)] pub enum BuiltinBound { BoundSend, BoundSized, @@ -1628,10 +1628,10 @@ pub fn region_existential_bound<'tcx>(r: ty::Region) -> ExistentialBounds<'tcx> } impl CLike for BuiltinBound { - fn to_usize(&self) -> uint { - *self as uint + fn to_usize(&self) -> usize { + *self as usize } - fn from_usize(v: uint) -> BuiltinBound { + fn from_usize(v: usize) -> BuiltinBound { unsafe { mem::transmute(v) } } } @@ -2202,8 +2202,8 @@ impl<'tcx> Predicate<'tcx> { /// /// Here, the `GenericPredicates` for `Foo` would contain a list of bounds like /// `[[], [U:Bar]]`. Now if there were some particular reference -/// like `Foo`, then the `InstantiatedPredicates` would be `[[], -/// [uint:Bar]]`. +/// like `Foo`, then the `InstantiatedPredicates` would be `[[], +/// [usize:Bar]]`. #[derive(Clone, Debug)] pub struct InstantiatedPredicates<'tcx> { pub predicates: VecPerParamSpace>, @@ -2545,12 +2545,12 @@ impl<'tcx> CommonTypes<'tcx> { bool: intern_ty(arena, interner, ty_bool), char: intern_ty(arena, interner, ty_char), err: intern_ty(arena, interner, ty_err), - int: intern_ty(arena, interner, ty_int(ast::TyIs)), + isize: intern_ty(arena, interner, ty_int(ast::TyIs)), i8: intern_ty(arena, interner, ty_int(ast::TyI8)), i16: intern_ty(arena, interner, ty_int(ast::TyI16)), i32: intern_ty(arena, interner, ty_int(ast::TyI32)), i64: intern_ty(arena, interner, ty_int(ast::TyI64)), - uint: intern_ty(arena, interner, ty_uint(ast::TyUs)), + usize: intern_ty(arena, interner, ty_uint(ast::TyUs)), u8: intern_ty(arena, interner, ty_uint(ast::TyU8)), u16: intern_ty(arena, interner, ty_uint(ast::TyU16)), u32: intern_ty(arena, interner, ty_uint(ast::TyU32)), @@ -2935,7 +2935,7 @@ impl FlagComputation { pub fn mk_mach_int<'tcx>(tcx: &ctxt<'tcx>, tm: ast::IntTy) -> Ty<'tcx> { match tm { - ast::TyIs => tcx.types.int, + ast::TyIs => tcx.types.isize, ast::TyI8 => tcx.types.i8, ast::TyI16 => tcx.types.i16, ast::TyI32 => tcx.types.i32, @@ -2945,7 +2945,7 @@ pub fn mk_mach_int<'tcx>(tcx: &ctxt<'tcx>, tm: ast::IntTy) -> Ty<'tcx> { pub fn mk_mach_uint<'tcx>(tcx: &ctxt<'tcx>, tm: ast::UintTy) -> Ty<'tcx> { match tm { - ast::TyUs => tcx.types.uint, + ast::TyUs => tcx.types.usize, ast::TyU8 => tcx.types.u8, ast::TyU16 => tcx.types.u16, ast::TyU32 => tcx.types.u32, @@ -3004,7 +3004,7 @@ pub fn mk_nil_ptr<'tcx>(cx: &ctxt<'tcx>) -> Ty<'tcx> { mk_ptr(cx, mt {ty: mk_nil(cx), mutbl: ast::MutImmutable}) } -pub fn mk_vec<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>, sz: Option) -> Ty<'tcx> { +pub fn mk_vec<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>, sz: Option) -> Ty<'tcx> { mk_t(cx, ty_vec(ty, sz)) } @@ -3130,9 +3130,9 @@ impl<'tcx> TyS<'tcx> { /// structs or variants. For example: /// /// ```notrust - /// int => { int } - /// Foo> => { Foo>, Bar, int } - /// [int] => { [int], int } + /// isize => { isize } + /// Foo> => { Foo>, Bar, isize } + /// [isize] => { [isize], isize } /// ``` pub fn walk(&'tcx self) -> TypeWalker<'tcx> { TypeWalker::new(self) @@ -3143,9 +3143,9 @@ impl<'tcx> TyS<'tcx> { /// example: /// /// ```notrust - /// int => { } - /// Foo> => { Bar, int } - /// [int] => { int } + /// isize => { } + /// Foo> => { Bar, isize } + /// [isize] => { isize } /// ``` pub fn walk_children(&'tcx self) -> TypeWalker<'tcx> { // Walks type reachable from `self` but not `self @@ -3343,7 +3343,7 @@ pub fn simd_type<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> Ty<'tcx> { } } -pub fn simd_size(cx: &ctxt, ty: Ty) -> uint { +pub fn simd_size(cx: &ctxt, ty: Ty) -> usize { match ty.sty { ty_struct(did, _) => { let fields = lookup_struct_fields(cx, did); @@ -3611,7 +3611,7 @@ pub fn type_contents<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> TypeContents { cache.insert(ty, TC::None); let result = match ty.sty { - // uint and int are ffi-unsafe + // usize and isize are ffi-unsafe ty_uint(ast::TyUs) | ty_int(ast::TyIs) => { TC::ReachesFfiUnsafe } @@ -4292,7 +4292,7 @@ pub fn array_element_ty<'tcx>(tcx: &ctxt<'tcx>, ty: Ty<'tcx>) -> Option /// For an enum `t`, `variant` is None only if `t` is a univariant enum. pub fn positional_element_ty<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>, - i: uint, + i: usize, variant: Option) -> Option> { match (&ty.sty, variant) { @@ -4468,8 +4468,8 @@ pub fn pat_ty_opt<'tcx>(cx: &ctxt<'tcx>, pat: &ast::Pat) -> Option> { // adjustments. See `expr_ty_adjusted()` instead. // // NB (2): This type doesn't provide type parameter substitutions; e.g. if you -// ask for the type of "id" in "id(3)", it will return "fn(&int) -> int" -// instead of "fn(ty) -> T with T = int". +// ask for the type of "id" in "id(3)", it will return "fn(&isize) -> isize" +// instead of "fn(ty) -> T with T = isize". pub fn expr_ty<'tcx>(cx: &ctxt<'tcx>, expr: &ast::Expr) -> Ty<'tcx> { return node_id_to_type(cx, expr.id); } @@ -4879,7 +4879,7 @@ pub fn stmt_node_id(s: &ast::Stmt) -> ast::NodeId { } pub fn field_idx_strict(tcx: &ctxt, name: ast::Name, fields: &[field]) - -> uint { + -> usize { let mut i = 0; for f in fields { if f.name == name { return i; } i += 1; } tcx.sess.bug(&format!( @@ -4891,7 +4891,7 @@ pub fn field_idx_strict(tcx: &ctxt, name: ast::Name, fields: &[field]) } pub fn impl_or_trait_item_idx(id: ast::Name, trait_items: &[ImplOrTraitItem]) - -> Option { + -> Option { trait_items.iter().position(|m| m.name() == id) } @@ -5163,7 +5163,7 @@ fn lookup_locally_or_in_crate_store(descr: &str, v } -pub fn trait_item<'tcx>(cx: &ctxt<'tcx>, trait_did: ast::DefId, idx: uint) +pub fn trait_item<'tcx>(cx: &ctxt<'tcx>, trait_did: ast::DefId, idx: usize) -> ImplOrTraitItem<'tcx> { let method_def_id = (*ty::trait_item_def_ids(cx, trait_did))[idx].def_id(); impl_or_trait_item(cx, method_def_id) @@ -5238,10 +5238,10 @@ pub fn is_associated_type(cx: &ctxt, id: ast::DefId) -> bool { pub fn associated_type_parameter_index(cx: &ctxt, trait_def: &TraitDef, associated_type_id: ast::DefId) - -> uint { + -> usize { for type_parameter_def in trait_def.generics.types.iter() { if type_parameter_def.def_id == associated_type_id { - return type_parameter_def.index as uint + return type_parameter_def.index as usize } } cx.sess.bug("couldn't find associated type parameter index") @@ -5794,24 +5794,24 @@ pub fn closure_upvars<'tcx>(typer: &mc::Typer<'tcx>, pub fn is_binopable<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>, op: ast::BinOp) -> bool { #![allow(non_upper_case_globals)] - const tycat_other: int = 0; - const tycat_bool: int = 1; - const tycat_char: int = 2; - const tycat_int: int = 3; - const tycat_float: int = 4; - const tycat_raw_ptr: int = 6; - - const opcat_add: int = 0; - const opcat_sub: int = 1; - const opcat_mult: int = 2; - const opcat_shift: int = 3; - const opcat_rel: int = 4; - const opcat_eq: int = 5; - const opcat_bit: int = 6; - const opcat_logic: int = 7; - const opcat_mod: int = 8; - - fn opcat(op: ast::BinOp) -> int { + const tycat_other: isize = 0; + const tycat_bool: isize = 1; + const tycat_char: isize = 2; + const tycat_int: isize = 3; + const tycat_float: isize = 4; + const tycat_raw_ptr: isize = 6; + + const opcat_add: isize = 0; + const opcat_sub: isize = 1; + const opcat_mult: isize = 2; + const opcat_shift: isize = 3; + const opcat_rel: isize = 4; + const opcat_eq: isize = 5; + const opcat_bit: isize = 6; + const opcat_logic: isize = 7; + const opcat_mod: isize = 8; + + fn opcat(op: ast::BinOp) -> isize { match op.node { ast::BiAdd => opcat_add, ast::BiSub => opcat_sub, @@ -5834,7 +5834,7 @@ pub fn is_binopable<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>, op: ast::BinOp) -> bool } } - fn tycat<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> int { + fn tycat<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> isize { if type_is_simd(cx, ty) { return tycat(cx, simd_type(cx, ty)) } @@ -5856,21 +5856,21 @@ pub fn is_binopable<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>, op: ast::BinOp) -> bool /*other*/ [f, f, f, f, f, f, f, f, f], /*bool*/ [f, f, f, f, t, t, t, t, f], /*char*/ [f, f, f, f, t, t, f, f, f], - /*int*/ [t, t, t, t, t, t, t, f, t], + /*isize*/ [t, t, t, t, t, t, t, f, t], /*float*/ [t, t, t, f, t, t, f, f, f], /*bot*/ [t, t, t, t, t, t, t, t, t], /*raw ptr*/ [f, f, f, f, t, t, f, f, f]]; - return tbl[tycat(cx, ty) as uint ][opcat(op) as uint]; + return tbl[tycat(cx, ty) as usize ][opcat(op) as usize]; } // Returns the repeat count for a repeating vector expression. -pub fn eval_repeat_count(tcx: &ctxt, count_expr: &ast::Expr) -> uint { - match const_eval::eval_const_expr_partial(tcx, count_expr, Some(tcx.types.uint)) { +pub fn eval_repeat_count(tcx: &ctxt, count_expr: &ast::Expr) -> usize { + match const_eval::eval_const_expr_partial(tcx, count_expr, Some(tcx.types.usize)) { Ok(val) => { let found = match val { - const_eval::const_uint(count) => return count as uint, - const_eval::const_int(count) if count >= 0 => return count as uint, + const_eval::const_uint(count) => return count as usize, + const_eval::const_int(count) if count >= 0 => return count as usize, const_eval::const_int(_) => "negative integer", const_eval::const_float(_) => "float", const_eval::const_str(_) => "string", @@ -6739,7 +6739,7 @@ pub fn liberate_late_bound_regions<'tcx, T>( pub fn count_late_bound_regions<'tcx, T>( tcx: &ty::ctxt<'tcx>, value: &Binder) - -> uint + -> usize where T : TypeFoldable<'tcx> + Repr<'tcx> { let (_, skol_map) = replace_late_bound_regions(tcx, value, |_| ty::ReStatic); @@ -6785,8 +6785,8 @@ pub fn erase_late_bound_regions<'tcx, T>( /// /// The chief purpose of this function is to canonicalize regions so that two /// `FnSig`s or `TraitRef`s which are equivalent up to region naming will become -/// structurally identical. For example, `for<'a, 'b> fn(&'a int, &'b int)` and -/// `for<'a, 'b> fn(&'b int, &'a int)` will become identical after anonymization. +/// structurally identical. For example, `for<'a, 'b> fn(&'a isize, &'b isize)` and +/// `for<'a, 'b> fn(&'b isize, &'a isize)` will become identical after anonymization. pub fn anonymize_late_bound_regions<'tcx, T>( tcx: &ctxt<'tcx>, sig: &Binder) diff --git a/src/librustc/middle/ty_walk.rs b/src/librustc/middle/ty_walk.rs index 1069d1282ea..5d492f1c95e 100644 --- a/src/librustc/middle/ty_walk.rs +++ b/src/librustc/middle/ty_walk.rs @@ -15,7 +15,7 @@ use std::iter::Iterator; pub struct TypeWalker<'tcx> { stack: Vec>, - last_subtree: uint, + last_subtree: usize, } impl<'tcx> TypeWalker<'tcx> { @@ -80,14 +80,14 @@ impl<'tcx> TypeWalker<'tcx> { /// Skips the subtree of types corresponding to the last type /// returned by `next()`. /// - /// Example: Imagine you are walking `Foo, uint>`. + /// Example: Imagine you are walking `Foo, usize>`. /// /// ``` /// let mut iter: TypeWalker = ...; /// iter.next(); // yields Foo /// iter.next(); // yields Bar /// iter.skip_current_subtree(); // skips int - /// iter.next(); // yields uint + /// iter.next(); // yields usize /// ``` pub fn skip_current_subtree(&mut self) { self.stack.truncate(self.last_subtree); diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs index a7c67a08631..1f0431d8c4f 100644 --- a/src/librustc/session/config.rs +++ b/src/librustc/session/config.rs @@ -440,14 +440,14 @@ macro_rules! options { } } - fn parse_uint(slot: &mut uint, v: Option<&str>) -> bool { + fn parse_uint(slot: &mut usize, v: Option<&str>) -> bool { match v.and_then(|s| s.parse().ok()) { Some(i) => { *slot = i; true }, None => false } } - fn parse_opt_uint(slot: &mut Option, v: Option<&str>) -> bool { + fn parse_opt_uint(slot: &mut Option, v: Option<&str>) -> bool { match v { Some(s) => { *slot = s.parse().ok(); slot.is_some() } None => { *slot = None; true } @@ -519,16 +519,16 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options, "metadata to mangle symbol names with"), extra_filename: String = ("".to_string(), parse_string, "extra data to put in each output filename"), - codegen_units: uint = (1, parse_uint, + codegen_units: usize = (1, parse_uint, "divide crate into N units to optimize in parallel"), remark: Passes = (SomePasses(Vec::new()), parse_passes, "print remarks for these optimization passes (space separated, or \"all\")"), no_stack_check: bool = (false, parse_bool, "disable checks for stack exhaustion (a memory-safety hazard!)"), - debuginfo: Option = (None, parse_opt_uint, + debuginfo: Option = (None, parse_opt_uint, "debug info emission level, 0 = no debug info, 1 = line tables only, \ 2 = full debug info with variable and type information"), - opt_level: Option = (None, parse_opt_uint, + opt_level: Option = (None, parse_opt_uint, "Optimize with possible levels 0-3"), debug_assertions: Option = (None, parse_opt_bool, "explicitly enable the cfg(debug_assertions) directive"), diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs index 8bc842671a0..3e3e5e17963 100644 --- a/src/librustc/session/mod.rs +++ b/src/librustc/session/mod.rs @@ -58,7 +58,7 @@ pub struct Session { /// The maximum recursion limit for potentially infinitely recursive /// operations such as auto-dereference and monomorphization. - pub recursion_limit: Cell, + pub recursion_limit: Cell, pub can_print_warnings: bool } @@ -106,7 +106,7 @@ impl Session { } self.diagnostic().handler().err(msg) } - pub fn err_count(&self) -> uint { + pub fn err_count(&self) -> usize { self.diagnostic().handler().err_count() } pub fn has_errors(&self) -> bool { diff --git a/src/librustc/util/common.rs b/src/librustc/util/common.rs index 38502e3c102..60ae053dbaf 100644 --- a/src/librustc/util/common.rs +++ b/src/librustc/util/common.rs @@ -35,7 +35,7 @@ pub struct ErrorReported; pub fn time(do_it: bool, what: &str, u: U, f: F) -> T where F: FnOnce(U) -> T, { - thread_local!(static DEPTH: Cell = Cell::new(0)); + thread_local!(static DEPTH: Cell = Cell::new(0)); if !do_it { return f(u); } let old = DEPTH.with(|slot| { @@ -196,10 +196,10 @@ pub fn can_reach(edges_map: &HashMap, S>, source: T, /// # Examples /// ``` /// struct Context { -/// cache: RefCell> +/// cache: RefCell> /// } /// -/// fn factorial(ctxt: &Context, n: uint) -> uint { +/// fn factorial(ctxt: &Context, n: usize) -> usize { /// memoized(&ctxt.cache, n, |n| match n { /// 0 | 1 => n, /// _ => factorial(ctxt, n - 2) + factorial(ctxt, n - 1) diff --git a/src/librustc/util/lev_distance.rs b/src/librustc/util/lev_distance.rs index d3b9b07ea41..28f8510ce3f 100644 --- a/src/librustc/util/lev_distance.rs +++ b/src/librustc/util/lev_distance.rs @@ -10,7 +10,7 @@ use std::cmp; -pub fn lev_distance(me: &str, t: &str) -> uint { +pub fn lev_distance(me: &str, t: &str) -> usize { if me.is_empty() { return t.chars().count(); } if t.is_empty() { return me.chars().count(); } diff --git a/src/librustc/util/snapshot_vec.rs b/src/librustc/util/snapshot_vec.rs index 8fbc682246f..d2e0b3aec2f 100644 --- a/src/librustc/util/snapshot_vec.rs +++ b/src/librustc/util/snapshot_vec.rs @@ -30,10 +30,10 @@ pub enum UndoLog { CommittedSnapshot, /// New variable with given index was created. - NewElem(uint), + NewElem(usize), /// Variable with given index was changed *from* the given value. - SetElem(uint, D::Value), + SetElem(usize, D::Value), /// Extensible set of actions Other(D::Undo) @@ -48,7 +48,7 @@ pub struct SnapshotVec { // Snapshots are tokens that should be created/consumed linearly. pub struct Snapshot { // Length of the undo log at the time the snapshot was taken. - length: uint, + length: usize, } pub trait SnapshotVecDelegate { @@ -77,7 +77,7 @@ impl SnapshotVec { } } - pub fn push(&mut self, elem: D::Value) -> uint { + pub fn push(&mut self, elem: D::Value) -> usize { let len = self.values.len(); self.values.push(elem); @@ -88,20 +88,20 @@ impl SnapshotVec { len } - pub fn get<'a>(&'a self, index: uint) -> &'a D::Value { + pub fn get<'a>(&'a self, index: usize) -> &'a D::Value { &self.values[index] } /// Returns a mutable pointer into the vec; whatever changes you make here cannot be undone /// automatically, so you should be sure call `record()` with some sort of suitable undo /// action. - pub fn get_mut<'a>(&'a mut self, index: uint) -> &'a mut D::Value { + pub fn get_mut<'a>(&'a mut self, index: usize) -> &'a mut D::Value { &mut self.values[index] } /// Updates the element at the given index. The old value will saved (and perhaps restored) if /// a snapshot is active. - pub fn set(&mut self, index: uint, new_elem: D::Value) { + pub fn set(&mut self, index: usize, new_elem: D::Value) { let old_elem = mem::replace(&mut self.values[index], new_elem); if self.in_snapshot() { self.undo_log.push(SetElem(index, old_elem)); diff --git a/src/librustc_back/abi.rs b/src/librustc_back/abi.rs index 4b9064aaa05..c3a3a8d582a 100644 --- a/src/librustc_back/abi.rs +++ b/src/librustc_back/abi.rs @@ -8,17 +8,17 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub const BOX_FIELD_DROP_GLUE: uint = 1; -pub const BOX_FIELD_BODY: uint = 4; +pub const BOX_FIELD_DROP_GLUE: usize = 1; +pub const BOX_FIELD_BODY: usize = 4; /// The first half of a fat pointer. /// - For a closure, this is the code address. /// - For an object or trait instance, this is the address of the box. /// - For a slice, this is the base address. -pub const FAT_PTR_ADDR: uint = 0; +pub const FAT_PTR_ADDR: usize = 0; /// The second half of a fat pointer. /// - For a closure, this is the address of the environment. /// - For an object or trait instance, this is the address of the vtable. /// - For a slice, this is the length. -pub const FAT_PTR_EXTRA: uint = 1; +pub const FAT_PTR_EXTRA: usize = 1; diff --git a/src/librustc_back/archive.rs b/src/librustc_back/archive.rs index 2cc51a723f2..9f5751c421e 100644 --- a/src/librustc_back/archive.rs +++ b/src/librustc_back/archive.rs @@ -246,7 +246,7 @@ impl<'a> ArchiveBuilder<'a> { // Don't allow the total size of `args` to grow beyond 32,000 bytes. // Windows will raise an error if the argument string is longer than // 32,768, and we leave a bit of extra space for the program name. - const ARG_LENGTH_LIMIT: uint = 32_000; + const ARG_LENGTH_LIMIT: usize = 32_000; for member_name in &self.members { let len = member_name.to_string_lossy().len(); diff --git a/src/librustc_back/lib.rs b/src/librustc_back/lib.rs index f7ee76c0a43..fe457841e91 100644 --- a/src/librustc_back/lib.rs +++ b/src/librustc_back/lib.rs @@ -36,7 +36,6 @@ #![feature(collections)] #![feature(core)] #![feature(old_fs)] -#![feature(int_uint)] #![feature(io)] #![feature(old_io)] #![feature(old_path)] diff --git a/src/librustc_back/sha2.rs b/src/librustc_back/sha2.rs index 1a399519296..c7049f750fc 100644 --- a/src/librustc_back/sha2.rs +++ b/src/librustc_back/sha2.rs @@ -90,29 +90,29 @@ trait FixedBuffer { /// Zero the buffer up until the specified index. The buffer position currently must not be /// greater than that index. - fn zero_until(&mut self, idx: uint); + fn zero_until(&mut self, idx: usize); /// Get a slice of the buffer of the specified size. There must be at least that many bytes /// remaining in the buffer. - fn next<'s>(&'s mut self, len: uint) -> &'s mut [u8]; + fn next<'s>(&'s mut self, len: usize) -> &'s mut [u8]; /// Get the current buffer. The buffer must already be full. This clears the buffer as well. fn full_buffer<'s>(&'s mut self) -> &'s [u8]; /// Get the current position of the buffer. - fn position(&self) -> uint; + fn position(&self) -> usize; /// Get the number of bytes remaining in the buffer until it is full. - fn remaining(&self) -> uint; + fn remaining(&self) -> usize; /// Get the size of the buffer - fn size(&self) -> uint; + fn size(&self) -> usize; } /// A FixedBuffer of 64 bytes useful for implementing Sha256 which has a 64 byte blocksize. struct FixedBuffer64 { buffer: [u8; 64], - buffer_idx: uint, + buffer_idx: usize, } impl FixedBuffer64 { @@ -174,13 +174,13 @@ impl FixedBuffer for FixedBuffer64 { self.buffer_idx = 0; } - fn zero_until(&mut self, idx: uint) { + fn zero_until(&mut self, idx: usize) { assert!(idx >= self.buffer_idx); self.buffer[self.buffer_idx..idx].set_memory(0); self.buffer_idx = idx; } - fn next<'s>(&'s mut self, len: uint) -> &'s mut [u8] { + fn next<'s>(&'s mut self, len: usize) -> &'s mut [u8] { self.buffer_idx += len; return &mut self.buffer[self.buffer_idx - len..self.buffer_idx]; } @@ -191,11 +191,11 @@ impl FixedBuffer for FixedBuffer64 { return &self.buffer[..64]; } - fn position(&self) -> uint { self.buffer_idx } + fn position(&self) -> usize { self.buffer_idx } - fn remaining(&self) -> uint { 64 - self.buffer_idx } + fn remaining(&self) -> usize { 64 - self.buffer_idx } - fn size(&self) -> uint { 64 } + fn size(&self) -> usize { 64 } } /// The StandardPadding trait adds a method useful for Sha256 to a FixedBuffer struct. @@ -204,11 +204,11 @@ trait StandardPadding { /// guaranteed to have exactly rem remaining bytes when it returns. If there are not at least /// rem bytes available, the buffer will be zero padded, processed, cleared, and then filled /// with zeros again until only rem bytes are remaining. - fn standard_padding(&mut self, rem: uint, func: F) where F: FnMut(&[u8]); + fn standard_padding(&mut self, rem: usize, func: F) where F: FnMut(&[u8]); } impl StandardPadding for T { - fn standard_padding(&mut self, rem: uint, mut func: F) where F: FnMut(&[u8]) { + fn standard_padding(&mut self, rem: usize, mut func: F) where F: FnMut(&[u8]) { let size = self.size(); self.next(1)[0] = 128; @@ -244,7 +244,7 @@ pub trait Digest { fn reset(&mut self); /// Get the output size in bits. - fn output_bits(&self) -> uint; + fn output_bits(&self) -> usize; /// Convenience function that feeds a string into a digest. /// @@ -514,7 +514,7 @@ impl Digest for Sha256 { self.engine.reset(&H256); } - fn output_bits(&self) -> uint { 256 } + fn output_bits(&self) -> usize { 256 } } static H256: [u32; 8] = [ @@ -613,7 +613,7 @@ mod tests { /// Feed 1,000,000 'a's into the digest with varying input sizes and check that the result is /// correct. - fn test_digest_1million_random(digest: &mut D, blocksize: uint, expected: &str) { + fn test_digest_1million_random(digest: &mut D, blocksize: usize, expected: &str) { let total_size = 1000000; let buffer: Vec = repeat('a' as u8).take(blocksize * 2).collect(); let mut rng = IsaacRng::new_unseeded(); @@ -622,7 +622,7 @@ mod tests { digest.reset(); while count < total_size { - let next: uint = rng.gen_range(0, 2 * blocksize + 1); + let next: usize = rng.gen_range(0, 2 * blocksize + 1); let remaining = total_size - count; let size = if next > remaining { remaining } else { next }; digest.input(&buffer[..size]); diff --git a/src/librustc_back/svh.rs b/src/librustc_back/svh.rs index 5aae0e9dbdc..f9416d53a8f 100644 --- a/src/librustc_back/svh.rs +++ b/src/librustc_back/svh.rs @@ -221,7 +221,7 @@ mod svh_visitor { SawExprLoop(Option), SawExprField(token::InternedString), - SawExprTupField(uint), + SawExprTupField(usize), SawExprBreak(Option), SawExprAgain(Option), diff --git a/src/librustc_back/tempdir.rs b/src/librustc_back/tempdir.rs index 0e87ba278db..d4503ae7fc9 100644 --- a/src/librustc_back/tempdir.rs +++ b/src/librustc_back/tempdir.rs @@ -27,7 +27,7 @@ const NUM_RETRIES: u32 = 1 << 31; // be enough to dissuade an attacker from trying to preemptively create names // of that length, but not so huge that we unnecessarily drain the random number // generator of entropy. -const NUM_RAND_CHARS: uint = 12; +const NUM_RAND_CHARS: usize = 12; impl TempDir { /// Attempts to make a temporary directory inside of `tmpdir` whose name diff --git a/src/librustc_borrowck/borrowck/check_loans.rs b/src/librustc_borrowck/borrowck/check_loans.rs index 23ca5b63681..f268a957fe8 100644 --- a/src/librustc_borrowck/borrowck/check_loans.rs +++ b/src/librustc_borrowck/borrowck/check_loans.rs @@ -335,7 +335,7 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> { return true; } - pub fn loans_generated_by(&self, scope: region::CodeExtent) -> Vec { + pub fn loans_generated_by(&self, scope: region::CodeExtent) -> Vec { //! Returns a vector of the loans that are generated as //! we enter `scope`. @@ -727,7 +727,7 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> { /// let a: int; /// a = 10; // ok, even though a is uninitialized /// - /// struct Point { x: uint, y: uint } + /// struct Point { x: usize, y: usize } /// let p: Point; /// p.x = 22; // ok, even though `p` is uninitialized /// diff --git a/src/librustc_borrowck/borrowck/mod.rs b/src/librustc_borrowck/borrowck/mod.rs index b176d8d4118..b5ceff6124d 100644 --- a/src/librustc_borrowck/borrowck/mod.rs +++ b/src/librustc_borrowck/borrowck/mod.rs @@ -88,7 +88,7 @@ pub fn check_crate(tcx: &ty::ctxt) { make_stat(&bccx, bccx.stats.stable_paths)); } - fn make_stat(bccx: &BorrowckCtxt, stat: uint) -> String { + fn make_stat(bccx: &BorrowckCtxt, stat: usize) -> String { let total = bccx.stats.guaranteed_paths as f64; let perc = if total == 0.0 { 0.0 } else { stat as f64 * 100.0 / total }; format!("{} ({:.0}%)", stat, perc) @@ -238,10 +238,10 @@ pub struct BorrowckCtxt<'a, 'tcx: 'a> { } struct BorrowStats { - loaned_paths_same: uint, - loaned_paths_imm: uint, - stable_paths: uint, - guaranteed_paths: uint + loaned_paths_same: usize, + loaned_paths_imm: usize, + stable_paths: usize, + guaranteed_paths: usize } pub type BckResult<'tcx, T> = Result>; @@ -251,7 +251,7 @@ pub type BckResult<'tcx, T> = Result>; /// Record of a loan that was issued. pub struct Loan<'tcx> { - index: uint, + index: usize, loan_path: Rc>, kind: ty::BorrowKind, restricted_paths: Vec>>, @@ -382,7 +382,7 @@ impl<'tcx> LoanPath<'tcx> { } } - fn depth(&self) -> uint { + fn depth(&self) -> usize { match self.kind { LpExtend(ref base, _, LpDeref(_)) => base.depth(), LpExtend(ref base, _, LpInterior(_)) => base.depth() + 1, @@ -1043,7 +1043,7 @@ fn is_statement_scope(tcx: &ty::ctxt, region: ty::Region) -> bool { impl BitwiseOperator for LoanDataFlowOperator { #[inline] - fn join(&self, succ: uint, pred: uint) -> uint { + fn join(&self, succ: usize, pred: usize) -> usize { succ | pred // loans from both preds are in scope } } diff --git a/src/librustc_borrowck/borrowck/move_data.rs b/src/librustc_borrowck/borrowck/move_data.rs index 2834fce5278..a4470acbe4d 100644 --- a/src/librustc_borrowck/borrowck/move_data.rs +++ b/src/librustc_borrowck/borrowck/move_data.rs @@ -76,10 +76,10 @@ pub struct FlowedMoveData<'a, 'tcx: 'a> { /// Index into `MoveData.paths`, used like a pointer #[derive(Copy, PartialEq, Eq, PartialOrd, Ord, Debug)] -pub struct MovePathIndex(uint); +pub struct MovePathIndex(usize); impl MovePathIndex { - fn get(&self) -> uint { + fn get(&self) -> usize { let MovePathIndex(v) = *self; v } } @@ -95,10 +95,10 @@ const InvalidMovePathIndex: MovePathIndex = MovePathIndex(usize::MAX); /// Index into `MoveData.moves`, used like a pointer #[derive(Copy, PartialEq)] -pub struct MoveIndex(uint); +pub struct MoveIndex(usize); impl MoveIndex { - fn get(&self) -> uint { + fn get(&self) -> usize { let MoveIndex(v) = *self; v } } @@ -740,7 +740,7 @@ impl<'a, 'tcx> FlowedMoveData<'a, 'tcx> { impl BitwiseOperator for MoveDataFlowOperator { #[inline] - fn join(&self, succ: uint, pred: uint) -> uint { + fn join(&self, succ: usize, pred: usize) -> usize { succ | pred // moves from both preds are in scope } } @@ -754,7 +754,7 @@ impl DataFlowOperator for MoveDataFlowOperator { impl BitwiseOperator for AssignDataFlowOperator { #[inline] - fn join(&self, succ: uint, pred: uint) -> uint { + fn join(&self, succ: usize, pred: usize) -> usize { succ | pred // moves from both preds are in scope } } diff --git a/src/librustc_borrowck/graphviz.rs b/src/librustc_borrowck/graphviz.rs index a2c9930c0ed..624a95c2906 100644 --- a/src/librustc_borrowck/graphviz.rs +++ b/src/librustc_borrowck/graphviz.rs @@ -79,7 +79,7 @@ impl<'a, 'tcx> DataflowLabeller<'a, 'tcx> { cfgidx: CFGIndex, dfcx: &DataFlowContext<'a, 'tcx, O>, mut to_lp: F) -> String where - F: FnMut(uint) -> Rc>, + F: FnMut(usize) -> Rc>, { let mut saw_some = false; let mut set = "{".to_string(); diff --git a/src/librustc_borrowck/lib.rs b/src/librustc_borrowck/lib.rs index e927ea5b86c..fbbd20d6dc7 100644 --- a/src/librustc_borrowck/lib.rs +++ b/src/librustc_borrowck/lib.rs @@ -22,7 +22,6 @@ #![allow(non_camel_case_types)] #![feature(core)] -#![feature(int_uint)] #![feature(quote)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index 5e6f2fb835b..756a575523f 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -28,7 +28,6 @@ #![feature(box_syntax)] #![feature(collections)] #![feature(core)] -#![feature(int_uint)] #![feature(libc)] #![feature(quote)] #![feature(rustc_diagnostic_macros)] @@ -101,7 +100,7 @@ const BUG_REPORT_URL: &'static str = "https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports"; -pub fn run(args: Vec) -> int { +pub fn run(args: Vec) -> isize { monitor(move || run_compiler(&args, &mut RustcDefaultCalls)); 0 } @@ -795,7 +794,7 @@ fn parse_crate_attrs(sess: &Session, input: &Input) -> /// errors of the compiler. #[allow(deprecated)] pub fn monitor(f: F) { - const STACK_SIZE: uint = 8 * 1024 * 1024; // 8MB + const STACK_SIZE: usize = 8 * 1024 * 1024; // 8MB struct Sink(Arc>>); impl Write for Sink { diff --git a/src/librustc_driver/test.rs b/src/librustc_driver/test.rs index 23f07c8e25c..fcb0b9bdd3c 100644 --- a/src/librustc_driver/test.rs +++ b/src/librustc_driver/test.rs @@ -88,13 +88,13 @@ impl Emitter for ExpectErrorEmitter { } } -fn errors(msgs: &[&str]) -> (Box, uint) { +fn errors(msgs: &[&str]) -> (Box, usize) { let v = msgs.iter().map(|m| m.to_string()).collect(); (box ExpectErrorEmitter { messages: v } as Box, msgs.len()) } fn test_env(source_string: &str, - (emitter, expected_err_count): (Box, uint), + (emitter, expected_err_count): (Box, usize), body: F) where F: FnOnce(Env), { @@ -178,7 +178,7 @@ impl<'a, 'tcx> Env<'a, 'tcx> { fn search_mod(this: &Env, m: &ast::Mod, - idx: uint, + idx: usize, names: &[String]) -> Option { assert!(idx < names.len()); @@ -192,7 +192,7 @@ impl<'a, 'tcx> Env<'a, 'tcx> { fn search(this: &Env, it: &ast::Item, - idx: uint, + idx: usize, names: &[String]) -> Option { if idx == names.len() { @@ -300,14 +300,14 @@ impl<'a, 'tcx> Env<'a, 'tcx> { pub fn t_rptr(&self, r: ty::Region) -> Ty<'tcx> { ty::mk_imm_rptr(self.infcx.tcx, self.infcx.tcx.mk_region(r), - self.tcx().types.int) + self.tcx().types.isize) } pub fn t_rptr_late_bound(&self, id: u32) -> Ty<'tcx> { let r = self.re_late_bound_with_debruijn(id, ty::DebruijnIndex::new(1)); ty::mk_imm_rptr(self.infcx.tcx, self.infcx.tcx.mk_region(r), - self.tcx().types.int) + self.tcx().types.isize) } pub fn t_rptr_late_bound_with_debruijn(&self, @@ -317,13 +317,13 @@ impl<'a, 'tcx> Env<'a, 'tcx> { let r = self.re_late_bound_with_debruijn(id, debruijn); ty::mk_imm_rptr(self.infcx.tcx, self.infcx.tcx.mk_region(r), - self.tcx().types.int) + self.tcx().types.isize) } pub fn t_rptr_scope(&self, id: ast::NodeId) -> Ty<'tcx> { let r = ty::ReScope(CodeExtent::from_node_id(id)); ty::mk_imm_rptr(self.infcx.tcx, self.infcx.tcx.mk_region(r), - self.tcx().types.int) + self.tcx().types.isize) } pub fn re_free(&self, nid: ast::NodeId, id: u32) -> ty::Region { @@ -335,13 +335,13 @@ impl<'a, 'tcx> Env<'a, 'tcx> { let r = self.re_free(nid, id); ty::mk_imm_rptr(self.infcx.tcx, self.infcx.tcx.mk_region(r), - self.tcx().types.int) + self.tcx().types.isize) } pub fn t_rptr_static(&self) -> Ty<'tcx> { ty::mk_imm_rptr(self.infcx.tcx, self.infcx.tcx.mk_region(ty::ReStatic), - self.tcx().types.int) + self.tcx().types.isize) } pub fn dummy_type_trace(&self) -> infer::TypeTrace<'tcx> { @@ -464,15 +464,15 @@ fn contravariant_region_ptr_err() { fn sub_free_bound_false() { //! Test that: //! - //! fn(&'a int) <: for<'b> fn(&'b int) + //! fn(&'a isize) <: for<'b> fn(&'b isize) //! //! does NOT hold. test_env(EMPTY_SOURCE_STR, errors(&[]), |env| { let t_rptr_free1 = env.t_rptr_free(0, 1); let t_rptr_bound1 = env.t_rptr_late_bound(1); - env.check_not_sub(env.t_fn(&[t_rptr_free1], env.tcx().types.int), - env.t_fn(&[t_rptr_bound1], env.tcx().types.int)); + env.check_not_sub(env.t_fn(&[t_rptr_free1], env.tcx().types.isize), + env.t_fn(&[t_rptr_bound1], env.tcx().types.isize)); }) } @@ -480,15 +480,15 @@ fn sub_free_bound_false() { fn sub_bound_free_true() { //! Test that: //! - //! for<'a> fn(&'a int) <: fn(&'b int) + //! for<'a> fn(&'a isize) <: fn(&'b isize) //! //! DOES hold. test_env(EMPTY_SOURCE_STR, errors(&[]), |env| { let t_rptr_bound1 = env.t_rptr_late_bound(1); let t_rptr_free1 = env.t_rptr_free(0, 1); - env.check_sub(env.t_fn(&[t_rptr_bound1], env.tcx().types.int), - env.t_fn(&[t_rptr_free1], env.tcx().types.int)); + env.check_sub(env.t_fn(&[t_rptr_bound1], env.tcx().types.isize), + env.t_fn(&[t_rptr_free1], env.tcx().types.isize)); }) } @@ -496,15 +496,15 @@ fn sub_bound_free_true() { fn sub_free_bound_false_infer() { //! Test that: //! - //! fn(_#1) <: for<'b> fn(&'b int) + //! fn(_#1) <: for<'b> fn(&'b isize) //! //! does NOT hold for any instantiation of `_#1`. test_env(EMPTY_SOURCE_STR, errors(&[]), |env| { let t_infer1 = env.infcx.next_ty_var(); let t_rptr_bound1 = env.t_rptr_late_bound(1); - env.check_not_sub(env.t_fn(&[t_infer1], env.tcx().types.int), - env.t_fn(&[t_rptr_bound1], env.tcx().types.int)); + env.check_not_sub(env.t_fn(&[t_infer1], env.tcx().types.isize), + env.t_fn(&[t_rptr_bound1], env.tcx().types.isize)); }) } @@ -512,19 +512,19 @@ fn sub_free_bound_false_infer() { fn lub_free_bound_infer() { //! Test result of: //! - //! LUB(fn(_#1), for<'b> fn(&'b int)) + //! LUB(fn(_#1), for<'b> fn(&'b isize)) //! - //! This should yield `fn(&'_ int)`. We check - //! that it yields `fn(&'x int)` for some free `'x`, + //! This should yield `fn(&'_ isize)`. We check + //! that it yields `fn(&'x isize)` for some free `'x`, //! anyhow. test_env(EMPTY_SOURCE_STR, errors(&[]), |env| { let t_infer1 = env.infcx.next_ty_var(); let t_rptr_bound1 = env.t_rptr_late_bound(1); let t_rptr_free1 = env.t_rptr_free(0, 1); - env.check_lub(env.t_fn(&[t_infer1], env.tcx().types.int), - env.t_fn(&[t_rptr_bound1], env.tcx().types.int), - env.t_fn(&[t_rptr_free1], env.tcx().types.int)); + env.check_lub(env.t_fn(&[t_infer1], env.tcx().types.isize), + env.t_fn(&[t_rptr_bound1], env.tcx().types.isize), + env.t_fn(&[t_rptr_free1], env.tcx().types.isize)); }); } @@ -533,9 +533,9 @@ fn lub_bound_bound() { test_env(EMPTY_SOURCE_STR, errors(&[]), |env| { let t_rptr_bound1 = env.t_rptr_late_bound(1); let t_rptr_bound2 = env.t_rptr_late_bound(2); - env.check_lub(env.t_fn(&[t_rptr_bound1], env.tcx().types.int), - env.t_fn(&[t_rptr_bound2], env.tcx().types.int), - env.t_fn(&[t_rptr_bound1], env.tcx().types.int)); + env.check_lub(env.t_fn(&[t_rptr_bound1], env.tcx().types.isize), + env.t_fn(&[t_rptr_bound2], env.tcx().types.isize), + env.t_fn(&[t_rptr_bound1], env.tcx().types.isize)); }) } @@ -544,9 +544,9 @@ fn lub_bound_free() { test_env(EMPTY_SOURCE_STR, errors(&[]), |env| { let t_rptr_bound1 = env.t_rptr_late_bound(1); let t_rptr_free1 = env.t_rptr_free(0, 1); - env.check_lub(env.t_fn(&[t_rptr_bound1], env.tcx().types.int), - env.t_fn(&[t_rptr_free1], env.tcx().types.int), - env.t_fn(&[t_rptr_free1], env.tcx().types.int)); + env.check_lub(env.t_fn(&[t_rptr_bound1], env.tcx().types.isize), + env.t_fn(&[t_rptr_free1], env.tcx().types.isize), + env.t_fn(&[t_rptr_free1], env.tcx().types.isize)); }) } @@ -555,9 +555,9 @@ fn lub_bound_static() { test_env(EMPTY_SOURCE_STR, errors(&[]), |env| { let t_rptr_bound1 = env.t_rptr_late_bound(1); let t_rptr_static = env.t_rptr_static(); - env.check_lub(env.t_fn(&[t_rptr_bound1], env.tcx().types.int), - env.t_fn(&[t_rptr_static], env.tcx().types.int), - env.t_fn(&[t_rptr_static], env.tcx().types.int)); + env.check_lub(env.t_fn(&[t_rptr_bound1], env.tcx().types.isize), + env.t_fn(&[t_rptr_static], env.tcx().types.isize), + env.t_fn(&[t_rptr_static], env.tcx().types.isize)); }) } @@ -578,9 +578,9 @@ fn lub_free_free() { let t_rptr_free1 = env.t_rptr_free(0, 1); let t_rptr_free2 = env.t_rptr_free(0, 2); let t_rptr_static = env.t_rptr_static(); - env.check_lub(env.t_fn(&[t_rptr_free1], env.tcx().types.int), - env.t_fn(&[t_rptr_free2], env.tcx().types.int), - env.t_fn(&[t_rptr_static], env.tcx().types.int)); + env.check_lub(env.t_fn(&[t_rptr_free1], env.tcx().types.isize), + env.t_fn(&[t_rptr_free2], env.tcx().types.isize), + env.t_fn(&[t_rptr_static], env.tcx().types.isize)); }) } @@ -603,9 +603,9 @@ fn glb_free_free_with_common_scope() { let t_rptr_free1 = env.t_rptr_free(0, 1); let t_rptr_free2 = env.t_rptr_free(0, 2); let t_rptr_scope = env.t_rptr_scope(0); - env.check_glb(env.t_fn(&[t_rptr_free1], env.tcx().types.int), - env.t_fn(&[t_rptr_free2], env.tcx().types.int), - env.t_fn(&[t_rptr_scope], env.tcx().types.int)); + env.check_glb(env.t_fn(&[t_rptr_free1], env.tcx().types.isize), + env.t_fn(&[t_rptr_free2], env.tcx().types.isize), + env.t_fn(&[t_rptr_scope], env.tcx().types.isize)); }) } @@ -614,9 +614,9 @@ fn glb_bound_bound() { test_env(EMPTY_SOURCE_STR, errors(&[]), |env| { let t_rptr_bound1 = env.t_rptr_late_bound(1); let t_rptr_bound2 = env.t_rptr_late_bound(2); - env.check_glb(env.t_fn(&[t_rptr_bound1], env.tcx().types.int), - env.t_fn(&[t_rptr_bound2], env.tcx().types.int), - env.t_fn(&[t_rptr_bound1], env.tcx().types.int)); + env.check_glb(env.t_fn(&[t_rptr_bound1], env.tcx().types.isize), + env.t_fn(&[t_rptr_bound2], env.tcx().types.isize), + env.t_fn(&[t_rptr_bound1], env.tcx().types.isize)); }) } @@ -625,9 +625,9 @@ fn glb_bound_free() { test_env(EMPTY_SOURCE_STR, errors(&[]), |env| { let t_rptr_bound1 = env.t_rptr_late_bound(1); let t_rptr_free1 = env.t_rptr_free(0, 1); - env.check_glb(env.t_fn(&[t_rptr_bound1], env.tcx().types.int), - env.t_fn(&[t_rptr_free1], env.tcx().types.int), - env.t_fn(&[t_rptr_bound1], env.tcx().types.int)); + env.check_glb(env.t_fn(&[t_rptr_bound1], env.tcx().types.isize), + env.t_fn(&[t_rptr_free1], env.tcx().types.isize), + env.t_fn(&[t_rptr_bound1], env.tcx().types.isize)); }) } @@ -637,14 +637,14 @@ fn glb_bound_free_infer() { let t_rptr_bound1 = env.t_rptr_late_bound(1); let t_infer1 = env.infcx.next_ty_var(); - // compute GLB(fn(_) -> int, for<'b> fn(&'b int) -> int), - // which should yield for<'b> fn(&'b int) -> int - env.check_glb(env.t_fn(&[t_rptr_bound1], env.tcx().types.int), - env.t_fn(&[t_infer1], env.tcx().types.int), - env.t_fn(&[t_rptr_bound1], env.tcx().types.int)); + // compute GLB(fn(_) -> isize, for<'b> fn(&'b isize) -> isize), + // which should yield for<'b> fn(&'b isize) -> isize + env.check_glb(env.t_fn(&[t_rptr_bound1], env.tcx().types.isize), + env.t_fn(&[t_infer1], env.tcx().types.isize), + env.t_fn(&[t_rptr_bound1], env.tcx().types.isize)); // as a side-effect, computing GLB should unify `_` with - // `&'_ int` + // `&'_ isize` let t_resolve1 = env.infcx.shallow_resolve(t_infer1); match t_resolve1.sty { ty::ty_rptr(..) => { } @@ -658,9 +658,9 @@ fn glb_bound_static() { test_env(EMPTY_SOURCE_STR, errors(&[]), |env| { let t_rptr_bound1 = env.t_rptr_late_bound(1); let t_rptr_static = env.t_rptr_static(); - env.check_glb(env.t_fn(&[t_rptr_bound1], env.tcx().types.int), - env.t_fn(&[t_rptr_static], env.tcx().types.int), - env.t_fn(&[t_rptr_bound1], env.tcx().types.int)); + env.check_glb(env.t_fn(&[t_rptr_bound1], env.tcx().types.isize), + env.t_fn(&[t_rptr_static], env.tcx().types.isize), + env.t_fn(&[t_rptr_bound1], env.tcx().types.isize)); }) } @@ -684,7 +684,7 @@ fn subst_ty_renumber_bound() { let substs = subst::Substs::new_type(vec![t_rptr_bound1], vec![]); let t_substituted = t_source.subst(env.infcx.tcx, &substs); - // t_expected = fn(&'a int) + // t_expected = fn(&'a isize) let t_expected = { let t_ptr_bound2 = env.t_rptr_late_bound_with_debruijn(1, ty::DebruijnIndex::new(2)); env.t_fn(&[t_ptr_bound2], env.t_nil()) @@ -719,7 +719,7 @@ fn subst_ty_renumber_some_bounds() { let substs = subst::Substs::new_type(vec![t_rptr_bound1], vec![]); let t_substituted = t_source.subst(env.infcx.tcx, &substs); - // t_expected = (&'a int, fn(&'a int)) + // t_expected = (&'a isize, fn(&'a isize)) // // but not that the Debruijn index is different in the different cases. let t_expected = { @@ -771,7 +771,7 @@ fn subst_region_renumber_region() { test_env(EMPTY_SOURCE_STR, errors(&[]), |env| { let re_bound1 = env.re_late_bound_with_debruijn(1, ty::DebruijnIndex::new(1)); - // type t_source<'a> = fn(&'a int) + // type t_source<'a> = fn(&'a isize) let t_source = { let re_early = env.re_early_bound(subst::TypeSpace, 0, "'a"); env.t_fn(&[env.t_rptr(re_early)], env.t_nil()) @@ -780,7 +780,7 @@ fn subst_region_renumber_region() { let substs = subst::Substs::new_type(vec![], vec![re_bound1]); let t_substituted = t_source.subst(env.infcx.tcx, &substs); - // t_expected = fn(&'a int) + // t_expected = fn(&'a isize) // // but not that the Debruijn index is different in the different cases. let t_expected = { @@ -802,8 +802,8 @@ fn subst_region_renumber_region() { fn walk_ty() { test_env(EMPTY_SOURCE_STR, errors(&[]), |env| { let tcx = env.infcx.tcx; - let int_ty = tcx.types.int; - let uint_ty = tcx.types.uint; + let int_ty = tcx.types.isize; + let uint_ty = tcx.types.usize; let tup1_ty = ty::mk_tup(tcx, vec!(int_ty, uint_ty, int_ty, uint_ty)); let tup2_ty = ty::mk_tup(tcx, vec!(tup1_ty, tup1_ty, uint_ty)); let uniq_ty = ty::mk_uniq(tcx, tup2_ty); @@ -821,8 +821,8 @@ fn walk_ty() { fn walk_ty_skip_subtree() { test_env(EMPTY_SOURCE_STR, errors(&[]), |env| { let tcx = env.infcx.tcx; - let int_ty = tcx.types.int; - let uint_ty = tcx.types.uint; + let int_ty = tcx.types.isize; + let uint_ty = tcx.types.usize; let tup1_ty = ty::mk_tup(tcx, vec!(int_ty, uint_ty, int_ty, uint_ty)); let tup2_ty = ty::mk_tup(tcx, vec!(tup1_ty, tup1_ty, uint_ty)); let uniq_ty = ty::mk_uniq(tcx, tup2_ty); @@ -836,7 +836,7 @@ fn walk_ty_skip_subtree() { (uint_ty, false), (int_ty, false), (uint_ty, false), - (tup1_ty, true), // skip the int/uint/int/uint + (tup1_ty, true), // skip the isize/usize/isize/usize (uint_ty, false)); expected.reverse(); diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index df4b74d9b85..5a3d7c728e0 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -180,7 +180,7 @@ impl LintPass for TypeLimits { if let ast::LitInt(shift, _) = lit.node { shift >= bits } else { false } } else { - match eval_const_expr_partial(cx.tcx, &**r, Some(cx.tcx.types.uint)) { + match eval_const_expr_partial(cx.tcx, &**r, Some(cx.tcx.types.usize)) { Ok(const_int(shift)) => { shift as u64 >= bits }, Ok(const_uint(shift)) => { shift >= bits }, _ => { false } diff --git a/src/librustc_lint/lib.rs b/src/librustc_lint/lib.rs index e158541cd1c..34f7436d0cd 100644 --- a/src/librustc_lint/lib.rs +++ b/src/librustc_lint/lib.rs @@ -34,7 +34,6 @@ #![feature(box_syntax)] #![feature(collections)] #![feature(core)] -#![feature(int_uint)] #![feature(quote)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] diff --git a/src/librustc_llvm/archive_ro.rs b/src/librustc_llvm/archive_ro.rs index 0728d5b46e2..cc6a85e86ce 100644 --- a/src/librustc_llvm/archive_ro.rs +++ b/src/librustc_llvm/archive_ro.rs @@ -61,7 +61,7 @@ impl ArchiveRO { if ptr.is_null() { None } else { - Some(slice::from_raw_parts(ptr as *const u8, size as uint)) + Some(slice::from_raw_parts(ptr as *const u8, size as usize)) } } } diff --git a/src/librustc_llvm/lib.rs b/src/librustc_llvm/lib.rs index 9d564fa56f5..60755093516 100644 --- a/src/librustc_llvm/lib.rs +++ b/src/librustc_llvm/lib.rs @@ -28,7 +28,6 @@ #![feature(box_syntax)] #![feature(collections)] -#![feature(int_uint)] #![feature(libc)] #![feature(link_args)] #![feature(staged_api)] @@ -77,7 +76,7 @@ pub type Bool = c_uint; pub const True: Bool = 1 as Bool; pub const False: Bool = 0 as Bool; -// Consts for the LLVM CallConv type, pre-cast to uint. +// Consts for the LLVM CallConv type, pre-cast to usize. #[derive(Copy, PartialEq)] pub enum CallConv { @@ -242,7 +241,7 @@ impl AttrHelper for SpecialAttribute { } pub struct AttrBuilder { - attrs: Vec<(uint, Box)> + attrs: Vec<(usize, Box)> } impl AttrBuilder { @@ -252,13 +251,13 @@ impl AttrBuilder { } } - pub fn arg<'a, T: AttrHelper + 'static>(&'a mut self, idx: uint, a: T) -> &'a mut AttrBuilder { + pub fn arg<'a, T: AttrHelper + 'static>(&'a mut self, idx: usize, a: T) -> &'a mut AttrBuilder { self.attrs.push((idx, box a as Box)); self } pub fn ret<'a, T: AttrHelper + 'static>(&'a mut self, a: T) -> &'a mut AttrBuilder { - self.attrs.push((ReturnIndex as uint, box a as Box)); + self.attrs.push((ReturnIndex as usize, box a as Box)); self } @@ -693,7 +692,7 @@ extern { -> ValueRef; pub fn LLVMConstFCmp(Pred: c_ushort, V1: ValueRef, V2: ValueRef) -> ValueRef; - /* only for int/vector */ + /* only for isize/vector */ pub fn LLVMGetUndef(Ty: TypeRef) -> ValueRef; pub fn LLVMIsConstant(Val: ValueRef) -> Bool; pub fn LLVMIsNull(Val: ValueRef) -> Bool; @@ -2167,7 +2166,7 @@ impl ObjectFile { pub fn new(llmb: MemoryBufferRef) -> Option { unsafe { let llof = LLVMCreateObjectFile(llmb); - if llof as int == 0 { + if llof as isize == 0 { // LLVMCreateObjectFile took ownership of llmb return None } @@ -2227,7 +2226,7 @@ type RustStringRepr = *mut RefCell>; pub unsafe extern "C" fn rust_llvm_string_write_impl(sr: RustStringRef, ptr: *const c_char, size: size_t) { - let slice = slice::from_raw_parts(ptr as *const u8, size as uint); + let slice = slice::from_raw_parts(ptr as *const u8, size as usize); let sr: RustStringRepr = mem::transmute(sr); (*sr).borrow_mut().push_all(slice); diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs index 2e7fe91365a..9b1b57e7bbe 100644 --- a/src/librustc_privacy/lib.rs +++ b/src/librustc_privacy/lib.rs @@ -19,7 +19,6 @@ html_favicon_url = "http://www.rust-lang.org/favicon.ico", html_root_url = "http://doc.rust-lang.org/nightly/")] -#![feature(int_uint)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] #![feature(staged_api)] @@ -378,7 +377,7 @@ enum PrivacyResult { } enum FieldName { - UnnamedField(uint), // index + UnnamedField(usize), // index // (Name, not Ident, because struct fields are not macro-hygienic) NamedField(ast::Name), } diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 1d445344b8d..0f8f3091319 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -22,7 +22,6 @@ #![feature(alloc)] #![feature(collections)] #![feature(core)] -#![feature(int_uint)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] #![feature(staged_api)] @@ -327,7 +326,7 @@ enum UseLexicalScopeFlag { enum ModulePrefixResult { NoPrefixFound, - PrefixFound(Rc, uint) + PrefixFound(Rc, usize) } #[derive(Copy, PartialEq)] @@ -415,10 +414,10 @@ pub struct Module { import_resolutions: RefCell>, // The number of unresolved globs that this module exports. - glob_count: Cell, + glob_count: Cell, // The index of the import we're resolving. - resolved_import_count: Cell, + resolved_import_count: Cell, // Whether this module is populated. If not populated, any attempt to // access the children must be preceded with a @@ -777,7 +776,7 @@ pub struct Resolver<'a, 'tcx:'a> { structs: FnvHashMap>, // The number of imports that are currently unresolved. - unresolved_imports: uint, + unresolved_imports: usize, // The module that represents the current item scope. current_module: Rc, @@ -959,7 +958,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { fn resolve_module_path_from_root(&mut self, module_: Rc, module_path: &[Name], - index: uint, + index: usize, span: Span, name_search_type: NameSearchType, lp: LastPrivate) @@ -3053,12 +3052,12 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { NoSuggestion } - fn find_best_match_for_name(&mut self, name: &str, max_distance: uint) + fn find_best_match_for_name(&mut self, name: &str, max_distance: usize) -> Option { let this = &mut *self; let mut maybes: Vec = Vec::new(); - let mut values: Vec = Vec::new(); + let mut values: Vec = Vec::new(); for rib in this.value_ribs.iter().rev() { for (&k, _) in &rib.bindings { diff --git a/src/librustc_resolve/resolve_imports.rs b/src/librustc_resolve/resolve_imports.rs index 46451019760..b2004c89ed2 100644 --- a/src/librustc_resolve/resolve_imports.rs +++ b/src/librustc_resolve/resolve_imports.rs @@ -115,7 +115,7 @@ pub struct ImportResolution { // Note that this is usually either 0 or 1 - shadowing is forbidden the only // way outstanding_references is > 1 in a legal program is if the name is // used in both namespaces. - pub outstanding_references: uint, + pub outstanding_references: usize, /// The value that this `use` directive names, if there is one. pub value_target: Option, diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs index bb7880161d5..5e85209fe1a 100644 --- a/src/librustc_trans/back/link.rs +++ b/src/librustc_trans/back/link.rs @@ -60,16 +60,16 @@ pub const RLIB_BYTECODE_OBJECT_MAGIC: &'static [u8] = b"RUST_OBJECT"; pub const RLIB_BYTECODE_OBJECT_VERSION: u32 = 1; // The offset in bytes the bytecode object format version number can be found at -pub const RLIB_BYTECODE_OBJECT_VERSION_OFFSET: uint = 11; +pub const RLIB_BYTECODE_OBJECT_VERSION_OFFSET: usize = 11; // The offset in bytes the size of the compressed bytecode can be found at in // format version 1 -pub const RLIB_BYTECODE_OBJECT_V1_DATASIZE_OFFSET: uint = +pub const RLIB_BYTECODE_OBJECT_V1_DATASIZE_OFFSET: usize = RLIB_BYTECODE_OBJECT_VERSION_OFFSET + 4; // The offset in bytes the compressed LLVM bytecode can be found at in format // version 1 -pub const RLIB_BYTECODE_OBJECT_V1_DATA_OFFSET: uint = +pub const RLIB_BYTECODE_OBJECT_V1_DATA_OFFSET: usize = RLIB_BYTECODE_OBJECT_V1_DATASIZE_OFFSET + 8; @@ -323,7 +323,7 @@ pub fn mangle_exported_name<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, path: PathEl "abcdefghijklmnopqrstuvwxyz\ ABCDEFGHIJKLMNOPQRSTUVWXYZ\ 0123456789"; - let id = id as uint; + let id = id as usize; let extra1 = id % EXTRA_CHARS.len(); let id = id / EXTRA_CHARS.len(); let extra2 = id % EXTRA_CHARS.len(); @@ -695,7 +695,7 @@ fn write_rlib_bytecode_object_v1(writer: &mut Write, RLIB_BYTECODE_OBJECT_MAGIC.len() + // magic id mem::size_of_val(&RLIB_BYTECODE_OBJECT_VERSION) + // version mem::size_of_val(&bc_data_deflated_size) + // data size field - bc_data_deflated_size as uint; // actual data + bc_data_deflated_size as usize; // actual data // If the number of bytes written to the object so far is odd, add a // padding byte to make it even. This works around a crash bug in LLDB @@ -1154,7 +1154,7 @@ fn add_upstream_rust_crates(cmd: &mut Command, sess: &Session, // We may not pass all crates through to the linker. Some crates may // appear statically in an existing dylib, meaning we'll pick up all the // symbols from the dylib. - let kind = match data[cnum as uint - 1] { + let kind = match data[cnum as usize - 1] { Some(t) => t, None => continue }; diff --git a/src/librustc_trans/back/lto.rs b/src/librustc_trans/back/lto.rs index a3ab863c4ec..056550f6635 100644 --- a/src/librustc_trans/back/lto.rs +++ b/src/librustc_trans/back/lto.rs @@ -92,7 +92,7 @@ pub fn run(sess: &session::Session, llmod: ModuleRef, let data_size = extract_compressed_bytecode_size_v1(bc_encoded); let compressed_data = &bc_encoded[ link::RLIB_BYTECODE_OBJECT_V1_DATA_OFFSET.. - (link::RLIB_BYTECODE_OBJECT_V1_DATA_OFFSET + data_size as uint)]; + (link::RLIB_BYTECODE_OBJECT_V1_DATA_OFFSET + data_size as usize)]; match flate::inflate_bytes(compressed_data) { Ok(inflated) => inflated, @@ -204,7 +204,7 @@ fn extract_compressed_bytecode_size_v1(bc: &[u8]) -> u64 { return read_from_le_bytes::(bc, link::RLIB_BYTECODE_OBJECT_V1_DATASIZE_OFFSET); } -fn read_from_le_bytes(bytes: &[u8], position_in_bytes: uint) -> T { +fn read_from_le_bytes(bytes: &[u8], position_in_bytes: usize) -> T { let byte_data = &bytes[position_in_bytes..position_in_bytes + mem::size_of::()]; let data = unsafe { *(byte_data.as_ptr() as *const T) diff --git a/src/librustc_trans/back/write.rs b/src/librustc_trans/back/write.rs index 156cfa6c4b2..cc588a365f6 100644 --- a/src/librustc_trans/back/write.rs +++ b/src/librustc_trans/back/write.rs @@ -898,7 +898,7 @@ fn run_work_singlethreaded(sess: &Session, fn run_work_multithreaded(sess: &Session, work_items: Vec, - num_workers: uint) { + num_workers: usize) { // Run some workers to process the work items. let work_items_arc = Arc::new(Mutex::new(work_items)); let mut diag_emitter = SharedEmitter::new(); diff --git a/src/librustc_trans/lib.rs b/src/librustc_trans/lib.rs index 99a64156d66..8cb4f886b2d 100644 --- a/src/librustc_trans/lib.rs +++ b/src/librustc_trans/lib.rs @@ -30,7 +30,6 @@ #![feature(box_syntax)] #![feature(collections)] #![feature(core)] -#![feature(int_uint)] #![feature(libc)] #![feature(quote)] #![feature(rustc_diagnostic_macros)] diff --git a/src/librustc_trans/save/mod.rs b/src/librustc_trans/save/mod.rs index 327e5ab3882..a415875d852 100644 --- a/src/librustc_trans/save/mod.rs +++ b/src/librustc_trans/save/mod.rs @@ -465,7 +465,7 @@ impl <'l, 'tcx> DxrVisitor<'l, 'tcx> { // However full span is the entire enum/fn/struct block, so we only want // the first few to match the number of generics we're looking for. let param_sub_spans = self.span.spans_for_ty_params(full_span, - (generics.ty_params.len() as int)); + (generics.ty_params.len() as isize)); for (param, param_ss) in generics.ty_params.iter().zip(param_sub_spans.iter()) { // Append $id to name to make sure each one is unique let name = format!("{}::{}${}", diff --git a/src/librustc_trans/save/span_utils.rs b/src/librustc_trans/save/span_utils.rs index 8de046fa6eb..84a7678959d 100644 --- a/src/librustc_trans/save/span_utils.rs +++ b/src/librustc_trans/save/span_utils.rs @@ -24,7 +24,7 @@ use syntax::parse::token::{keywords, Token}; #[derive(Clone)] pub struct SpanUtils<'a> { pub sess: &'a Session, - pub err_count: Cell, + pub err_count: Cell, } impl<'a> SpanUtils<'a> { @@ -232,7 +232,7 @@ impl<'a> SpanUtils<'a> { // example with Foo, Bar> // Nesting = 0: all idents outside of brackets: ~[Foo] // Nesting = 1: idents within one level of brackets: ~[Bar, Bar] - pub fn spans_with_brackets(&self, span: Span, nesting: int, limit: int) -> Vec { + pub fn spans_with_brackets(&self, span: Span, nesting: isize, limit: isize) -> Vec { let mut result: Vec = vec!(); let mut toks = self.retokenise_span(span); @@ -250,7 +250,7 @@ impl<'a> SpanUtils<'a> { } return result } - if (result.len() as int) == limit { + if (result.len() as isize) == limit { return result; } bracket_count += match ts.tok { @@ -347,7 +347,7 @@ impl<'a> SpanUtils<'a> { // Return an owned vector of the subspans of the param identifier // tokens found in span. - pub fn spans_for_ty_params(&self, span: Span, number: int) -> Vec { + pub fn spans_for_ty_params(&self, span: Span, number: isize) -> Vec { if generated_code(span) { return vec!(); } diff --git a/src/librustc_trans/trans/_match.rs b/src/librustc_trans/trans/_match.rs index c48b63cdcb6..e669accf150 100644 --- a/src/librustc_trans/trans/_match.rs +++ b/src/librustc_trans/trans/_match.rs @@ -28,7 +28,7 @@ //! constituent pattern. N here is usually the number of arms but may be //! greater, if some arms have multiple alternatives. For example, here: //! -//! enum Foo { A, B(int), C(uint, uint) } +//! enum Foo { A, B(int), C(usize, usize) } //! match foo { //! A => ..., //! B(x) => ..., @@ -246,9 +246,9 @@ enum Opt<'a, 'tcx> { ConstantValue(ConstantExpr<'a>, DebugLoc), ConstantRange(ConstantExpr<'a>, ConstantExpr<'a>, DebugLoc), Variant(ty::Disr, Rc>, ast::DefId, DebugLoc), - SliceLengthEqual(uint, DebugLoc), - SliceLengthGreaterOrEqual(/* prefix length */ uint, - /* suffix length */ uint, + SliceLengthEqual(usize, DebugLoc), + SliceLengthGreaterOrEqual(/* prefix length */ usize, + /* suffix length */ usize, DebugLoc), } @@ -381,7 +381,7 @@ impl<'a, 'p, 'blk, 'tcx> Repr<'tcx> for Match<'a, 'p, 'blk, 'tcx> { } } -fn has_nested_bindings(m: &[Match], col: uint) -> bool { +fn has_nested_bindings(m: &[Match], col: usize) -> bool { for br in m { match br.pats[col].node { ast::PatIdent(_, _, Some(_)) => return true, @@ -393,7 +393,7 @@ fn has_nested_bindings(m: &[Match], col: uint) -> bool { fn expand_nested_bindings<'a, 'p, 'blk, 'tcx>(bcx: Block<'blk, 'tcx>, m: &[Match<'a, 'p, 'blk, 'tcx>], - col: uint, + col: usize, val: ValueRef) -> Vec> { debug!("expand_nested_bindings(bcx={}, m={}, col={}, val={})", @@ -430,7 +430,7 @@ fn expand_nested_bindings<'a, 'p, 'blk, 'tcx>(bcx: Block<'blk, 'tcx>, fn enter_match<'a, 'b, 'p, 'blk, 'tcx, F>(bcx: Block<'blk, 'tcx>, dm: &DefMap, m: &[Match<'a, 'p, 'blk, 'tcx>], - col: uint, + col: usize, val: ValueRef, mut e: F) -> Vec> where @@ -476,7 +476,7 @@ fn enter_match<'a, 'b, 'p, 'blk, 'tcx, F>(bcx: Block<'blk, 'tcx>, fn enter_default<'a, 'p, 'blk, 'tcx>(bcx: Block<'blk, 'tcx>, dm: &DefMap, m: &[Match<'a, 'p, 'blk, 'tcx>], - col: uint, + col: usize, val: ValueRef) -> Vec> { debug!("enter_default(bcx={}, m={}, col={}, val={})", @@ -532,8 +532,8 @@ fn enter_opt<'a, 'p, 'blk, 'tcx>( dm: &DefMap, m: &[Match<'a, 'p, 'blk, 'tcx>], opt: &Opt, - col: uint, - variant_size: uint, + col: usize, + variant_size: usize, val: ValueRef) -> Vec> { debug!("enter_opt(bcx={}, m={}, opt={:?}, col={}, val={})", @@ -575,7 +575,7 @@ fn enter_opt<'a, 'p, 'blk, 'tcx>( // on a set of enum variants or a literal. fn get_branches<'a, 'p, 'blk, 'tcx>(bcx: Block<'blk, 'tcx>, m: &[Match<'a, 'p, 'blk, 'tcx>], - col: uint) + col: usize) -> Vec> { let tcx = bcx.tcx(); @@ -656,8 +656,8 @@ fn match_datum<'tcx>(val: ValueRef, left_ty: Ty<'tcx>) -> Datum<'tcx, Lvalue> { fn bind_subslice_pat(bcx: Block, pat_id: ast::NodeId, val: ValueRef, - offset_left: uint, - offset_right: uint) -> ValueRef { + offset_left: usize, + offset_right: usize) -> ValueRef { let _icx = push_ctxt("match::bind_subslice_pat"); let vec_ty = node_id_type(bcx, pat_id); let unit_ty = ty::sequence_element_type(bcx.tcx(), ty::type_content(vec_ty)); @@ -679,8 +679,8 @@ fn bind_subslice_pat(bcx: Block, fn extract_vec_elems<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, left_ty: Ty<'tcx>, - before: uint, - after: uint, + before: usize, + after: usize, val: ValueRef) -> ExtractedBlock<'blk, 'tcx> { let _icx = push_ctxt("match::extract_vec_elems"); @@ -711,15 +711,15 @@ macro_rules! any_pat { ) } -fn any_uniq_pat(m: &[Match], col: uint) -> bool { +fn any_uniq_pat(m: &[Match], col: usize) -> bool { any_pat!(m, col, ast::PatBox(_)) } -fn any_region_pat(m: &[Match], col: uint) -> bool { +fn any_region_pat(m: &[Match], col: usize) -> bool { any_pat!(m, col, ast::PatRegion(..)) } -fn any_irrefutable_adt_pat(tcx: &ty::ctxt, m: &[Match], col: uint) -> bool { +fn any_irrefutable_adt_pat(tcx: &ty::ctxt, m: &[Match], col: usize) -> bool { m.iter().any(|br| { let pat = br.pats[col]; match pat.node { @@ -772,8 +772,8 @@ impl FailureHandler { } } -fn pick_column_to_specialize(def_map: &DefMap, m: &[Match]) -> Option { - fn pat_score(def_map: &DefMap, pat: &ast::Pat) -> uint { +fn pick_column_to_specialize(def_map: &DefMap, m: &[Match]) -> Option { + fn pat_score(def_map: &DefMap, pat: &ast::Pat) -> usize { match pat.node { ast::PatIdent(_, _, Some(ref inner)) => pat_score(def_map, &**inner), _ if pat_is_refutable(def_map, pat) => 1, @@ -781,7 +781,7 @@ fn pick_column_to_specialize(def_map: &DefMap, m: &[Match]) -> Option { } } - let column_score = |m: &[Match], col: uint| -> uint { + let column_score = |m: &[Match], col: usize| -> usize { let total_score = m.iter() .map(|row| row.pats[col]) .map(|pat| pat_score(def_map, pat)) @@ -795,7 +795,7 @@ fn pick_column_to_specialize(def_map: &DefMap, m: &[Match]) -> Option { } }; - let column_contains_any_nonwild_patterns = |&col: &uint| -> bool { + let column_contains_any_nonwild_patterns = |&col: &usize| -> bool { m.iter().any(|row| match row.pats[col].node { ast::PatWild(_) => false, _ => true @@ -1047,7 +1047,7 @@ fn compile_submatch_continue<'a, 'p, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>, m: &[Match<'a, 'p, 'blk, 'tcx>], vals: &[ValueRef], chk: &FailureHandler, - col: uint, + col: usize, val: ValueRef, has_genuine_default: bool) { let fcx = bcx.fcx; @@ -1187,7 +1187,7 @@ fn compile_submatch_continue<'a, 'p, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>, let t = if kind == Compare { left_ty } else { - tcx.types.uint // vector length + tcx.types.usize // vector length }; let Result { bcx: after_cx, val: matches } = { match opt.trans(bcx) { diff --git a/src/librustc_trans/trans/adt.rs b/src/librustc_trans/trans/adt.rs index 61214f65c87..c88503f8d3d 100644 --- a/src/librustc_trans/trans/adt.rs +++ b/src/librustc_trans/trans/adt.rs @@ -339,7 +339,7 @@ struct Case<'tcx> { } /// This represents the (GEP) indices to follow to get to the discriminant field -pub type DiscrField = Vec; +pub type DiscrField = Vec; fn find_discr_field_candidate<'tcx>(tcx: &ty::ctxt<'tcx>, ty: Ty<'tcx>, @@ -776,7 +776,7 @@ fn load_discr(bcx: Block, ity: IntType, ptr: ValueRef, min: Disr, max: Disr) assert_eq!(val_ty(ptr), llty.ptr_to()); let bits = machine::llbitsize_of_real(bcx.ccx(), llty); assert!(bits <= 64); - let bits = bits as uint; + let bits = bits as usize; let mask = (-1u64 >> (64 - bits)) as Disr; // For a (max) discr of -1, max will be `-1 as usize`, which overflows. // However, that is fine here (it would still represent the full range), @@ -832,7 +832,7 @@ pub fn trans_set_discr<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, r: &Repr<'tcx>, General(ity, ref cases, dtor) => { if dtor { let ptr = trans_field_ptr(bcx, r, val, discr, - cases[discr as uint].fields.len() - 2); + cases[discr as usize].fields.len() - 2); Store(bcx, C_u8(bcx.ccx(), 1), ptr); } Store(bcx, C_integral(ll_inttype(bcx.ccx(), ity), discr as u64, true), @@ -870,7 +870,7 @@ fn assert_discr_in_range(ity: IntType, min: Disr, max: Disr, discr: Disr) { /// The number of fields in a given case; for use when obtaining this /// information from the type or definition is less convenient. -pub fn num_args(r: &Repr, discr: Disr) -> uint { +pub fn num_args(r: &Repr, discr: Disr) -> usize { match *r { CEnum(..) => 0, Univariant(ref st, dtor) => { @@ -878,7 +878,7 @@ pub fn num_args(r: &Repr, discr: Disr) -> uint { st.fields.len() - (if dtor { 1 } else { 0 }) } General(_, ref cases, dtor) => { - cases[discr as uint].fields.len() - 1 - (if dtor { 1 } else { 0 }) + cases[discr as usize].fields.len() - 1 - (if dtor { 1 } else { 0 }) } RawNullablePointer { nndiscr, ref nullfields, .. } => { if discr == nndiscr { 1 } else { nullfields.len() } @@ -892,7 +892,7 @@ pub fn num_args(r: &Repr, discr: Disr) -> uint { /// Access a field, at a point when the value's case is known. pub fn trans_field_ptr<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, r: &Repr<'tcx>, - val: ValueRef, discr: Disr, ix: uint) -> ValueRef { + val: ValueRef, discr: Disr, ix: usize) -> ValueRef { // Note: if this ever needs to generate conditionals (e.g., if we // decide to do some kind of cdr-coding-like non-unique repr // someday), it will need to return a possibly-new bcx as well. @@ -905,7 +905,7 @@ pub fn trans_field_ptr<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, r: &Repr<'tcx>, struct_field_ptr(bcx, st, val, ix, false) } General(_, ref cases, _) => { - struct_field_ptr(bcx, &cases[discr as uint], val, ix + 1, true) + struct_field_ptr(bcx, &cases[discr as usize], val, ix + 1, true) } RawNullablePointer { nndiscr, ref nullfields, .. } | StructWrappedNullablePointer { nndiscr, ref nullfields, .. } if discr != nndiscr => { @@ -931,7 +931,7 @@ pub fn trans_field_ptr<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, r: &Repr<'tcx>, } pub fn struct_field_ptr<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, st: &Struct<'tcx>, val: ValueRef, - ix: uint, needs_cast: bool) -> ValueRef { + ix: usize, needs_cast: bool) -> ValueRef { let val = if needs_cast { let ccx = bcx.ccx(); let fields = st.fields.iter().map(|&ty| type_of::type_of(ccx, ty)).collect::>(); @@ -1046,7 +1046,7 @@ pub fn trans_const<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, r: &Repr<'tcx>, discr C_integral(ll_inttype(ccx, ity), discr as u64, true) } General(ity, ref cases, _) => { - let case = &cases[discr as uint]; + let case = &cases[discr as usize]; let (max_sz, _) = union_size_and_align(&cases[..]); let lldiscr = C_integral(ll_inttype(ccx, ity), discr as u64, true); let mut f = vec![lldiscr]; @@ -1184,7 +1184,7 @@ pub fn const_get_discrim(ccx: &CrateContext, r: &Repr, val: ValueRef) -> Disr { /// (Not to be confused with `common::const_get_elt`, which operates on /// raw LLVM-level structs and arrays.) pub fn const_get_field(ccx: &CrateContext, r: &Repr, val: ValueRef, - _discr: Disr, ix: uint) -> ValueRef { + _discr: Disr, ix: usize) -> ValueRef { match *r { CEnum(..) => ccx.sess().bug("element access in C-like enum const"), Univariant(..) => const_struct_field(ccx, val, ix), @@ -1198,7 +1198,7 @@ pub fn const_get_field(ccx: &CrateContext, r: &Repr, val: ValueRef, } /// Extract field of struct-like const, skipping our alignment padding. -fn const_struct_field(ccx: &CrateContext, val: ValueRef, ix: uint) -> ValueRef { +fn const_struct_field(ccx: &CrateContext, val: ValueRef, ix: usize) -> ValueRef { // Get the ix-th non-undef element of the struct. let mut real_ix = 0; // actual position in the struct let mut ix = ix; // logical index relative to real_ix diff --git a/src/librustc_trans/trans/base.rs b/src/librustc_trans/trans/base.rs index 49bc5846e30..206b8c80c77 100644 --- a/src/librustc_trans/trans/base.rs +++ b/src/librustc_trans/trans/base.rs @@ -151,7 +151,7 @@ pub fn push_ctxt(s: &'static str) -> _InsnCtxt { pub struct StatRecorder<'a, 'tcx: 'a> { ccx: &'a CrateContext<'a, 'tcx>, name: Option, - istart: uint, + istart: usize, } impl<'a, 'tcx> StatRecorder<'a, 'tcx> { @@ -707,7 +707,7 @@ pub fn iter_structural_ty<'blk, 'tcx, F>(cx: Block<'blk, 'tcx>, substs, &mut f); } (_match::Switch, Some(lldiscrim_a)) => { - cx = f(cx, lldiscrim_a, cx.tcx().types.int); + cx = f(cx, lldiscrim_a, cx.tcx().types.isize); let unr_cx = fcx.new_temp_block("enum-iter-unr"); Unreachable(unr_cx); let llswitch = Switch(cx, lldiscrim_a, unr_cx.llbb, diff --git a/src/librustc_trans/trans/build.rs b/src/librustc_trans/trans/build.rs index 2fcfc5e4393..a16c4d6c2c4 100644 --- a/src/librustc_trans/trans/build.rs +++ b/src/librustc_trans/trans/build.rs @@ -105,7 +105,7 @@ pub fn CondBr(cx: Block, B(cx).cond_br(if_, then, else_); } -pub fn Switch(cx: Block, v: ValueRef, else_: BasicBlockRef, num_cases: uint) +pub fn Switch(cx: Block, v: ValueRef, else_: BasicBlockRef, num_cases: usize) -> ValueRef { if cx.unreachable.get() { return _Undef(v); } check_not_terminated(cx); @@ -122,7 +122,7 @@ pub fn AddCase(s: ValueRef, on_val: ValueRef, dest: BasicBlockRef) { pub fn IndirectBr(cx: Block, addr: ValueRef, - num_dests: uint, + num_dests: usize, debug_loc: DebugLoc) { if cx.unreachable.get() { return; @@ -673,7 +673,7 @@ pub fn GEP(cx: Block, pointer: ValueRef, indices: &[ValueRef]) -> ValueRef { // Simple wrapper around GEP that takes an array of ints and wraps them // in C_i32() #[inline] -pub fn GEPi(cx: Block, base: ValueRef, ixs: &[uint]) -> ValueRef { +pub fn GEPi(cx: Block, base: ValueRef, ixs: &[usize]) -> ValueRef { unsafe { if cx.unreachable.get() { return llvm::LLVMGetUndef(Type::nil(cx.ccx()).ptr_to().to_ref()); @@ -691,7 +691,7 @@ pub fn InBoundsGEP(cx: Block, pointer: ValueRef, indices: &[ValueRef]) -> ValueR } } -pub fn StructGEP(cx: Block, pointer: ValueRef, idx: uint) -> ValueRef { +pub fn StructGEP(cx: Block, pointer: ValueRef, idx: usize) -> ValueRef { unsafe { if cx.unreachable.get() { return llvm::LLVMGetUndef(Type::nil(cx.ccx()).ptr_to().to_ref()); @@ -1011,7 +1011,7 @@ pub fn ShuffleVector(cx: Block, v1: ValueRef, v2: ValueRef, } } -pub fn VectorSplat(cx: Block, num_elts: uint, elt_val: ValueRef) -> ValueRef { +pub fn VectorSplat(cx: Block, num_elts: usize, elt_val: ValueRef) -> ValueRef { unsafe { if cx.unreachable.get() { return llvm::LLVMGetUndef(Type::nil(cx.ccx()).to_ref()); @@ -1020,7 +1020,7 @@ pub fn VectorSplat(cx: Block, num_elts: uint, elt_val: ValueRef) -> ValueRef { } } -pub fn ExtractValue(cx: Block, agg_val: ValueRef, index: uint) -> ValueRef { +pub fn ExtractValue(cx: Block, agg_val: ValueRef, index: usize) -> ValueRef { unsafe { if cx.unreachable.get() { return llvm::LLVMGetUndef(Type::nil(cx.ccx()).to_ref()); @@ -1029,7 +1029,7 @@ pub fn ExtractValue(cx: Block, agg_val: ValueRef, index: uint) -> ValueRef { } } -pub fn InsertValue(cx: Block, agg_val: ValueRef, elt_val: ValueRef, index: uint) -> ValueRef { +pub fn InsertValue(cx: Block, agg_val: ValueRef, elt_val: ValueRef, index: usize) -> ValueRef { unsafe { if cx.unreachable.get() { return llvm::LLVMGetUndef(Type::nil(cx.ccx()).to_ref()); @@ -1070,7 +1070,7 @@ pub fn Trap(cx: Block) { } pub fn LandingPad(cx: Block, ty: Type, pers_fn: ValueRef, - num_clauses: uint) -> ValueRef { + num_clauses: usize) -> ValueRef { check_not_terminated(cx); assert!(!cx.unreachable.get()); B(cx).landing_pad(ty, pers_fn, num_clauses) diff --git a/src/librustc_trans/trans/builder.rs b/src/librustc_trans/trans/builder.rs index 8199e6189c9..92bc20bafcf 100644 --- a/src/librustc_trans/trans/builder.rs +++ b/src/librustc_trans/trans/builder.rs @@ -140,13 +140,13 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { } } - pub fn switch(&self, v: ValueRef, else_llbb: BasicBlockRef, num_cases: uint) -> ValueRef { + pub fn switch(&self, v: ValueRef, else_llbb: BasicBlockRef, num_cases: usize) -> ValueRef { unsafe { llvm::LLVMBuildSwitch(self.llbuilder, v, else_llbb, num_cases as c_uint) } } - pub fn indirect_br(&self, addr: ValueRef, num_dests: uint) { + pub fn indirect_br(&self, addr: ValueRef, num_dests: usize) { self.count_insn("indirectbr"); unsafe { llvm::LLVMBuildIndirectBr(self.llbuilder, addr, num_dests as c_uint); @@ -555,7 +555,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { // Simple wrapper around GEP that takes an array of ints and wraps them // in C_i32() #[inline] - pub fn gepi(&self, base: ValueRef, ixs: &[uint]) -> ValueRef { + pub fn gepi(&self, base: ValueRef, ixs: &[usize]) -> ValueRef { // Small vector optimization. This should catch 100% of the cases that // we care about. if ixs.len() < 16 { @@ -579,7 +579,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { } } - pub fn struct_gep(&self, ptr: ValueRef, idx: uint) -> ValueRef { + pub fn struct_gep(&self, ptr: ValueRef, idx: usize) -> ValueRef { self.count_insn("structgep"); unsafe { llvm::LLVMBuildStructGEP(self.llbuilder, ptr, idx as c_uint, noname()) @@ -886,7 +886,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { } } - pub fn vector_splat(&self, num_elts: uint, elt: ValueRef) -> ValueRef { + pub fn vector_splat(&self, num_elts: usize, elt: ValueRef) -> ValueRef { unsafe { let elt_ty = val_ty(elt); let undef = llvm::LLVMGetUndef(Type::vector(&elt_ty, num_elts as u64).to_ref()); @@ -896,7 +896,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { } } - pub fn extract_value(&self, agg_val: ValueRef, idx: uint) -> ValueRef { + pub fn extract_value(&self, agg_val: ValueRef, idx: usize) -> ValueRef { self.count_insn("extractvalue"); unsafe { llvm::LLVMBuildExtractValue(self.llbuilder, agg_val, idx as c_uint, noname()) @@ -904,7 +904,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { } pub fn insert_value(&self, agg_val: ValueRef, elt: ValueRef, - idx: uint) -> ValueRef { + idx: usize) -> ValueRef { self.count_insn("insertvalue"); unsafe { llvm::LLVMBuildInsertValue(self.llbuilder, agg_val, elt, idx as c_uint, @@ -940,7 +940,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { let m: ModuleRef = llvm::LLVMGetGlobalParent(fn_); let p = "llvm.trap\0".as_ptr(); let t: ValueRef = llvm::LLVMGetNamedFunction(m, p as *const _); - assert!((t as int != 0)); + assert!((t as isize != 0)); let args: &[ValueRef] = &[]; self.count_insn("trap"); llvm::LLVMBuildCall( @@ -948,7 +948,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { } } - pub fn landing_pad(&self, ty: Type, pers_fn: ValueRef, num_clauses: uint) -> ValueRef { + pub fn landing_pad(&self, ty: Type, pers_fn: ValueRef, num_clauses: usize) -> ValueRef { self.count_insn("landingpad"); unsafe { llvm::LLVMBuildLandingPad( diff --git a/src/librustc_trans/trans/cabi_aarch64.rs b/src/librustc_trans/trans/cabi_aarch64.rs index 03496a966bf..8ac4f84d6ef 100644 --- a/src/librustc_trans/trans/cabi_aarch64.rs +++ b/src/librustc_trans/trans/cabi_aarch64.rs @@ -18,18 +18,18 @@ use trans::type_::Type; use std::cmp; -fn align_up_to(off: uint, a: uint) -> uint { +fn align_up_to(off: usize, a: usize) -> usize { return (off + a - 1) / a * a; } -fn align(off: uint, ty: Type) -> uint { +fn align(off: usize, ty: Type) -> usize { let a = ty_align(ty); return align_up_to(off, a); } -fn ty_align(ty: Type) -> uint { +fn ty_align(ty: Type) -> usize { match ty.kind() { - Integer => ((ty.int_width() as uint) + 7) / 8, + Integer => ((ty.int_width() as usize) + 7) / 8, Pointer => 8, Float => 4, Double => 8, @@ -54,9 +54,9 @@ fn ty_align(ty: Type) -> uint { } } -fn ty_size(ty: Type) -> uint { +fn ty_size(ty: Type) -> usize { match ty.kind() { - Integer => ((ty.int_width() as uint) + 7) / 8, + Integer => ((ty.int_width() as usize) + 7) / 8, Pointer => 8, Float => 4, Double => 8, diff --git a/src/librustc_trans/trans/cabi_arm.rs b/src/librustc_trans/trans/cabi_arm.rs index 50014230df6..941c065e3d5 100644 --- a/src/librustc_trans/trans/cabi_arm.rs +++ b/src/librustc_trans/trans/cabi_arm.rs @@ -23,20 +23,20 @@ pub enum Flavor { Ios } -type TyAlignFn = fn(ty: Type) -> uint; +type TyAlignFn = fn(ty: Type) -> usize; -fn align_up_to(off: uint, a: uint) -> uint { +fn align_up_to(off: usize, a: usize) -> usize { return (off + a - 1) / a * a; } -fn align(off: uint, ty: Type, align_fn: TyAlignFn) -> uint { +fn align(off: usize, ty: Type, align_fn: TyAlignFn) -> usize { let a = align_fn(ty); return align_up_to(off, a); } -fn general_ty_align(ty: Type) -> uint { +fn general_ty_align(ty: Type) -> usize { match ty.kind() { - Integer => ((ty.int_width() as uint) + 7) / 8, + Integer => ((ty.int_width() as usize) + 7) / 8, Pointer => 4, Float => 4, Double => 8, @@ -68,9 +68,9 @@ fn general_ty_align(ty: Type) -> uint { // ARMv6 // https://developer.apple.com/library/ios/documentation/Xcode/Conceptual // /iPhoneOSABIReference/Articles/ARMv6FunctionCallingConventions.html -fn ios_ty_align(ty: Type) -> uint { +fn ios_ty_align(ty: Type) -> usize { match ty.kind() { - Integer => cmp::min(4, ((ty.int_width() as uint) + 7) / 8), + Integer => cmp::min(4, ((ty.int_width() as usize) + 7) / 8), Pointer => 4, Float => 4, Double => 4, @@ -95,9 +95,9 @@ fn ios_ty_align(ty: Type) -> uint { } } -fn ty_size(ty: Type, align_fn: TyAlignFn) -> uint { +fn ty_size(ty: Type, align_fn: TyAlignFn) -> usize { match ty.kind() { - Integer => ((ty.int_width() as uint) + 7) / 8, + Integer => ((ty.int_width() as usize) + 7) / 8, Pointer => 4, Float => 4, Double => 8, diff --git a/src/librustc_trans/trans/cabi_mips.rs b/src/librustc_trans/trans/cabi_mips.rs index bc171e3ae43..2d7fdd2f2eb 100644 --- a/src/librustc_trans/trans/cabi_mips.rs +++ b/src/librustc_trans/trans/cabi_mips.rs @@ -19,18 +19,18 @@ use trans::cabi::{ArgType, FnType}; use trans::context::CrateContext; use trans::type_::Type; -fn align_up_to(off: uint, a: uint) -> uint { +fn align_up_to(off: usize, a: usize) -> usize { return (off + a - 1) / a * a; } -fn align(off: uint, ty: Type) -> uint { +fn align(off: usize, ty: Type) -> usize { let a = ty_align(ty); return align_up_to(off, a); } -fn ty_align(ty: Type) -> uint { +fn ty_align(ty: Type) -> usize { match ty.kind() { - Integer => ((ty.int_width() as uint) + 7) / 8, + Integer => ((ty.int_width() as usize) + 7) / 8, Pointer => 4, Float => 4, Double => 8, @@ -55,9 +55,9 @@ fn ty_align(ty: Type) -> uint { } } -fn ty_size(ty: Type) -> uint { +fn ty_size(ty: Type) -> usize { match ty.kind() { - Integer => ((ty.int_width() as uint) + 7) / 8, + Integer => ((ty.int_width() as usize) + 7) / 8, Pointer => 4, Float => 4, Double => 8, @@ -96,7 +96,7 @@ fn classify_ret_ty(ccx: &CrateContext, ty: Type) -> ArgType { } } -fn classify_arg_ty(ccx: &CrateContext, ty: Type, offset: &mut uint) -> ArgType { +fn classify_arg_ty(ccx: &CrateContext, ty: Type, offset: &mut usize) -> ArgType { let orig_offset = *offset; let size = ty_size(ty) * 8; let mut align = ty_align(ty); @@ -129,7 +129,7 @@ fn is_reg_ty(ty: Type) -> bool { }; } -fn padding_ty(ccx: &CrateContext, align: uint, offset: uint) -> Option { +fn padding_ty(ccx: &CrateContext, align: usize, offset: usize) -> Option { if ((align - 1 ) & offset) > 0 { Some(Type::i32(ccx)) } else { @@ -137,7 +137,7 @@ fn padding_ty(ccx: &CrateContext, align: uint, offset: uint) -> Option { } } -fn coerce_to_int(ccx: &CrateContext, size: uint) -> Vec { +fn coerce_to_int(ccx: &CrateContext, size: usize) -> Vec { let int_ty = Type::i32(ccx); let mut args = Vec::new(); diff --git a/src/librustc_trans/trans/cabi_powerpc.rs b/src/librustc_trans/trans/cabi_powerpc.rs index 4871617e89f..8c30d4fcc2b 100644 --- a/src/librustc_trans/trans/cabi_powerpc.rs +++ b/src/librustc_trans/trans/cabi_powerpc.rs @@ -18,20 +18,20 @@ use trans::type_::Type; use std::cmp; -fn align_up_to(off: uint, a: uint) -> uint { +fn align_up_to(off: usize, a: usize) -> usize { return (off + a - 1) / a * a; } -fn align(off: uint, ty: Type) -> uint { +fn align(off: usize, ty: Type) -> usize { let a = ty_align(ty); return align_up_to(off, a); } -fn ty_align(ty: Type) -> uint { +fn ty_align(ty: Type) -> usize { match ty.kind() { Integer => { unsafe { - ((llvm::LLVMGetIntTypeWidth(ty.to_ref()) as uint) + 7) / 8 + ((llvm::LLVMGetIntTypeWidth(ty.to_ref()) as usize) + 7) / 8 } } Pointer => 4, @@ -53,11 +53,11 @@ fn ty_align(ty: Type) -> uint { } } -fn ty_size(ty: Type) -> uint { +fn ty_size(ty: Type) -> usize { match ty.kind() { Integer => { unsafe { - ((llvm::LLVMGetIntTypeWidth(ty.to_ref()) as uint) + 7) / 8 + ((llvm::LLVMGetIntTypeWidth(ty.to_ref()) as usize) + 7) / 8 } } Pointer => 4, @@ -92,7 +92,7 @@ fn classify_ret_ty(ccx: &CrateContext, ty: Type) -> ArgType { } } -fn classify_arg_ty(ccx: &CrateContext, ty: Type, offset: &mut uint) -> ArgType { +fn classify_arg_ty(ccx: &CrateContext, ty: Type, offset: &mut usize) -> ArgType { let orig_offset = *offset; let size = ty_size(ty) * 8; let mut align = ty_align(ty); @@ -124,7 +124,7 @@ fn is_reg_ty(ty: Type) -> bool { }; } -fn padding_ty(ccx: &CrateContext, align: uint, offset: uint) -> Option { +fn padding_ty(ccx: &CrateContext, align: usize, offset: usize) -> Option { if ((align - 1 ) & offset) > 0 { Some(Type::i32(ccx)) } else { @@ -132,7 +132,7 @@ fn padding_ty(ccx: &CrateContext, align: uint, offset: uint) -> Option { } } -fn coerce_to_int(ccx: &CrateContext, size: uint) -> Vec { +fn coerce_to_int(ccx: &CrateContext, size: usize) -> Vec { let int_ty = Type::i32(ccx); let mut args = Vec::new(); diff --git a/src/librustc_trans/trans/cabi_x86_64.rs b/src/librustc_trans/trans/cabi_x86_64.rs index ab41fe31a6e..754b7ee5cf5 100644 --- a/src/librustc_trans/trans/cabi_x86_64.rs +++ b/src/librustc_trans/trans/cabi_x86_64.rs @@ -86,14 +86,14 @@ impl ClassList for [RegClass] { } fn classify_ty(ty: Type) -> Vec { - fn align(off: uint, ty: Type) -> uint { + fn align(off: usize, ty: Type) -> usize { let a = ty_align(ty); return (off + a - 1) / a * a; } - fn ty_align(ty: Type) -> uint { + fn ty_align(ty: Type) -> usize { match ty.kind() { - Integer => ((ty.int_width() as uint) + 7) / 8, + Integer => ((ty.int_width() as usize) + 7) / 8, Pointer => 8, Float => 4, Double => 8, @@ -118,9 +118,9 @@ fn classify_ty(ty: Type) -> Vec { } } - fn ty_size(ty: Type) -> uint { + fn ty_size(ty: Type) -> usize { match ty.kind() { - Integer => (ty.int_width() as uint + 7) / 8, + Integer => (ty.int_width() as usize + 7) / 8, Pointer => 8, Float => 4, Double => 8, @@ -157,7 +157,7 @@ fn classify_ty(ty: Type) -> Vec { } fn unify(cls: &mut [RegClass], - i: uint, + i: usize, newv: RegClass) { if cls[i] == newv { return } @@ -191,8 +191,8 @@ fn classify_ty(ty: Type) -> Vec { fn classify_struct(tys: &[Type], cls: &mut [RegClass], - i: uint, - off: uint, + i: usize, + off: usize, packed: bool) { let mut field_off = off; for ty in tys { @@ -205,8 +205,8 @@ fn classify_ty(ty: Type) -> Vec { } fn classify(ty: Type, - cls: &mut [RegClass], ix: uint, - off: uint) { + cls: &mut [RegClass], ix: usize, + off: usize) { let t_align = ty_align(ty); let t_size = ty_size(ty); @@ -331,7 +331,7 @@ fn classify_ty(ty: Type) -> Vec { } fn llreg_ty(ccx: &CrateContext, cls: &[RegClass]) -> Type { - fn llvec_len(cls: &[RegClass]) -> uint { + fn llvec_len(cls: &[RegClass]) -> usize { let mut len = 1; for c in cls { if *c != SSEUp { diff --git a/src/librustc_trans/trans/cleanup.rs b/src/librustc_trans/trans/cleanup.rs index ad07f3953cc..de6e439801a 100644 --- a/src/librustc_trans/trans/cleanup.rs +++ b/src/librustc_trans/trans/cleanup.rs @@ -155,12 +155,12 @@ pub struct CleanupScope<'blk, 'tcx: 'blk> { #[derive(Copy, Debug)] pub struct CustomScopeIndex { - index: uint + index: usize } -pub const EXIT_BREAK: uint = 0; -pub const EXIT_LOOP: uint = 1; -pub const EXIT_MAX: uint = 2; +pub const EXIT_BREAK: usize = 0; +pub const EXIT_LOOP: usize = 1; +pub const EXIT_MAX: usize = 2; pub enum CleanupScopeKind<'blk, 'tcx: 'blk> { CustomScopeKind, @@ -188,7 +188,7 @@ impl<'blk, 'tcx: 'blk> fmt::Debug for CleanupScopeKind<'blk, 'tcx> { pub enum EarlyExitLabel { UnwindExit, ReturnExit, - LoopExit(ast::NodeId, uint) + LoopExit(ast::NodeId, usize) } #[derive(Copy)] @@ -357,7 +357,7 @@ impl<'blk, 'tcx> CleanupMethods<'blk, 'tcx> for FunctionContext<'blk, 'tcx> { /// break/continue (depending on `exit`) out of the loop with id `cleanup_scope` fn normal_exit_block(&'blk self, cleanup_scope: ast::NodeId, - exit: uint) -> BasicBlockRef { + exit: usize) -> BasicBlockRef { self.trans_cleanups_to_exit_scope(LoopExit(cleanup_scope, exit)) } @@ -585,7 +585,7 @@ impl<'blk, 'tcx> CleanupHelperMethods<'blk, 'tcx> for FunctionContext<'blk, 'tcx None } - fn top_nonempty_cleanup_scope(&self) -> Option { + fn top_nonempty_cleanup_scope(&self) -> Option { self.scopes.borrow().iter().rev().position(|s| !s.cleanups.is_empty()) } @@ -614,7 +614,7 @@ impl<'blk, 'tcx> CleanupHelperMethods<'blk, 'tcx> for FunctionContext<'blk, 'tcx bcx } - fn scopes_len(&self) -> uint { + fn scopes_len(&self) -> usize { self.scopes.borrow().len() } @@ -962,7 +962,7 @@ impl<'blk, 'tcx> CleanupScopeKind<'blk, 'tcx> { /// If this is a loop scope with id `id`, return the early exit block `exit`, else `None` fn early_exit_block(&self, id: ast::NodeId, - exit: uint) -> Option { + exit: usize) -> Option { match *self { LoopScopeKind(i, ref exits) if id == i => Some(exits[exit].llbb), _ => None, @@ -1182,7 +1182,7 @@ pub trait CleanupMethods<'blk, 'tcx> { fn top_loop_scope(&self) -> ast::NodeId; fn normal_exit_block(&'blk self, cleanup_scope: ast::NodeId, - exit: uint) -> BasicBlockRef; + exit: usize) -> BasicBlockRef; fn return_exit_block(&'blk self) -> BasicBlockRef; fn schedule_lifetime_end(&self, cleanup_scope: ScopeId, @@ -1225,7 +1225,7 @@ pub trait CleanupMethods<'blk, 'tcx> { trait CleanupHelperMethods<'blk, 'tcx> { fn top_ast_scope(&self) -> Option; - fn top_nonempty_cleanup_scope(&self) -> Option; + fn top_nonempty_cleanup_scope(&self) -> Option; fn is_valid_to_pop_custom_scope(&self, custom_scope: CustomScopeIndex) -> bool; fn is_valid_custom_scope(&self, custom_scope: CustomScopeIndex) -> bool; fn trans_scope_cleanups(&self, @@ -1235,7 +1235,7 @@ trait CleanupHelperMethods<'blk, 'tcx> { label: EarlyExitLabel) -> BasicBlockRef; fn get_or_create_landing_pad(&'blk self) -> BasicBlockRef; - fn scopes_len(&self) -> uint; + fn scopes_len(&self) -> usize; fn push_scope(&self, scope: CleanupScope<'blk, 'tcx>); fn pop_scope(&self) -> CleanupScope<'blk, 'tcx>; fn top_scope(&self, f: F) -> R where F: FnOnce(&CleanupScope<'blk, 'tcx>) -> R; diff --git a/src/librustc_trans/trans/common.rs b/src/librustc_trans/trans/common.rs index 61cdde3bfbe..1644871492a 100644 --- a/src/librustc_trans/trans/common.rs +++ b/src/librustc_trans/trans/common.rs @@ -459,7 +459,7 @@ pub struct FunctionContext<'a, 'tcx: 'a> { } impl<'a, 'tcx> FunctionContext<'a, 'tcx> { - pub fn arg_pos(&self, arg: uint) -> uint { + pub fn arg_pos(&self, arg: usize) -> usize { let arg = self.env_arg_pos() + arg; if self.llenv.is_some() { arg + 1 @@ -468,7 +468,7 @@ impl<'a, 'tcx> FunctionContext<'a, 'tcx> { } } - pub fn env_arg_pos(&self) -> uint { + pub fn env_arg_pos(&self) -> usize { if self.caller_expects_out_pointer { 1 } else { @@ -846,13 +846,13 @@ pub trait AsU64 { fn as_u64(self) -> u64; } // are host-architecture-dependent impl AsI64 for i64 { fn as_i64(self) -> i64 { self as i64 }} impl AsI64 for i32 { fn as_i64(self) -> i64 { self as i64 }} -impl AsI64 for int { fn as_i64(self) -> i64 { self as i64 }} +impl AsI64 for isize { fn as_i64(self) -> i64 { self as i64 }} impl AsU64 for u64 { fn as_u64(self) -> u64 { self as u64 }} impl AsU64 for u32 { fn as_u64(self) -> u64 { self as u64 }} -impl AsU64 for uint { fn as_u64(self) -> u64 { self as u64 }} +impl AsU64 for usize { fn as_u64(self) -> u64 { self as u64 }} -pub fn C_u8(ccx: &CrateContext, i: uint) -> ValueRef { +pub fn C_u8(ccx: &CrateContext, i: usize) -> ValueRef { C_integral(Type::i8(ccx), i as u64, false) } diff --git a/src/librustc_trans/trans/consts.rs b/src/librustc_trans/trans/consts.rs index 4b1a03e47e7..348335139da 100644 --- a/src/librustc_trans/trans/consts.rs +++ b/src/librustc_trans/trans/consts.rs @@ -53,7 +53,7 @@ pub fn const_lit(cx: &CrateContext, e: &ast::Expr, lit: &ast::Lit) } _ => cx.sess().span_bug(lit.span, &format!("integer literal has type {} (expected int \ - or uint)", + or usize)", ty_to_string(cx.tcx(), lit_int_ty))) } } @@ -652,8 +652,8 @@ fn const_expr_unadjusted<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, let unit_ty = ty::sequence_element_type(cx.tcx(), ety); let llunitty = type_of::type_of(cx, unit_ty); let n = match const_eval::eval_const_expr_partial(cx.tcx(), &**count, None) { - Ok(const_eval::const_int(i)) => i as uint, - Ok(const_eval::const_uint(i)) => i as uint, + Ok(const_eval::const_int(i)) => i as usize, + Ok(const_eval::const_uint(i)) => i as usize, _ => cx.sess().span_bug(count.span, "count must be integral const expression.") }; let unit_val = const_expr(cx, &**elem, param_substs).0; diff --git a/src/librustc_trans/trans/context.rs b/src/librustc_trans/trans/context.rs index 6614d538971..5239389a593 100644 --- a/src/librustc_trans/trans/context.rs +++ b/src/librustc_trans/trans/context.rs @@ -38,17 +38,17 @@ use syntax::ast; use syntax::parse::token::InternedString; pub struct Stats { - pub n_glues_created: Cell, - pub n_null_glues: Cell, - pub n_real_glues: Cell, - pub n_fns: Cell, - pub n_monos: Cell, - pub n_inlines: Cell, - pub n_closures: Cell, - pub n_llvm_insns: Cell, - pub llvm_insns: RefCell>, + pub n_glues_created: Cell, + pub n_null_glues: Cell, + pub n_real_glues: Cell, + pub n_fns: Cell, + pub n_monos: Cell, + pub n_inlines: Cell, + pub n_closures: Cell, + pub n_llvm_insns: Cell, + pub llvm_insns: RefCell>, // (ident, llvm-instructions) - pub fn_stats: RefCell >, + pub fn_stats: RefCell >, } /// The shared portion of a `CrateContext`. There is one `SharedCrateContext` @@ -95,7 +95,7 @@ pub struct LocalCrateContext<'tcx> { external_srcs: RefCell>, /// Cache instances of monomorphized functions monomorphized: RefCell, ValueRef>>, - monomorphizing: RefCell>, + monomorphizing: RefCell>, /// Cache generated vtables vtables: RefCell, ValueRef>>, /// Cache of constant strings, @@ -149,7 +149,7 @@ pub struct LocalCrateContext<'tcx> { /// Number of LLVM instructions translated into this `LocalCrateContext`. /// This is used to perform some basic load-balancing to keep all LLVM /// contexts around the same size. - n_llvm_insns: Cell, + n_llvm_insns: Cell, trait_cache: RefCell, traits::Vtable<'tcx, ()>>>, @@ -160,12 +160,12 @@ pub struct CrateContext<'a, 'tcx: 'a> { local: &'a LocalCrateContext<'tcx>, /// The index of `local` in `shared.local_ccxs`. This is used in /// `maybe_iter(true)` to identify the original `LocalCrateContext`. - index: uint, + index: usize, } pub struct CrateContextIterator<'a, 'tcx: 'a> { shared: &'a SharedCrateContext<'tcx>, - index: uint, + index: usize, } impl<'a, 'tcx> Iterator for CrateContextIterator<'a,'tcx> { @@ -190,9 +190,9 @@ impl<'a, 'tcx> Iterator for CrateContextIterator<'a,'tcx> { /// The iterator produced by `CrateContext::maybe_iter`. pub struct CrateContextMaybeIterator<'a, 'tcx: 'a> { shared: &'a SharedCrateContext<'tcx>, - index: uint, + index: usize, single: bool, - origin: uint, + origin: usize, } impl<'a, 'tcx> Iterator for CrateContextMaybeIterator<'a, 'tcx> { @@ -236,7 +236,7 @@ unsafe fn create_context_and_module(sess: &Session, mod_name: &str) -> (ContextR impl<'tcx> SharedCrateContext<'tcx> { pub fn new(crate_name: &str, - local_count: uint, + local_count: usize, tcx: ty::ctxt<'tcx>, export_map: ExportMap, symbol_hasher: Sha256, @@ -299,7 +299,7 @@ impl<'tcx> SharedCrateContext<'tcx> { } } - pub fn get_ccx<'a>(&'a self, index: uint) -> CrateContext<'a, 'tcx> { + pub fn get_ccx<'a>(&'a self, index: usize) -> CrateContext<'a, 'tcx> { CrateContext { shared: self, local: &self.local_ccxs[index], @@ -456,7 +456,7 @@ impl<'tcx> LocalCrateContext<'tcx> { CrateContext { shared: shared, local: self, - index: -1 as uint, + index: -1 as usize, } } } @@ -588,7 +588,7 @@ impl<'b, 'tcx> CrateContext<'b, 'tcx> { &self.local.monomorphized } - pub fn monomorphizing<'a>(&'a self) -> &'a RefCell> { + pub fn monomorphizing<'a>(&'a self) -> &'a RefCell> { &self.local.monomorphizing } diff --git a/src/librustc_trans/trans/controlflow.rs b/src/librustc_trans/trans/controlflow.rs index 85d0bc0319f..bd31580333f 100644 --- a/src/librustc_trans/trans/controlflow.rs +++ b/src/librustc_trans/trans/controlflow.rs @@ -293,7 +293,7 @@ pub fn trans_loop<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, pub fn trans_break_cont<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, expr: &ast::Expr, opt_label: Option, - exit: uint) + exit: usize) -> Block<'blk, 'tcx> { let _icx = push_ctxt("trans_break_cont"); let fcx = bcx.fcx; diff --git a/src/librustc_trans/trans/debuginfo.rs b/src/librustc_trans/trans/debuginfo.rs index e0dd1cf8389..f2c24501c66 100644 --- a/src/librustc_trans/trans/debuginfo.rs +++ b/src/librustc_trans/trans/debuginfo.rs @@ -694,7 +694,7 @@ impl FunctionDebugContext { struct FunctionDebugContextData { scope_map: RefCell>, fn_metadata: DISubprogram, - argument_counter: Cell, + argument_counter: Cell, source_locations_enabled: Cell, source_location_override: Cell, } @@ -708,7 +708,7 @@ enum VariableAccess<'a> { } enum VariableKind { - ArgumentVariable(uint /*index*/), + ArgumentVariable(usize /*index*/), LocalVariable, CapturedVariable, } @@ -876,7 +876,7 @@ pub fn create_local_var_metadata(bcx: Block, local: &ast::Local) { pub fn create_captured_var_metadata<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, node_id: ast::NodeId, env_pointer: ValueRef, - env_index: uint, + env_index: usize, captured_by_ref: bool, span: Span) { if bcx.unreachable.get() || @@ -1873,7 +1873,7 @@ fn pointer_type_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, //=----------------------------------------------------------------------------- enum MemberOffset { - FixedMemberOffset { bytes: uint }, + FixedMemberOffset { bytes: usize }, // For ComputedMemberOffset, the offset is read from the llvm type definition ComputedMemberOffset } @@ -2022,7 +2022,7 @@ impl<'tcx> StructMemberDescriptionFactory<'tcx> { } let field_size = if self.is_simd { - machine::llsize_of_alloc(cx, type_of::type_of(cx, self.fields[0].mt.ty)) as uint + machine::llsize_of_alloc(cx, type_of::type_of(cx, self.fields[0].mt.ty)) as usize } else { 0xdeadbeef }; @@ -2245,7 +2245,7 @@ impl<'tcx> EnumMemberDescriptionFactory<'tcx> { // DWARF representation of enums uniform. // First create a description of the artificial wrapper struct: - let non_null_variant = &(*self.variants)[non_null_variant_index as uint]; + let non_null_variant = &(*self.variants)[non_null_variant_index as usize]; let non_null_variant_name = token::get_name(non_null_variant.name); // The llvm type and metadata of the pointer @@ -2290,7 +2290,7 @@ impl<'tcx> EnumMemberDescriptionFactory<'tcx> { // Encode the information about the null variant in the union // member's name. - let null_variant_index = (1 - non_null_variant_index) as uint; + let null_variant_index = (1 - non_null_variant_index) as usize; let null_variant_name = token::get_name((*self.variants)[null_variant_index].name); let union_member_name = format!("RUST$ENCODED$ENUM${}${}", 0, @@ -2316,7 +2316,7 @@ impl<'tcx> EnumMemberDescriptionFactory<'tcx> { describe_enum_variant(cx, self.enum_type, struct_def, - &*(*self.variants)[nndiscr as uint], + &*(*self.variants)[nndiscr as usize], OptimizedDiscriminant, self.containing_scope, self.span); @@ -2331,7 +2331,7 @@ impl<'tcx> EnumMemberDescriptionFactory<'tcx> { // Encode the information about the null variant in the union // member's name. - let null_variant_index = (1 - nndiscr) as uint; + let null_variant_index = (1 - nndiscr) as usize; let null_variant_name = token::get_name((*self.variants)[null_variant_index].name); let discrfield = discrfield.iter() .skip(1) @@ -2813,7 +2813,7 @@ fn vec_slice_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, MemberDescription { name: "length".to_string(), llvm_type: member_llvm_types[1], - type_metadata: type_metadata(cx, cx.tcx().types.uint, span), + type_metadata: type_metadata(cx, cx.tcx().types.usize, span), offset: ComputedMemberOffset, flags: FLAGS_NONE }, @@ -3108,12 +3108,12 @@ impl MetadataCreationResult { #[derive(Copy, PartialEq)] enum InternalDebugLocation { - KnownLocation { scope: DIScope, line: uint, col: uint }, + KnownLocation { scope: DIScope, line: usize, col: usize }, UnknownLocation } impl InternalDebugLocation { - fn new(scope: DIScope, line: uint, col: uint) -> InternalDebugLocation { + fn new(scope: DIScope, line: usize, col: usize) -> InternalDebugLocation { KnownLocation { scope: scope, line: line, diff --git a/src/librustc_trans/trans/expr.rs b/src/librustc_trans/trans/expr.rs index c5a22c0da9d..b064f16ebd4 100644 --- a/src/librustc_trans/trans/expr.rs +++ b/src/librustc_trans/trans/expr.rs @@ -521,7 +521,7 @@ fn apply_adjustments<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, fn unsize_unique_vec<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, expr: &ast::Expr, datum: Datum<'tcx, Expr>, - len: uint) + len: usize) -> DatumBlock<'blk, 'tcx, Expr> { let mut bcx = bcx; let tcx = bcx.tcx(); @@ -744,7 +744,7 @@ fn trans_field<'blk, 'tcx, F>(bcx: Block<'blk, 'tcx>, base: &ast::Expr, get_idx: F) -> DatumBlock<'blk, 'tcx, Expr> where - F: FnOnce(&'blk ty::ctxt<'tcx>, &[ty::field<'tcx>]) -> uint, + F: FnOnce(&'blk ty::ctxt<'tcx>, &[ty::field<'tcx>]) -> usize, { let mut bcx = bcx; let _icx = push_ctxt("trans_rec_field"); @@ -785,7 +785,7 @@ fn trans_rec_field<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, /// Translates `base.`. fn trans_rec_tup_field<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, base: &ast::Expr, - idx: uint) + idx: usize) -> DatumBlock<'blk, 'tcx, Expr> { trans_field(bcx, base, |_, _| idx) } @@ -1149,7 +1149,7 @@ fn trans_rvalue_dps_unadjusted<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, } } ast::ExprTup(ref args) => { - let numbered_fields: Vec<(uint, &ast::Expr)> = + let numbered_fields: Vec<(usize, &ast::Expr)> = args.iter().enumerate().map(|(i, arg)| (i, &**arg)).collect(); trans_adt(bcx, expr_ty(bcx, expr), @@ -1485,7 +1485,7 @@ pub struct StructBaseInfo<'a, 'tcx> { /// The base expression; will be evaluated after all explicit fields. expr: &'a ast::Expr, /// The indices of fields to copy paired with their types. - fields: Vec<(uint, Ty<'tcx>)> + fields: Vec<(usize, Ty<'tcx>)> } /// Constructs an ADT instance: @@ -1499,7 +1499,7 @@ pub struct StructBaseInfo<'a, 'tcx> { pub fn trans_adt<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>, ty: Ty<'tcx>, discr: ty::Disr, - fields: &[(uint, &ast::Expr)], + fields: &[(usize, &ast::Expr)], optbase: Option>, dest: Dest, debug_location: DebugLoc) @@ -2228,7 +2228,7 @@ fn auto_ref<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, fn deref_multiple<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, expr: &ast::Expr, datum: Datum<'tcx, Expr>, - times: uint) + times: usize) -> DatumBlock<'blk, 'tcx, Expr> { let mut bcx = bcx; let mut datum = datum; diff --git a/src/librustc_trans/trans/intrinsic.rs b/src/librustc_trans/trans/intrinsic.rs index f714c5800c5..f6db40b684e 100644 --- a/src/librustc_trans/trans/intrinsic.rs +++ b/src/librustc_trans/trans/intrinsic.rs @@ -121,10 +121,10 @@ pub fn check_intrinsics(ccx: &CrateContext) { &format!("transmute called on types with potentially different sizes: \ {} (could be {} bit{}) to {} (could be {} bit{})", ty_to_string(ccx.tcx(), transmute_restriction.original_from), - from_type_size as uint, + from_type_size as usize, if from_type_size == 1 {""} else {"s"}, ty_to_string(ccx.tcx(), transmute_restriction.original_to), - to_type_size as uint, + to_type_size as usize, if to_type_size == 1 {""} else {"s"})); } else { ccx.sess().span_err( @@ -132,10 +132,10 @@ pub fn check_intrinsics(ccx: &CrateContext) { &format!("transmute called on types with different sizes: \ {} ({} bit{}) to {} ({} bit{})", ty_to_string(ccx.tcx(), transmute_restriction.original_from), - from_type_size as uint, + from_type_size as usize, if from_type_size == 1 {""} else {"s"}, ty_to_string(ccx.tcx(), transmute_restriction.original_to), - to_type_size as uint, + to_type_size as usize, if to_type_size == 1 {""} else {"s"})); } } diff --git a/src/librustc_trans/trans/machine.rs b/src/librustc_trans/trans/machine.rs index 9b17c4f8baa..ce37d38dc89 100644 --- a/src/librustc_trans/trans/machine.rs +++ b/src/librustc_trans/trans/machine.rs @@ -99,7 +99,7 @@ pub fn llalign_of_min(cx: &CrateContext, ty: Type) -> llalign { } } -pub fn llelement_offset(cx: &CrateContext, struct_ty: Type, element: uint) -> u64 { +pub fn llelement_offset(cx: &CrateContext, struct_ty: Type, element: usize) -> u64 { unsafe { return llvm::LLVMOffsetOfElement(cx.td().lltd, struct_ty.to_ref(), element as u32); diff --git a/src/librustc_trans/trans/meth.rs b/src/librustc_trans/trans/meth.rs index 1a38b3d1426..ea1d4690f05 100644 --- a/src/librustc_trans/trans/meth.rs +++ b/src/librustc_trans/trans/meth.rs @@ -47,7 +47,7 @@ use syntax::codemap::DUMMY_SP; use syntax::ptr::P; // drop_glue pointer, size, align. -const VTABLE_OFFSET: uint = 3; +const VTABLE_OFFSET: usize = 3; /// The main "translation" pass for methods. Generates code /// for non-monomorphized methods only. Other methods will @@ -325,7 +325,7 @@ fn method_with_name(ccx: &CrateContext, impl_id: ast::DefId, name: ast::Name) fn trans_monomorphized_callee<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, method_call: MethodCall, trait_id: ast::DefId, - n_method: uint, + n_method: usize, vtable: traits::Vtable<'tcx, ()>) -> Callee<'blk, 'tcx> { let _icx = push_ctxt("meth::trans_monomorphized_callee"); @@ -437,7 +437,7 @@ fn combine_impl_and_methods_tps<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, /// extract the self data and vtable out of the pair. fn trans_trait_callee<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, method_ty: Ty<'tcx>, - vtable_index: uint, + vtable_index: usize, self_expr: &ast::Expr, arg_cleanup_scope: cleanup::ScopeId) -> Callee<'blk, 'tcx> { @@ -474,7 +474,7 @@ fn trans_trait_callee<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, /// pair. pub fn trans_trait_callee_from_llval<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, callee_ty: Ty<'tcx>, - vtable_index: uint, + vtable_index: usize, llpair: ValueRef) -> Callee<'blk, 'tcx> { let _icx = push_ctxt("meth::trans_trait_callee"); @@ -547,7 +547,7 @@ pub fn trans_object_shim<'a, 'tcx>( ccx: &'a CrateContext<'a, 'tcx>, object_ty: Ty<'tcx>, upcast_trait_ref: ty::PolyTraitRef<'tcx>, - method_offset_in_trait: uint) + method_offset_in_trait: usize) -> (ValueRef, Ty<'tcx>) { let _icx = push_ctxt("trans_object_shim"); diff --git a/src/librustc_trans/trans/tvec.rs b/src/librustc_trans/trans/tvec.rs index 6a35a1a55b6..8f1ef84386f 100644 --- a/src/librustc_trans/trans/tvec.rs +++ b/src/librustc_trans/trans/tvec.rs @@ -265,7 +265,7 @@ fn vec_types<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, unit_ty: Ty<'tcx>) } } -fn elements_required(bcx: Block, content_expr: &ast::Expr) -> uint { +fn elements_required(bcx: Block, content_expr: &ast::Expr) -> usize { //! Figure out the number of elements we need to store this content match content_expr.node { @@ -291,7 +291,7 @@ fn elements_required(bcx: Block, content_expr: &ast::Expr) -> uint { /// which should be by ref. pub fn get_fixed_base_and_len(bcx: Block, llval: ValueRef, - vec_length: uint) + vec_length: usize) -> (ValueRef, ValueRef) { let ccx = bcx.ccx(); diff --git a/src/librustc_trans/trans/type_.rs b/src/librustc_trans/trans/type_.rs index 17c756a33f2..339b4734ee4 100644 --- a/src/librustc_trans/trans/type_.rs +++ b/src/librustc_trans/trans/type_.rs @@ -239,21 +239,21 @@ impl Type { } /// Return the number of elements in `self` if it is a LLVM vector type. - pub fn vector_length(&self) -> uint { + pub fn vector_length(&self) -> usize { unsafe { - llvm::LLVMGetVectorSize(self.to_ref()) as uint + llvm::LLVMGetVectorSize(self.to_ref()) as usize } } - pub fn array_length(&self) -> uint { + pub fn array_length(&self) -> usize { unsafe { - llvm::LLVMGetArrayLength(self.to_ref()) as uint + llvm::LLVMGetArrayLength(self.to_ref()) as usize } } pub fn field_types(&self) -> Vec { unsafe { - let n_elts = llvm::LLVMCountStructElementTypes(self.to_ref()) as uint; + let n_elts = llvm::LLVMCountStructElementTypes(self.to_ref()) as usize; if n_elts == 0 { return Vec::new(); } @@ -270,7 +270,7 @@ impl Type { pub fn func_params(&self) -> Vec { unsafe { - let n_args = llvm::LLVMCountParamTypes(self.to_ref()) as uint; + let n_args = llvm::LLVMCountParamTypes(self.to_ref()) as usize; let mut args: Vec<_> = repeat(Type { rf: ptr::null_mut() }).take(n_args).collect(); llvm::LLVMGetParamTypes(self.to_ref(), args.as_mut_ptr() as *mut TypeRef); @@ -278,7 +278,7 @@ impl Type { } } - pub fn float_width(&self) -> uint { + pub fn float_width(&self) -> usize { match self.kind() { Float => 32, Double => 64, diff --git a/src/librustc_trans/trans/value.rs b/src/librustc_trans/trans/value.rs index 464522f167b..c2d91e4e160 100644 --- a/src/librustc_trans/trans/value.rs +++ b/src/librustc_trans/trans/value.rs @@ -107,7 +107,7 @@ impl Value { /// Returns the requested operand of this instruction /// Returns None, if there's no operand at the given index - pub fn get_operand(self, i: uint) -> Option { + pub fn get_operand(self, i: usize) -> Option { opt_val!(llvm::LLVMGetOperand(self.get(), i as c_uint)) } diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index e9de8bd879e..0d6ca7430d3 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -504,9 +504,9 @@ fn convert_angle_bracketed_parameters<'tcx>(this: &AstConv<'tcx>, /// (if one exists) and a vector of the (pattern, number of lifetimes) /// corresponding to each input type/pattern. fn find_implied_output_region(input_tys: &[Ty], input_pats: Vec) - -> (Option, Vec<(String, uint)>) + -> (Option, Vec<(String, usize)>) { - let mut lifetimes_for_params: Vec<(String, uint)> = Vec::new(); + let mut lifetimes_for_params: Vec<(String, usize)> = Vec::new(); let mut possible_implied_output_region = None; for (input_type, input_pat) in input_tys.iter().zip(input_pats.into_iter()) { @@ -534,7 +534,7 @@ fn find_implied_output_region(input_tys: &[Ty], input_pats: Vec) fn convert_ty_with_lifetime_elision<'tcx>(this: &AstConv<'tcx>, implied_output_region: Option, - param_lifetimes: Vec<(String, uint)>, + param_lifetimes: Vec<(String, usize)>, ty: &ast::Ty) -> Ty<'tcx> { @@ -1401,15 +1401,15 @@ pub fn ast_ty_to_ty<'tcx>(this: &AstConv<'tcx>, ty } ast::TyFixedLengthVec(ref ty, ref e) => { - match const_eval::eval_const_expr_partial(tcx, &**e, Some(tcx.types.uint)) { + match const_eval::eval_const_expr_partial(tcx, &**e, Some(tcx.types.usize)) { Ok(r) => { match r { const_eval::const_int(i) => ty::mk_vec(tcx, ast_ty_to_ty(this, rscope, &**ty), - Some(i as uint)), + Some(i as usize)), const_eval::const_uint(i) => ty::mk_vec(tcx, ast_ty_to_ty(this, rscope, &**ty), - Some(i as uint)), + Some(i as usize)), _ => { span_err!(tcx.sess, ast_ty.span, E0249, "expected constant expr for array length"); @@ -1666,7 +1666,7 @@ fn determine_explicit_self_category<'a, 'tcx>(this: &AstConv<'tcx>, } }; - fn count_modifiers(ty: Ty) -> uint { + fn count_modifiers(ty: Ty) -> usize { match ty.sty { ty::ty_rptr(_, mt) => count_modifiers(mt.ty) + 1, ty::ty_uniq(t) => count_modifiers(t) + 1, diff --git a/src/librustc_typeck/check/dropck.rs b/src/librustc_typeck/check/dropck.rs index c48033cab89..49f4399b2c7 100644 --- a/src/librustc_typeck/check/dropck.rs +++ b/src/librustc_typeck/check/dropck.rs @@ -339,8 +339,8 @@ fn iterate_over_potentially_unsafe_regions_in_type<'a, 'tcx>( ty_root: ty::Ty<'tcx>, span: Span, scope: region::CodeExtent, - depth: uint, - xref_depth: uint) -> Result<(), Error<'tcx>> + depth: usize, + xref_depth: usize) -> Result<(), Error<'tcx>> { // Issue #22443: Watch out for overflow. While we are careful to // handle regular types properly, non-regular ones cause problems. diff --git a/src/librustc_typeck/check/method/mod.rs b/src/librustc_typeck/check/method/mod.rs index 7ef2db2c28d..930ba4ae03e 100644 --- a/src/librustc_typeck/check/method/mod.rs +++ b/src/librustc_typeck/check/method/mod.rs @@ -58,7 +58,7 @@ pub enum CandidateSource { TraitSource(/* trait id */ ast::DefId), } -type MethodIndex = uint; // just for doc purposes +type MethodIndex = usize; // just for doc purposes /// Determines whether the type `self_ty` supports a method name `method_name` or not. pub fn exists<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>, @@ -334,7 +334,7 @@ pub fn resolve_ufcs<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>, fn trait_method<'tcx>(tcx: &ty::ctxt<'tcx>, trait_def_id: ast::DefId, method_name: ast::Name) - -> Option<(uint, Rc>)> + -> Option<(usize, Rc>)> { let trait_items = ty::trait_items(tcx, trait_def_id); trait_items diff --git a/src/librustc_typeck/check/method/probe.rs b/src/librustc_typeck/check/method/probe.rs index 49406d3ae33..d1ebfe7d26e 100644 --- a/src/librustc_typeck/check/method/probe.rs +++ b/src/librustc_typeck/check/method/probe.rs @@ -60,7 +60,7 @@ struct Candidate<'tcx> { enum CandidateKind<'tcx> { InherentImplCandidate(/* Impl */ ast::DefId, subst::Substs<'tcx>), - ObjectCandidate(/* Trait */ ast::DefId, /* method_num */ uint, /* vtable index */ uint), + ObjectCandidate(/* Trait */ ast::DefId, /* method_num */ usize, /* vtable index */ usize), ExtensionImplCandidate(/* Impl */ ast::DefId, Rc>, subst::Substs<'tcx>, MethodIndex), ClosureCandidate(/* Trait */ ast::DefId, MethodIndex), @@ -77,7 +77,7 @@ pub struct Pick<'tcx> { #[derive(Clone,Debug)] pub enum PickKind<'tcx> { InherentImplPick(/* Impl */ ast::DefId), - ObjectPick(/* Trait */ ast::DefId, /* method_num */ uint, /* real_index */ uint), + ObjectPick(/* Trait */ ast::DefId, /* method_num */ usize, /* real_index */ usize), ExtensionImplPick(/* Impl */ ast::DefId, MethodIndex), TraitPick(/* Trait */ ast::DefId, MethodIndex), WhereClausePick(/* Trait */ ty::PolyTraitRef<'tcx>, MethodIndex), @@ -94,14 +94,14 @@ pub enum PickAdjustment { // Indicates that the source expression should be autoderef'd N times // // A = expr | *expr | **expr - AutoDeref(uint), + AutoDeref(usize), // Indicates that the source expression should be autoderef'd N // times and then "unsized". This should probably eventually go // away in favor of just coercing method receivers. // // A = unsize(expr | *expr | **expr) - AutoUnsizeLength(/* number of autoderefs */ uint, /* length*/ uint), + AutoUnsizeLength(/* number of autoderefs */ usize, /* length*/ usize), // Indicates that an autoref is applied after some number of other adjustments // @@ -526,7 +526,7 @@ impl<'a,'tcx> ProbeContext<'a,'tcx> { &mut ProbeContext<'b, 'tcx>, ty::PolyTraitRef<'tcx>, Rc>, - uint, + usize, ), { debug!("elaborate_bounds(bounds={})", bounds.repr(self.tcx())); @@ -625,7 +625,7 @@ impl<'a,'tcx> ProbeContext<'a,'tcx> { fn assemble_extension_candidates_for_trait_impls(&mut self, trait_def_id: ast::DefId, method: Rc>, - method_index: uint) + method_index: usize) { ty::populate_implementations_for_trait_if_necessary(self.tcx(), trait_def_id); @@ -692,7 +692,7 @@ impl<'a,'tcx> ProbeContext<'a,'tcx> { fn assemble_closure_candidates(&mut self, trait_def_id: ast::DefId, method_ty: Rc>, - method_index: uint) + method_index: usize) -> Result<(),MethodError> { // Check if this is one of the Fn,FnMut,FnOnce traits. @@ -754,7 +754,7 @@ impl<'a,'tcx> ProbeContext<'a,'tcx> { fn assemble_projection_candidates(&mut self, trait_def_id: ast::DefId, method: Rc>, - method_index: uint) + method_index: usize) { debug!("assemble_projection_candidates(\ trait_def_id={}, \ @@ -815,7 +815,7 @@ impl<'a,'tcx> ProbeContext<'a,'tcx> { fn assemble_where_clause_candidates(&mut self, trait_def_id: ast::DefId, method_ty: Rc>, - method_index: uint) + method_index: usize) { debug!("assemble_where_clause_candidates(trait_def_id={})", trait_def_id.repr(self.tcx())); @@ -933,7 +933,7 @@ impl<'a,'tcx> ProbeContext<'a,'tcx> { return self.pick_method(step.self_ty).map(|r| self.adjust(r, adjustment.clone())); - fn consider_reborrow<'tcx>(ty: Ty<'tcx>, d: uint) -> PickAdjustment { + fn consider_reborrow<'tcx>(ty: Ty<'tcx>, d: usize) -> PickAdjustment { // Insert a `&*` or `&mut *` if this is a reference type: match ty.sty { ty::ty_rptr(_, ref mt) => AutoRef(mt.mutbl, box AutoDeref(d+1)), @@ -1100,7 +1100,7 @@ impl<'a,'tcx> ProbeContext<'a,'tcx> { /// ``` /// trait Foo { ... } /// impl Foo for Vec { ... } - /// impl Foo for Vec { ... } + /// impl Foo for Vec { ... } /// ``` /// /// Now imagine the receiver is `Vec<_>`. It doesn't really matter at this time which impl we @@ -1281,7 +1281,7 @@ fn impl_method<'tcx>(tcx: &ty::ctxt<'tcx>, fn trait_method<'tcx>(tcx: &ty::ctxt<'tcx>, trait_def_id: ast::DefId, method_name: ast::Name) - -> Option<(uint, Rc>)> + -> Option<(usize, Rc>)> { let trait_items = ty::trait_items(tcx, trait_def_id); debug!("trait_method; items: {:?}", trait_items); diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index aef7557a906..9b107c4227b 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -310,7 +310,7 @@ pub struct FnCtxt<'a, 'tcx: 'a> { // checking this function. On exit, if we find that *more* errors // have been reported, we will skip regionck and other work that // expects the types within the function to be consistent. - err_count_on_creation: uint, + err_count_on_creation: usize, ret_ty: ty::FnOutput<'tcx>, @@ -468,7 +468,7 @@ impl<'a, 'tcx> Visitor<'tcx> for CheckItemTypesVisitor<'a, 'tcx> { fn visit_ty(&mut self, t: &'tcx ast::Ty) { match t.node { ast::TyFixedLengthVec(_, ref expr) => { - check_const_in_type(self.ccx, &**expr, self.ccx.tcx.types.uint); + check_const_in_type(self.ccx, &**expr, self.ccx.tcx.types.usize); } _ => {} } @@ -612,7 +612,7 @@ impl<'a, 'tcx> Visitor<'tcx> for GatherLocalsVisitor<'a, 'tcx> { match t.node { ast::TyFixedLengthVec(ref ty, ref count_expr) => { self.visit_ty(&**ty); - check_expr_with_hint(self.fcx, &**count_expr, self.fcx.tcx().types.uint); + check_expr_with_hint(self.fcx, &**count_expr, self.fcx.tcx().types.usize); } _ => visit::walk_ty(self, t) } @@ -1314,7 +1314,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { &self.tcx().sess } - pub fn err_count_since_creation(&self) -> uint { + pub fn err_count_since_creation(&self) -> usize { self.ccx.tcx.sess.err_count() - self.err_count_on_creation } @@ -1437,7 +1437,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { pub fn write_autoderef_adjustment(&self, node_id: ast::NodeId, span: Span, - derefs: uint) { + derefs: usize) { if derefs == 0 { return; } self.write_adjustment( node_id, @@ -1914,7 +1914,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { span: Span, class_id: ast::DefId, items: &[ty::field_ty], - idx: uint, + idx: usize, substs: &subst::Substs<'tcx>) -> Option> { @@ -1945,8 +1945,8 @@ impl<'a, 'tcx> RegionScope for FnCtxt<'a, 'tcx> { Some(self.infcx().next_region_var(infer::MiscVariable(span))) } - fn anon_regions(&self, span: Span, count: uint) - -> Result, Option>> { + fn anon_regions(&self, span: Span, count: usize) + -> Result, Option>> { Ok((0..count).map(|_| { self.infcx().next_region_var(infer::MiscVariable(span)) }).collect()) @@ -1982,8 +1982,8 @@ pub fn autoderef<'a, 'tcx, T, F>(fcx: &FnCtxt<'a, 'tcx>, unresolved_type_action: UnresolvedTypeAction, mut lvalue_pref: LvaluePreference, mut should_stop: F) - -> (Ty<'tcx>, uint, Option) - where F: FnMut(Ty<'tcx>, uint) -> Option, + -> (Ty<'tcx>, usize, Option) + where F: FnMut(Ty<'tcx>, usize) -> Option, { debug!("autoderef(base_ty={}, opt_expr={}, lvalue_pref={:?})", base_ty.repr(fcx.tcx()), @@ -2189,7 +2189,7 @@ fn try_index_step<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>, (Some(ty), &ty::ty_uint(ast::TyUs)) | (Some(ty), &ty::ty_infer(ty::IntVar(_))) => { debug!("try_index_step: success, using built-in indexing"); fcx.write_adjustment(base_expr.id, base_expr.span, ty::AdjustDerefRef(adjustment)); - return Some((tcx.types.uint, ty)); + return Some((tcx.types.usize, ty)); } _ => {} } @@ -2490,7 +2490,7 @@ fn check_argument_types<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>, } // FIXME(#17596) Ty<'tcx> is incorrectly invariant w.r.t 'tcx. -fn err_args<'tcx>(tcx: &ty::ctxt<'tcx>, len: uint) -> Vec> { +fn err_args<'tcx>(tcx: &ty::ctxt<'tcx>, len: usize) -> Vec> { (0..len).map(|_| tcx.types.err).collect() } @@ -2528,8 +2528,8 @@ fn check_lit<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>, match ty.sty { ty::ty_int(_) | ty::ty_uint(_) => Some(ty), ty::ty_char => Some(tcx.types.u8), - ty::ty_ptr(..) => Some(tcx.types.uint), - ty::ty_bare_fn(..) => Some(tcx.types.uint), + ty::ty_ptr(..) => Some(tcx.types.usize), + ty::ty_bare_fn(..) => Some(tcx.types.usize), _ => None } }); @@ -2638,7 +2638,7 @@ pub enum AutorefArgs { /// passed as a single parameter. For example, if tupling is enabled, this /// function: /// -/// fn f(x: (int, int)) +/// fn f(x: (isize, isize)) /// /// Can be called as: /// @@ -2921,7 +2921,7 @@ fn check_expr_with_unifier<'a, 'tcx, F>(fcx: &FnCtxt<'a, 'tcx>, }); if ty::type_is_integral(lhs_t) && ast_util::is_shift_binop(op.node) { - // Shift is a special case: rhs must be uint, no matter what lhs is + // Shift is a special case: rhs must be usize, no matter what lhs is check_expr(fcx, &**rhs); let rhs_ty = fcx.expr_ty(&**rhs); let rhs_ty = structurally_resolved_type(fcx, rhs.span, rhs_ty); @@ -3184,7 +3184,7 @@ fn check_expr_with_unifier<'a, 'tcx, F>(fcx: &FnCtxt<'a, 'tcx>, expr: &'tcx ast::Expr, lvalue_pref: LvaluePreference, base: &'tcx ast::Expr, - idx: codemap::Spanned) { + idx: codemap::Spanned) { let tcx = fcx.ccx.tcx; check_expr_with_lvalue_pref(fcx, base, lvalue_pref); let expr_t = structurally_resolved_type(fcx, expr.span, @@ -3834,7 +3834,7 @@ fn check_expr_with_unifier<'a, 'tcx, F>(fcx: &FnCtxt<'a, 'tcx>, } ast::ExprCast(ref e, ref t) => { if let ast::TyFixedLengthVec(_, ref count_expr) = t.node { - check_expr_with_hint(fcx, &**count_expr, tcx.types.uint); + check_expr_with_hint(fcx, &**count_expr, tcx.types.usize); } // Find the type of `e`. Supply hints based on the type we are casting to, @@ -3891,7 +3891,7 @@ fn check_expr_with_unifier<'a, 'tcx, F>(fcx: &FnCtxt<'a, 'tcx>, fcx.write_ty(id, typ); } ast::ExprRepeat(ref element, ref count_expr) => { - check_expr_has_type(fcx, &**count_expr, tcx.types.uint); + check_expr_has_type(fcx, &**count_expr, tcx.types.usize); let count = ty::eval_repeat_count(fcx.tcx(), &**count_expr); let uty = match expected { @@ -4199,16 +4199,16 @@ impl<'tcx> Expectation<'tcx> { /// is useful in determining the concrete type. /// /// The primary use case is where the expected type is a fat pointer, - /// like `&[int]`. For example, consider the following statement: + /// like `&[isize]`. For example, consider the following statement: /// - /// let x: &[int] = &[1, 2, 3]; + /// let x: &[isize] = &[1, 2, 3]; /// /// In this case, the expected type for the `&[1, 2, 3]` expression is - /// `&[int]`. If however we were to say that `[1, 2, 3]` has the - /// expectation `ExpectHasType([int])`, that would be too strong -- - /// `[1, 2, 3]` does not have the type `[int]` but rather `[int; 3]`. + /// `&[isize]`. If however we were to say that `[1, 2, 3]` has the + /// expectation `ExpectHasType([isize])`, that would be too strong -- + /// `[1, 2, 3]` does not have the type `[isize]` but rather `[isize; 3]`. /// It is only the `&[1, 2, 3]` expression as a whole that can be coerced - /// to the type `&[int]`. Therefore, we propagate this more limited hint, + /// to the type `&[isize]`. Therefore, we propagate this more limited hint, /// which still is useful, because it informs integer literals and the like. /// See the test case `test/run-pass/coerce-expect-unsized.rs` and #20169 /// for examples of where this comes up,. @@ -4655,7 +4655,9 @@ pub fn check_enum_variants<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>, let inh = static_inherited_fields(ccx); let fcx = blank_fn_ctxt(ccx, &inh, ty::FnConverging(rty), e.id); let declty = match hint { - attr::ReprAny | attr::ReprPacked | attr::ReprExtern => fcx.tcx().types.int, + attr::ReprAny | attr::ReprPacked | + attr::ReprExtern => fcx.tcx().types.isize, + attr::ReprInt(_, attr::SignedInt(ity)) => { ty::mk_mach_int(fcx.tcx(), ity) } @@ -5324,7 +5326,7 @@ pub fn check_bounds_are_used<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>, match t.sty { ty::ty_param(ParamTy {idx, ..}) => { debug!("Found use of ty param num {}", idx); - tps_used[idx as uint] = true; + tps_used[idx as usize] = true; } _ => () } @@ -5383,7 +5385,7 @@ pub fn check_intrinsic_type(ccx: &CrateCtxt, it: &ast::ForeignItem) { let (n_tps, inputs, output) = match &name[..] { "breakpoint" => (0, Vec::new(), ty::mk_nil(tcx)), "size_of" | - "pref_align_of" | "min_align_of" => (1, Vec::new(), ccx.tcx.types.uint), + "pref_align_of" | "min_align_of" => (1, Vec::new(), ccx.tcx.types.usize), "init" => (1, Vec::new(), param(ccx, 0)), "uninit" => (1, Vec::new(), param(ccx, 0)), "forget" => (1, vec!( param(ccx, 0) ), ty::mk_nil(tcx)), @@ -5412,7 +5414,7 @@ pub fn check_intrinsic_type(ccx: &CrateCtxt, it: &ast::ForeignItem) { ty: param(ccx, 0), mutbl: ast::MutImmutable }), - ccx.tcx.types.int + ccx.tcx.types.isize ), ty::mk_ptr(tcx, ty::mt { ty: param(ccx, 0), @@ -5431,7 +5433,7 @@ pub fn check_intrinsic_type(ccx: &CrateCtxt, it: &ast::ForeignItem) { ty: param(ccx, 0), mutbl: ast::MutImmutable }), - tcx.types.uint, + tcx.types.usize, ), ty::mk_nil(tcx)) } @@ -5443,7 +5445,7 @@ pub fn check_intrinsic_type(ccx: &CrateCtxt, it: &ast::ForeignItem) { mutbl: ast::MutMutable }), tcx.types.u8, - tcx.types.uint, + tcx.types.usize, ), ty::mk_nil(tcx)) } diff --git a/src/librustc_typeck/check/regionck.rs b/src/librustc_typeck/check/regionck.rs index 5a4ccc0b7b4..3edea6d3004 100644 --- a/src/librustc_typeck/check/regionck.rs +++ b/src/librustc_typeck/check/regionck.rs @@ -319,7 +319,7 @@ impl<'a, 'tcx> Rcx<'a, 'tcx> { /// This method populates the region map's `free_region_map`. It walks over the transformed /// argument and return types for each function just before we check the body of that function, /// looking for types where you have a borrowed pointer to other borrowed data (e.g., `&'a &'b - /// [uint]`. We do not allow references to outlive the things they point at, so we can assume + /// [usize]`. We do not allow references to outlive the things they point at, so we can assume /// that `'a <= 'b`. This holds for both the argument and return types, basically because, on /// the caller side, the caller is responsible for checking that the type of every expression /// (including the actual values for the arguments, as well as the return type of the fn call) @@ -862,7 +862,7 @@ fn constrain_call<'a, I: Iterator>(rcx: &mut Rcx, /// dereferenced, the lifetime of the pointer includes the deref expr. fn constrain_autoderefs<'a, 'tcx>(rcx: &mut Rcx<'a, 'tcx>, deref_expr: &ast::Expr, - derefs: uint, + derefs: usize, mut derefd_ty: Ty<'tcx>) { debug!("constrain_autoderefs(deref_expr={}, derefs={}, derefd_ty={})", @@ -1118,7 +1118,7 @@ fn link_pattern<'a, 'tcx>(rcx: &Rcx<'a, 'tcx>, /// autoref'd. fn link_autoref(rcx: &Rcx, expr: &ast::Expr, - autoderefs: uint, + autoderefs: usize, autoref: &ty::AutoRef) { debug!("link_autoref(autoref={:?})", autoref); diff --git a/src/librustc_typeck/check/wf.rs b/src/librustc_typeck/check/wf.rs index adbf4c6b210..d26d26557ab 100644 --- a/src/librustc_typeck/check/wf.rs +++ b/src/librustc_typeck/check/wf.rs @@ -528,7 +528,7 @@ pub struct BoundsChecker<'cx,'tcx:'cx> { // has left it as a NodeId rather than porting to CodeExtent. scope: ast::NodeId, - binding_count: uint, + binding_count: usize, cache: Option<&'cx mut HashSet>>, } diff --git a/src/librustc_typeck/check/writeback.rs b/src/librustc_typeck/check/writeback.rs index 2537f9362bf..e555d3085a4 100644 --- a/src/librustc_typeck/check/writeback.rs +++ b/src/librustc_typeck/check/writeback.rs @@ -169,7 +169,7 @@ impl<'cx, 'tcx, 'v> Visitor<'v> for WritebackCx<'cx, 'tcx> { match t.node { ast::TyFixedLengthVec(ref ty, ref count_expr) => { self.visit_ty(&**ty); - write_ty_to_tcx(self.tcx(), count_expr.id, self.tcx().types.uint); + write_ty_to_tcx(self.tcx(), count_expr.id, self.tcx().types.usize); } _ => visit::walk_ty(self, t) } diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index 4e7e63a5d77..91410fa808c 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -79,7 +79,6 @@ This API is completely unstable and subject to change. #![feature(box_syntax)] #![feature(collections)] #![feature(core)] -#![feature(int_uint)] #![feature(quote)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] @@ -281,10 +280,10 @@ fn check_start_fn_ty(ccx: &CrateCtxt, abi: abi::Rust, sig: ty::Binder(ty::FnSig { inputs: vec!( - tcx.types.int, + tcx.types.isize, ty::mk_imm_ptr(tcx, ty::mk_imm_ptr(tcx, tcx.types.u8)) ), - output: ty::FnConverging(tcx.types.int), + output: ty::FnConverging(tcx.types.isize), variadic: false, }), })); diff --git a/src/librustc_typeck/rscope.rs b/src/librustc_typeck/rscope.rs index b591209a638..f1050a936e2 100644 --- a/src/librustc_typeck/rscope.rs +++ b/src/librustc_typeck/rscope.rs @@ -29,8 +29,8 @@ use syntax::codemap::Span; pub trait RegionScope { fn anon_regions(&self, span: Span, - count: uint) - -> Result, Option>>; + count: usize) + -> Result, Option>>; /// If an object omits any explicit lifetime bound, and none can /// be derived from the object traits, what should we use? If @@ -50,17 +50,17 @@ impl RegionScope for ExplicitRscope { fn anon_regions(&self, _span: Span, - _count: uint) - -> Result, Option>> { + _count: usize) + -> Result, Option>> { Err(None) } } // Same as `ExplicitRscope`, but provides some extra information for diagnostics -pub struct UnelidableRscope(Vec<(String, uint)>); +pub struct UnelidableRscope(Vec<(String, usize)>); impl UnelidableRscope { - pub fn new(v: Vec<(String, uint)>) -> UnelidableRscope { + pub fn new(v: Vec<(String, usize)>) -> UnelidableRscope { UnelidableRscope(v) } } @@ -72,8 +72,8 @@ impl RegionScope for UnelidableRscope { fn anon_regions(&self, _span: Span, - _count: uint) - -> Result, Option>> { + _count: usize) + -> Result, Option>> { let UnelidableRscope(ref v) = *self; Err(Some(v.clone())) } @@ -103,8 +103,8 @@ impl RegionScope for ElidableRscope { fn anon_regions(&self, _span: Span, - count: uint) - -> Result, Option>> + count: usize) + -> Result, Option>> { Ok(repeat(self.default).take(count).collect()) } @@ -140,8 +140,8 @@ impl RegionScope for BindingRscope { fn anon_regions(&self, _: Span, - count: uint) - -> Result, Option>> + count: usize) + -> Result, Option>> { Ok((0..count).map(|_| self.next_region()).collect()) } @@ -176,8 +176,8 @@ impl<'r> RegionScope for ObjectLifetimeDefaultRscope<'r> { fn anon_regions(&self, span: Span, - count: uint) - -> Result, Option>> + count: usize) + -> Result, Option>> { self.base_scope.anon_regions(span, count) } @@ -203,8 +203,8 @@ impl<'r> RegionScope for ShiftedRscope<'r> { fn anon_regions(&self, span: Span, - count: uint) - -> Result, Option>> + count: usize) + -> Result, Option>> { match self.base_scope.anon_regions(span, count) { Ok(mut v) => { diff --git a/src/librustc_typeck/variance.rs b/src/librustc_typeck/variance.rs index ac1ff29e7f5..89b8d389f22 100644 --- a/src/librustc_typeck/variance.rs +++ b/src/librustc_typeck/variance.rs @@ -296,7 +296,7 @@ pub fn infer_variance(tcx: &ty::ctxt) { type VarianceTermPtr<'a> = &'a VarianceTerm<'a>; #[derive(Copy, Debug)] -struct InferredIndex(uint); +struct InferredIndex(usize); #[derive(Copy)] enum VarianceTerm<'a> { @@ -346,7 +346,7 @@ struct InferredInfo<'a> { item_id: ast::NodeId, kind: ParamKind, space: ParamSpace, - index: uint, + index: usize, param_id: ast::NodeId, term: VarianceTermPtr<'a>, @@ -457,7 +457,7 @@ impl<'a, 'tcx> TermsContext<'a, 'tcx> { item_id: ast::NodeId, kind: ParamKind, space: ParamSpace, - index: uint, + index: usize, param_id: ast::NodeId) { let inf_index = InferredIndex(self.inferred_infos.len()); let term = self.arena.alloc(InferredTerm(inf_index)); @@ -488,7 +488,7 @@ impl<'a, 'tcx> TermsContext<'a, 'tcx> { fn pick_initial_variance(&self, item_id: ast::NodeId, space: ParamSpace, - index: uint) + index: usize) -> ty::Variance { match space { @@ -505,7 +505,7 @@ impl<'a, 'tcx> TermsContext<'a, 'tcx> { } } - fn num_inferred(&self) -> uint { + fn num_inferred(&self) -> usize { self.inferred_infos.len() } } @@ -791,7 +791,7 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> { item_def_id: ast::DefId, kind: ParamKind, space: ParamSpace, - index: uint) + index: usize) -> VarianceTermPtr<'a> { assert_eq!(param_def_id.krate, item_def_id.krate); @@ -977,7 +977,7 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> { } ty::ty_param(ref data) => { - let def_id = generics.types.get(data.space, data.idx as uint).def_id; + let def_id = generics.types.get(data.space, data.idx as usize).def_id; assert_eq!(def_id.krate, ast::LOCAL_CRATE); match self.terms_cx.inferred_map.get(&def_id.node) { Some(&index) => { @@ -1027,9 +1027,9 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> { for p in type_param_defs { let variance_decl = self.declared_variance(p.def_id, def_id, TypeParam, - p.space, p.index as uint); + p.space, p.index as usize); let variance_i = self.xform(variance, variance_decl); - let substs_ty = *substs.types.get(p.space, p.index as uint); + let substs_ty = *substs.types.get(p.space, p.index as usize); debug!("add_constraints_from_substs: variance_decl={:?} variance_i={:?}", variance_decl, variance_i); self.add_constraints_from_ty(generics, substs_ty, variance_i); @@ -1038,9 +1038,9 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> { for p in region_param_defs { let variance_decl = self.declared_variance(p.def_id, def_id, - RegionParam, p.space, p.index as uint); + RegionParam, p.space, p.index as usize); let variance_i = self.xform(variance, variance_decl); - let substs_r = *substs.regions().get(p.space, p.index as uint); + let substs_r = *substs.regions().get(p.space, p.index as usize); self.add_constraints_from_region(generics, substs_r, variance_i); } } diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 41e05ff5162..e4d9fac5b9c 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -1322,7 +1322,7 @@ pub enum Type { /// For parameterized types, so the consumer of the JSON don't go /// looking for types which don't exist anywhere. Generic(String), - /// Primitives are the fixed-size numeric types (plus int/uint/float), char, + /// Primitives are the fixed-size numeric types (plus int/usize/float), char, /// arrays, slices, and tuples. Primitive(PrimitiveType), /// extern "ABI" fn @@ -1383,12 +1383,12 @@ pub enum TypeKind { impl PrimitiveType { fn from_str(s: &str) -> Option { match s { - "isize" | "int" => Some(Isize), + "isize" => Some(Isize), "i8" => Some(I8), "i16" => Some(I16), "i32" => Some(I32), "i64" => Some(I64), - "usize" | "uint" => Some(Usize), + "usize" => Some(Usize), "u8" => Some(U8), "u16" => Some(U16), "u32" => Some(U32), @@ -1516,12 +1516,12 @@ impl<'tcx> Clean for ty::Ty<'tcx> { match self.sty { ty::ty_bool => Primitive(Bool), ty::ty_char => Primitive(Char), - ty::ty_int(ast::TyIs(_)) => Primitive(Isize), + ty::ty_int(ast::TyIs) => Primitive(Isize), ty::ty_int(ast::TyI8) => Primitive(I8), ty::ty_int(ast::TyI16) => Primitive(I16), ty::ty_int(ast::TyI32) => Primitive(I32), ty::ty_int(ast::TyI64) => Primitive(I64), - ty::ty_uint(ast::TyUs(_)) => Primitive(Usize), + ty::ty_uint(ast::TyUs) => Primitive(Usize), ty::ty_uint(ast::TyU8) => Primitive(U8), ty::ty_uint(ast::TyU16) => Primitive(U16), ty::ty_uint(ast::TyU32) => Primitive(U32), @@ -1833,10 +1833,10 @@ impl Clean for ast::VariantKind { #[derive(Clone, RustcEncodable, RustcDecodable, Debug)] pub struct Span { pub filename: String, - pub loline: uint, - pub locol: uint, - pub hiline: uint, - pub hicol: uint, + pub loline: usize, + pub locol: usize, + pub hiline: usize, + pub hicol: usize, } impl Span { @@ -2399,12 +2399,12 @@ fn resolve_type(cx: &DocContext, ast::TyStr => return Primitive(Str), ast::TyBool => return Primitive(Bool), ast::TyChar => return Primitive(Char), - ast::TyInt(ast::TyIs(_)) => return Primitive(Isize), + ast::TyInt(ast::TyIs) => return Primitive(Isize), ast::TyInt(ast::TyI8) => return Primitive(I8), ast::TyInt(ast::TyI16) => return Primitive(I16), ast::TyInt(ast::TyI32) => return Primitive(I32), ast::TyInt(ast::TyI64) => return Primitive(I64), - ast::TyUint(ast::TyUs(_)) => return Primitive(Usize), + ast::TyUint(ast::TyUs) => return Primitive(Usize), ast::TyUint(ast::TyU8) => return Primitive(U8), ast::TyUint(ast::TyU16) => return Primitive(U16), ast::TyUint(ast::TyU32) => return Primitive(U32), diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs index cfa84de5ca7..4e6db5e5cd1 100644 --- a/src/librustdoc/html/markdown.rs +++ b/src/librustdoc/html/markdown.rs @@ -185,7 +185,7 @@ fn stripped_filtered_line<'a>(s: &'a str) -> Option<&'a str> { } } -thread_local!(static USED_HEADER_MAP: RefCell> = { +thread_local!(static USED_HEADER_MAP: RefCell> = { RefCell::new(HashMap::new()) }); diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index d57739c4002..6ea218368f1 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -498,7 +498,7 @@ fn build_index(krate: &clean::Crate, cache: &mut Cache) -> io::Result { try!(write!(&mut w, ",")); } try!(write!(&mut w, r#"[{},"{}","{}",{}"#, - item.ty as uint, item.name, path, + item.ty as usize, item.name, path, item.desc.to_json().to_string())); match item.parent { Some(nodeid) => { @@ -522,7 +522,7 @@ fn build_index(krate: &clean::Crate, cache: &mut Cache) -> io::Result { try!(write!(&mut w, ",")); } try!(write!(&mut w, r#"[{},"{}"]"#, - short as uint, *fqp.last().unwrap())); + short as usize, *fqp.last().unwrap())); } try!(write!(&mut w, "]}};")); @@ -1572,7 +1572,7 @@ fn item_module(w: &mut fmt::Formatter, cx: &Context, let mut indices = (0..items.len()).filter(|i| { !cx.ignore_private_item(&items[*i]) - }).collect::>(); + }).collect::>(); // the order of item types in the listing fn reorder(ty: ItemType) -> u8 { @@ -1593,7 +1593,7 @@ fn item_module(w: &mut fmt::Formatter, cx: &Context, } } - fn cmp(i1: &clean::Item, i2: &clean::Item, idx1: uint, idx2: uint) -> Ordering { + fn cmp(i1: &clean::Item, i2: &clean::Item, idx1: usize, idx2: usize) -> Ordering { let ty1 = shortty(i1); let ty2 = shortty(i2); if ty1 == ty2 { diff --git a/src/librustdoc/html/toc.rs b/src/librustdoc/html/toc.rs index ecef4c9bf72..78feb6c77c4 100644 --- a/src/librustdoc/html/toc.rs +++ b/src/librustdoc/html/toc.rs @@ -33,7 +33,7 @@ pub struct Toc { } impl Toc { - fn count_entries_with_level(&self, level: u32) -> uint { + fn count_entries_with_level(&self, level: u32) -> usize { self.entries.iter().filter(|e| e.level == level).count() } } diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 9f1d876432c..14045ce9fc7 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -16,16 +16,15 @@ #![crate_type = "dylib"] #![crate_type = "rlib"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", - html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://doc.rust-lang.org/nightly/", - html_playground_url = "http://play.rust-lang.org/")] + html_favicon_url = "http://www.rust-lang.org/favicon.ico", + html_root_url = "http://doc.rust-lang.org/nightly/", + html_playground_url = "http://play.rust-lang.org/")] #![feature(box_patterns)] #![feature(box_syntax)] #![feature(collections)] #![feature(core)] #![feature(exit_status)] -#![feature(int_uint)] #![feature(set_stdio)] #![feature(libc)] #![feature(old_path)] @@ -195,7 +194,7 @@ pub fn usage(argv0: &str) { &opts())); } -pub fn main_args(args: &[String]) -> int { +pub fn main_args(args: &[String]) -> isize { let matches = match getopts::getopts(args.tail(), &opts()) { Ok(m) => m, Err(err) => { diff --git a/src/librustdoc/markdown.rs b/src/librustdoc/markdown.rs index f3d7ae19f4d..a84da60b018 100644 --- a/src/librustdoc/markdown.rs +++ b/src/librustdoc/markdown.rs @@ -44,7 +44,7 @@ fn extract_leading_metadata<'a>(s: &'a str) -> (Vec<&'a str>, &'a str) { /// Render `input` (e.g. "foo.md") into an HTML file in `output` /// (e.g. output = "bar" => "bar/foo.html"). pub fn render(input: &str, mut output: PathBuf, matches: &getopts::Matches, - external_html: &ExternalHtml, include_toc: bool) -> int { + external_html: &ExternalHtml, include_toc: bool) -> isize { let input_p = Path::new(input); output.push(input_p.file_stem().unwrap()); output.set_extension("html"); @@ -140,7 +140,7 @@ pub fn render(input: &str, mut output: PathBuf, matches: &getopts::Matches, /// Run any tests/code examples in the markdown file `input`. pub fn test(input: &str, libs: SearchPaths, externs: core::Externs, - mut test_args: Vec) -> int { + mut test_args: Vec) -> isize { let input_str = load_or_return!(input, 1, 2); let mut collector = Collector::new(input.to_string(), libs, externs, true, false); diff --git a/src/librustdoc/test.rs b/src/librustdoc/test.rs index 7b37a5a9d1c..6d17627e0a7 100644 --- a/src/librustdoc/test.rs +++ b/src/librustdoc/test.rs @@ -45,7 +45,7 @@ pub fn run(input: &str, externs: core::Externs, mut test_args: Vec, crate_name: Option) - -> int { + -> isize { let input_path = PathBuf::from(input); let input = config::Input::File(input_path.clone()); @@ -321,7 +321,7 @@ pub struct Collector { names: Vec, libs: SearchPaths, externs: core::Externs, - cnt: uint, + cnt: usize, use_headers: bool, current_header: Option, cratename: String, diff --git a/src/libserialize/hex.rs b/src/libserialize/hex.rs index e42aa1835dc..dc44536d60c 100644 --- a/src/libserialize/hex.rs +++ b/src/libserialize/hex.rs @@ -44,8 +44,8 @@ impl ToHex for [u8] { fn to_hex(&self) -> String { let mut v = Vec::with_capacity(self.len() * 2); for &byte in self { - v.push(CHARS[(byte >> 4) as uint]); - v.push(CHARS[(byte & 0xf) as uint]); + v.push(CHARS[(byte >> 4) as usize]); + v.push(CHARS[(byte & 0xf) as usize]); } unsafe { @@ -65,7 +65,7 @@ pub trait FromHex { #[derive(Copy, Debug)] pub enum FromHexError { /// The input contained a character not part of the hex format - InvalidHexCharacter(char, uint), + InvalidHexCharacter(char, usize), /// The input had an invalid length InvalidHexLength, } @@ -188,7 +188,7 @@ mod tests { #[test] pub fn test_to_hex_all_bytes() { for i in 0..256 { - assert_eq!([i as u8].to_hex(), format!("{:02x}", i as uint)); + assert_eq!([i as u8].to_hex(), format!("{:02x}", i as usize)); } } @@ -196,10 +196,10 @@ mod tests { pub fn test_from_hex_all_bytes() { for i in 0..256 { let ii: &[u8] = &[i as u8]; - assert_eq!(format!("{:02x}", i as uint).from_hex() + assert_eq!(format!("{:02x}", i as usize).from_hex() .unwrap(), ii); - assert_eq!(format!("{:02X}", i as uint).from_hex() + assert_eq!(format!("{:02X}", i as usize).from_hex() .unwrap(), ii); } diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs index 0d6ed91d529..d4998b496d9 100644 --- a/src/libserialize/json.rs +++ b/src/libserialize/json.rs @@ -233,7 +233,7 @@ pub type Object = BTreeMap; pub struct PrettyJson<'a> { inner: &'a Json } pub struct AsJson<'a, T: 'a> { inner: &'a T } -pub struct AsPrettyJson<'a, T: 'a> { inner: &'a T, indent: Option } +pub struct AsPrettyJson<'a, T: 'a> { inner: &'a T, indent: Option } /// The errors that can arise while parsing a JSON stream. #[derive(Clone, Copy, PartialEq, Debug)] @@ -260,7 +260,7 @@ pub enum ErrorCode { #[derive(Clone, PartialEq, Debug)] pub enum ParserError { /// msg, line, col - SyntaxError(ErrorCode, uint, uint), + SyntaxError(ErrorCode, usize, usize), IoError(io::ErrorKind, String), } @@ -441,7 +441,7 @@ fn escape_char(writer: &mut fmt::Write, v: char) -> EncodeResult { escape_str(writer, buf) } -fn spaces(wr: &mut fmt::Write, mut n: uint) -> EncodeResult { +fn spaces(wr: &mut fmt::Write, mut n: usize) -> EncodeResult { const BUF: &'static str = " "; while n >= BUF.len() { @@ -498,13 +498,13 @@ impl<'a> ::Encoder for Encoder<'a> { Ok(()) } - fn emit_uint(&mut self, v: uint) -> EncodeResult { emit_enquoted_if_mapkey!(self, v) } + fn emit_uint(&mut self, v: usize) -> EncodeResult { emit_enquoted_if_mapkey!(self, v) } fn emit_u64(&mut self, v: u64) -> EncodeResult { emit_enquoted_if_mapkey!(self, v) } fn emit_u32(&mut self, v: u32) -> EncodeResult { emit_enquoted_if_mapkey!(self, v) } fn emit_u16(&mut self, v: u16) -> EncodeResult { emit_enquoted_if_mapkey!(self, v) } fn emit_u8(&mut self, v: u8) -> EncodeResult { emit_enquoted_if_mapkey!(self, v) } - fn emit_int(&mut self, v: int) -> EncodeResult { emit_enquoted_if_mapkey!(self, v) } + fn emit_int(&mut self, v: isize) -> EncodeResult { emit_enquoted_if_mapkey!(self, v) } fn emit_i64(&mut self, v: i64) -> EncodeResult { emit_enquoted_if_mapkey!(self, v) } fn emit_i32(&mut self, v: i32) -> EncodeResult { emit_enquoted_if_mapkey!(self, v) } fn emit_i16(&mut self, v: i16) -> EncodeResult { emit_enquoted_if_mapkey!(self, v) } @@ -542,8 +542,8 @@ impl<'a> ::Encoder for Encoder<'a> { fn emit_enum_variant(&mut self, name: &str, - _id: uint, - cnt: uint, + _id: usize, + cnt: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { @@ -563,7 +563,7 @@ impl<'a> ::Encoder for Encoder<'a> { } } - fn emit_enum_variant_arg(&mut self, idx: uint, f: F) -> EncodeResult where + fn emit_enum_variant_arg(&mut self, idx: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); } @@ -575,8 +575,8 @@ impl<'a> ::Encoder for Encoder<'a> { fn emit_enum_struct_variant(&mut self, name: &str, - id: uint, - cnt: uint, + id: usize, + cnt: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { @@ -586,7 +586,7 @@ impl<'a> ::Encoder for Encoder<'a> { fn emit_enum_struct_variant_field(&mut self, _: &str, - idx: uint, + idx: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { @@ -594,7 +594,7 @@ impl<'a> ::Encoder for Encoder<'a> { self.emit_enum_variant_arg(idx, f) } - fn emit_struct(&mut self, _: &str, _: uint, f: F) -> EncodeResult where + fn emit_struct(&mut self, _: &str, _: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); } @@ -604,7 +604,7 @@ impl<'a> ::Encoder for Encoder<'a> { Ok(()) } - fn emit_struct_field(&mut self, name: &str, idx: uint, f: F) -> EncodeResult where + fn emit_struct_field(&mut self, name: &str, idx: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); } @@ -614,26 +614,26 @@ impl<'a> ::Encoder for Encoder<'a> { f(self) } - fn emit_tuple(&mut self, len: uint, f: F) -> EncodeResult where + fn emit_tuple(&mut self, len: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); } self.emit_seq(len, f) } - fn emit_tuple_arg(&mut self, idx: uint, f: F) -> EncodeResult where + fn emit_tuple_arg(&mut self, idx: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); } self.emit_seq_elt(idx, f) } - fn emit_tuple_struct(&mut self, _name: &str, len: uint, f: F) -> EncodeResult where + fn emit_tuple_struct(&mut self, _name: &str, len: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); } self.emit_seq(len, f) } - fn emit_tuple_struct_arg(&mut self, idx: uint, f: F) -> EncodeResult where + fn emit_tuple_struct_arg(&mut self, idx: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); } @@ -657,7 +657,7 @@ impl<'a> ::Encoder for Encoder<'a> { f(self) } - fn emit_seq(&mut self, _len: uint, f: F) -> EncodeResult where + fn emit_seq(&mut self, _len: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); } @@ -667,7 +667,7 @@ impl<'a> ::Encoder for Encoder<'a> { Ok(()) } - fn emit_seq_elt(&mut self, idx: uint, f: F) -> EncodeResult where + fn emit_seq_elt(&mut self, idx: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); } @@ -677,7 +677,7 @@ impl<'a> ::Encoder for Encoder<'a> { f(self) } - fn emit_map(&mut self, _len: uint, f: F) -> EncodeResult where + fn emit_map(&mut self, _len: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); } @@ -687,7 +687,7 @@ impl<'a> ::Encoder for Encoder<'a> { Ok(()) } - fn emit_map_elt_key(&mut self, idx: uint, f: F) -> EncodeResult where + fn emit_map_elt_key(&mut self, idx: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); } @@ -698,7 +698,7 @@ impl<'a> ::Encoder for Encoder<'a> { Ok(()) } - fn emit_map_elt_val(&mut self, _idx: uint, f: F) -> EncodeResult where + fn emit_map_elt_val(&mut self, _idx: usize, f: F) -> EncodeResult where F: FnOnce(&mut Encoder<'a>) -> EncodeResult, { if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); } @@ -711,8 +711,8 @@ impl<'a> ::Encoder for Encoder<'a> { /// compact data pub struct PrettyEncoder<'a> { writer: &'a mut (fmt::Write+'a), - curr_indent: uint, - indent: uint, + curr_indent: usize, + indent: usize, is_emitting_map_key: bool, } @@ -729,7 +729,7 @@ impl<'a> PrettyEncoder<'a> { /// Set the number of spaces to indent for each level. /// This is safe to set during encoding. - pub fn set_indent(&mut self, indent: uint) { + pub fn set_indent(&mut self, indent: usize) { // self.indent very well could be 0 so we need to use checked division. let level = self.curr_indent.checked_div(self.indent).unwrap_or(0); self.indent = indent; @@ -746,13 +746,13 @@ impl<'a> ::Encoder for PrettyEncoder<'a> { Ok(()) } - fn emit_uint(&mut self, v: uint) -> EncodeResult { emit_enquoted_if_mapkey!(self, v) } + fn emit_uint(&mut self, v: usize) -> EncodeResult { emit_enquoted_if_mapkey!(self, v) } fn emit_u64(&mut self, v: u64) -> EncodeResult { emit_enquoted_if_mapkey!(self, v) } fn emit_u32(&mut self, v: u32) -> EncodeResult { emit_enquoted_if_mapkey!(self, v) } fn emit_u16(&mut self, v: u16) -> EncodeResult { emit_enquoted_if_mapkey!(self, v) } fn emit_u8(&mut self, v: u8) -> EncodeResult { emit_enquoted_if_mapkey!(self, v) } - fn emit_int(&mut self, v: int) -> EncodeResult { emit_enquoted_if_mapkey!(self, v) } + fn emit_int(&mut self, v: isize) -> EncodeResult { emit_enquoted_if_mapkey!(self, v) } fn emit_i64(&mut self, v: i64) -> EncodeResult { emit_enquoted_if_mapkey!(self, v) } fn emit_i32(&mut self, v: i32) -> EncodeResult { emit_enquoted_if_mapkey!(self, v) } fn emit_i16(&mut self, v: i16) -> EncodeResult { emit_enquoted_if_mapkey!(self, v) } @@ -790,8 +790,8 @@ impl<'a> ::Encoder for PrettyEncoder<'a> { fn emit_enum_variant(&mut self, name: &str, - _id: uint, - cnt: uint, + _id: usize, + cnt: usize, f: F) -> EncodeResult where F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult, @@ -821,7 +821,7 @@ impl<'a> ::Encoder for PrettyEncoder<'a> { } } - fn emit_enum_variant_arg(&mut self, idx: uint, f: F) -> EncodeResult where + fn emit_enum_variant_arg(&mut self, idx: usize, f: F) -> EncodeResult where F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult, { if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); } @@ -834,8 +834,8 @@ impl<'a> ::Encoder for PrettyEncoder<'a> { fn emit_enum_struct_variant(&mut self, name: &str, - id: uint, - cnt: uint, + id: usize, + cnt: usize, f: F) -> EncodeResult where F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult, { @@ -845,7 +845,7 @@ impl<'a> ::Encoder for PrettyEncoder<'a> { fn emit_enum_struct_variant_field(&mut self, _: &str, - idx: uint, + idx: usize, f: F) -> EncodeResult where F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult, { @@ -854,7 +854,7 @@ impl<'a> ::Encoder for PrettyEncoder<'a> { } - fn emit_struct(&mut self, _: &str, len: uint, f: F) -> EncodeResult where + fn emit_struct(&mut self, _: &str, len: usize, f: F) -> EncodeResult where F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult, { if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); } @@ -872,7 +872,7 @@ impl<'a> ::Encoder for PrettyEncoder<'a> { Ok(()) } - fn emit_struct_field(&mut self, name: &str, idx: uint, f: F) -> EncodeResult where + fn emit_struct_field(&mut self, name: &str, idx: usize, f: F) -> EncodeResult where F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult, { if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); } @@ -887,26 +887,26 @@ impl<'a> ::Encoder for PrettyEncoder<'a> { f(self) } - fn emit_tuple(&mut self, len: uint, f: F) -> EncodeResult where + fn emit_tuple(&mut self, len: usize, f: F) -> EncodeResult where F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult, { if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); } self.emit_seq(len, f) } - fn emit_tuple_arg(&mut self, idx: uint, f: F) -> EncodeResult where + fn emit_tuple_arg(&mut self, idx: usize, f: F) -> EncodeResult where F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult, { if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); } self.emit_seq_elt(idx, f) } - fn emit_tuple_struct(&mut self, _: &str, len: uint, f: F) -> EncodeResult where + fn emit_tuple_struct(&mut self, _: &str, len: usize, f: F) -> EncodeResult where F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult, { if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); } self.emit_seq(len, f) } - fn emit_tuple_struct_arg(&mut self, idx: uint, f: F) -> EncodeResult where + fn emit_tuple_struct_arg(&mut self, idx: usize, f: F) -> EncodeResult where F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult, { if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); } @@ -930,7 +930,7 @@ impl<'a> ::Encoder for PrettyEncoder<'a> { f(self) } - fn emit_seq(&mut self, len: uint, f: F) -> EncodeResult where + fn emit_seq(&mut self, len: usize, f: F) -> EncodeResult where F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult, { if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); } @@ -948,7 +948,7 @@ impl<'a> ::Encoder for PrettyEncoder<'a> { Ok(()) } - fn emit_seq_elt(&mut self, idx: uint, f: F) -> EncodeResult where + fn emit_seq_elt(&mut self, idx: usize, f: F) -> EncodeResult where F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult, { if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); } @@ -961,7 +961,7 @@ impl<'a> ::Encoder for PrettyEncoder<'a> { f(self) } - fn emit_map(&mut self, len: uint, f: F) -> EncodeResult where + fn emit_map(&mut self, len: usize, f: F) -> EncodeResult where F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult, { if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); } @@ -979,7 +979,7 @@ impl<'a> ::Encoder for PrettyEncoder<'a> { Ok(()) } - fn emit_map_elt_key(&mut self, idx: uint, f: F) -> EncodeResult where + fn emit_map_elt_key(&mut self, idx: usize, f: F) -> EncodeResult where F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult, { if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); } @@ -995,7 +995,7 @@ impl<'a> ::Encoder for PrettyEncoder<'a> { Ok(()) } - fn emit_map_elt_val(&mut self, _idx: uint, f: F) -> EncodeResult where + fn emit_map_elt_val(&mut self, _idx: usize, f: F) -> EncodeResult where F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult, { if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); } @@ -1237,25 +1237,25 @@ impl<'a> Index<&'a str> for Json { } #[cfg(stage0)] -impl Index for Json { +impl Index for Json { type Output = Json; - fn index<'a>(&'a self, idx: &uint) -> &'a Json { + fn index<'a>(&'a self, idx: &usize) -> &'a Json { match self { &Json::Array(ref v) => &v[*idx], - _ => panic!("can only index Json with uint if it is an array") + _ => panic!("can only index Json with usize if it is an array") } } } #[cfg(not(stage0))] -impl Index for Json { +impl Index for Json { type Output = Json; - fn index<'a>(&'a self, idx: uint) -> &'a Json { + fn index<'a>(&'a self, idx: usize) -> &'a Json { match self { &Json::Array(ref v) => &v[idx], - _ => panic!("can only index Json with uint if it is an array") + _ => panic!("can only index Json with usize if it is an array") } } } @@ -1326,7 +1326,7 @@ impl Stack { } /// Returns The number of elements in the Stack. - pub fn len(&self) -> uint { self.stack.len() } + pub fn len(&self) -> usize { self.stack.len() } /// Returns true if the stack is empty. pub fn is_empty(&self) -> bool { self.stack.is_empty() } @@ -1334,12 +1334,12 @@ impl Stack { /// Provides access to the StackElement at a given index. /// lower indices are at the bottom of the stack while higher indices are /// at the top. - pub fn get<'l>(&'l self, idx: uint) -> StackElement<'l> { + pub fn get<'l>(&'l self, idx: usize) -> StackElement<'l> { match self.stack[idx] { InternalIndex(i) => StackElement::Index(i), InternalKey(start, size) => { StackElement::Key(str::from_utf8( - &self.str_buffer[start as uint .. start as uint + size as uint]) + &self.str_buffer[start as usize .. start as usize + size as usize]) .unwrap()) } } @@ -1382,7 +1382,7 @@ impl Stack { Some(&InternalIndex(i)) => Some(StackElement::Index(i)), Some(&InternalKey(start, size)) => { Some(StackElement::Key(str::from_utf8( - &self.str_buffer[start as uint .. (start+size) as uint] + &self.str_buffer[start as usize .. (start+size) as usize] ).unwrap())) } } @@ -1406,7 +1406,7 @@ impl Stack { assert!(!self.is_empty()); match *self.stack.last().unwrap() { InternalKey(_, sz) => { - let new_size = self.str_buffer.len() - sz as uint; + let new_size = self.str_buffer.len() - sz as usize; self.str_buffer.truncate(new_size); } InternalIndex(_) => {} @@ -1439,8 +1439,8 @@ impl Stack { pub struct Parser { rdr: T, ch: Option, - line: uint, - col: uint, + line: usize, + col: usize, // We maintain a stack representing where we are in the logical structure // of the JSON stream. stack: Stack, @@ -1625,7 +1625,7 @@ impl> Parser { match self.ch_or_null() { c @ '0' ... '9' => { dec /= 10.0; - res += (((c as int) - ('0' as int)) as f64) * dec; + res += (((c as isize) - ('0' as isize)) as f64) * dec; self.bump(); } _ => break, @@ -1657,7 +1657,7 @@ impl> Parser { match self.ch_or_null() { c @ '0' ... '9' => { exp *= 10; - exp += (c as uint) - ('0' as uint); + exp += (c as usize) - ('0' as usize); self.bump(); } @@ -1769,7 +1769,7 @@ impl> Parser { // information to return a JsonEvent. // Manages an internal state so that parsing can be interrupted and resumed. // Also keeps track of the position in the logical structure of the json - // stream int the form of a stack that can be queried by the user using the + // stream isize the form of a stack that can be queried by the user using the // stack() method. fn parse(&mut self) -> JsonEvent { loop { @@ -2150,7 +2150,7 @@ macro_rules! read_primitive { None => Err(ExpectedError("Number".to_string(), format!("{}", f))), }, Json::F64(f) => Err(ExpectedError("Integer".to_string(), format!("{}", f))), - // re: #12967.. a type w/ numeric keys (ie HashMap etc) + // re: #12967.. a type w/ numeric keys (ie HashMap etc) // is going to have a string here, as per JSON spec. Json::String(s) => match s.parse().ok() { Some(f) => Ok(f), @@ -2169,12 +2169,12 @@ impl ::Decoder for Decoder { expect!(self.pop(), Null) } - read_primitive! { read_uint, uint } + read_primitive! { read_uint, usize } read_primitive! { read_u8, u8 } read_primitive! { read_u16, u16 } read_primitive! { read_u32, u32 } read_primitive! { read_u64, u64 } - read_primitive! { read_int, int } + read_primitive! { read_int, isize } read_primitive! { read_i8, i8 } read_primitive! { read_i16, i16 } read_primitive! { read_i32, i32 } @@ -2188,7 +2188,7 @@ impl ::Decoder for Decoder { Json::U64(f) => Ok(f as f64), Json::F64(f) => Ok(f), Json::String(s) => { - // re: #12967.. a type w/ numeric keys (ie HashMap etc) + // re: #12967.. a type w/ numeric keys (ie HashMap etc) // is going to have a string here, as per JSON spec. match s.parse().ok() { Some(f) => Ok(f), @@ -2229,7 +2229,7 @@ impl ::Decoder for Decoder { fn read_enum_variant(&mut self, names: &[&str], mut f: F) -> DecodeResult - where F: FnMut(&mut Decoder, uint) -> DecodeResult, + where F: FnMut(&mut Decoder, usize) -> DecodeResult, { let name = match self.pop() { Json::String(s) => s, @@ -2269,14 +2269,14 @@ impl ::Decoder for Decoder { f(self, idx) } - fn read_enum_variant_arg(&mut self, _idx: uint, f: F) -> DecodeResult where + fn read_enum_variant_arg(&mut self, _idx: usize, f: F) -> DecodeResult where F: FnOnce(&mut Decoder) -> DecodeResult, { f(self) } fn read_enum_struct_variant(&mut self, names: &[&str], f: F) -> DecodeResult where - F: FnMut(&mut Decoder, uint) -> DecodeResult, + F: FnMut(&mut Decoder, usize) -> DecodeResult, { self.read_enum_variant(names, f) } @@ -2284,7 +2284,7 @@ impl ::Decoder for Decoder { fn read_enum_struct_variant_field(&mut self, _name: &str, - idx: uint, + idx: usize, f: F) -> DecodeResult where F: FnOnce(&mut Decoder) -> DecodeResult, @@ -2292,7 +2292,7 @@ impl ::Decoder for Decoder { self.read_enum_variant_arg(idx, f) } - fn read_struct(&mut self, _name: &str, _len: uint, f: F) -> DecodeResult where + fn read_struct(&mut self, _name: &str, _len: usize, f: F) -> DecodeResult where F: FnOnce(&mut Decoder) -> DecodeResult, { let value = try!(f(self)); @@ -2302,7 +2302,7 @@ impl ::Decoder for Decoder { fn read_struct_field(&mut self, name: &str, - _idx: uint, + _idx: usize, f: F) -> DecodeResult where F: FnOnce(&mut Decoder) -> DecodeResult, @@ -2328,7 +2328,7 @@ impl ::Decoder for Decoder { Ok(value) } - fn read_tuple(&mut self, tuple_len: uint, f: F) -> DecodeResult where + fn read_tuple(&mut self, tuple_len: usize, f: F) -> DecodeResult where F: FnOnce(&mut Decoder) -> DecodeResult, { self.read_seq(move |d, len| { @@ -2340,7 +2340,7 @@ impl ::Decoder for Decoder { }) } - fn read_tuple_arg(&mut self, idx: uint, f: F) -> DecodeResult where + fn read_tuple_arg(&mut self, idx: usize, f: F) -> DecodeResult where F: FnOnce(&mut Decoder) -> DecodeResult, { self.read_seq_elt(idx, f) @@ -2348,7 +2348,7 @@ impl ::Decoder for Decoder { fn read_tuple_struct(&mut self, _name: &str, - len: uint, + len: usize, f: F) -> DecodeResult where F: FnOnce(&mut Decoder) -> DecodeResult, @@ -2357,7 +2357,7 @@ impl ::Decoder for Decoder { } fn read_tuple_struct_arg(&mut self, - idx: uint, + idx: usize, f: F) -> DecodeResult where F: FnOnce(&mut Decoder) -> DecodeResult, @@ -2375,7 +2375,7 @@ impl ::Decoder for Decoder { } fn read_seq(&mut self, f: F) -> DecodeResult where - F: FnOnce(&mut Decoder, uint) -> DecodeResult, + F: FnOnce(&mut Decoder, usize) -> DecodeResult, { let array = try!(expect!(self.pop(), Array)); let len = array.len(); @@ -2385,14 +2385,14 @@ impl ::Decoder for Decoder { f(self, len) } - fn read_seq_elt(&mut self, _idx: uint, f: F) -> DecodeResult where + fn read_seq_elt(&mut self, _idx: usize, f: F) -> DecodeResult where F: FnOnce(&mut Decoder) -> DecodeResult, { f(self) } fn read_map(&mut self, f: F) -> DecodeResult where - F: FnOnce(&mut Decoder, uint) -> DecodeResult, + F: FnOnce(&mut Decoder, usize) -> DecodeResult, { let obj = try!(expect!(self.pop(), Object)); let len = obj.len(); @@ -2403,13 +2403,13 @@ impl ::Decoder for Decoder { f(self, len) } - fn read_map_elt_key(&mut self, _idx: uint, f: F) -> DecodeResult where + fn read_map_elt_key(&mut self, _idx: usize, f: F) -> DecodeResult where F: FnOnce(&mut Decoder) -> DecodeResult, { f(self) } - fn read_map_elt_val(&mut self, _idx: uint, f: F) -> DecodeResult where + fn read_map_elt_val(&mut self, _idx: usize, f: F) -> DecodeResult where F: FnOnce(&mut Decoder) -> DecodeResult, { f(self) @@ -2437,7 +2437,7 @@ macro_rules! to_json_impl_i64 { ) } -to_json_impl_i64! { int, i8, i16, i32, i64 } +to_json_impl_i64! { isize, i8, i16, i32, i64 } macro_rules! to_json_impl_u64 { ($($t:ty), +) => ( @@ -2450,7 +2450,7 @@ macro_rules! to_json_impl_u64 { ) } -to_json_impl_u64! { uint, u8, u16, u32, u64 } +to_json_impl_u64! { usize, u8, u16, u32, u64 } impl ToJson for Json { fn to_json(&self) -> Json { self.clone() } @@ -2605,7 +2605,7 @@ impl<'a, T: Encodable> fmt::Display for AsJson<'a, T> { impl<'a, T> AsPrettyJson<'a, T> { /// Set the indentation level for the emitted JSON - pub fn indent(mut self, indent: uint) -> AsPrettyJson<'a, T> { + pub fn indent(mut self, indent: usize) -> AsPrettyJson<'a, T> { self.indent = Some(indent); self } @@ -2655,7 +2655,7 @@ mod tests { #[derive(RustcDecodable, Eq, PartialEq, Debug)] struct OptionData { - opt: Option, + opt: Option, } #[test] @@ -2683,13 +2683,13 @@ mod tests { #[derive(PartialEq, RustcEncodable, RustcDecodable, Debug)] enum Animal { Dog, - Frog(string::String, int) + Frog(string::String, isize) } #[derive(PartialEq, RustcEncodable, RustcDecodable, Debug)] struct Inner { a: (), - b: uint, + b: usize, c: Vec, } @@ -3113,30 +3113,30 @@ mod tests { let v: Vec = super::decode("[true]").unwrap(); assert_eq!(v, [true]); - let v: Vec = super::decode("[3, 1]").unwrap(); + let v: Vec = super::decode("[3, 1]").unwrap(); assert_eq!(v, [3, 1]); - let v: Vec> = super::decode("[[3], [1, 2]]").unwrap(); + let v: Vec> = super::decode("[[3], [1, 2]]").unwrap(); assert_eq!(v, [vec![3], vec![1, 2]]); } #[test] fn test_decode_tuple() { - let t: (uint, uint, uint) = super::decode("[1, 2, 3]").unwrap(); + let t: (usize, usize, usize) = super::decode("[1, 2, 3]").unwrap(); assert_eq!(t, (1, 2, 3)); - let t: (uint, string::String) = super::decode("[1, \"two\"]").unwrap(); + let t: (usize, string::String) = super::decode("[1, \"two\"]").unwrap(); assert_eq!(t, (1, "two".to_string())); } #[test] fn test_decode_tuple_malformed_types() { - assert!(super::decode::<(uint, string::String)>("[1, 2]").is_err()); + assert!(super::decode::<(usize, string::String)>("[1, 2]").is_err()); } #[test] fn test_decode_tuple_malformed_length() { - assert!(super::decode::<(uint, uint)>("[1, 2, 3]").is_err()); + assert!(super::decode::<(usize, usize)>("[1, 2, 3]").is_err()); } #[test] @@ -3488,7 +3488,7 @@ mod tests { use std::str::from_utf8; use std::old_io::Writer; use std::collections::HashMap; - let mut hm: HashMap = HashMap::new(); + let mut hm: HashMap = HashMap::new(); hm.insert(1, true); let mut mem_buf = Vec::new(); write!(&mut mem_buf, "{}", super::as_pretty_json(&hm)).unwrap(); @@ -3504,7 +3504,7 @@ mod tests { use std::str::from_utf8; use std::old_io::Writer; use std::collections::HashMap; - let mut hm: HashMap = HashMap::new(); + let mut hm: HashMap = HashMap::new(); hm.insert(1, true); let mut mem_buf = Vec::new(); write!(&mut mem_buf, "{}", super::as_pretty_json(&hm)).unwrap(); @@ -3537,7 +3537,7 @@ mod tests { ); // Helper function for counting indents - fn indents(source: &str) -> uint { + fn indents(source: &str) -> usize { let trimmed = source.trim_left_matches(' '); source.len() - trimmed.len() } @@ -3595,7 +3595,7 @@ mod tests { Ok(o) => o }; let mut decoder = Decoder::new(json_obj); - let _hm: HashMap = Decodable::decode(&mut decoder).unwrap(); + let _hm: HashMap = Decodable::decode(&mut decoder).unwrap(); } #[test] @@ -3608,7 +3608,7 @@ mod tests { Ok(o) => o }; let mut decoder = Decoder::new(json_obj); - let result: Result, DecoderError> = Decodable::decode(&mut decoder); + let result: Result, DecoderError> = Decodable::decode(&mut decoder); assert_eq!(result, Err(ExpectedError("Number".to_string(), "a".to_string()))); } @@ -3971,14 +3971,14 @@ mod tests { assert_eq!(hash_map.to_json(), object); assert_eq!(Some(15).to_json(), I64(15)); assert_eq!(Some(15 as usize).to_json(), U64(15)); - assert_eq!(None::.to_json(), Null); + assert_eq!(None::.to_json(), Null); } #[test] fn test_encode_hashmap_with_arbitrary_key() { use std::collections::HashMap; #[derive(PartialEq, Eq, Hash, RustcEncodable)] - struct ArbitraryType(uint); + struct ArbitraryType(usize); let mut hm: HashMap = HashMap::new(); hm.insert(ArbitraryType(1), true); let mut mem_buf = string::String::new(); diff --git a/src/libserialize/lib.rs b/src/libserialize/lib.rs index 482e0d1d0ee..b79323b3f96 100644 --- a/src/libserialize/lib.rs +++ b/src/libserialize/lib.rs @@ -30,7 +30,6 @@ Core encoding and decoding interfaces. #![feature(box_syntax)] #![feature(collections)] #![feature(core)] -#![feature(int_uint)] #![feature(old_path)] #![feature(rustc_private)] #![feature(staged_api)] diff --git a/src/libserialize/serialize.rs b/src/libserialize/serialize.rs index 5e9baa9b9e9..81b5d4c5818 100644 --- a/src/libserialize/serialize.rs +++ b/src/libserialize/serialize.rs @@ -26,12 +26,12 @@ pub trait Encoder { // Primitive types: fn emit_nil(&mut self) -> Result<(), Self::Error>; - fn emit_uint(&mut self, v: uint) -> Result<(), Self::Error>; + fn emit_uint(&mut self, v: usize) -> Result<(), Self::Error>; fn emit_u64(&mut self, v: u64) -> Result<(), Self::Error>; fn emit_u32(&mut self, v: u32) -> Result<(), Self::Error>; fn emit_u16(&mut self, v: u16) -> Result<(), Self::Error>; fn emit_u8(&mut self, v: u8) -> Result<(), Self::Error>; - fn emit_int(&mut self, v: int) -> Result<(), Self::Error>; + fn emit_int(&mut self, v: isize) -> Result<(), Self::Error>; fn emit_i64(&mut self, v: i64) -> Result<(), Self::Error>; fn emit_i32(&mut self, v: i32) -> Result<(), Self::Error>; fn emit_i16(&mut self, v: i16) -> Result<(), Self::Error>; @@ -47,41 +47,41 @@ pub trait Encoder { where F: FnOnce(&mut Self) -> Result<(), Self::Error>; fn emit_enum_variant(&mut self, v_name: &str, - v_id: uint, - len: uint, + v_id: usize, + len: usize, f: F) -> Result<(), Self::Error> where F: FnOnce(&mut Self) -> Result<(), Self::Error>; - fn emit_enum_variant_arg(&mut self, a_idx: uint, f: F) + fn emit_enum_variant_arg(&mut self, a_idx: usize, f: F) -> Result<(), Self::Error> where F: FnOnce(&mut Self) -> Result<(), Self::Error>; fn emit_enum_struct_variant(&mut self, v_name: &str, - v_id: uint, - len: uint, + v_id: usize, + len: usize, f: F) -> Result<(), Self::Error> where F: FnOnce(&mut Self) -> Result<(), Self::Error>; fn emit_enum_struct_variant_field(&mut self, f_name: &str, - f_idx: uint, + f_idx: usize, f: F) -> Result<(), Self::Error> where F: FnOnce(&mut Self) -> Result<(), Self::Error>; - fn emit_struct(&mut self, name: &str, len: uint, f: F) + fn emit_struct(&mut self, name: &str, len: usize, f: F) -> Result<(), Self::Error> where F: FnOnce(&mut Self) -> Result<(), Self::Error>; - fn emit_struct_field(&mut self, f_name: &str, f_idx: uint, f: F) + fn emit_struct_field(&mut self, f_name: &str, f_idx: usize, f: F) -> Result<(), Self::Error> where F: FnOnce(&mut Self) -> Result<(), Self::Error>; - fn emit_tuple(&mut self, len: uint, f: F) -> Result<(), Self::Error> + fn emit_tuple(&mut self, len: usize, f: F) -> Result<(), Self::Error> where F: FnOnce(&mut Self) -> Result<(), Self::Error>; - fn emit_tuple_arg(&mut self, idx: uint, f: F) -> Result<(), Self::Error> + fn emit_tuple_arg(&mut self, idx: usize, f: F) -> Result<(), Self::Error> where F: FnOnce(&mut Self) -> Result<(), Self::Error>; - fn emit_tuple_struct(&mut self, name: &str, len: uint, f: F) + fn emit_tuple_struct(&mut self, name: &str, len: usize, f: F) -> Result<(), Self::Error> where F: FnOnce(&mut Self) -> Result<(), Self::Error>; - fn emit_tuple_struct_arg(&mut self, f_idx: uint, f: F) + fn emit_tuple_struct_arg(&mut self, f_idx: usize, f: F) -> Result<(), Self::Error> where F: FnOnce(&mut Self) -> Result<(), Self::Error>; @@ -92,16 +92,16 @@ pub trait Encoder { fn emit_option_some(&mut self, f: F) -> Result<(), Self::Error> where F: FnOnce(&mut Self) -> Result<(), Self::Error>; - fn emit_seq(&mut self, len: uint, f: F) -> Result<(), Self::Error> + fn emit_seq(&mut self, len: usize, f: F) -> Result<(), Self::Error> where F: FnOnce(&mut Self) -> Result<(), Self::Error>; - fn emit_seq_elt(&mut self, idx: uint, f: F) -> Result<(), Self::Error> + fn emit_seq_elt(&mut self, idx: usize, f: F) -> Result<(), Self::Error> where F: FnOnce(&mut Self) -> Result<(), Self::Error>; - fn emit_map(&mut self, len: uint, f: F) -> Result<(), Self::Error> + fn emit_map(&mut self, len: usize, f: F) -> Result<(), Self::Error> where F: FnOnce(&mut Self) -> Result<(), Self::Error>; - fn emit_map_elt_key(&mut self, idx: uint, f: F) -> Result<(), Self::Error> + fn emit_map_elt_key(&mut self, idx: usize, f: F) -> Result<(), Self::Error> where F: FnOnce(&mut Self) -> Result<(), Self::Error>; - fn emit_map_elt_val(&mut self, idx: uint, f: F) -> Result<(), Self::Error> + fn emit_map_elt_val(&mut self, idx: usize, f: F) -> Result<(), Self::Error> where F: FnOnce(&mut Self) -> Result<(), Self::Error>; } @@ -110,12 +110,12 @@ pub trait Decoder { // Primitive types: fn read_nil(&mut self) -> Result<(), Self::Error>; - fn read_uint(&mut self) -> Result; + fn read_uint(&mut self) -> Result; fn read_u64(&mut self) -> Result; fn read_u32(&mut self) -> Result; fn read_u16(&mut self) -> Result; fn read_u8(&mut self) -> Result; - fn read_int(&mut self) -> Result; + fn read_int(&mut self) -> Result; fn read_i64(&mut self) -> Result; fn read_i32(&mut self) -> Result; fn read_i16(&mut self) -> Result; @@ -132,41 +132,41 @@ pub trait Decoder { fn read_enum_variant(&mut self, names: &[&str], f: F) -> Result - where F: FnMut(&mut Self, uint) -> Result; - fn read_enum_variant_arg(&mut self, a_idx: uint, f: F) + where F: FnMut(&mut Self, usize) -> Result; + fn read_enum_variant_arg(&mut self, a_idx: usize, f: F) -> Result where F: FnOnce(&mut Self) -> Result; fn read_enum_struct_variant(&mut self, names: &[&str], f: F) -> Result - where F: FnMut(&mut Self, uint) -> Result; + where F: FnMut(&mut Self, usize) -> Result; fn read_enum_struct_variant_field(&mut self, &f_name: &str, - f_idx: uint, + f_idx: usize, f: F) -> Result where F: FnOnce(&mut Self) -> Result; - fn read_struct(&mut self, s_name: &str, len: uint, f: F) + fn read_struct(&mut self, s_name: &str, len: usize, f: F) -> Result where F: FnOnce(&mut Self) -> Result; fn read_struct_field(&mut self, f_name: &str, - f_idx: uint, + f_idx: usize, f: F) -> Result where F: FnOnce(&mut Self) -> Result; - fn read_tuple(&mut self, len: uint, f: F) -> Result + fn read_tuple(&mut self, len: usize, f: F) -> Result where F: FnOnce(&mut Self) -> Result; - fn read_tuple_arg(&mut self, a_idx: uint, f: F) + fn read_tuple_arg(&mut self, a_idx: usize, f: F) -> Result where F: FnOnce(&mut Self) -> Result; - fn read_tuple_struct(&mut self, s_name: &str, len: uint, f: F) + fn read_tuple_struct(&mut self, s_name: &str, len: usize, f: F) -> Result where F: FnOnce(&mut Self) -> Result; - fn read_tuple_struct_arg(&mut self, a_idx: uint, f: F) + fn read_tuple_struct_arg(&mut self, a_idx: usize, f: F) -> Result where F: FnOnce(&mut Self) -> Result; @@ -175,16 +175,16 @@ pub trait Decoder { where F: FnMut(&mut Self, bool) -> Result; fn read_seq(&mut self, f: F) -> Result - where F: FnOnce(&mut Self, uint) -> Result; - fn read_seq_elt(&mut self, idx: uint, f: F) -> Result + where F: FnOnce(&mut Self, usize) -> Result; + fn read_seq_elt(&mut self, idx: usize, f: F) -> Result where F: FnOnce(&mut Self) -> Result; fn read_map(&mut self, f: F) -> Result - where F: FnOnce(&mut Self, uint) -> Result; - fn read_map_elt_key(&mut self, idx: uint, f: F) + where F: FnOnce(&mut Self, usize) -> Result; + fn read_map_elt_key(&mut self, idx: usize, f: F) -> Result where F: FnOnce(&mut Self) -> Result; - fn read_map_elt_val(&mut self, idx: uint, f: F) + fn read_map_elt_val(&mut self, idx: usize, f: F) -> Result where F: FnOnce(&mut Self) -> Result; @@ -200,14 +200,14 @@ pub trait Decodable { fn decode(d: &mut D) -> Result; } -impl Encodable for uint { +impl Encodable for usize { fn encode(&self, s: &mut S) -> Result<(), S::Error> { s.emit_uint(*self) } } -impl Decodable for uint { - fn decode(d: &mut D) -> Result { +impl Decodable for usize { + fn decode(d: &mut D) -> Result { d.read_uint() } } @@ -260,14 +260,14 @@ impl Decodable for u64 { } } -impl Encodable for int { +impl Encodable for isize { fn encode(&self, s: &mut S) -> Result<(), S::Error> { s.emit_int(*self) } } -impl Decodable for int { - fn decode(d: &mut D) -> Result { +impl Decodable for isize { + fn decode(d: &mut D) -> Result { d.read_int() } } @@ -510,7 +510,7 @@ macro_rules! tuple { impl<$($name:Decodable),*> Decodable for ($($name,)*) { #[allow(non_snake_case)] fn decode(d: &mut D) -> Result<($($name,)*), D::Error> { - let len: uint = count_idents!($($name,)*); + let len: usize = count_idents!($($name,)*); d.read_tuple(len, |d| { let mut i = 0; let ret = ($(try!(d.read_tuple_arg({ i+=1; i-1 }, diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs index f9558b85825..76d7570bfed 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -505,7 +505,7 @@ impl HashMap { /// /// ``` /// use std::collections::HashMap; - /// let mut map: HashMap<&str, int> = HashMap::new(); + /// let mut map: HashMap<&str, isize> = HashMap::new(); /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] @@ -519,7 +519,7 @@ impl HashMap { /// /// ``` /// use std::collections::HashMap; - /// let mut map: HashMap<&str, int> = HashMap::with_capacity(10); + /// let mut map: HashMap<&str, isize> = HashMap::with_capacity(10); /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] @@ -596,7 +596,7 @@ impl HashMap /// /// ``` /// use std::collections::HashMap; - /// let map: HashMap = HashMap::with_capacity(100); + /// let map: HashMap = HashMap::with_capacity(100); /// assert!(map.capacity() >= 100); /// ``` #[inline] @@ -617,7 +617,7 @@ impl HashMap /// /// ``` /// use std::collections::HashMap; - /// let mut map: HashMap<&str, int> = HashMap::new(); + /// let mut map: HashMap<&str, isize> = HashMap::new(); /// map.reserve(10); /// ``` #[stable(feature = "rust1", since = "1.0.0")] @@ -725,7 +725,7 @@ impl HashMap /// ``` /// use std::collections::HashMap; /// - /// let mut map: HashMap = HashMap::with_capacity(100); + /// let mut map: HashMap = HashMap::with_capacity(100); /// map.insert(1, 2); /// map.insert(3, 4); /// assert!(map.capacity() >= 100); @@ -797,9 +797,9 @@ impl HashMap } } - let robin_ib = bucket.index() as int - bucket.distance() as int; + let robin_ib = bucket.index() as isize - bucket.distance() as isize; - if (ib as int) < robin_ib { + if (ib as isize) < robin_ib { // Found a luckier bucket than me. Better steal his spot. return robin_hood(bucket, robin_ib as usize, hash, k, v); } @@ -924,7 +924,7 @@ impl HashMap /// map.insert("c", 3); /// /// // Not possible with .iter() - /// let vec: Vec<(&str, int)> = map.into_iter().collect(); + /// let vec: Vec<(&str, isize)> = map.into_iter().collect(); /// ``` #[stable(feature = "rust1", since = "1.0.0")] pub fn into_iter(self) -> IntoIter { @@ -1188,9 +1188,9 @@ fn search_entry_hashed<'a, K: Eq, V>(table: &'a mut RawTable, hash: SafeHas } } - let robin_ib = bucket.index() as int - bucket.distance() as int; + let robin_ib = bucket.index() as isize - bucket.distance() as isize; - if (ib as int) < robin_ib { + if (ib as isize) < robin_ib { // Found a luckier bucket than me. Better steal his spot. return Vacant(VacantEntry { hash: hash, @@ -1648,7 +1648,7 @@ mod test_map { assert_eq!(*m.get(&2).unwrap(), 4); } - thread_local! { static DROP_VECTOR: RefCell> = RefCell::new(Vec::new()) } + thread_local! { static DROP_VECTOR: RefCell> = RefCell::new(Vec::new()) } #[derive(Hash, PartialEq, Eq)] struct Dropable { @@ -1805,7 +1805,7 @@ mod test_map { #[test] fn test_empty_pop() { - let mut m: HashMap = HashMap::new(); + let mut m: HashMap = HashMap::new(); assert_eq!(m.remove(&0), None); } diff --git a/src/libstd/fs/tempdir.rs b/src/libstd/fs/tempdir.rs index a9717e36323..8cc1dde98a0 100644 --- a/src/libstd/fs/tempdir.rs +++ b/src/libstd/fs/tempdir.rs @@ -34,7 +34,7 @@ const NUM_RETRIES: u32 = 1 << 31; // be enough to dissuade an attacker from trying to preemptively create names // of that length, but not so huge that we unnecessarily drain the random number // generator of entropy. -const NUM_RAND_CHARS: uint = 12; +const NUM_RAND_CHARS: usize = 12; impl TempDir { /// Attempts to make a temporary directory inside of `tmpdir` whose name diff --git a/src/libstd/io/buffered.rs b/src/libstd/io/buffered.rs index 2a1294f23b2..34d442e2fb5 100644 --- a/src/libstd/io/buffered.rs +++ b/src/libstd/io/buffered.rs @@ -98,7 +98,7 @@ impl BufRead for BufReader { self.buf.fill_buf() } - fn consume(&mut self, amt: uint) { + fn consume(&mut self, amt: usize) { self.buf.consume(amt) } } @@ -427,7 +427,7 @@ impl BufStream { #[stable(feature = "rust1", since = "1.0.0")] impl BufRead for BufStream { fn fill_buf(&mut self) -> io::Result<&[u8]> { self.inner.fill_buf() } - fn consume(&mut self, amt: uint) { self.inner.consume(amt) } + fn consume(&mut self, amt: usize) { self.inner.consume(amt) } } #[stable(feature = "rust1", since = "1.0.0")] diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index cca6bb747d4..5890a750f6e 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -123,7 +123,6 @@ #![feature(unsafe_destructor)] #![feature(unsafe_no_drop_flag)] #![feature(macro_reexport)] -#![feature(int_uint)] #![feature(unique)] #![feature(convert)] #![feature(allow_internal_unstable)] diff --git a/src/libstd/num/f32.rs b/src/libstd/num/f32.rs index a4f06f14d49..dc1d53b8a39 100644 --- a/src/libstd/num/f32.rs +++ b/src/libstd/num/f32.rs @@ -91,27 +91,27 @@ impl Float for f32 { #[allow(deprecated)] #[inline] - fn mantissa_digits(unused_self: Option) -> uint { + fn mantissa_digits(unused_self: Option) -> usize { num::Float::mantissa_digits(unused_self) } #[allow(deprecated)] #[inline] - fn digits(unused_self: Option) -> uint { num::Float::digits(unused_self) } + fn digits(unused_self: Option) -> usize { num::Float::digits(unused_self) } #[allow(deprecated)] #[inline] fn epsilon() -> f32 { num::Float::epsilon() } #[allow(deprecated)] #[inline] - fn min_exp(unused_self: Option) -> int { num::Float::min_exp(unused_self) } + fn min_exp(unused_self: Option) -> isize { num::Float::min_exp(unused_self) } #[allow(deprecated)] #[inline] - fn max_exp(unused_self: Option) -> int { num::Float::max_exp(unused_self) } + fn max_exp(unused_self: Option) -> isize { num::Float::max_exp(unused_self) } #[allow(deprecated)] #[inline] - fn min_10_exp(unused_self: Option) -> int { num::Float::min_10_exp(unused_self) } + fn min_10_exp(unused_self: Option) -> isize { num::Float::min_10_exp(unused_self) } #[allow(deprecated)] #[inline] - fn max_10_exp(unused_self: Option) -> int { num::Float::max_10_exp(unused_self) } + fn max_10_exp(unused_self: Option) -> isize { num::Float::max_10_exp(unused_self) } #[allow(deprecated)] #[inline] fn min_value() -> f32 { num::Float::min_value() } @@ -201,11 +201,11 @@ impl Float for f32 { /// - `self = x * pow(2, exp)` /// - `0.5 <= abs(x) < 1.0` #[inline] - fn frexp(self) -> (f32, int) { + fn frexp(self) -> (f32, isize) { unsafe { let mut exp = 0; let x = cmath::frexpf(self, &mut exp); - (x, exp as int) + (x, exp as isize) } } @@ -476,7 +476,7 @@ impl f32 { `std::f64::MANTISSA_DIGITS` as appropriate")] #[allow(deprecated)] #[inline] - pub fn mantissa_digits(unused_self: Option) -> uint { + pub fn mantissa_digits(unused_self: Option) -> usize { num::Float::mantissa_digits(unused_self) } @@ -486,7 +486,7 @@ impl f32 { reason = "use `std::f32::DIGITS` or `std::f64::DIGITS` as appropriate")] #[allow(deprecated)] #[inline] - pub fn digits(unused_self: Option) -> uint { num::Float::digits(unused_self) } + pub fn digits(unused_self: Option) -> usize { num::Float::digits(unused_self) } /// Deprecated: use `std::f32::EPSILON` or `std::f64::EPSILON` instead. #[unstable(feature = "std_misc")] @@ -502,7 +502,7 @@ impl f32 { reason = "use `std::f32::MIN_EXP` or `std::f64::MIN_EXP` as appropriate")] #[allow(deprecated)] #[inline] - pub fn min_exp(unused_self: Option) -> int { num::Float::min_exp(unused_self) } + pub fn min_exp(unused_self: Option) -> isize { num::Float::min_exp(unused_self) } /// Deprecated: use `std::f32::MAX_EXP` or `std::f64::MAX_EXP` instead. #[unstable(feature = "std_misc")] @@ -510,7 +510,7 @@ impl f32 { reason = "use `std::f32::MAX_EXP` or `std::f64::MAX_EXP` as appropriate")] #[allow(deprecated)] #[inline] - pub fn max_exp(unused_self: Option) -> int { num::Float::max_exp(unused_self) } + pub fn max_exp(unused_self: Option) -> isize { num::Float::max_exp(unused_self) } /// Deprecated: use `std::f32::MIN_10_EXP` or `std::f64::MIN_10_EXP` instead. #[unstable(feature = "std_misc")] @@ -518,7 +518,7 @@ impl f32 { reason = "use `std::f32::MIN_10_EXP` or `std::f64::MIN_10_EXP` as appropriate")] #[allow(deprecated)] #[inline] - pub fn min_10_exp(unused_self: Option) -> int { num::Float::min_10_exp(unused_self) } + pub fn min_10_exp(unused_self: Option) -> isize { num::Float::min_10_exp(unused_self) } /// Deprecated: use `std::f32::MAX_10_EXP` or `std::f64::MAX_10_EXP` instead. #[unstable(feature = "std_misc")] @@ -526,7 +526,7 @@ impl f32 { reason = "use `std::f32::MAX_10_EXP` or `std::f64::MAX_10_EXP` as appropriate")] #[allow(deprecated)] #[inline] - pub fn max_10_exp(unused_self: Option) -> int { num::Float::max_10_exp(unused_self) } + pub fn max_10_exp(unused_self: Option) -> isize { num::Float::max_10_exp(unused_self) } /// Returns the smallest finite value that this type can represent. /// @@ -1126,7 +1126,7 @@ impl f32 { #[unstable(feature = "std_misc", reason = "pending integer conventions")] #[inline] - pub fn ldexp(x: f32, exp: int) -> f32 { + pub fn ldexp(x: f32, exp: isize) -> f32 { unsafe { cmath::ldexpf(x, exp as c_int) } } @@ -1153,11 +1153,11 @@ impl f32 { #[unstable(feature = "std_misc", reason = "pending integer conventions")] #[inline] - pub fn frexp(self) -> (f32, int) { + pub fn frexp(self) -> (f32, isize) { unsafe { let mut exp = 0; let x = cmath::frexpf(self, &mut exp); - (x, exp as int) + (x, exp as isize) } } @@ -1681,7 +1681,7 @@ pub fn to_str_radix_special(num: f32, rdx: u32) -> (String, bool) { /// * digits - The number of significant digits #[inline] #[unstable(feature = "std_misc", reason = "may be removed or relocated")] -pub fn to_str_exact(num: f32, dig: uint) -> String { +pub fn to_str_exact(num: f32, dig: usize) -> String { let (r, _) = strconv::float_to_str_common( num, 10, true, SignNeg, DigExact(dig), ExpNone, false); r @@ -1696,7 +1696,7 @@ pub fn to_str_exact(num: f32, dig: uint) -> String { /// * digits - The number of significant digits #[inline] #[unstable(feature = "std_misc", reason = "may be removed or relocated")] -pub fn to_str_digits(num: f32, dig: uint) -> String { +pub fn to_str_digits(num: f32, dig: usize) -> String { let (r, _) = strconv::float_to_str_common( num, 10, true, SignNeg, DigMax(dig), ExpNone, false); r @@ -1712,7 +1712,7 @@ pub fn to_str_digits(num: f32, dig: uint) -> String { /// * upper - Use `E` instead of `e` for the exponent sign #[inline] #[unstable(feature = "std_misc", reason = "may be removed or relocated")] -pub fn to_str_exp_exact(num: f32, dig: uint, upper: bool) -> String { +pub fn to_str_exp_exact(num: f32, dig: usize, upper: bool) -> String { let (r, _) = strconv::float_to_str_common( num, 10, true, SignNeg, DigExact(dig), ExpDec, upper); r @@ -1728,7 +1728,7 @@ pub fn to_str_exp_exact(num: f32, dig: uint, upper: bool) -> String { /// * upper - Use `E` instead of `e` for the exponent sign #[inline] #[unstable(feature = "std_misc", reason = "may be removed or relocated")] -pub fn to_str_exp_digits(num: f32, dig: uint, upper: bool) -> String { +pub fn to_str_exp_digits(num: f32, dig: usize, upper: bool) -> String { let (r, _) = strconv::float_to_str_common( num, 10, true, SignNeg, DigMax(dig), ExpDec, upper); r diff --git a/src/libstd/num/f64.rs b/src/libstd/num/f64.rs index 9306804d1f7..41ce9a2598c 100644 --- a/src/libstd/num/f64.rs +++ b/src/libstd/num/f64.rs @@ -101,27 +101,27 @@ impl Float for f64 { #[allow(deprecated)] #[inline] - fn mantissa_digits(unused_self: Option) -> uint { + fn mantissa_digits(unused_self: Option) -> usize { num::Float::mantissa_digits(unused_self) } #[allow(deprecated)] #[inline] - fn digits(unused_self: Option) -> uint { num::Float::digits(unused_self) } + fn digits(unused_self: Option) -> usize { num::Float::digits(unused_self) } #[allow(deprecated)] #[inline] fn epsilon() -> f64 { num::Float::epsilon() } #[allow(deprecated)] #[inline] - fn min_exp(unused_self: Option) -> int { num::Float::min_exp(unused_self) } + fn min_exp(unused_self: Option) -> isize { num::Float::min_exp(unused_self) } #[allow(deprecated)] #[inline] - fn max_exp(unused_self: Option) -> int { num::Float::max_exp(unused_self) } + fn max_exp(unused_self: Option) -> isize { num::Float::max_exp(unused_self) } #[allow(deprecated)] #[inline] - fn min_10_exp(unused_self: Option) -> int { num::Float::min_10_exp(unused_self) } + fn min_10_exp(unused_self: Option) -> isize { num::Float::min_10_exp(unused_self) } #[allow(deprecated)] #[inline] - fn max_10_exp(unused_self: Option) -> int { num::Float::max_10_exp(unused_self) } + fn max_10_exp(unused_self: Option) -> isize { num::Float::max_10_exp(unused_self) } #[allow(deprecated)] #[inline] fn min_value() -> f64 { num::Float::min_value() } @@ -210,11 +210,11 @@ impl Float for f64 { /// - `self = x * pow(2, exp)` /// - `0.5 <= abs(x) < 1.0` #[inline] - fn frexp(self) -> (f64, int) { + fn frexp(self) -> (f64, isize) { unsafe { let mut exp = 0; let x = cmath::frexp(self, &mut exp); - (x, exp as int) + (x, exp as isize) } } @@ -485,7 +485,7 @@ impl f64 { `std::f64::MANTISSA_DIGITS` as appropriate")] #[allow(deprecated)] #[inline] - pub fn mantissa_digits(unused_self: Option) -> uint { + pub fn mantissa_digits(unused_self: Option) -> usize { num::Float::mantissa_digits(unused_self) } @@ -495,7 +495,7 @@ impl f64 { reason = "use `std::f32::DIGITS` or `std::f64::DIGITS` as appropriate")] #[allow(deprecated)] #[inline] - pub fn digits(unused_self: Option) -> uint { num::Float::digits(unused_self) } + pub fn digits(unused_self: Option) -> usize { num::Float::digits(unused_self) } /// Deprecated: use `std::f32::EPSILON` or `std::f64::EPSILON` instead. #[unstable(feature = "std_misc")] @@ -511,7 +511,7 @@ impl f64 { reason = "use `std::f32::MIN_EXP` or `std::f64::MIN_EXP` as appropriate")] #[allow(deprecated)] #[inline] - pub fn min_exp(unused_self: Option) -> int { num::Float::min_exp(unused_self) } + pub fn min_exp(unused_self: Option) -> isize { num::Float::min_exp(unused_self) } /// Deprecated: use `std::f32::MAX_EXP` or `std::f64::MAX_EXP` instead. #[unstable(feature = "std_misc")] @@ -519,7 +519,7 @@ impl f64 { reason = "use `std::f32::MAX_EXP` or `std::f64::MAX_EXP` as appropriate")] #[allow(deprecated)] #[inline] - pub fn max_exp(unused_self: Option) -> int { num::Float::max_exp(unused_self) } + pub fn max_exp(unused_self: Option) -> isize { num::Float::max_exp(unused_self) } /// Deprecated: use `std::f32::MIN_10_EXP` or `std::f64::MIN_10_EXP` instead. #[unstable(feature = "std_misc")] @@ -527,7 +527,7 @@ impl f64 { reason = "use `std::f32::MIN_10_EXP` or `std::f64::MIN_10_EXP` as appropriate")] #[allow(deprecated)] #[inline] - pub fn min_10_exp(unused_self: Option) -> int { num::Float::min_10_exp(unused_self) } + pub fn min_10_exp(unused_self: Option) -> isize { num::Float::min_10_exp(unused_self) } /// Deprecated: use `std::f32::MAX_10_EXP` or `std::f64::MAX_10_EXP` instead. #[unstable(feature = "std_misc")] @@ -535,7 +535,7 @@ impl f64 { reason = "use `std::f32::MAX_10_EXP` or `std::f64::MAX_10_EXP` as appropriate")] #[allow(deprecated)] #[inline] - pub fn max_10_exp(unused_self: Option) -> int { num::Float::max_10_exp(unused_self) } + pub fn max_10_exp(unused_self: Option) -> isize { num::Float::max_10_exp(unused_self) } /// Returns the smallest finite value that this type can represent. /// @@ -1134,7 +1134,7 @@ impl f64 { #[unstable(feature = "std_misc", reason = "pending integer conventions")] #[inline] - pub fn ldexp(x: f64, exp: int) -> f64 { + pub fn ldexp(x: f64, exp: isize) -> f64 { unsafe { cmath::ldexp(x, exp as c_int) } } @@ -1161,11 +1161,11 @@ impl f64 { #[unstable(feature = "std_misc", reason = "pending integer conventions")] #[inline] - pub fn frexp(self) -> (f64, int) { + pub fn frexp(self) -> (f64, isize) { unsafe { let mut exp = 0; let x = cmath::frexp(self, &mut exp); - (x, exp as int) + (x, exp as isize) } } @@ -1687,7 +1687,7 @@ pub fn to_str_radix_special(num: f64, rdx: u32) -> (String, bool) { /// * digits - The number of significant digits #[inline] #[unstable(feature = "std_misc", reason = "may be removed or relocated")] -pub fn to_str_exact(num: f64, dig: uint) -> String { +pub fn to_str_exact(num: f64, dig: usize) -> String { let (r, _) = strconv::float_to_str_common( num, 10, true, SignNeg, DigExact(dig), ExpNone, false); r @@ -1702,7 +1702,7 @@ pub fn to_str_exact(num: f64, dig: uint) -> String { /// * digits - The number of significant digits #[inline] #[unstable(feature = "std_misc", reason = "may be removed or relocated")] -pub fn to_str_digits(num: f64, dig: uint) -> String { +pub fn to_str_digits(num: f64, dig: usize) -> String { let (r, _) = strconv::float_to_str_common( num, 10, true, SignNeg, DigMax(dig), ExpNone, false); r @@ -1718,7 +1718,7 @@ pub fn to_str_digits(num: f64, dig: uint) -> String { /// * upper - Use `E` instead of `e` for the exponent sign #[inline] #[unstable(feature = "std_misc", reason = "may be removed or relocated")] -pub fn to_str_exp_exact(num: f64, dig: uint, upper: bool) -> String { +pub fn to_str_exp_exact(num: f64, dig: usize, upper: bool) -> String { let (r, _) = strconv::float_to_str_common( num, 10, true, SignNeg, DigExact(dig), ExpDec, upper); r @@ -1734,7 +1734,7 @@ pub fn to_str_exp_exact(num: f64, dig: uint, upper: bool) -> String { /// * upper - Use `E` instead of `e` for the exponent sign #[inline] #[unstable(feature = "std_misc", reason = "may be removed or relocated")] -pub fn to_str_exp_digits(num: f64, dig: uint, upper: bool) -> String { +pub fn to_str_exp_digits(num: f64, dig: usize, upper: bool) -> String { let (r, _) = strconv::float_to_str_common( num, 10, true, SignNeg, DigMax(dig), ExpDec, upper); r diff --git a/src/libstd/num/strconv.rs b/src/libstd/num/strconv.rs index 66826b359e6..1c1aaeb6d53 100644 --- a/src/libstd/num/strconv.rs +++ b/src/libstd/num/strconv.rs @@ -49,10 +49,10 @@ pub enum SignificantDigits { /// At most the given number of digits will be printed, truncating any /// trailing zeroes. - DigMax(uint), + DigMax(usize), /// Precisely the given number of digits will be printed. - DigExact(uint) + DigExact(usize) } /// How to emit the sign of a number. @@ -87,7 +87,7 @@ pub enum SignFormat { /// # Panics /// /// - Panics if `radix` < 2 or `radix` > 36. -fn int_to_str_bytes_common(num: T, radix: uint, sign: SignFormat, mut f: F) where +fn int_to_str_bytes_common(num: T, radix: usize, sign: SignFormat, mut f: F) where T: Int, F: FnMut(u8), { @@ -216,7 +216,7 @@ pub fn float_to_str_bytes_common( let neg = num < _0 || (negative_zero && _1 / num == Float::neg_infinity()); let mut buf = Vec::new(); - let radix_gen: T = num::cast(radix as int).unwrap(); + let radix_gen: T = num::cast(radix as isize).unwrap(); let (num, exp) = match exp_format { ExpNone => (num, 0), @@ -328,28 +328,28 @@ pub fn float_to_str_bytes_common( let extra_digit = ascii2value(buf.pop().unwrap()); if extra_digit >= radix / 2 { // -> need to round - let mut i: int = buf.len() as int - 1; + let mut i: isize = buf.len() as isize - 1; loop { // If reached left end of number, have to // insert additional digit: if i < 0 - || buf[i as uint] == b'-' - || buf[i as uint] == b'+' { - buf.insert((i + 1) as uint, value2ascii(1)); + || buf[i as usize] == b'-' + || buf[i as usize] == b'+' { + buf.insert((i + 1) as usize, value2ascii(1)); break; } // Skip the '.' - if buf[i as uint] == b'.' { i -= 1; continue; } + if buf[i as usize] == b'.' { i -= 1; continue; } // Either increment the digit, // or set to 0 if max and carry the 1. - let current_digit = ascii2value(buf[i as uint]); + let current_digit = ascii2value(buf[i as usize]); if current_digit < (radix - 1) { - buf[i as uint] = value2ascii(current_digit+1); + buf[i as usize] = value2ascii(current_digit+1); break; } else { - buf[i as uint] = value2ascii(0); + buf[i as usize] = value2ascii(0); i -= 1; } } @@ -461,85 +461,85 @@ mod bench { #![allow(deprecated)] // rand extern crate test; - mod uint { + mod usize { use super::test::Bencher; use rand::{weak_rng, Rng}; use std::fmt; #[inline] - fn to_string(x: uint, base: u8) { + fn to_string(x: usize, base: u8) { format!("{}", fmt::radix(x, base)); } #[bench] fn to_str_bin(b: &mut Bencher) { let mut rng = weak_rng(); - b.iter(|| { to_string(rng.gen::(), 2); }) + b.iter(|| { to_string(rng.gen::(), 2); }) } #[bench] fn to_str_oct(b: &mut Bencher) { let mut rng = weak_rng(); - b.iter(|| { to_string(rng.gen::(), 8); }) + b.iter(|| { to_string(rng.gen::(), 8); }) } #[bench] fn to_str_dec(b: &mut Bencher) { let mut rng = weak_rng(); - b.iter(|| { to_string(rng.gen::(), 10); }) + b.iter(|| { to_string(rng.gen::(), 10); }) } #[bench] fn to_str_hex(b: &mut Bencher) { let mut rng = weak_rng(); - b.iter(|| { to_string(rng.gen::(), 16); }) + b.iter(|| { to_string(rng.gen::(), 16); }) } #[bench] fn to_str_base_36(b: &mut Bencher) { let mut rng = weak_rng(); - b.iter(|| { to_string(rng.gen::(), 36); }) + b.iter(|| { to_string(rng.gen::(), 36); }) } } - mod int { + mod isize { use super::test::Bencher; use rand::{weak_rng, Rng}; use std::fmt; #[inline] - fn to_string(x: int, base: u8) { + fn to_string(x: isize, base: u8) { format!("{}", fmt::radix(x, base)); } #[bench] fn to_str_bin(b: &mut Bencher) { let mut rng = weak_rng(); - b.iter(|| { to_string(rng.gen::(), 2); }) + b.iter(|| { to_string(rng.gen::(), 2); }) } #[bench] fn to_str_oct(b: &mut Bencher) { let mut rng = weak_rng(); - b.iter(|| { to_string(rng.gen::(), 8); }) + b.iter(|| { to_string(rng.gen::(), 8); }) } #[bench] fn to_str_dec(b: &mut Bencher) { let mut rng = weak_rng(); - b.iter(|| { to_string(rng.gen::(), 10); }) + b.iter(|| { to_string(rng.gen::(), 10); }) } #[bench] fn to_str_hex(b: &mut Bencher) { let mut rng = weak_rng(); - b.iter(|| { to_string(rng.gen::(), 16); }) + b.iter(|| { to_string(rng.gen::(), 16); }) } #[bench] fn to_str_base_36(b: &mut Bencher) { let mut rng = weak_rng(); - b.iter(|| { to_string(rng.gen::(), 36); }) + b.iter(|| { to_string(rng.gen::(), 36); }) } } diff --git a/src/libstd/old_io/buffered.rs b/src/libstd/old_io/buffered.rs index 9a9d421dfe1..085ec78b565 100644 --- a/src/libstd/old_io/buffered.rs +++ b/src/libstd/old_io/buffered.rs @@ -49,8 +49,8 @@ use vec::Vec; pub struct BufferedReader { inner: R, buf: Vec, - pos: uint, - cap: uint, + pos: usize, + cap: usize, } #[stable(feature = "rust1", since = "1.0.0")] @@ -63,7 +63,7 @@ impl fmt::Debug for BufferedReader where R: fmt::Debug { impl BufferedReader { /// Creates a new `BufferedReader` with the specified buffer capacity - pub fn with_capacity(cap: uint, inner: R) -> BufferedReader { + pub fn with_capacity(cap: usize, inner: R) -> BufferedReader { BufferedReader { inner: inner, // We can't use the same trick here as we do for BufferedWriter, @@ -104,14 +104,14 @@ impl Buffer for BufferedReader { Ok(&self.buf[self.pos..self.cap]) } - fn consume(&mut self, amt: uint) { + fn consume(&mut self, amt: usize) { self.pos += amt; assert!(self.pos <= self.cap); } } impl Reader for BufferedReader { - fn read(&mut self, buf: &mut [u8]) -> IoResult { + fn read(&mut self, buf: &mut [u8]) -> IoResult { if self.pos == self.cap && buf.len() >= self.buf.len() { return self.inner.read(buf); } @@ -151,7 +151,7 @@ impl Reader for BufferedReader { pub struct BufferedWriter { inner: Option, buf: Vec, - pos: uint + pos: usize } #[stable(feature = "rust1", since = "1.0.0")] @@ -164,7 +164,7 @@ impl fmt::Debug for BufferedWriter where W: fmt::Debug { impl BufferedWriter { /// Creates a new `BufferedWriter` with the specified buffer capacity - pub fn with_capacity(cap: uint, inner: W) -> BufferedWriter { + pub fn with_capacity(cap: usize, inner: W) -> BufferedWriter { // It's *much* faster to create an uninitialized buffer than it is to // fill everything in with 0. This buffer is entirely an implementation // detail and is never exposed, so we're safe to not initialize @@ -309,7 +309,7 @@ impl InternalBufferedWriter { } impl Reader for InternalBufferedWriter { - fn read(&mut self, buf: &mut [u8]) -> IoResult { + fn read(&mut self, buf: &mut [u8]) -> IoResult { self.get_mut().inner.as_mut().unwrap().read(buf) } } @@ -362,7 +362,7 @@ impl fmt::Debug for BufferedStream where S: fmt::Debug { impl BufferedStream { /// Creates a new buffered stream with explicitly listed capacities for the /// reader/writer buffer. - pub fn with_capacities(reader_cap: uint, writer_cap: uint, inner: S) + pub fn with_capacities(reader_cap: usize, writer_cap: usize, inner: S) -> BufferedStream { let writer = BufferedWriter::with_capacity(writer_cap, inner); let internal_writer = InternalBufferedWriter(writer); @@ -407,11 +407,11 @@ impl BufferedStream { impl Buffer for BufferedStream { fn fill_buf<'a>(&'a mut self) -> IoResult<&'a [u8]> { self.inner.fill_buf() } - fn consume(&mut self, amt: uint) { self.inner.consume(amt) } + fn consume(&mut self, amt: usize) { self.inner.consume(amt) } } impl Reader for BufferedStream { - fn read(&mut self, buf: &mut [u8]) -> IoResult { + fn read(&mut self, buf: &mut [u8]) -> IoResult { self.inner.read(buf) } } @@ -442,7 +442,7 @@ mod test { pub struct NullStream; impl Reader for NullStream { - fn read(&mut self, _: &mut [u8]) -> old_io::IoResult { + fn read(&mut self, _: &mut [u8]) -> old_io::IoResult { Err(old_io::standard_error(old_io::EndOfFile)) } } @@ -453,11 +453,11 @@ mod test { /// A dummy reader intended at testing short-reads propagation. pub struct ShortReader { - lengths: Vec, + lengths: Vec, } impl Reader for ShortReader { - fn read(&mut self, _: &mut [u8]) -> old_io::IoResult { + fn read(&mut self, _: &mut [u8]) -> old_io::IoResult { if self.lengths.is_empty() { Err(old_io::standard_error(old_io::EndOfFile)) } else { @@ -565,7 +565,7 @@ mod test { } impl old_io::Reader for S { - fn read(&mut self, _: &mut [u8]) -> old_io::IoResult { + fn read(&mut self, _: &mut [u8]) -> old_io::IoResult { Err(old_io::standard_error(old_io::EndOfFile)) } } diff --git a/src/libstd/old_io/comm_adapters.rs b/src/libstd/old_io/comm_adapters.rs index cd8252540da..35bc58fecd2 100644 --- a/src/libstd/old_io/comm_adapters.rs +++ b/src/libstd/old_io/comm_adapters.rs @@ -39,7 +39,7 @@ use vec::Vec; /// ``` pub struct ChanReader { buf: Vec, // A buffer of bytes received but not consumed. - pos: uint, // How many of the buffered bytes have already be consumed. + pos: usize, // How many of the buffered bytes have already be consumed. rx: Receiver>, // The Receiver to pull data from. closed: bool, // Whether the channel this Receiver connects to has been closed. } @@ -77,14 +77,14 @@ impl Buffer for ChanReader { } } - fn consume(&mut self, amt: uint) { + fn consume(&mut self, amt: usize) { self.pos += amt; assert!(self.pos <= self.buf.len()); } } impl Reader for ChanReader { - fn read(&mut self, buf: &mut [u8]) -> IoResult { + fn read(&mut self, buf: &mut [u8]) -> IoResult { let mut num_read = 0; loop { let count = match self.fill_buf().ok() { diff --git a/src/libstd/old_io/extensions.rs b/src/libstd/old_io/extensions.rs index 5b1b9471b07..441f0a7536e 100644 --- a/src/libstd/old_io/extensions.rs +++ b/src/libstd/old_io/extensions.rs @@ -81,7 +81,7 @@ impl<'r, R: Reader> Iterator for Bytes<'r, R> { /// * `f`: A callback that receives the value. /// /// This function returns the value returned by the callback, for convenience. -pub fn u64_to_le_bytes(n: u64, size: uint, f: F) -> T where +pub fn u64_to_le_bytes(n: u64, size: usize, f: F) -> T where F: FnOnce(&[u8]) -> T, { use mem::transmute; @@ -122,7 +122,7 @@ pub fn u64_to_le_bytes(n: u64, size: uint, f: F) -> T where /// * `f`: A callback that receives the value. /// /// This function returns the value returned by the callback, for convenience. -pub fn u64_to_be_bytes(n: u64, size: uint, f: F) -> T where +pub fn u64_to_be_bytes(n: u64, size: usize, f: F) -> T where F: FnOnce(&[u8]) -> T, { use mem::transmute; @@ -158,7 +158,7 @@ pub fn u64_to_be_bytes(n: u64, size: uint, f: F) -> T where /// less, or task panic occurs. If this is less than 8, then only /// that many bytes are parsed. For example, if `size` is 4, then a /// 32-bit value is parsed. -pub fn u64_from_be_bytes(data: &[u8], start: uint, size: uint) -> u64 { +pub fn u64_from_be_bytes(data: &[u8], start: usize, size: usize) -> u64 { use ptr::{copy_nonoverlapping}; assert!(size <= 8); @@ -169,9 +169,9 @@ pub fn u64_from_be_bytes(data: &[u8], start: uint, size: uint) -> u64 { let mut buf = [0; 8]; unsafe { - let ptr = data.as_ptr().offset(start as int); + let ptr = data.as_ptr().offset(start as isize); let out = buf.as_mut_ptr(); - copy_nonoverlapping(out.offset((8 - size) as int), ptr, size); + copy_nonoverlapping(out.offset((8 - size) as isize), ptr, size); (*(out as *const u64)).to_be() } } @@ -183,11 +183,11 @@ mod test { use old_io::{MemReader, BytesReader}; struct InitialZeroByteReader { - count: int, + count: isize, } impl Reader for InitialZeroByteReader { - fn read(&mut self, buf: &mut [u8]) -> old_io::IoResult { + fn read(&mut self, buf: &mut [u8]) -> old_io::IoResult { if self.count == 0 { self.count = 1; Ok(0) @@ -201,7 +201,7 @@ mod test { struct EofReader; impl Reader for EofReader { - fn read(&mut self, _: &mut [u8]) -> old_io::IoResult { + fn read(&mut self, _: &mut [u8]) -> old_io::IoResult { Err(old_io::standard_error(old_io::EndOfFile)) } } @@ -209,17 +209,17 @@ mod test { struct ErroringReader; impl Reader for ErroringReader { - fn read(&mut self, _: &mut [u8]) -> old_io::IoResult { + fn read(&mut self, _: &mut [u8]) -> old_io::IoResult { Err(old_io::standard_error(old_io::InvalidInput)) } } struct PartialReader { - count: int, + count: isize, } impl Reader for PartialReader { - fn read(&mut self, buf: &mut [u8]) -> old_io::IoResult { + fn read(&mut self, buf: &mut [u8]) -> old_io::IoResult { if self.count == 0 { self.count = 1; buf[0] = 10; @@ -234,11 +234,11 @@ mod test { } struct ErroringLaterReader { - count: int, + count: isize, } impl Reader for ErroringLaterReader { - fn read(&mut self, buf: &mut [u8]) -> old_io::IoResult { + fn read(&mut self, buf: &mut [u8]) -> old_io::IoResult { if self.count == 0 { self.count = 1; buf[0] = 10; @@ -250,11 +250,11 @@ mod test { } struct ThreeChunkReader { - count: int, + count: isize, } impl Reader for ThreeChunkReader { - fn read(&mut self, buf: &mut [u8]) -> old_io::IoResult { + fn read(&mut self, buf: &mut [u8]) -> old_io::IoResult { if self.count == 0 { self.count = 1; buf[0] = 10; diff --git a/src/libstd/old_io/fs.rs b/src/libstd/old_io/fs.rs index 40a7cce81dd..9ce8e53f6e9 100644 --- a/src/libstd/old_io/fs.rs +++ b/src/libstd/old_io/fs.rs @@ -88,7 +88,7 @@ use sys_common; pub struct File { fd: fs_imp::FileDesc, path: Path, - last_nread: int, + last_nread: isize, } impl sys_common::AsInner for File { @@ -472,14 +472,14 @@ pub fn copy(from: &Path, to: &Path) -> IoResult<()> { #[deprecated(since = "1.0.0", reason = "replaced with std::fs::set_permissions")] #[unstable(feature = "old_io")] pub fn chmod(path: &Path, mode: old_io::FilePermission) -> IoResult<()> { - fs_imp::chmod(path, mode.bits() as uint) + fs_imp::chmod(path, mode.bits() as usize) .update_err("couldn't chmod path", |e| format!("{}; path={}; mode={:?}", e, path.display(), mode)) } /// Change the user and group owners of a file at the specified path. #[unstable(feature = "old_fs")] -pub fn chown(path: &Path, uid: int, gid: int) -> IoResult<()> { +pub fn chown(path: &Path, uid: isize, gid: isize) -> IoResult<()> { fs_imp::chown(path, uid, gid) .update_err("couldn't chown path", |e| format!("{}; path={}; uid={}; gid={}", e, path.display(), uid, gid)) @@ -541,7 +541,7 @@ pub fn readlink(path: &Path) -> IoResult { /// new directory at the provided `path`, or if the directory already exists. #[unstable(feature = "old_fs")] pub fn mkdir(path: &Path, mode: FilePermission) -> IoResult<()> { - fs_imp::mkdir(path, mode.bits() as uint) + fs_imp::mkdir(path, mode.bits() as usize) .update_err("couldn't create directory", |e| format!("{}; path={}; mode={}", e, path.display(), mode)) } @@ -773,7 +773,7 @@ pub fn change_file_times(path: &Path, atime: u64, mtime: u64) -> IoResult<()> { } impl Reader for File { - fn read(&mut self, buf: &mut [u8]) -> IoResult { + fn read(&mut self, buf: &mut [u8]) -> IoResult { fn update_err(result: IoResult, file: &File) -> IoResult { result.update_err("couldn't read file", |e| format!("{}; path={}", @@ -784,10 +784,10 @@ impl Reader for File { match result { Ok(read) => { - self.last_nread = read as int; + self.last_nread = read as isize; match read { 0 => update_err(Err(standard_error(old_io::EndOfFile)), self), - _ => Ok(read as uint) + _ => Ok(read as usize) } }, Err(e) => Err(e) @@ -1227,8 +1227,8 @@ mod test { let stem = f.filestem_str().unwrap(); let root = stem.as_bytes()[0] - b'0'; let name = stem.as_bytes()[1] - b'0'; - assert!(cur[root as uint] < name); - cur[root as uint] = name; + assert!(cur[root as usize] < name); + cur[root as usize] = name; } check!(rmdir_recursive(dir)); diff --git a/src/libstd/old_io/mem.rs b/src/libstd/old_io/mem.rs index d877a60b079..b84515c62f6 100644 --- a/src/libstd/old_io/mem.rs +++ b/src/libstd/old_io/mem.rs @@ -20,9 +20,9 @@ use old_io::{Reader, Writer, Seek, Buffer, IoError, SeekStyle, IoResult}; use slice; use vec::Vec; -const BUF_CAPACITY: uint = 128; +const BUF_CAPACITY: usize = 128; -fn combine(seek: SeekStyle, cur: uint, end: uint, offset: i64) -> IoResult { +fn combine(seek: SeekStyle, cur: usize, end: usize, offset: i64) -> IoResult { // compute offset as signed and clamp to prevent overflow let pos = match seek { old_io::SeekSet => 0, @@ -82,7 +82,7 @@ impl MemWriter { /// Create a new `MemWriter`, allocating at least `n` bytes for /// the internal buffer. #[inline] - pub fn with_capacity(n: uint) -> MemWriter { + pub fn with_capacity(n: usize) -> MemWriter { MemWriter::from_vec(Vec::with_capacity(n)) } /// Create a new `MemWriter` that will append to an existing `Vec`. @@ -125,7 +125,7 @@ impl Writer for MemWriter { /// ``` pub struct MemReader { buf: Vec, - pos: uint + pos: usize } impl MemReader { @@ -160,7 +160,7 @@ impl MemReader { impl Reader for MemReader { #[inline] - fn read(&mut self, buf: &mut [u8]) -> IoResult { + fn read(&mut self, buf: &mut [u8]) -> IoResult { if self.eof() { return Err(old_io::standard_error(old_io::EndOfFile)) } let write_len = min(buf.len(), self.buf.len() - self.pos); @@ -184,7 +184,7 @@ impl Seek for MemReader { #[inline] fn seek(&mut self, pos: i64, style: SeekStyle) -> IoResult<()> { let new = try!(combine(style, self.pos, self.buf.len(), pos)); - self.pos = new as uint; + self.pos = new as usize; Ok(()) } } @@ -200,12 +200,12 @@ impl Buffer for MemReader { } #[inline] - fn consume(&mut self, amt: uint) { self.pos += amt; } + fn consume(&mut self, amt: usize) { self.pos += amt; } } impl<'a> Reader for &'a [u8] { #[inline] - fn read(&mut self, buf: &mut [u8]) -> IoResult { + fn read(&mut self, buf: &mut [u8]) -> IoResult { if self.is_empty() { return Err(old_io::standard_error(old_io::EndOfFile)); } let write_len = min(buf.len(), self.len()); @@ -232,7 +232,7 @@ impl<'a> Buffer for &'a [u8] { } #[inline] - fn consume(&mut self, amt: uint) { + fn consume(&mut self, amt: usize) { *self = &self[amt..]; } } @@ -259,7 +259,7 @@ impl<'a> Buffer for &'a [u8] { /// ``` pub struct BufWriter<'a> { buf: &'a mut [u8], - pos: uint + pos: usize } impl<'a> BufWriter<'a> { @@ -309,7 +309,7 @@ impl<'a> Seek for BufWriter<'a> { #[inline] fn seek(&mut self, pos: i64, style: SeekStyle) -> IoResult<()> { let new = try!(combine(style, self.pos, self.buf.len(), pos)); - self.pos = min(new as uint, self.buf.len()); + self.pos = min(new as usize, self.buf.len()); Ok(()) } } @@ -330,7 +330,7 @@ impl<'a> Seek for BufWriter<'a> { /// ``` pub struct BufReader<'a> { buf: &'a [u8], - pos: uint + pos: usize } impl<'a> BufReader<'a> { @@ -352,7 +352,7 @@ impl<'a> BufReader<'a> { impl<'a> Reader for BufReader<'a> { #[inline] - fn read(&mut self, buf: &mut [u8]) -> IoResult { + fn read(&mut self, buf: &mut [u8]) -> IoResult { if self.eof() { return Err(old_io::standard_error(old_io::EndOfFile)) } let write_len = min(buf.len(), self.buf.len() - self.pos); @@ -376,7 +376,7 @@ impl<'a> Seek for BufReader<'a> { #[inline] fn seek(&mut self, pos: i64, style: SeekStyle) -> IoResult<()> { let new = try!(combine(style, self.pos, self.buf.len(), pos)); - self.pos = new as uint; + self.pos = new as usize; Ok(()) } } @@ -392,7 +392,7 @@ impl<'a> Buffer for BufReader<'a> { } #[inline] - fn consume(&mut self, amt: uint) { self.pos += amt; } + fn consume(&mut self, amt: usize) { self.pos += amt; } } #[cfg(test)] @@ -663,7 +663,7 @@ mod test { assert_eq!(buf, b); } - fn do_bench_mem_writer(b: &mut Bencher, times: uint, len: uint) { + fn do_bench_mem_writer(b: &mut Bencher, times: usize, len: usize) { let src: Vec = repeat(5).take(len).collect(); b.bytes = (times * len) as u64; diff --git a/src/libstd/old_io/mod.rs b/src/libstd/old_io/mod.rs index ac908c529dc..1bbd602b18a 100644 --- a/src/libstd/old_io/mod.rs +++ b/src/libstd/old_io/mod.rs @@ -326,7 +326,7 @@ pub mod test; /// The default buffer size for various I/O operations // libuv recommends 64k buffers to maximize throughput // https://groups.google.com/forum/#!topic/libuv/oQO1HJAIDdA -const DEFAULT_BUF_SIZE: uint = 1024 * 64; +const DEFAULT_BUF_SIZE: usize = 1024 * 64; /// A convenient typedef of the return value of any I/O action. pub type IoResult = Result; @@ -441,7 +441,7 @@ pub enum IoErrorKind { /// /// The payload contained as part of this variant is the number of bytes /// which are known to have been successfully written. - ShortWrite(uint), + ShortWrite(usize), /// The Reader returned 0 bytes from `read()` too many times. NoProgress, } @@ -483,7 +483,7 @@ impl UpdateIoError for IoResult { } } -static NO_PROGRESS_LIMIT: uint = 1000; +static NO_PROGRESS_LIMIT: usize = 1000; /// A trait for objects which are byte-oriented streams. Readers are defined by /// one method, `read`. This function will block until data is available, @@ -511,7 +511,7 @@ pub trait Reader { /// /// When implementing this method on a new Reader, you are strongly encouraged /// not to return 0 if you can avoid it. - fn read(&mut self, buf: &mut [u8]) -> IoResult; + fn read(&mut self, buf: &mut [u8]) -> IoResult; // Convenient helper methods based on the above methods @@ -526,7 +526,7 @@ pub trait Reader { /// /// If an error occurs at any point, that error is returned, and no further /// bytes are read. - fn read_at_least(&mut self, min: uint, buf: &mut [u8]) -> IoResult { + fn read_at_least(&mut self, min: usize, buf: &mut [u8]) -> IoResult { if min > buf.len() { return Err(IoError { detail: Some(String::from_str("the buffer is too short")), @@ -570,7 +570,7 @@ pub trait Reader { /// /// If an error occurs during this I/O operation, then it is returned /// as `Err(IoError)`. See `read()` for more details. - fn push(&mut self, len: uint, buf: &mut Vec) -> IoResult { + fn push(&mut self, len: usize, buf: &mut Vec) -> IoResult { let start_len = buf.len(); buf.reserve(len); @@ -594,7 +594,7 @@ pub trait Reader { /// /// If an error occurs at any point, that error is returned, and no further /// bytes are read. - fn push_at_least(&mut self, min: uint, len: uint, buf: &mut Vec) -> IoResult { + fn push_at_least(&mut self, min: usize, len: usize, buf: &mut Vec) -> IoResult { if min > len { return Err(IoError { detail: Some(String::from_str("the buffer is too short")), @@ -629,7 +629,7 @@ pub trait Reader { /// have already been consumed from the underlying reader, and they are lost /// (not returned as part of the error). If this is unacceptable, then it is /// recommended to use the `push_at_least` or `read` methods. - fn read_exact(&mut self, len: uint) -> IoResult> { + fn read_exact(&mut self, len: usize) -> IoResult> { let mut buf = Vec::with_capacity(len); match self.push_at_least(len, len, &mut buf) { Ok(_) => Ok(buf), @@ -679,7 +679,7 @@ pub trait Reader { /// Reads `n` little-endian unsigned integer bytes. /// /// `n` must be between 1 and 8, inclusive. - fn read_le_uint_n(&mut self, nbytes: uint) -> IoResult { + fn read_le_uint_n(&mut self, nbytes: usize) -> IoResult { assert!(nbytes > 0 && nbytes <= 8); let mut val = 0; @@ -696,14 +696,14 @@ pub trait Reader { /// Reads `n` little-endian signed integer bytes. /// /// `n` must be between 1 and 8, inclusive. - fn read_le_int_n(&mut self, nbytes: uint) -> IoResult { + fn read_le_int_n(&mut self, nbytes: usize) -> IoResult { self.read_le_uint_n(nbytes).map(|i| extend_sign(i, nbytes)) } /// Reads `n` big-endian unsigned integer bytes. /// /// `n` must be between 1 and 8, inclusive. - fn read_be_uint_n(&mut self, nbytes: uint) -> IoResult { + fn read_be_uint_n(&mut self, nbytes: usize) -> IoResult { assert!(nbytes > 0 && nbytes <= 8); let mut val = 0; @@ -718,36 +718,36 @@ pub trait Reader { /// Reads `n` big-endian signed integer bytes. /// /// `n` must be between 1 and 8, inclusive. - fn read_be_int_n(&mut self, nbytes: uint) -> IoResult { + fn read_be_int_n(&mut self, nbytes: usize) -> IoResult { self.read_be_uint_n(nbytes).map(|i| extend_sign(i, nbytes)) } /// Reads a little-endian unsigned integer. /// /// The number of bytes returned is system-dependent. - fn read_le_uint(&mut self) -> IoResult { - self.read_le_uint_n(usize::BYTES as usize).map(|i| i as uint) + fn read_le_uint(&mut self) -> IoResult { + self.read_le_uint_n(usize::BYTES as usize).map(|i| i as usize) } /// Reads a little-endian integer. /// /// The number of bytes returned is system-dependent. - fn read_le_int(&mut self) -> IoResult { - self.read_le_int_n(isize::BYTES as usize).map(|i| i as int) + fn read_le_int(&mut self) -> IoResult { + self.read_le_int_n(isize::BYTES as usize).map(|i| i as isize) } /// Reads a big-endian unsigned integer. /// /// The number of bytes returned is system-dependent. - fn read_be_uint(&mut self) -> IoResult { - self.read_be_uint_n(usize::BYTES as usize).map(|i| i as uint) + fn read_be_uint(&mut self) -> IoResult { + self.read_be_uint_n(usize::BYTES as usize).map(|i| i as usize) } /// Reads a big-endian integer. /// /// The number of bytes returned is system-dependent. - fn read_be_int(&mut self) -> IoResult { - self.read_be_int_n(isize::BYTES as usize).map(|i| i as int) + fn read_be_int(&mut self) -> IoResult { + self.read_be_int_n(isize::BYTES as usize).map(|i| i as isize) } /// Reads a big-endian `u64`. @@ -919,14 +919,14 @@ impl BytesReader for T { } impl<'a> Reader for Box { - fn read(&mut self, buf: &mut [u8]) -> IoResult { + fn read(&mut self, buf: &mut [u8]) -> IoResult { let reader: &mut Reader = &mut **self; reader.read(buf) } } impl<'a> Reader for &'a mut (Reader+'a) { - fn read(&mut self, buf: &mut [u8]) -> IoResult { (*self).read(buf) } + fn read(&mut self, buf: &mut [u8]) -> IoResult { (*self).read(buf) } } /// Returns a slice of `v` between `start` and `end`. @@ -940,13 +940,13 @@ impl<'a> Reader for &'a mut (Reader+'a) { /// `start` > `end`. // Private function here because we aren't sure if we want to expose this as // API yet. If so, it should be a method on Vec. -unsafe fn slice_vec_capacity<'a, T>(v: &'a mut Vec, start: uint, end: uint) -> &'a mut [T] { +unsafe fn slice_vec_capacity<'a, T>(v: &'a mut Vec, start: usize, end: usize) -> &'a mut [T] { use slice; assert!(start <= end); assert!(end <= v.capacity()); slice::from_raw_parts_mut( - v.as_mut_ptr().offset(start as int), + v.as_mut_ptr().offset(start as isize), end - start ) } @@ -980,15 +980,15 @@ pub struct RefReader<'a, R:'a> { } impl<'a, R: Reader> Reader for RefReader<'a, R> { - fn read(&mut self, buf: &mut [u8]) -> IoResult { self.inner.read(buf) } + fn read(&mut self, buf: &mut [u8]) -> IoResult { self.inner.read(buf) } } impl<'a, R: Buffer> Buffer for RefReader<'a, R> { fn fill_buf(&mut self) -> IoResult<&[u8]> { self.inner.fill_buf() } - fn consume(&mut self, amt: uint) { self.inner.consume(amt) } + fn consume(&mut self, amt: usize) { self.inner.consume(amt) } } -fn extend_sign(val: u64, nbytes: uint) -> i64 { +fn extend_sign(val: u64, nbytes: usize) -> i64 { let shift = (8 - nbytes) * 8; (val << shift) as i64 >> shift } @@ -1095,39 +1095,39 @@ pub trait Writer { self.write_all(&buf[..n]) } - /// Write the result of passing n through `int::to_str_bytes`. + /// Write the result of passing n through `isize::to_str_bytes`. #[inline] - fn write_int(&mut self, n: int) -> IoResult<()> { + fn write_int(&mut self, n: isize) -> IoResult<()> { write!(self, "{}", n) } - /// Write the result of passing n through `uint::to_str_bytes`. + /// Write the result of passing n through `usize::to_str_bytes`. #[inline] - fn write_uint(&mut self, n: uint) -> IoResult<()> { + fn write_uint(&mut self, n: usize) -> IoResult<()> { write!(self, "{}", n) } - /// Write a little-endian uint (number of bytes depends on system). + /// Write a little-endian usize (number of bytes depends on system). #[inline] - fn write_le_uint(&mut self, n: uint) -> IoResult<()> { + fn write_le_uint(&mut self, n: usize) -> IoResult<()> { extensions::u64_to_le_bytes(n as u64, usize::BYTES as usize, |v| self.write_all(v)) } - /// Write a little-endian int (number of bytes depends on system). + /// Write a little-endian isize (number of bytes depends on system). #[inline] - fn write_le_int(&mut self, n: int) -> IoResult<()> { + fn write_le_int(&mut self, n: isize) -> IoResult<()> { extensions::u64_to_le_bytes(n as u64, isize::BYTES as usize, |v| self.write_all(v)) } - /// Write a big-endian uint (number of bytes depends on system). + /// Write a big-endian usize (number of bytes depends on system). #[inline] - fn write_be_uint(&mut self, n: uint) -> IoResult<()> { + fn write_be_uint(&mut self, n: usize) -> IoResult<()> { extensions::u64_to_be_bytes(n as u64, usize::BYTES as usize, |v| self.write_all(v)) } - /// Write a big-endian int (number of bytes depends on system). + /// Write a big-endian isize (number of bytes depends on system). #[inline] - fn write_be_int(&mut self, n: int) -> IoResult<()> { + fn write_be_int(&mut self, n: isize) -> IoResult<()> { extensions::u64_to_be_bytes(n as u64, isize::BYTES as usize, |v| self.write_all(v)) } @@ -1409,7 +1409,7 @@ pub trait Buffer: Reader { /// Tells this buffer that `amt` bytes have been consumed from the buffer, /// so they should no longer be returned in calls to `read`. - fn consume(&mut self, amt: uint); + fn consume(&mut self, amt: usize); /// Reads the next line of input, interpreted as a sequence of UTF-8 /// encoded Unicode codepoints. If a newline is encountered, then the @@ -1870,8 +1870,8 @@ mod tests { #[derive(Clone, PartialEq, Debug)] enum BadReaderBehavior { - GoodBehavior(uint), - BadBehavior(uint) + GoodBehavior(usize), + BadBehavior(usize) } struct BadReader { @@ -1886,7 +1886,7 @@ mod tests { } impl Reader for BadReader { - fn read(&mut self, buf: &mut [u8]) -> IoResult { + fn read(&mut self, buf: &mut [u8]) -> IoResult { let BadReader { ref mut behavior, ref mut r } = *self; loop { if behavior.is_empty() { diff --git a/src/libstd/old_io/net/addrinfo.rs b/src/libstd/old_io/net/addrinfo.rs index 2b7506b5c34..0413a89ac4f 100644 --- a/src/libstd/old_io/net/addrinfo.rs +++ b/src/libstd/old_io/net/addrinfo.rs @@ -63,19 +63,19 @@ pub enum Protocol { /// `man -s 3 getaddrinfo` #[derive(Copy, Debug)] pub struct Hint { - pub family: uint, + pub family: usize, pub socktype: Option, pub protocol: Option, - pub flags: uint, + pub flags: usize, } #[derive(Copy, Debug)] pub struct Info { pub address: SocketAddr, - pub family: uint, + pub family: usize, pub socktype: Option, pub protocol: Option, - pub flags: uint, + pub flags: usize, } /// Easy name resolution. Given a hostname, returns the list of IP addresses for diff --git a/src/libstd/old_io/net/ip.rs b/src/libstd/old_io/net/ip.rs index f7953ac51b8..ba3578f7425 100644 --- a/src/libstd/old_io/net/ip.rs +++ b/src/libstd/old_io/net/ip.rs @@ -82,7 +82,7 @@ impl fmt::Display for SocketAddr { struct Parser<'a> { // parsing as ASCII, so can use byte array s: &'a [u8], - pos: uint, + pos: usize, } impl<'a> Parser<'a> { @@ -256,7 +256,7 @@ impl<'a> Parser<'a> { Ipv6Addr(gs[0], gs[1], gs[2], gs[3], gs[4], gs[5], gs[6], gs[7]) } - fn read_groups(p: &mut Parser, groups: &mut [u16; 8], limit: uint) -> (uint, bool) { + fn read_groups(p: &mut Parser, groups: &mut [u16; 8], limit: usize) -> (usize, bool) { let mut i = 0; while i < limit { if i < limit - 1 { diff --git a/src/libstd/old_io/net/pipe.rs b/src/libstd/old_io/net/pipe.rs index f9e5ae71e12..2f3cf3d84d0 100644 --- a/src/libstd/old_io/net/pipe.rs +++ b/src/libstd/old_io/net/pipe.rs @@ -150,7 +150,7 @@ impl Clone for UnixStream { } impl Reader for UnixStream { - fn read(&mut self, buf: &mut [u8]) -> IoResult { + fn read(&mut self, buf: &mut [u8]) -> IoResult { self.inner.read(buf) } } diff --git a/src/libstd/old_io/net/tcp.rs b/src/libstd/old_io/net/tcp.rs index 75f786f0bb1..d55d9ca11d1 100644 --- a/src/libstd/old_io/net/tcp.rs +++ b/src/libstd/old_io/net/tcp.rs @@ -122,7 +122,7 @@ impl TcpStream { /// this connection. Otherwise, the keepalive timeout will be set to the /// specified time, in seconds. #[unstable(feature = "io")] - pub fn set_keepalive(&mut self, delay_in_seconds: Option) -> IoResult<()> { + pub fn set_keepalive(&mut self, delay_in_seconds: Option) -> IoResult<()> { self.inner.set_keepalive(delay_in_seconds) } @@ -257,7 +257,7 @@ impl Clone for TcpStream { } impl Reader for TcpStream { - fn read(&mut self, buf: &mut [u8]) -> IoResult { + fn read(&mut self, buf: &mut [u8]) -> IoResult { self.inner.read(buf) } } @@ -789,12 +789,12 @@ mod test { #[test] fn multiple_connect_interleaved_greedy_schedule_ip4() { let addr = next_test_ip4(); - static MAX: int = 10; + static MAX: isize = 10; let acceptor = TcpListener::bind(addr).listen(); let _t = thread::spawn(move|| { let mut acceptor = acceptor; - for (i, stream) in acceptor.incoming().enumerate().take(MAX as uint) { + for (i, stream) in acceptor.incoming().enumerate().take(MAX as usize) { // Start another task to handle the connection let _t = thread::spawn(move|| { let mut stream = stream; @@ -808,7 +808,7 @@ mod test { connect(0, addr); - fn connect(i: int, addr: SocketAddr) { + fn connect(i: isize, addr: SocketAddr) { if i == MAX { return } let _t = thread::spawn(move|| { @@ -825,12 +825,12 @@ mod test { #[test] fn multiple_connect_interleaved_greedy_schedule_ip6() { let addr = next_test_ip6(); - static MAX: int = 10; + static MAX: isize = 10; let acceptor = TcpListener::bind(addr).listen(); let _t = thread::spawn(move|| { let mut acceptor = acceptor; - for (i, stream) in acceptor.incoming().enumerate().take(MAX as uint) { + for (i, stream) in acceptor.incoming().enumerate().take(MAX as usize) { // Start another task to handle the connection let _t = thread::spawn(move|| { let mut stream = stream; @@ -844,7 +844,7 @@ mod test { connect(0, addr); - fn connect(i: int, addr: SocketAddr) { + fn connect(i: isize, addr: SocketAddr) { if i == MAX { return } let _t = thread::spawn(move|| { @@ -860,13 +860,13 @@ mod test { #[test] fn multiple_connect_interleaved_lazy_schedule_ip4() { - static MAX: int = 10; + static MAX: isize = 10; let addr = next_test_ip4(); let acceptor = TcpListener::bind(addr).listen(); let _t = thread::spawn(move|| { let mut acceptor = acceptor; - for stream in acceptor.incoming().take(MAX as uint) { + for stream in acceptor.incoming().take(MAX as usize) { // Start another task to handle the connection let _t = thread::spawn(move|| { let mut stream = stream; @@ -880,7 +880,7 @@ mod test { connect(0, addr); - fn connect(i: int, addr: SocketAddr) { + fn connect(i: isize, addr: SocketAddr) { if i == MAX { return } let _t = thread::spawn(move|| { @@ -896,13 +896,13 @@ mod test { #[test] fn multiple_connect_interleaved_lazy_schedule_ip6() { - static MAX: int = 10; + static MAX: isize = 10; let addr = next_test_ip6(); let acceptor = TcpListener::bind(addr).listen(); let _t = thread::spawn(move|| { let mut acceptor = acceptor; - for stream in acceptor.incoming().take(MAX as uint) { + for stream in acceptor.incoming().take(MAX as usize) { // Start another task to handle the connection let _t = thread::spawn(move|| { let mut stream = stream; @@ -916,7 +916,7 @@ mod test { connect(0, addr); - fn connect(i: int, addr: SocketAddr) { + fn connect(i: isize, addr: SocketAddr) { if i == MAX { return } let _t = thread::spawn(move|| { diff --git a/src/libstd/old_io/net/udp.rs b/src/libstd/old_io/net/udp.rs index 3aa811974b3..196447d71ef 100644 --- a/src/libstd/old_io/net/udp.rs +++ b/src/libstd/old_io/net/udp.rs @@ -73,7 +73,7 @@ impl UdpSocket { /// Receives data from the socket. On success, returns the number of bytes /// read and the address from whence the data came. - pub fn recv_from(&mut self, buf: &mut [u8]) -> IoResult<(uint, SocketAddr)> { + pub fn recv_from(&mut self, buf: &mut [u8]) -> IoResult<(usize, SocketAddr)> { self.inner.recv_from(buf) } @@ -113,13 +113,13 @@ impl UdpSocket { /// Sets the multicast TTL #[unstable(feature = "io")] - pub fn set_multicast_ttl(&mut self, ttl: int) -> IoResult<()> { + pub fn set_multicast_ttl(&mut self, ttl: isize) -> IoResult<()> { self.inner.multicast_time_to_live(ttl) } /// Sets this socket's TTL #[unstable(feature = "io")] - pub fn set_ttl(&mut self, ttl: int) -> IoResult<()> { + pub fn set_ttl(&mut self, ttl: isize) -> IoResult<()> { self.inner.time_to_live(ttl) } diff --git a/src/libstd/old_io/pipe.rs b/src/libstd/old_io/pipe.rs index 0b555e2f0ff..26f24600479 100644 --- a/src/libstd/old_io/pipe.rs +++ b/src/libstd/old_io/pipe.rs @@ -100,7 +100,7 @@ impl Clone for PipeStream { } impl Reader for PipeStream { - fn read(&mut self, buf: &mut [u8]) -> IoResult { + fn read(&mut self, buf: &mut [u8]) -> IoResult { self.inner.read(buf) } } diff --git a/src/libstd/old_io/process.rs b/src/libstd/old_io/process.rs index d7ede451fb8..45bf5a58ec2 100644 --- a/src/libstd/old_io/process.rs +++ b/src/libstd/old_io/process.rs @@ -41,16 +41,16 @@ use thread; /// Signal a process to exit, without forcibly killing it. Corresponds to /// SIGTERM on unix platforms. -#[cfg(windows)] pub const PleaseExitSignal: int = 15; +#[cfg(windows)] pub const PleaseExitSignal: isize = 15; /// Signal a process to exit immediately, forcibly killing it. Corresponds to /// SIGKILL on unix platforms. -#[cfg(windows)] pub const MustDieSignal: int = 9; +#[cfg(windows)] pub const MustDieSignal: isize = 9; /// Signal a process to exit, without forcibly killing it. Corresponds to /// SIGTERM on unix platforms. -#[cfg(not(windows))] pub const PleaseExitSignal: int = libc::SIGTERM as int; +#[cfg(not(windows))] pub const PleaseExitSignal: isize = libc::SIGTERM as isize; /// Signal a process to exit immediately, forcibly killing it. Corresponds to /// SIGKILL on unix platforms. -#[cfg(not(windows))] pub const MustDieSignal: int = libc::SIGKILL as int; +#[cfg(not(windows))] pub const MustDieSignal: isize = libc::SIGKILL as isize; /// Representation of a running or exited child process. /// @@ -80,7 +80,7 @@ pub struct Process { exit_code: Option, /// Manually delivered signal - exit_signal: Option, + exit_signal: Option, /// Deadline after which wait() will return deadline: u64, @@ -186,8 +186,8 @@ pub struct Command { stdin: StdioContainer, stdout: StdioContainer, stderr: StdioContainer, - uid: Option, - gid: Option, + uid: Option, + gid: Option, detach: bool, } @@ -321,14 +321,14 @@ impl Command { /// the child process. Setting this value on windows will cause the spawn to /// fail. Failure in the `setuid` call on unix will also cause the spawn to /// fail. - pub fn uid<'a>(&'a mut self, id: uint) -> &'a mut Command { + pub fn uid<'a>(&'a mut self, id: usize) -> &'a mut Command { self.uid = Some(id); self } /// Similar to `uid`, but sets the group id of the child process. This has /// the same semantics as the `uid` field. - pub fn gid<'a>(&'a mut self, id: uint) -> &'a mut Command { + pub fn gid<'a>(&'a mut self, id: usize) -> &'a mut Command { self.gid = Some(id); self } @@ -458,10 +458,10 @@ impl sys::process::ProcessConfig for Command { fn cwd(&self) -> Option<&CString> { self.cwd.as_ref() } - fn uid(&self) -> Option { + fn uid(&self) -> Option { self.uid.clone() } - fn gid(&self) -> Option { + fn gid(&self) -> Option { self.gid.clone() } fn detach(&self) -> bool { @@ -507,10 +507,10 @@ pub enum StdioContainer { #[derive(PartialEq, Eq, Clone, Copy, Debug)] pub enum ProcessExit { /// Normal termination with an exit status. - ExitStatus(int), + ExitStatus(isize), /// Termination by signal, with the signal number. - ExitSignal(int), + ExitSignal(isize), } #[stable(feature = "rust1", since = "1.0.0")] @@ -533,7 +533,7 @@ impl ProcessExit { /// Checks whether this ProcessExit matches the given exit status. /// Termination by signal will never match an exit code. - pub fn matches_exit_status(&self, wanted: int) -> bool { + pub fn matches_exit_status(&self, wanted: isize) -> bool { *self == ExitStatus(wanted) } } @@ -549,7 +549,7 @@ impl Process { /// process. Note, though, that on some platforms signals will continue to /// be successfully delivered if the child has exited, but not yet been /// reaped. - pub fn kill(id: libc::pid_t, signal: int) -> IoResult<()> { + pub fn kill(id: libc::pid_t, signal: isize) -> IoResult<()> { unsafe { ProcessImp::killpid(id, signal) } } @@ -571,7 +571,7 @@ impl Process { /// # Errors /// /// If the signal delivery fails, the corresponding error is returned. - pub fn signal(&mut self, signal: int) -> IoResult<()> { + pub fn signal(&mut self, signal: isize) -> IoResult<()> { #[cfg(unix)] fn collect_status(p: &mut Process) { // On Linux (and possibly other unices), a process that has exited will // continue to accept signals because it is "defunct". The delivery of @@ -888,8 +888,8 @@ mod tests { use libc; let mut p = Command::new("/bin/sh") .arg("-c").arg("true") - .uid(unsafe { libc::getuid() as uint }) - .gid(unsafe { libc::getgid() as uint }) + .uid(unsafe { libc::getuid() as usize }) + .gid(unsafe { libc::getgid() as usize }) .spawn().unwrap(); assert!(p.wait().unwrap().success()); } diff --git a/src/libstd/old_io/result.rs b/src/libstd/old_io/result.rs index 9dcb487cdb0..cda19f8ae84 100644 --- a/src/libstd/old_io/result.rs +++ b/src/libstd/old_io/result.rs @@ -35,7 +35,7 @@ impl Writer for IoResult { } impl Reader for IoResult { - fn read(&mut self, buf: &mut [u8]) -> IoResult { + fn read(&mut self, buf: &mut [u8]) -> IoResult { match *self { Ok(ref mut reader) => reader.read(buf), Err(ref e) => Err(e.clone()), diff --git a/src/libstd/old_io/stdio.rs b/src/libstd/old_io/stdio.rs index 90d27084911..b4924c7b78b 100644 --- a/src/libstd/old_io/stdio.rs +++ b/src/libstd/old_io/stdio.rs @@ -182,7 +182,7 @@ impl StdinReader { } impl Reader for StdinReader { - fn read(&mut self, buf: &mut [u8]) -> IoResult { + fn read(&mut self, buf: &mut [u8]) -> IoResult { self.inner.lock().unwrap().0.read(buf) } @@ -190,11 +190,11 @@ impl Reader for StdinReader { // read more than once and we don't want those calls to interleave (or // incur the costs of repeated locking). - fn read_at_least(&mut self, min: uint, buf: &mut [u8]) -> IoResult { + fn read_at_least(&mut self, min: usize, buf: &mut [u8]) -> IoResult { self.inner.lock().unwrap().0.read_at_least(min, buf) } - fn push_at_least(&mut self, min: uint, len: uint, buf: &mut Vec) -> IoResult { + fn push_at_least(&mut self, min: usize, len: usize, buf: &mut Vec) -> IoResult { self.inner.lock().unwrap().0.push_at_least(min, len, buf) } @@ -202,11 +202,11 @@ impl Reader for StdinReader { self.inner.lock().unwrap().0.read_to_end() } - fn read_le_uint_n(&mut self, nbytes: uint) -> IoResult { + fn read_le_uint_n(&mut self, nbytes: usize) -> IoResult { self.inner.lock().unwrap().0.read_le_uint_n(nbytes) } - fn read_be_uint_n(&mut self, nbytes: uint) -> IoResult { + fn read_be_uint_n(&mut self, nbytes: usize) -> IoResult { self.inner.lock().unwrap().0.read_be_uint_n(nbytes) } } @@ -410,16 +410,16 @@ impl StdReader { } impl Reader for StdReader { - fn read(&mut self, buf: &mut [u8]) -> IoResult { + fn read(&mut self, buf: &mut [u8]) -> IoResult { let ret = match self.inner { TTY(ref mut tty) => { // Flush the task-local stdout so that weird issues like a // print!'d prompt not being shown until after the user hits // enter. flush(); - tty.read(buf).map(|i| i as uint) + tty.read(buf).map(|i| i as usize) }, - File(ref mut file) => file.read(buf).map(|i| i as uint), + File(ref mut file) => file.read(buf).map(|i| i as usize), }; match ret { // When reading a piped stdin, libuv will return 0-length reads when @@ -452,7 +452,7 @@ impl StdWriter { /// /// This function will return an error if the output stream is not actually /// connected to a TTY instance, or if querying the TTY instance fails. - pub fn winsize(&mut self) -> IoResult<(int, int)> { + pub fn winsize(&mut self) -> IoResult<(isize, isize)> { match self.inner { TTY(ref mut tty) => { tty.get_winsize() diff --git a/src/libstd/old_io/tempfile.rs b/src/libstd/old_io/tempfile.rs index c0f6ddaaef7..bf9b79ce65a 100644 --- a/src/libstd/old_io/tempfile.rs +++ b/src/libstd/old_io/tempfile.rs @@ -89,7 +89,7 @@ const NUM_RETRIES: u32 = 1 << 31; // be enough to dissuade an attacker from trying to preemptively create names // of that length, but not so huge that we unnecessarily drain the random number // generator of entropy. -const NUM_RAND_CHARS: uint = 12; +const NUM_RAND_CHARS: usize = 12; impl TempDir { /// Attempts to make a temporary directory inside of `tmpdir` whose name diff --git a/src/libstd/old_io/util.rs b/src/libstd/old_io/util.rs index 1f782b6f221..604099f1178 100644 --- a/src/libstd/old_io/util.rs +++ b/src/libstd/old_io/util.rs @@ -22,7 +22,7 @@ use slice::bytes::MutableByteVector; #[deprecated(since = "1.0.0", reason = "use std::io::Take")] #[unstable(feature = "old_io")] pub struct LimitReader { - limit: uint, + limit: usize, inner: R } @@ -32,7 +32,7 @@ impl LimitReader { /// Creates a new `LimitReader` #[deprecated(since = "1.0.0", reason = "use std::io's take method instead")] #[unstable(feature = "old_io")] - pub fn new(r: R, limit: uint) -> LimitReader { + pub fn new(r: R, limit: usize) -> LimitReader { LimitReader { limit: limit, inner: r } } @@ -46,13 +46,13 @@ impl LimitReader { /// /// The reader may reach EOF after reading fewer bytes than indicated by /// this method if the underlying reader reaches EOF. - pub fn limit(&self) -> uint { self.limit } + pub fn limit(&self) -> usize { self.limit } } #[deprecated(since = "1.0.0", reason = "use std::io's take method instead")] #[unstable(feature = "old_io")] impl Reader for LimitReader { - fn read(&mut self, buf: &mut [u8]) -> old_io::IoResult { + fn read(&mut self, buf: &mut [u8]) -> old_io::IoResult { if self.limit == 0 { return Err(old_io::standard_error(old_io::EndOfFile)); } @@ -80,7 +80,7 @@ impl Buffer for LimitReader { } } - fn consume(&mut self, amt: uint) { + fn consume(&mut self, amt: usize) { // Don't let callers reset the limit by passing an overlarge value let amt = cmp::min(amt, self.limit); self.limit -= amt; @@ -112,7 +112,7 @@ pub struct ZeroReader; #[unstable(feature = "old_io")] impl Reader for ZeroReader { #[inline] - fn read(&mut self, buf: &mut [u8]) -> old_io::IoResult { + fn read(&mut self, buf: &mut [u8]) -> old_io::IoResult { buf.set_memory(0); Ok(buf.len()) } @@ -126,7 +126,7 @@ impl Buffer for ZeroReader { Ok(&DATA) } - fn consume(&mut self, _amt: uint) {} + fn consume(&mut self, _amt: usize) {} } /// A `Reader` which is always at EOF, like /dev/null. @@ -139,7 +139,7 @@ pub struct NullReader; #[unstable(feature = "old_io")] impl Reader for NullReader { #[inline] - fn read(&mut self, _buf: &mut [u8]) -> old_io::IoResult { + fn read(&mut self, _buf: &mut [u8]) -> old_io::IoResult { Err(old_io::standard_error(old_io::EndOfFile)) } } @@ -150,7 +150,7 @@ impl Buffer for NullReader { fn fill_buf<'a>(&'a mut self) -> old_io::IoResult<&'a [u8]> { Err(old_io::standard_error(old_io::EndOfFile)) } - fn consume(&mut self, _amt: uint) {} + fn consume(&mut self, _amt: usize) {} } /// A `Writer` which multiplexes writes to a set of `Writer`s. @@ -216,7 +216,7 @@ impl> ChainedReader { #[deprecated(since = "1.0.0", reason = "use std::io::Chain instead")] #[unstable(feature = "old_io")] impl> Reader for ChainedReader { - fn read(&mut self, buf: &mut [u8]) -> old_io::IoResult { + fn read(&mut self, buf: &mut [u8]) -> old_io::IoResult { loop { let err = match self.cur_reader { Some(ref mut r) => { @@ -269,7 +269,7 @@ impl TeeReader { #[deprecated(since = "1.0.0", reason = "use std::io::Tee instead")] #[unstable(feature = "old_io")] impl Reader for TeeReader { - fn read(&mut self, buf: &mut [u8]) -> old_io::IoResult { + fn read(&mut self, buf: &mut [u8]) -> old_io::IoResult { self.reader.read(buf).and_then(|len| { self.writer.write_all(&mut buf[..len]).map(|()| len) }) @@ -307,7 +307,7 @@ impl> IterReader { impl> Reader for IterReader { #[inline] - fn read(&mut self, buf: &mut [u8]) -> old_io::IoResult { + fn read(&mut self, buf: &mut [u8]) -> old_io::IoResult { let mut len = 0; for (slot, elt) in buf.iter_mut().zip(self.iter.by_ref()) { *slot = elt; @@ -392,8 +392,8 @@ mod test { #[test] fn test_multi_writer() { - static mut writes: uint = 0; - static mut flushes: uint = 0; + static mut writes: usize = 0; + static mut flushes: usize = 0; struct TestWriter; impl Writer for TestWriter { diff --git a/src/libstd/old_path/posix.rs b/src/libstd/old_path/posix.rs index 0ab8612a7cb..67bfe2bd770 100644 --- a/src/libstd/old_path/posix.rs +++ b/src/libstd/old_path/posix.rs @@ -37,7 +37,7 @@ pub type StrComponents<'a> = #[derive(Clone)] pub struct Path { repr: Vec, // assumed to never be empty or contain NULs - sepidx: Option // index of the final separator in repr + sepidx: Option // index of the final separator in repr } /// The standard path separator character diff --git a/src/libstd/old_path/windows.rs b/src/libstd/old_path/windows.rs index 4f367e30526..869a8127301 100644 --- a/src/libstd/old_path/windows.rs +++ b/src/libstd/old_path/windows.rs @@ -81,7 +81,7 @@ pub type Components<'a> = pub struct Path { repr: String, // assumed to never be empty prefix: Option, - sepidx: Option // index of the final separator in the non-prefix portion of repr + sepidx: Option // index of the final separator in the non-prefix portion of repr } #[stable(feature = "rust1", since = "1.0.0")] @@ -749,7 +749,7 @@ impl Path { if prefix.is_some() && comps.is_empty() { match prefix.unwrap() { DiskPrefix => { - let len = prefix_len(prefix) + is_abs as uint; + let len = prefix_len(prefix) + is_abs as usize; let mut s = String::from_str(&s[..len]); unsafe { let v = s.as_mut_vec(); @@ -764,7 +764,7 @@ impl Path { Some(s) } VerbatimDiskPrefix => { - let len = prefix_len(prefix) + is_abs as uint; + let len = prefix_len(prefix) + is_abs as usize; let mut s = String::from_str(&s[..len]); unsafe { let v = s.as_mut_vec(); @@ -838,7 +838,7 @@ impl Path { self.sepidx = idx.and_then(|x| if x < prefixlen { None } else { Some(x) }); } - fn prefix_len(&self) -> uint { + fn prefix_len(&self) -> usize { prefix_len(self.prefix) } @@ -847,7 +847,7 @@ impl Path { // end is the length of the string, normally, or the index of the final character if it is // a non-semantic trailing separator in a verbatim string. // If the prefix is considered the separator, before and after are the same. - fn sepidx_or_prefix_len(&self) -> Option<(uint,uint,uint)> { + fn sepidx_or_prefix_len(&self) -> Option<(usize,usize,usize)> { match self.sepidx { None => match self.prefix_len() { 0 => None, x => Some((x,x,self.repr.len())) }, Some(x) => { @@ -973,16 +973,16 @@ pub fn is_sep_byte_verbatim(u: &u8) -> bool { /// Prefix types for Path #[derive(Copy, PartialEq, Clone, Debug)] pub enum PathPrefix { - /// Prefix `\\?\`, uint is the length of the following component - VerbatimPrefix(uint), + /// Prefix `\\?\`, usize is the length of the following component + VerbatimPrefix(usize), /// Prefix `\\?\UNC\`, uints are the lengths of the UNC components - VerbatimUNCPrefix(uint, uint), + VerbatimUNCPrefix(usize, usize), /// Prefix `\\?\C:\` (for any alphabetic character) VerbatimDiskPrefix, - /// Prefix `\\.\`, uint is the length of the following component - DeviceNSPrefix(uint), + /// Prefix `\\.\`, usize is the length of the following component + DeviceNSPrefix(usize), /// UNC prefix `\\server\share`, uints are the lengths of the server/share - UNCPrefix(uint, uint), + UNCPrefix(usize, usize), /// Prefix `C:` for any alphabetic character DiskPrefix } @@ -1037,7 +1037,7 @@ fn parse_prefix<'a>(mut path: &'a str) -> Option { } return None; - fn parse_two_comps(mut path: &str, f: fn(char) -> bool) -> Option<(uint, uint)> { + fn parse_two_comps(mut path: &str, f: fn(char) -> bool) -> Option<(usize, usize)> { let idx_a = match path.find(f) { None => return None, Some(x) => x @@ -1107,7 +1107,7 @@ fn prefix_is_verbatim(p: Option) -> bool { } } -fn prefix_len(p: Option) -> uint { +fn prefix_len(p: Option) -> usize { match p { None => 0, Some(VerbatimPrefix(x)) => 4 + x, diff --git a/src/libstd/os.rs b/src/libstd/os.rs index 40aaea7aca0..2e8521cc94b 100644 --- a/src/libstd/os.rs +++ b/src/libstd/os.rs @@ -100,9 +100,9 @@ fn path2old(path: &path::Path) -> Path { } /// Get the number of cores available -pub fn num_cpus() -> uint { +pub fn num_cpus() -> usize { unsafe { - return rust_get_num_cpus() as uint; + return rust_get_num_cpus() as usize; } extern { @@ -110,7 +110,7 @@ pub fn num_cpus() -> uint { } } -pub const TMPBUF_SZ : uint = 1000; +pub const TMPBUF_SZ : usize = 1000; /// Returns the current working directory as a `Path`. /// @@ -592,7 +592,7 @@ pub fn last_os_error() -> String { /// Note that this is not synchronized against modifications of other threads. #[deprecated(since = "1.0.0", reason = "renamed to env::set_exit_status")] #[unstable(feature = "os")] -pub fn set_exit_status(code: int) { +pub fn set_exit_status(code: isize) { env::set_exit_status(code as i32) } @@ -600,12 +600,12 @@ pub fn set_exit_status(code: int) { /// by calling `set_exit_status`. #[deprecated(since = "1.0.0", reason = "renamed to env::get_exit_status")] #[unstable(feature = "os")] -pub fn get_exit_status() -> int { +pub fn get_exit_status() -> isize { env::get_exit_status() as isize } #[cfg(target_os = "macos")] -unsafe fn load_argc_and_argv(argc: int, +unsafe fn load_argc_and_argv(argc: isize, argv: *const *const c_char) -> Vec> { use ffi::CStr; @@ -620,7 +620,7 @@ unsafe fn load_argc_and_argv(argc: int, #[cfg(target_os = "macos")] fn real_args_as_bytes() -> Vec> { unsafe { - let (argc, argv) = (*_NSGetArgc() as int, + let (argc, argv) = (*_NSGetArgc() as isize, *_NSGetArgv() as *const *const c_char); load_argc_and_argv(argc, argv) } @@ -670,7 +670,7 @@ fn real_args_as_bytes() -> Vec> { let info = objc_msgSend(klass, processInfoSel); let args = objc_msgSend(info, argumentsSel); - let cnt: int = mem::transmute(objc_msgSend(args, countSel)); + let cnt: isize = mem::transmute(objc_msgSend(args, countSel)); for i in 0..cnt { let tmp = objc_msgSend(args, objectAtSel, i); let utf_c_str: *const libc::c_char = @@ -711,11 +711,11 @@ fn real_args() -> Vec { let lpCmdLine = unsafe { GetCommandLineW() }; let szArgList = unsafe { CommandLineToArgvW(lpCmdLine, lpArgCount) }; - let args: Vec<_> = (0..nArgs as uint).map(|i| unsafe { + let args: Vec<_> = (0..nArgs as usize).map(|i| unsafe { // Determine the length of this argument. - let ptr = *szArgList.offset(i as int); + let ptr = *szArgList.offset(i as isize); let mut len = 0; - while *ptr.offset(len as int) != 0 { len += 1; } + while *ptr.offset(len as isize) != 0 { len += 1; } // Push it onto the list. let ptr = ptr as *const u16; @@ -796,7 +796,7 @@ extern { /// Returns the page size of the current architecture in bytes. #[deprecated(since = "1.0.0", reason = "renamed to env::page_size")] #[unstable(feature = "os")] -pub fn page_size() -> uint { +pub fn page_size() -> usize { sys::os::page_size() } @@ -810,7 +810,7 @@ pub fn page_size() -> uint { /// let it leave scope by accident if you want it to stick around. pub struct MemoryMap { data: *mut u8, - len: uint, + len: usize, kind: MemoryMapKind, } @@ -846,9 +846,9 @@ pub enum MapOption { /// Create a memory mapping for a file with a given fd. #[cfg(not(windows))] MapFd(c_int), - /// When using `MapFd`, the start of the map is `uint` bytes from the start + /// When using `MapFd`, the start of the map is `usize` bytes from the start /// of the file. - MapOffset(uint), + MapOffset(usize), /// On POSIX, this can be used to specify the default flags passed to /// `mmap`. By default it uses `MAP_PRIVATE` and, if not using `MapFd`, /// `MAP_ANON`. This will override both of those. This is platform-specific @@ -880,7 +880,7 @@ pub enum MapError { /// Not all platforms obey this, but this wrapper does. ErrZeroLength, /// Unrecognized error. The inner value is the unrecognized errno. - ErrUnknown(int), + ErrUnknown(isize), /// # The following are Windows-specific /// /// Unsupported combination of protection flags @@ -940,7 +940,7 @@ impl Error for MapError { } // Round up `from` to be divisible by `to` -fn round_up(from: uint, to: uint) -> uint { +fn round_up(from: usize, to: usize) -> usize { let r = if from % to == 0 { from } else { @@ -958,7 +958,7 @@ impl MemoryMap { /// Create a new mapping with the given `options`, at least `min_len` bytes /// long. `min_len` must be greater than zero; see the note on /// `ErrZeroLength`. - pub fn new(min_len: uint, options: &[MapOption]) -> Result { + pub fn new(min_len: usize, options: &[MapOption]) -> Result { use libc::off_t; if min_len == 0 { @@ -1002,7 +1002,7 @@ impl MemoryMap { libc::EINVAL => ErrUnaligned, libc::ENODEV => ErrNoMapSupport, libc::ENOMEM => ErrNoMem, - code => ErrUnknown(code as int) + code => ErrUnknown(code as isize) }) } else { Ok(MemoryMap { @@ -1019,7 +1019,7 @@ impl MemoryMap { /// Granularity that the offset or address must be for `MapOffset` and /// `MapAddr` respectively. - pub fn granularity() -> uint { + pub fn granularity() -> usize { env::page_size() } } @@ -1040,7 +1040,7 @@ impl Drop for MemoryMap { #[cfg(windows)] impl MemoryMap { /// Create a new mapping with the given `options`, at least `min_len` bytes long. - pub fn new(min_len: uint, options: &[MapOption]) -> Result { + pub fn new(min_len: usize, options: &[MapOption]) -> Result { use libc::types::os::arch::extra::{LPVOID, DWORD, SIZE_T, HANDLE}; let mut lpAddress: LPVOID = ptr::null_mut(); @@ -1048,7 +1048,7 @@ impl MemoryMap { let mut writable = false; let mut executable = false; let mut handle: HANDLE = libc::INVALID_HANDLE_VALUE; - let mut offset: uint = 0; + let mut offset: usize = 0; let len = round_up(min_len, env::page_size()); for &o in options { @@ -1083,7 +1083,7 @@ impl MemoryMap { libc::MEM_COMMIT | libc::MEM_RESERVE, flProtect) }; - match r as uint { + match r as usize { 0 => Err(ErrVirtualAlloc(errno())), _ => Ok(MemoryMap { data: r as *mut u8, @@ -1119,7 +1119,7 @@ impl MemoryMap { ((len as u64) >> 32) as DWORD, (offset & 0xffff_ffff) as DWORD, 0); - match r as uint { + match r as usize { 0 => Err(ErrMapViewOfFile(errno())), _ => Ok(MemoryMap { data: r as *mut u8, @@ -1133,13 +1133,13 @@ impl MemoryMap { /// Granularity of MapAddr() and MapOffset() parameter values. /// This may be greater than the value returned by page_size(). - pub fn granularity() -> uint { + pub fn granularity() -> usize { use mem; unsafe { let mut info = mem::zeroed(); libc::GetSystemInfo(&mut info); - return info.dwAllocationGranularity as uint; + return info.dwAllocationGranularity as usize; } } } @@ -1178,7 +1178,7 @@ impl MemoryMap { /// Returns the pointer to the memory created or modified by this map. pub fn data(&self) -> *mut u8 { self.data } /// Returns the number of bytes this map applies to. - pub fn len(&self) -> uint { self.len } + pub fn len(&self) -> usize { self.len } /// Returns the type of mapping this represents. pub fn kind(&self) -> MemoryMapKind { self.kind } } diff --git a/src/libstd/rand/mod.rs b/src/libstd/rand/mod.rs index 656ca980624..cfd4e17c021 100644 --- a/src/libstd/rand/mod.rs +++ b/src/libstd/rand/mod.rs @@ -64,7 +64,7 @@ //! //! let mut rng = rand::thread_rng(); //! if rng.gen() { // random bool -//! println!("int: {}, uint: {}", rng.gen::(), rng.gen::()) +//! println!("isize: {}, usize: {}", rng.gen::(), rng.gen::()) //! } //! ``` //! @@ -148,7 +148,7 @@ //! } //! //! // Run a single simulation of the Monty Hall problem. -//! fn simulate(random_door: &Range, rng: &mut R) -> SimulationResult { +//! fn simulate(random_door: &Range, rng: &mut R) -> SimulationResult { //! let car = random_door.ind_sample(rng); //! //! // This is our initial choice @@ -168,18 +168,18 @@ //! //! // Returns the door the game host opens given our choice and knowledge of //! // where the car is. The game host will never open the door with the car. -//! fn game_host_open(car: uint, choice: uint, rng: &mut R) -> uint { +//! fn game_host_open(car: usize, choice: usize, rng: &mut R) -> usize { //! let choices = free_doors(&[car, choice]); //! rand::sample(rng, choices.into_iter(), 1)[0] //! } //! //! // Returns the door we switch to, given our current choice and //! // the open door. There will only be one valid door. -//! fn switch_door(choice: uint, open: uint) -> uint { +//! fn switch_door(choice: usize, open: usize) -> usize { //! free_doors(&[choice, open])[0] //! } //! -//! fn free_doors(blocked: &[uint]) -> Vec { +//! fn free_doors(blocked: &[usize]) -> Vec { //! (0..3).filter(|x| !blocked.contains(x)).collect() //! } //! @@ -336,7 +336,7 @@ pub struct ThreadRng { /// Retrieve the lazily-initialized thread-local random number /// generator, seeded by the system. Intended to be used in method -/// chaining style, e.g. `thread_rng().gen::()`. +/// chaining style, e.g. `thread_rng().gen::()`. /// /// The RNG provided will reseed itself from the operating system /// after generating a certain amount of randomness. @@ -556,14 +556,14 @@ mod test { let mut r = thread_rng(); assert_eq!(r.choose(&[1, 1, 1]).cloned(), Some(1)); - let v: &[int] = &[]; + let v: &[isize] = &[]; assert_eq!(r.choose(v), None); } #[test] fn test_shuffle() { let mut r = thread_rng(); - let empty: &mut [int] = &mut []; + let empty: &mut [isize] = &mut []; r.shuffle(empty); let mut one = [1]; r.shuffle(&mut one); @@ -583,7 +583,7 @@ mod test { #[test] fn test_thread_rng() { let mut r = thread_rng(); - r.gen::(); + r.gen::(); let mut v = [1, 1, 1]; r.shuffle(&mut v); let b: &[_] = &[1, 1, 1]; @@ -594,12 +594,12 @@ mod test { #[test] fn test_random() { // not sure how to test this aside from just getting some values - let _n : uint = random(); + let _n : usize = random(); let _f : f32 = random(); let _o : Option> = random(); let _many : ((), - (uint, - int, + (usize, + isize, Option<(u32, (bool,))>), (u8, i8, u16, i16, u32, i32, u64, i64), (f32, (f64, (f64,)))) = random(); @@ -611,7 +611,7 @@ mod test { let max_val = 100; let mut r = thread_rng(); - let vals = (min_val..max_val).collect::>(); + let vals = (min_val..max_val).collect::>(); let small_sample = sample(&mut r, vals.iter(), 5); let large_sample = sample(&mut r, vals.iter(), vals.len() + 5); @@ -625,7 +625,7 @@ mod test { #[test] fn test_std_rng_seeded() { - let s = thread_rng().gen_iter::().take(256).collect::>(); + let s = thread_rng().gen_iter::().take(256).collect::>(); let mut ra: StdRng = SeedableRng::from_seed(&*s); let mut rb: StdRng = SeedableRng::from_seed(&*s); assert!(order::equals(ra.gen_ascii_chars().take(100), @@ -634,7 +634,7 @@ mod test { #[test] fn test_std_rng_reseed() { - let s = thread_rng().gen_iter::().take(256).collect::>(); + let s = thread_rng().gen_iter::().take(256).collect::>(); let mut r: StdRng = SeedableRng::from_seed(&*s); let string1 = r.gen_ascii_chars().take(100).collect::(); @@ -662,10 +662,10 @@ mod bench { let mut rng: XorShiftRng = OsRng::new().unwrap().gen(); b.iter(|| { for _ in 0..RAND_BENCH_N { - rng.gen::(); + rng.gen::(); } }); - b.bytes = size_of::() as u64 * RAND_BENCH_N; + b.bytes = size_of::() as u64 * RAND_BENCH_N; } #[bench] @@ -673,10 +673,10 @@ mod bench { let mut rng: IsaacRng = OsRng::new().unwrap().gen(); b.iter(|| { for _ in 0..RAND_BENCH_N { - rng.gen::(); + rng.gen::(); } }); - b.bytes = size_of::() as u64 * RAND_BENCH_N; + b.bytes = size_of::() as u64 * RAND_BENCH_N; } #[bench] @@ -684,10 +684,10 @@ mod bench { let mut rng: Isaac64Rng = OsRng::new().unwrap().gen(); b.iter(|| { for _ in 0..RAND_BENCH_N { - rng.gen::(); + rng.gen::(); } }); - b.bytes = size_of::() as u64 * RAND_BENCH_N; + b.bytes = size_of::() as u64 * RAND_BENCH_N; } #[bench] @@ -695,16 +695,16 @@ mod bench { let mut rng = StdRng::new().unwrap(); b.iter(|| { for _ in 0..RAND_BENCH_N { - rng.gen::(); + rng.gen::(); } }); - b.bytes = size_of::() as u64 * RAND_BENCH_N; + b.bytes = size_of::() as u64 * RAND_BENCH_N; } #[bench] fn rand_shuffle_100(b: &mut Bencher) { let mut rng = weak_rng(); - let x : &mut[uint] = &mut [1; 100]; + let x : &mut[usize] = &mut [1; 100]; b.iter(|| { rng.shuffle(x); }) diff --git a/src/libstd/rand/reader.rs b/src/libstd/rand/reader.rs index d3a8fa864fc..ece6867ddca 100644 --- a/src/libstd/rand/reader.rs +++ b/src/libstd/rand/reader.rs @@ -29,7 +29,7 @@ use result::Result::{Ok, Err}; /// use std::old_io::MemReader; /// /// let mut rng = reader::ReaderRng::new(MemReader::new(vec!(1,2,3,4,5,6,7,8))); -/// println!("{:x}", rng.gen::()); +/// println!("{:x}", rng.gen::()); /// ``` pub struct ReaderRng { reader: R diff --git a/src/libstd/rt/args.rs b/src/libstd/rt/args.rs index 9da63405346..428bcaa49f7 100644 --- a/src/libstd/rt/args.rs +++ b/src/libstd/rt/args.rs @@ -23,7 +23,7 @@ use core::prelude::*; use vec::Vec; /// One-time global initialization. -pub unsafe fn init(argc: int, argv: *const *const u8) { imp::init(argc, argv) } +pub unsafe fn init(argc: isize, argv: *const *const u8) { imp::init(argc, argv) } /// One-time global cleanup. pub unsafe fn cleanup() { imp::cleanup() } @@ -54,10 +54,10 @@ mod imp { use sync::{StaticMutex, MUTEX_INIT}; - static mut GLOBAL_ARGS_PTR: uint = 0; + static mut GLOBAL_ARGS_PTR: usize = 0; static LOCK: StaticMutex = MUTEX_INIT; - pub unsafe fn init(argc: int, argv: *const *const u8) { + pub unsafe fn init(argc: isize, argv: *const *const u8) { let args = load_argc_and_argv(argc, argv); put(args); } @@ -146,7 +146,7 @@ mod imp { use core::prelude::*; use vec::Vec; - pub unsafe fn init(_argc: int, _argv: *const *const u8) { + pub unsafe fn init(_argc: isize, _argv: *const *const u8) { } pub fn cleanup() { diff --git a/src/libstd/rt/libunwind.rs b/src/libstd/rt/libunwind.rs index 3063d9d942a..b7769910564 100644 --- a/src/libstd/rt/libunwind.rs +++ b/src/libstd/rt/libunwind.rs @@ -64,25 +64,25 @@ pub type _Unwind_Exception_Class = u64; pub type _Unwind_Word = libc::uintptr_t; #[cfg(target_arch = "x86")] -pub const unwinder_private_data_size: uint = 5; +pub const unwinder_private_data_size: usize = 5; #[cfg(target_arch = "x86_64")] -pub const unwinder_private_data_size: uint = 6; +pub const unwinder_private_data_size: usize = 6; #[cfg(all(target_arch = "arm", not(target_os = "ios")))] -pub const unwinder_private_data_size: uint = 20; +pub const unwinder_private_data_size: usize = 20; #[cfg(all(target_arch = "arm", target_os = "ios"))] -pub const unwinder_private_data_size: uint = 5; +pub const unwinder_private_data_size: usize = 5; #[cfg(target_arch = "aarch64")] -pub const unwinder_private_data_size: uint = 2; +pub const unwinder_private_data_size: usize = 2; #[cfg(any(target_arch = "mips", target_arch = "mipsel"))] -pub const unwinder_private_data_size: uint = 2; +pub const unwinder_private_data_size: usize = 2; #[cfg(target_arch = "powerpc")] -pub const unwinder_private_data_size: uint = 2; +pub const unwinder_private_data_size: usize = 2; #[repr(C)] pub struct _Unwind_Exception { diff --git a/src/libstd/rt/mod.rs b/src/libstd/rt/mod.rs index 497076cc6ac..696c7960c3e 100644 --- a/src/libstd/rt/mod.rs +++ b/src/libstd/rt/mod.rs @@ -48,16 +48,16 @@ mod libunwind; /// The default error code of the rust runtime if the main thread panics instead /// of exiting cleanly. -pub const DEFAULT_ERROR_CODE: int = 101; +pub const DEFAULT_ERROR_CODE: isize = 101; #[cfg(any(windows, android))] -const OS_DEFAULT_STACK_ESTIMATE: uint = 1 << 20; +const OS_DEFAULT_STACK_ESTIMATE: usize = 1 << 20; #[cfg(all(unix, not(android)))] -const OS_DEFAULT_STACK_ESTIMATE: uint = 2 * (1 << 20); +const OS_DEFAULT_STACK_ESTIMATE: usize = 2 * (1 << 20); #[cfg(not(test))] #[lang = "start"] -fn lang_start(main: *const u8, argc: int, argv: *const *const u8) -> int { +fn lang_start(main: *const u8, argc: isize, argv: *const *const u8) -> isize { use prelude::v1::*; use mem; @@ -68,13 +68,13 @@ fn lang_start(main: *const u8, argc: int, argv: *const *const u8) -> int { use thread::Thread; let something_around_the_top_of_the_stack = 1; - let addr = &something_around_the_top_of_the_stack as *const _ as *const int; - let my_stack_top = addr as uint; + let addr = &something_around_the_top_of_the_stack as *const _ as *const isize; + let my_stack_top = addr as usize; // FIXME #11359 we just assume that this thread has a stack of a // certain size, and estimate that there's at most 20KB of stack // frames above our current position. - const TWENTY_KB: uint = 20000; + const TWENTY_KB: usize = 20000; // saturating-add to sidestep overflow let top_plus_spill = if usize::MAX - TWENTY_KB < my_stack_top { diff --git a/src/libstd/rt/unwind.rs b/src/libstd/rt/unwind.rs index 3ee3954ed64..e4927bbd3d2 100644 --- a/src/libstd/rt/unwind.rs +++ b/src/libstd/rt/unwind.rs @@ -78,12 +78,12 @@ struct Exception { cause: Option>, } -pub type Callback = fn(msg: &(Any + Send), file: &'static str, line: uint); +pub type Callback = fn(msg: &(Any + Send), file: &'static str, line: usize); // Variables used for invoking callbacks when a thread starts to unwind. // // For more information, see below. -const MAX_CALLBACKS: uint = 16; +const MAX_CALLBACKS: usize = 16; static CALLBACKS: [atomic::AtomicUsize; MAX_CALLBACKS] = [atomic::ATOMIC_USIZE_INIT, atomic::ATOMIC_USIZE_INIT, atomic::ATOMIC_USIZE_INIT, atomic::ATOMIC_USIZE_INIT, @@ -176,7 +176,7 @@ fn rust_panic(cause: Box) -> ! { }; let exception_param = boxed::into_raw(exception) as *mut uw::_Unwind_Exception; let error = uw::_Unwind_RaiseException(exception_param); - rtabort!("Could not unwind stack, error = {}", error as int) + rtabort!("Could not unwind stack, error = {}", error as isize) } extern fn exception_cleanup(_unwind_code: uw::_Unwind_Reason_Code, @@ -484,7 +484,7 @@ pub mod eabi { /// Entry point of panic from the libcore crate. #[lang = "panic_fmt"] pub extern fn rust_begin_unwind(msg: fmt::Arguments, - file: &'static str, line: uint) -> ! { + file: &'static str, line: usize) -> ! { begin_unwind_fmt(msg, &(file, line)) } @@ -496,7 +496,7 @@ pub extern fn rust_begin_unwind(msg: fmt::Arguments, /// the actual formatting into this shared place. #[inline(never)] #[cold] #[stable(since = "1.0.0", feature = "rust1")] -pub fn begin_unwind_fmt(msg: fmt::Arguments, file_line: &(&'static str, uint)) -> ! { +pub fn begin_unwind_fmt(msg: fmt::Arguments, file_line: &(&'static str, usize)) -> ! { use fmt::Write; // We do two allocations here, unfortunately. But (a) they're @@ -512,7 +512,7 @@ pub fn begin_unwind_fmt(msg: fmt::Arguments, file_line: &(&'static str, uint)) - /// This is the entry point of unwinding for panic!() and assert!(). #[inline(never)] #[cold] // avoid code bloat at the call sites as much as possible #[stable(since = "1.0.0", feature = "rust1")] -pub fn begin_unwind(msg: M, file_line: &(&'static str, uint)) -> ! { +pub fn begin_unwind(msg: M, file_line: &(&'static str, usize)) -> ! { // Note that this should be the only allocation performed in this code path. // Currently this means that panic!() on OOM will invoke this code path, // but then again we're not really ready for panic on OOM anyway. If @@ -535,7 +535,7 @@ pub fn begin_unwind(msg: M, file_line: &(&'static str, uint)) -> /// }` from ~1900/3700 (-O/no opts) to 180/590. #[inline(never)] #[cold] // this is the slow path, please never inline this fn begin_unwind_inner(msg: Box, - file_line: &(&'static str, uint)) -> ! { + file_line: &(&'static str, usize)) -> ! { // Make sure the default failure handler is registered before we look at the // callbacks. We also use a raw sys-based mutex here instead of a // `std::sync` one as accessing TLS can cause weird recursive problems (and diff --git a/src/libstd/rt/util.rs b/src/libstd/rt/util.rs index cf627ca2548..5a482fbb50f 100644 --- a/src/libstd/rt/util.rs +++ b/src/libstd/rt/util.rs @@ -43,7 +43,7 @@ pub fn limit_thread_creation_due_to_osx_and_valgrind() -> bool { (cfg!(target_os="macos")) && running_on_valgrind() } -pub fn min_stack() -> uint { +pub fn min_stack() -> usize { static MIN: atomic::AtomicUsize = atomic::ATOMIC_USIZE_INIT; match MIN.load(Ordering::SeqCst) { 0 => {} diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index eb421fe55a4..b2b87bb6c44 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -1109,13 +1109,13 @@ mod test { #[test] fn drop_full() { - let (tx, _rx) = channel::>(); + let (tx, _rx) = channel::>(); tx.send(box 1).unwrap(); } #[test] fn drop_full_shared() { - let (tx, _rx) = channel::>(); + let (tx, _rx) = channel::>(); drop(tx.clone()); drop(tx.clone()); tx.send(box 1).unwrap(); @@ -1454,7 +1454,7 @@ mod test { #[test] fn oneshot_multi_thread_send_recv_stress() { for _ in 0..stress_factor() { - let (tx, rx) = channel::>(); + let (tx, rx) = channel::>(); let _t = thread::spawn(move|| { tx.send(box 10).unwrap(); }); @@ -1631,7 +1631,7 @@ mod sync_tests { #[test] fn drop_full() { - let (tx, _rx) = sync_channel::>(1); + let (tx, _rx) = sync_channel::>(1); tx.send(box 1).unwrap(); } diff --git a/src/libstd/sync/mpsc/shared.rs b/src/libstd/sync/mpsc/shared.rs index f3930a8a5d6..80cbd076163 100644 --- a/src/libstd/sync/mpsc/shared.rs +++ b/src/libstd/sync/mpsc/shared.rs @@ -398,7 +398,7 @@ impl Packet { } // increment the count on the channel (used for selection) - fn bump(&mut self, amt: int) -> int { + fn bump(&mut self, amt: isize) -> isize { match self.cnt.fetch_add(amt, Ordering::SeqCst) { DISCONNECTED => { self.cnt.store(DISCONNECTED, Ordering::SeqCst); diff --git a/src/libstd/sync/rwlock.rs b/src/libstd/sync/rwlock.rs index 6e94db6d753..a79ffaa0860 100644 --- a/src/libstd/sync/rwlock.rs +++ b/src/libstd/sync/rwlock.rs @@ -551,7 +551,7 @@ mod tests { let arc2 = arc.clone(); let _ = thread::spawn(move|| -> () { struct Unwinder { - i: Arc>, + i: Arc>, } impl Drop for Unwinder { fn drop(&mut self) { diff --git a/src/libstd/sync/semaphore.rs b/src/libstd/sync/semaphore.rs index 059cce57245..be521095aa9 100644 --- a/src/libstd/sync/semaphore.rs +++ b/src/libstd/sync/semaphore.rs @@ -44,7 +44,7 @@ use sync::{Mutex, Condvar}; /// sem.release(); /// ``` pub struct Semaphore { - lock: Mutex, + lock: Mutex, cvar: Condvar, } @@ -60,7 +60,7 @@ impl Semaphore { /// The count specified can be thought of as a number of resources, and a /// call to `acquire` or `access` will block until at least one resource is /// available. It is valid to initialize a semaphore with a negative count. - pub fn new(count: int) -> Semaphore { + pub fn new(count: isize) -> Semaphore { Semaphore { lock: Mutex::new(count), cvar: Condvar::new(), diff --git a/src/libstd/sys/common/backtrace.rs b/src/libstd/sys/common/backtrace.rs index c42a755b444..cd118b3c9ee 100644 --- a/src/libstd/sys/common/backtrace.rs +++ b/src/libstd/sys/common/backtrace.rs @@ -14,10 +14,10 @@ use io::prelude::*; use io; #[cfg(target_pointer_width = "64")] -pub const HEX_WIDTH: uint = 18; +pub const HEX_WIDTH: usize = 18; #[cfg(target_pointer_width = "32")] -pub const HEX_WIDTH: uint = 10; +pub const HEX_WIDTH: usize = 10; // All rust symbols are in theory lists of "::"-separated identifiers. Some // assemblers, however, can't handle these characters in symbol names. To get @@ -57,7 +57,7 @@ pub fn demangle(writer: &mut Write, s: &str) -> io::Result<()> { let mut i = 0; for c in chars.by_ref() { if c.is_numeric() { - i = i * 10 + c as uint - '0' as uint; + i = i * 10 + c as usize - '0' as usize; } else { break } @@ -86,7 +86,7 @@ pub fn demangle(writer: &mut Write, s: &str) -> io::Result<()> { while rest.char_at(0).is_numeric() { rest = &rest[1..]; } - let i: uint = inner[.. (inner.len() - rest.len())].parse().unwrap(); + let i: usize = inner[.. (inner.len() - rest.len())].parse().unwrap(); inner = &rest[i..]; rest = &rest[..i]; while rest.len() > 0 { diff --git a/src/libstd/sys/common/helper_thread.rs b/src/libstd/sys/common/helper_thread.rs index 10077dfd1b8..34a58f6c83a 100644 --- a/src/libstd/sys/common/helper_thread.rs +++ b/src/libstd/sys/common/helper_thread.rs @@ -51,7 +51,7 @@ pub struct Helper { pub chan: UnsafeCell<*mut Sender>, /// OS handle used to wake up a blocked helper thread - pub signal: UnsafeCell, + pub signal: UnsafeCell, /// Flag if this helper thread has booted and been initialized yet. pub initialized: UnsafeCell, @@ -96,11 +96,11 @@ impl Helper { { unsafe { let _guard = self.lock.lock().unwrap(); - if *self.chan.get() as uint == 0 { + if *self.chan.get() as usize == 0 { let (tx, rx) = channel(); *self.chan.get() = boxed::into_raw(box tx); let (receive, send) = helper_signal::new(); - *self.signal.get() = send as uint; + *self.signal.get() = send as usize; let receive = RaceBox(receive); @@ -114,7 +114,7 @@ impl Helper { let _ = rt::at_exit(move || { self.shutdown() }); *self.initialized.get() = true; - } else if *self.chan.get() as uint == 1 { + } else if *self.chan.get() as usize == 1 { panic!("cannot continue usage after shutdown"); } } @@ -130,8 +130,8 @@ impl Helper { // Must send and *then* signal to ensure that the child receives the // message. Otherwise it could wake up and go to sleep before we // send the message. - assert!(*self.chan.get() as uint != 0); - assert!(*self.chan.get() as uint != 1, + assert!(*self.chan.get() as usize != 0); + assert!(*self.chan.get() as usize != 1, "cannot continue usage after shutdown"); (**self.chan.get()).send(msg).unwrap(); helper_signal::signal(*self.signal.get() as helper_signal::signal); @@ -146,7 +146,7 @@ impl Helper { let mut guard = self.lock.lock().unwrap(); let ptr = *self.chan.get(); - if ptr as uint == 1 { + if ptr as usize == 1 { panic!("cannot continue usage after shutdown"); } // Close the channel by destroying it diff --git a/src/libstd/sys/common/mod.rs b/src/libstd/sys/common/mod.rs index 29c05b1e0d8..a8769ba99e8 100644 --- a/src/libstd/sys/common/mod.rs +++ b/src/libstd/sys/common/mod.rs @@ -56,7 +56,7 @@ pub fn timeout(desc: &'static str) -> IoError { } #[allow(deprecated)] -pub fn short_write(n: uint, desc: &'static str) -> IoError { +pub fn short_write(n: usize, desc: &'static str) -> IoError { IoError { kind: if n == 0 { old_io::TimedOut } else { old_io::ShortWrite(n) }, desc: desc, @@ -84,7 +84,7 @@ pub fn mkerr_libc(ret: T) -> IoResult<()> { } pub fn keep_going(data: &[u8], mut f: F) -> i64 where - F: FnMut(*const u8, uint) -> i64, + F: FnMut(*const u8, usize) -> i64, { let origamt = data.len(); let mut data = data.as_ptr(); @@ -94,8 +94,8 @@ pub fn keep_going(data: &[u8], mut f: F) -> i64 where if ret == 0 { break } else if ret != -1 { - amt -= ret as uint; - data = unsafe { data.offset(ret as int) }; + amt -= ret as usize; + data = unsafe { data.offset(ret as isize) }; } else { return ret; } @@ -134,7 +134,7 @@ pub trait ProcessConfig { fn args(&self) -> &[CString]; fn env(&self) -> Option<&collections::HashMap>; fn cwd(&self) -> Option<&CString>; - fn uid(&self) -> Option; - fn gid(&self) -> Option; + fn uid(&self) -> Option; + fn gid(&self) -> Option; fn detach(&self) -> bool; } diff --git a/src/libstd/sys/common/net.rs b/src/libstd/sys/common/net.rs index 96b72b42e54..1a0ee17904a 100644 --- a/src/libstd/sys/common/net.rs +++ b/src/libstd/sys/common/net.rs @@ -148,7 +148,7 @@ pub fn getsockopt(fd: sock_t, opt: libc::c_int, if ret != 0 { Err(last_net_error()) } else { - assert!(len as uint == mem::size_of::()); + assert!(len as usize == mem::size_of::()); Ok(slot) } } @@ -170,14 +170,14 @@ pub fn sockname(fd: sock_t, return Err(last_net_error()) } } - return sockaddr_to_addr(&storage, len as uint); + return sockaddr_to_addr(&storage, len as usize); } pub fn sockaddr_to_addr(storage: &libc::sockaddr_storage, - len: uint) -> IoResult { + len: usize) -> IoResult { match storage.ss_family as libc::c_int { libc::AF_INET => { - assert!(len as uint >= mem::size_of::()); + assert!(len as usize >= mem::size_of::()); let storage: &libc::sockaddr_in = unsafe { mem::transmute(storage) }; @@ -192,7 +192,7 @@ pub fn sockaddr_to_addr(storage: &libc::sockaddr_storage, }) } libc::AF_INET6 => { - assert!(len as uint >= mem::size_of::()); + assert!(len as usize >= mem::size_of::()); let storage: &libc::sockaddr_in6 = unsafe { mem::transmute(storage) }; @@ -283,13 +283,13 @@ pub fn get_host_addresses(host: Option<&str>, servname: Option<&str>, while !rp.is_null() { unsafe { let addr = try!(sockaddr_to_addr(mem::transmute((*rp).ai_addr), - (*rp).ai_addrlen as uint)); + (*rp).ai_addrlen as usize)); addrs.push(addrinfo::Info { address: addr, - family: (*rp).ai_family as uint, + family: (*rp).ai_family as usize, socktype: None, protocol: None, - flags: (*rp).ai_flags as uint + flags: (*rp).ai_flags as usize }); rp = (*rp).ai_next as *mut libc::addrinfo; @@ -312,7 +312,7 @@ extern "system" { flags: c_int) -> c_int; } -const NI_MAXHOST: uint = 1025; +const NI_MAXHOST: usize = 1025; pub fn get_address_name(addr: IpAddr) -> Result { let addr = SocketAddr{ip: addr, port: 0}; @@ -393,7 +393,7 @@ pub fn get_address_name(addr: IpAddr) -> Result { // [1] http://twistedmatrix.com/pipermail/twisted-commits/2012-April/034692.html // [2] http://stackoverflow.com/questions/19819198/does-send-msg-dontwait -pub fn read(fd: sock_t, deadline: u64, mut lock: L, mut read: R) -> IoResult where +pub fn read(fd: sock_t, deadline: u64, mut lock: L, mut read: R) -> IoResult where L: FnMut() -> T, R: FnMut(bool) -> libc::c_int, { @@ -431,7 +431,7 @@ pub fn read(fd: sock_t, deadline: u64, mut lock: L, mut read: R) -> IoR match ret { 0 => Err(sys_common::eof()), n if n < 0 => Err(last_net_error()), - n => Ok(n as uint) + n => Ok(n as usize) } } @@ -440,9 +440,9 @@ pub fn write(fd: sock_t, buf: &[u8], write_everything: bool, mut lock: L, - mut write: W) -> IoResult where + mut write: W) -> IoResult where L: FnMut() -> T, - W: FnMut(bool, *const u8, uint) -> i64, + W: FnMut(bool, *const u8, usize) -> i64, { let mut ret = -1; let mut written = 0; @@ -454,7 +454,7 @@ pub fn write(fd: sock_t, }); } else { ret = retry(|| { write(false, buf.as_ptr(), buf.len()) }); - if ret > 0 { written = ret as uint; } + if ret > 0 { written = ret as usize; } } } @@ -483,7 +483,7 @@ pub fn write(fd: sock_t, match retry(|| write(deadline.is_some(), ptr, len)) { -1 if wouldblock() => {} -1 => return Err(last_net_error()), - n => { written += n as uint; } + n => { written += n as usize; } } } ret = 0; @@ -513,8 +513,8 @@ pub fn connect_timeout(fd: sock_t, // If the connection is in progress, then we need to wait for it to // finish (with a timeout). The current strategy for doing this is // to use select() with a timeout. - -1 if os::errno() as int == INPROGRESS as int || - os::errno() as int == WOULDBLOCK as int => { + -1 if os::errno() as isize == INPROGRESS as isize || + os::errno() as isize == WOULDBLOCK as isize => { let mut set: c::fd_set = unsafe { mem::zeroed() }; c::fd_set(&mut set, fd); match await(fd, &mut set, timeout_ms) { @@ -686,7 +686,7 @@ impl TcpStream { nodelay as libc::c_int) } - pub fn set_keepalive(&mut self, seconds: Option) -> IoResult<()> { + pub fn set_keepalive(&mut self, seconds: Option) -> IoResult<()> { let ret = setsockopt(self.fd(), libc::SOL_SOCKET, libc::SO_KEEPALIVE, seconds.is_some() as libc::c_int); match seconds { @@ -696,18 +696,18 @@ impl TcpStream { } #[cfg(any(target_os = "macos", target_os = "ios"))] - fn set_tcp_keepalive(&mut self, seconds: uint) -> IoResult<()> { + fn set_tcp_keepalive(&mut self, seconds: usize) -> IoResult<()> { setsockopt(self.fd(), libc::IPPROTO_TCP, libc::TCP_KEEPALIVE, seconds as libc::c_int) } #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] - fn set_tcp_keepalive(&mut self, seconds: uint) -> IoResult<()> { + fn set_tcp_keepalive(&mut self, seconds: usize) -> IoResult<()> { setsockopt(self.fd(), libc::IPPROTO_TCP, libc::TCP_KEEPIDLE, seconds as libc::c_int) } #[cfg(target_os = "openbsd")] - fn set_tcp_keepalive(&mut self, seconds: uint) -> IoResult<()> { + fn set_tcp_keepalive(&mut self, seconds: usize) -> IoResult<()> { setsockopt(self.fd(), libc::IPPROTO_TCP, libc::SO_KEEPALIVE, seconds as libc::c_int) } @@ -716,7 +716,7 @@ impl TcpStream { target_os = "freebsd", target_os = "dragonfly", target_os = "openbsd")))] - fn set_tcp_keepalive(&mut self, _seconds: uint) -> IoResult<()> { + fn set_tcp_keepalive(&mut self, _seconds: usize) -> IoResult<()> { Ok(()) } @@ -733,7 +733,7 @@ impl TcpStream { ret } - pub fn read(&mut self, buf: &mut [u8]) -> IoResult { + pub fn read(&mut self, buf: &mut [u8]) -> IoResult { let fd = self.fd(); let dolock = || self.lock_nonblocking(); let doread = |nb| unsafe { @@ -749,7 +749,7 @@ impl TcpStream { pub fn write(&mut self, buf: &[u8]) -> IoResult<()> { let fd = self.fd(); let dolock = || self.lock_nonblocking(); - let dowrite = |nb: bool, buf: *const u8, len: uint| unsafe { + let dowrite = |nb: bool, buf: *const u8, len: usize| unsafe { let flags = if nb {c::MSG_DONTWAIT} else {0}; libc::send(fd, buf as *const _, @@ -876,7 +876,7 @@ impl UdpSocket { sockname(self.fd(), libc::getsockname) } - pub fn recv_from(&mut self, buf: &mut [u8]) -> IoResult<(uint, SocketAddr)> { + pub fn recv_from(&mut self, buf: &mut [u8]) -> IoResult<(usize, SocketAddr)> { let fd = self.fd(); let mut storage: libc::sockaddr_storage = unsafe { mem::zeroed() }; let storagep = &mut storage as *mut _ as *mut libc::sockaddr; @@ -893,7 +893,7 @@ impl UdpSocket { storagep, &mut addrlen) as libc::c_int })); - Ok((n as uint, sockaddr_to_addr(&storage, addrlen as uint).unwrap())) + Ok((n as usize, sockaddr_to_addr(&storage, addrlen as usize).unwrap())) } pub fn send_to(&mut self, buf: &[u8], dst: SocketAddr) -> IoResult<()> { @@ -903,7 +903,7 @@ impl UdpSocket { let fd = self.fd(); let dolock = || self.lock_nonblocking(); - let dowrite = |nb, buf: *const u8, len: uint| unsafe { + let dowrite = |nb, buf: *const u8, len: usize| unsafe { let flags = if nb {c::MSG_DONTWAIT} else {0}; libc::sendto(fd, buf as *const libc::c_void, @@ -939,11 +939,11 @@ impl UdpSocket { } } - pub fn multicast_time_to_live(&mut self, ttl: int) -> IoResult<()> { + pub fn multicast_time_to_live(&mut self, ttl: isize) -> IoResult<()> { setsockopt(self.fd(), libc::IPPROTO_IP, libc::IP_MULTICAST_TTL, ttl as libc::c_int) } - pub fn time_to_live(&mut self, ttl: int) -> IoResult<()> { + pub fn time_to_live(&mut self, ttl: isize) -> IoResult<()> { setsockopt(self.fd(), libc::IPPROTO_IP, libc::IP_TTL, ttl as libc::c_int) } diff --git a/src/libstd/sys/common/stack.rs b/src/libstd/sys/common/stack.rs index 8c428275ccf..8dc3407db77 100644 --- a/src/libstd/sys/common/stack.rs +++ b/src/libstd/sys/common/stack.rs @@ -46,7 +46,7 @@ // corresponding prolog, decision was taken to disable segmented // stack support on iOS. -pub const RED_ZONE: uint = 20 * 1024; +pub const RED_ZONE: usize = 20 * 1024; /// This function is invoked from rust's current __morestack function. Segmented /// stacks are currently not enabled as segmented stacks, but rather one giant @@ -117,7 +117,7 @@ extern fn stack_exhausted() { // On all other platforms both variants behave identically. #[inline(always)] -pub unsafe fn record_os_managed_stack_bounds(stack_lo: uint, _stack_hi: uint) { +pub unsafe fn record_os_managed_stack_bounds(stack_lo: usize, _stack_hi: usize) { record_sp_limit(stack_lo + RED_ZONE); } @@ -136,31 +136,31 @@ pub unsafe fn record_os_managed_stack_bounds(stack_lo: uint, _stack_hi: uint) { /// would be unfortunate for the functions themselves to trigger a morestack /// invocation (if they were an actual function call). #[inline(always)] -pub unsafe fn record_sp_limit(limit: uint) { +pub unsafe fn record_sp_limit(limit: usize) { return target_record_sp_limit(limit); // x86-64 #[cfg(all(target_arch = "x86_64", any(target_os = "macos", target_os = "ios")))] #[inline(always)] - unsafe fn target_record_sp_limit(limit: uint) { + unsafe fn target_record_sp_limit(limit: usize) { asm!("movq $$0x60+90*8, %rsi movq $0, %gs:(%rsi)" :: "r"(limit) : "rsi" : "volatile") } #[cfg(all(target_arch = "x86_64", target_os = "linux"))] #[inline(always)] - unsafe fn target_record_sp_limit(limit: uint) { + unsafe fn target_record_sp_limit(limit: usize) { asm!("movq $0, %fs:112" :: "r"(limit) :: "volatile") } #[cfg(all(target_arch = "x86_64", target_os = "windows"))] #[inline(always)] - unsafe fn target_record_sp_limit(_: uint) { + unsafe fn target_record_sp_limit(_: usize) { } #[cfg(all(target_arch = "x86_64", target_os = "freebsd"))] #[inline(always)] - unsafe fn target_record_sp_limit(limit: uint) { + unsafe fn target_record_sp_limit(limit: usize) { asm!("movq $0, %fs:24" :: "r"(limit) :: "volatile") } #[cfg(all(target_arch = "x86_64", target_os = "dragonfly"))] #[inline(always)] - unsafe fn target_record_sp_limit(limit: uint) { + unsafe fn target_record_sp_limit(limit: usize) { asm!("movq $0, %fs:32" :: "r"(limit) :: "volatile") } @@ -168,18 +168,18 @@ pub unsafe fn record_sp_limit(limit: uint) { #[cfg(all(target_arch = "x86", any(target_os = "macos", target_os = "ios")))] #[inline(always)] - unsafe fn target_record_sp_limit(limit: uint) { + unsafe fn target_record_sp_limit(limit: usize) { asm!("movl $$0x48+90*4, %eax movl $0, %gs:(%eax)" :: "r"(limit) : "eax" : "volatile") } #[cfg(all(target_arch = "x86", any(target_os = "linux", target_os = "freebsd")))] #[inline(always)] - unsafe fn target_record_sp_limit(limit: uint) { + unsafe fn target_record_sp_limit(limit: usize) { asm!("movl $0, %gs:48" :: "r"(limit) :: "volatile") } #[cfg(all(target_arch = "x86", target_os = "windows"))] #[inline(always)] - unsafe fn target_record_sp_limit(_: uint) { + unsafe fn target_record_sp_limit(_: usize) { } // mips, arm - Some brave soul can port these to inline asm, but it's over @@ -188,7 +188,7 @@ pub unsafe fn record_sp_limit(limit: uint) { target_arch = "mipsel", all(target_arch = "arm", not(target_os = "ios"))))] #[inline(always)] - unsafe fn target_record_sp_limit(limit: uint) { + unsafe fn target_record_sp_limit(limit: usize) { use libc::c_void; return record_sp_limit(limit as *const c_void); extern { @@ -205,7 +205,7 @@ pub unsafe fn record_sp_limit(limit: uint) { all(target_arch = "arm", target_os = "ios"), target_os = "bitrig", target_os = "openbsd"))] - unsafe fn target_record_sp_limit(_: uint) { + unsafe fn target_record_sp_limit(_: usize) { } } @@ -218,38 +218,38 @@ pub unsafe fn record_sp_limit(limit: uint) { /// As with the setter, this function does not have a __morestack header and can /// therefore be called in a "we're out of stack" situation. #[inline(always)] -pub unsafe fn get_sp_limit() -> uint { +pub unsafe fn get_sp_limit() -> usize { return target_get_sp_limit(); // x86-64 #[cfg(all(target_arch = "x86_64", any(target_os = "macos", target_os = "ios")))] #[inline(always)] - unsafe fn target_get_sp_limit() -> uint { + unsafe fn target_get_sp_limit() -> usize { let limit; asm!("movq $$0x60+90*8, %rsi movq %gs:(%rsi), $0" : "=r"(limit) :: "rsi" : "volatile"); return limit; } #[cfg(all(target_arch = "x86_64", target_os = "linux"))] #[inline(always)] - unsafe fn target_get_sp_limit() -> uint { + unsafe fn target_get_sp_limit() -> usize { let limit; asm!("movq %fs:112, $0" : "=r"(limit) ::: "volatile"); return limit; } #[cfg(all(target_arch = "x86_64", target_os = "windows"))] #[inline(always)] - unsafe fn target_get_sp_limit() -> uint { + unsafe fn target_get_sp_limit() -> usize { return 1024; } #[cfg(all(target_arch = "x86_64", target_os = "freebsd"))] #[inline(always)] - unsafe fn target_get_sp_limit() -> uint { + unsafe fn target_get_sp_limit() -> usize { let limit; asm!("movq %fs:24, $0" : "=r"(limit) ::: "volatile"); return limit; } #[cfg(all(target_arch = "x86_64", target_os = "dragonfly"))] #[inline(always)] - unsafe fn target_get_sp_limit() -> uint { + unsafe fn target_get_sp_limit() -> usize { let limit; asm!("movq %fs:32, $0" : "=r"(limit) ::: "volatile"); return limit; @@ -259,7 +259,7 @@ pub unsafe fn get_sp_limit() -> uint { #[cfg(all(target_arch = "x86", any(target_os = "macos", target_os = "ios")))] #[inline(always)] - unsafe fn target_get_sp_limit() -> uint { + unsafe fn target_get_sp_limit() -> usize { let limit; asm!("movl $$0x48+90*4, %eax movl %gs:(%eax), $0" : "=r"(limit) :: "eax" : "volatile"); @@ -268,13 +268,13 @@ pub unsafe fn get_sp_limit() -> uint { #[cfg(all(target_arch = "x86", any(target_os = "linux", target_os = "freebsd")))] #[inline(always)] - unsafe fn target_get_sp_limit() -> uint { + unsafe fn target_get_sp_limit() -> usize { let limit; asm!("movl %gs:48, $0" : "=r"(limit) ::: "volatile"); return limit; } #[cfg(all(target_arch = "x86", target_os = "windows"))] #[inline(always)] - unsafe fn target_get_sp_limit() -> uint { + unsafe fn target_get_sp_limit() -> usize { return 1024; } @@ -284,9 +284,9 @@ pub unsafe fn get_sp_limit() -> uint { target_arch = "mipsel", all(target_arch = "arm", not(target_os = "ios"))))] #[inline(always)] - unsafe fn target_get_sp_limit() -> uint { + unsafe fn target_get_sp_limit() -> usize { use libc::c_void; - return get_sp_limit() as uint; + return get_sp_limit() as usize; extern { fn get_sp_limit() -> *const c_void; } @@ -305,7 +305,7 @@ pub unsafe fn get_sp_limit() -> uint { target_os = "bitrig", target_os = "openbsd"))] #[inline(always)] - unsafe fn target_get_sp_limit() -> uint { + unsafe fn target_get_sp_limit() -> usize { 1024 } } diff --git a/src/libstd/sys/common/thread_info.rs b/src/libstd/sys/common/thread_info.rs index 90526b8f4f3..22cb5943371 100644 --- a/src/libstd/sys/common/thread_info.rs +++ b/src/libstd/sys/common/thread_info.rs @@ -18,7 +18,7 @@ use thread::Thread; use thread::LocalKeyState; struct ThreadInfo { - stack_guard: uint, + stack_guard: usize, thread: Thread, } @@ -47,11 +47,11 @@ pub fn current_thread() -> Thread { ThreadInfo::with(|info| info.thread.clone()) } -pub fn stack_guard() -> uint { +pub fn stack_guard() -> usize { ThreadInfo::with(|info| info.stack_guard) } -pub fn set(stack_guard: uint, thread: Thread) { +pub fn set(stack_guard: usize, thread: Thread) { THREAD_INFO.with(|c| assert!(c.borrow().is_none())); THREAD_INFO.with(move |c| *c.borrow_mut() = Some(ThreadInfo{ stack_guard: stack_guard, diff --git a/src/libstd/sys/common/thread_local.rs b/src/libstd/sys/common/thread_local.rs index 5e2a138fa63..5995d7ac10f 100644 --- a/src/libstd/sys/common/thread_local.rs +++ b/src/libstd/sys/common/thread_local.rs @@ -178,7 +178,7 @@ impl StaticKey { } } - unsafe fn lazy_init(&self) -> uint { + unsafe fn lazy_init(&self) -> usize { // POSIX allows the key created here to be 0, but the compare_and_swap // below relies on using 0 as a sentinel value to check who won the // race to set the shared TLS key. As far as I know, there is no @@ -197,9 +197,9 @@ impl StaticKey { key2 }; assert!(key != 0); - match self.inner.key.compare_and_swap(0, key as uint, Ordering::SeqCst) { + match self.inner.key.compare_and_swap(0, key as usize, Ordering::SeqCst) { // The CAS succeeded, so we've created the actual key - 0 => key as uint, + 0 => key as usize, // If someone beat us to the punch, use their key instead n => { imp::destroy(key); n } } @@ -261,8 +261,8 @@ mod tests { assert!(k2.get().is_null()); k1.set(1 as *mut _); k2.set(2 as *mut _); - assert_eq!(k1.get() as uint, 1); - assert_eq!(k2.get() as uint, 2); + assert_eq!(k1.get() as usize, 1); + assert_eq!(k2.get() as usize, 2); } #[test] @@ -275,8 +275,8 @@ mod tests { assert!(K2.get().is_null()); K1.set(1 as *mut _); K2.set(2 as *mut _); - assert_eq!(K1.get() as uint, 1); - assert_eq!(K2.get() as uint, 2); + assert_eq!(K1.get() as usize, 1); + assert_eq!(K2.get() as usize, 2); } } } diff --git a/src/libstd/sys/common/wtf8.rs b/src/libstd/sys/common/wtf8.rs index 9f3dae34c7a..7efe7d96b71 100644 --- a/src/libstd/sys/common/wtf8.rs +++ b/src/libstd/sys/common/wtf8.rs @@ -158,7 +158,7 @@ impl Wtf8Buf { /// Create an new, empty WTF-8 string with pre-allocated capacity for `n` bytes. #[inline] - pub fn with_capacity(n: uint) -> Wtf8Buf { + pub fn with_capacity(n: usize) -> Wtf8Buf { Wtf8Buf { bytes: Vec::with_capacity(n) } } @@ -214,7 +214,7 @@ impl Wtf8Buf { // Attempt to not use an intermediate buffer by just pushing bytes // directly onto this string. let slice = slice::from_raw_parts_mut( - self.bytes.as_mut_ptr().offset(cur_len as int), + self.bytes.as_mut_ptr().offset(cur_len as isize), 4 ); let used = encode_utf8_raw(code_point.value, mem::transmute(slice)) @@ -234,15 +234,15 @@ impl Wtf8Buf { /// /// # Panics /// - /// Panics if the new capacity overflows `uint`. + /// Panics if the new capacity overflows `usize`. #[inline] - pub fn reserve(&mut self, additional: uint) { + pub fn reserve(&mut self, additional: usize) { self.bytes.reserve(additional) } /// Returns the number of bytes that this string buffer can hold without reallocating. #[inline] - pub fn capacity(&self) -> uint { + pub fn capacity(&self) -> usize { self.bytes.capacity() } @@ -313,7 +313,7 @@ impl Wtf8Buf { /// Panics if `new_len` > current length, /// or if `new_len` is not a code point boundary. #[inline] - pub fn truncate(&mut self, new_len: uint) { + pub fn truncate(&mut self, new_len: usize) { assert!(is_code_point_boundary(self, new_len)); self.bytes.truncate(new_len) } @@ -463,7 +463,7 @@ impl Wtf8 { /// Return the length, in WTF-8 bytes. #[inline] - pub fn len(&self) -> uint { + pub fn len(&self) -> usize { self.bytes.len() } @@ -474,7 +474,7 @@ impl Wtf8 { /// /// Panics if `position` is beyond the end of the string. #[inline] - pub fn ascii_byte_at(&self, position: uint) -> u8 { + pub fn ascii_byte_at(&self, position: usize) -> u8 { match self.bytes[position] { ascii_byte @ 0x00 ... 0x7F => ascii_byte, _ => 0xFF @@ -488,7 +488,7 @@ impl Wtf8 { /// Panics if `position` is not at a code point boundary, /// or is beyond the end of the string. #[inline] - pub fn code_point_at(&self, position: uint) -> CodePoint { + pub fn code_point_at(&self, position: usize) -> CodePoint { let (code_point, _) = self.code_point_range_at(position); code_point } @@ -501,7 +501,7 @@ impl Wtf8 { /// Panics if `position` is not at a code point boundary, /// or is beyond the end of the string. #[inline] - pub fn code_point_range_at(&self, position: uint) -> (CodePoint, uint) { + pub fn code_point_range_at(&self, position: usize) -> (CodePoint, usize) { let (c, n) = char_range_at_raw(&self.bytes, position); (CodePoint { value: c }, n) } @@ -570,7 +570,7 @@ impl Wtf8 { } #[inline] - fn next_surrogate(&self, mut pos: uint) -> Option<(uint, u16)> { + fn next_surrogate(&self, mut pos: usize) -> Option<(usize, u16)> { let mut iter = self.bytes[pos..].iter(); loop { let b = match iter.next() { @@ -792,7 +792,7 @@ fn decode_surrogate_pair(lead: u16, trail: u16) -> char { /// Copied from core::str::StrPrelude::is_char_boundary #[inline] -pub fn is_code_point_boundary(slice: &Wtf8, index: uint) -> bool { +pub fn is_code_point_boundary(slice: &Wtf8, index: usize) -> bool { if index == slice.len() { return true; } match slice.bytes.get(index) { None => false, @@ -802,17 +802,17 @@ pub fn is_code_point_boundary(slice: &Wtf8, index: uint) -> bool { /// Copied from core::str::raw::slice_unchecked #[inline] -pub unsafe fn slice_unchecked(s: &Wtf8, begin: uint, end: uint) -> &Wtf8 { +pub unsafe fn slice_unchecked(s: &Wtf8, begin: usize, end: usize) -> &Wtf8 { // memory layout of an &[u8] and &Wtf8 are the same mem::transmute(slice::from_raw_parts( - s.bytes.as_ptr().offset(begin as int), + s.bytes.as_ptr().offset(begin as isize), end - begin )) } /// Copied from core::str::raw::slice_error_fail #[inline(never)] -pub fn slice_error_fail(s: &Wtf8, begin: uint, end: uint) -> ! { +pub fn slice_error_fail(s: &Wtf8, begin: usize, end: usize) -> ! { assert!(begin <= end); panic!("index {} and/or {} in `{:?}` do not lie on character boundary", begin, end, s); @@ -835,7 +835,7 @@ impl<'a> Iterator for Wtf8CodePoints<'a> { } #[inline] - fn size_hint(&self) -> (uint, Option) { + fn size_hint(&self) -> (usize, Option) { let (len, _) = self.bytes.size_hint(); (len.saturating_add(3) / 4, Some(len)) } @@ -869,7 +869,7 @@ impl<'a> Iterator for EncodeWide<'a> { } #[inline] - fn size_hint(&self) -> (uint, Option) { + fn size_hint(&self) -> (usize, Option) { let (low, high) = self.code_points.size_hint(); // every code point gets either one u16 or two u16, // so this iterator is between 1 or 2 times as diff --git a/src/libstd/sys/unix/backtrace.rs b/src/libstd/sys/unix/backtrace.rs index 7db64cfb936..b46d390826c 100644 --- a/src/libstd/sys/unix/backtrace.rs +++ b/src/libstd/sys/unix/backtrace.rs @@ -128,7 +128,7 @@ pub fn write(w: &mut Write) -> io::Result<()> { // skipping the first one as it is write itself let iter = (1..cnt).map(|i| { - print(w, i as int, buf[i], buf[i]) + print(w, i as isize, buf[i], buf[i]) }); result::fold(iter, (), |_, _| ()) } @@ -138,7 +138,7 @@ pub fn write(w: &mut Write) -> io::Result<()> { // tracing pub fn write(w: &mut Write) -> io::Result<()> { struct Context<'a> { - idx: int, + idx: isize, writer: &'a mut (Write+'a), last_error: Option, } @@ -222,7 +222,7 @@ pub fn write(w: &mut Write) -> io::Result<()> { } #[cfg(any(target_os = "macos", target_os = "ios"))] -fn print(w: &mut Write, idx: int, addr: *mut libc::c_void, +fn print(w: &mut Write, idx: isize, addr: *mut libc::c_void, _symaddr: *mut libc::c_void) -> io::Result<()> { use intrinsics; #[repr(C)] @@ -248,7 +248,7 @@ fn print(w: &mut Write, idx: int, addr: *mut libc::c_void, } #[cfg(not(any(target_os = "macos", target_os = "ios")))] -fn print(w: &mut Write, idx: int, addr: *mut libc::c_void, +fn print(w: &mut Write, idx: isize, addr: *mut libc::c_void, symaddr: *mut libc::c_void) -> io::Result<()> { use env; use ffi::AsOsStr; @@ -441,7 +441,7 @@ fn print(w: &mut Write, idx: int, addr: *mut libc::c_void, } // Finally, after all that work above, we can emit a symbol. -fn output(w: &mut Write, idx: int, addr: *mut libc::c_void, +fn output(w: &mut Write, idx: isize, addr: *mut libc::c_void, s: Option<&[u8]>) -> io::Result<()> { try!(write!(w, " {:2}: {:2$?} - ", idx, addr, HEX_WIDTH)); match s.and_then(|s| str::from_utf8(s).ok()) { diff --git a/src/libstd/sys/unix/c.rs b/src/libstd/sys/unix/c.rs index 4e9f9c80a18..2514d4bf4a3 100644 --- a/src/libstd/sys/unix/c.rs +++ b/src/libstd/sys/unix/c.rs @@ -167,7 +167,7 @@ extern { #[cfg(any(target_os = "macos", target_os = "ios"))] mod select { - pub const FD_SETSIZE: uint = 1024; + pub const FD_SETSIZE: usize = 1024; #[repr(C)] pub struct fd_set { @@ -175,7 +175,7 @@ mod select { } pub fn fd_set(set: &mut fd_set, fd: i32) { - set.fds_bits[(fd / 32) as uint] |= 1 << ((fd % 32) as uint); + set.fds_bits[(fd / 32) as usize] |= 1 << ((fd % 32) as usize); } } @@ -198,7 +198,7 @@ mod select { } pub fn fd_set(set: &mut fd_set, fd: i32) { - let fd = fd as uint; + let fd = fd as usize; set.fds_bits[fd / usize::BITS as usize] |= 1 << (fd % usize::BITS as usize); } } diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs index 327ff3953aa..2569653811f 100644 --- a/src/libstd/sys/unix/fs.rs +++ b/src/libstd/sys/unix/fs.rs @@ -42,7 +42,7 @@ impl FileDesc { FileDesc { fd: fd, close_on_drop: close_on_drop } } - pub fn read(&self, buf: &mut [u8]) -> IoResult { + pub fn read(&self, buf: &mut [u8]) -> IoResult { let ret = retry(|| unsafe { libc::read(self.fd(), buf.as_mut_ptr() as *mut libc::c_void, @@ -53,7 +53,7 @@ impl FileDesc { } else if ret < 0 { Err(super::last_error()) } else { - Ok(ret as uint) + Ok(ret as usize) } } pub fn write(&self, buf: &[u8]) -> IoResult<()> { @@ -181,7 +181,7 @@ pub fn open(path: &Path, fm: FileMode, fa: FileAccess) -> IoResult { } } -pub fn mkdir(p: &Path, mode: uint) -> IoResult<()> { +pub fn mkdir(p: &Path, mode: usize) -> IoResult<()> { let p = try!(cstr(p)); mkerr_libc(unsafe { libc::mkdir(p.as_ptr(), mode as libc::mode_t) }) } @@ -204,13 +204,13 @@ pub fn readdir(p: &Path) -> IoResult> { } let size = unsafe { rust_dirent_t_size() }; - let mut buf = Vec::::with_capacity(size as uint); + let mut buf = Vec::::with_capacity(size as usize); let ptr = buf.as_mut_ptr() as *mut dirent_t; let p = try!(CString::new(p.as_vec())); let dir_ptr = unsafe {opendir(p.as_ptr())}; - if dir_ptr as uint != 0 { + if dir_ptr as usize != 0 { let mut paths = vec!(); let mut entry_ptr = ptr::null_mut(); while unsafe { readdir_r(dir_ptr, ptr, &mut entry_ptr) == 0 } { @@ -239,7 +239,7 @@ pub fn rename(old: &Path, new: &Path) -> IoResult<()> { }) } -pub fn chmod(p: &Path, mode: uint) -> IoResult<()> { +pub fn chmod(p: &Path, mode: usize) -> IoResult<()> { let p = try!(cstr(p)); mkerr_libc(retry(|| unsafe { libc::chmod(p.as_ptr(), mode as libc::mode_t) @@ -251,7 +251,7 @@ pub fn rmdir(p: &Path) -> IoResult<()> { mkerr_libc(unsafe { libc::rmdir(p.as_ptr()) }) } -pub fn chown(p: &Path, uid: int, gid: int) -> IoResult<()> { +pub fn chown(p: &Path, uid: isize, gid: isize) -> IoResult<()> { let p = try!(cstr(p)); mkerr_libc(retry(|| unsafe { libc::chown(p.as_ptr(), uid as libc::uid_t, gid as libc::gid_t) @@ -265,7 +265,7 @@ pub fn readlink(p: &Path) -> IoResult { if len == -1 { len = 1024; // FIXME: read PATH_MAX from C ffi? } - let mut buf: Vec = Vec::with_capacity(len as uint); + let mut buf: Vec = Vec::with_capacity(len as usize); match unsafe { libc::readlink(p, buf.as_ptr() as *mut libc::c_char, len as libc::size_t) as libc::c_int @@ -273,7 +273,7 @@ pub fn readlink(p: &Path) -> IoResult { -1 => Err(super::last_error()), n => { assert!(n > 0); - unsafe { buf.set_len(n as uint); } + unsafe { buf.set_len(n as usize); } Ok(Path::new(buf)) } } diff --git a/src/libstd/sys/unix/os.rs b/src/libstd/sys/unix/os.rs index c73d30d543a..724156d81d8 100644 --- a/src/libstd/sys/unix/os.rs +++ b/src/libstd/sys/unix/os.rs @@ -199,13 +199,13 @@ pub fn current_exe() -> io::Result { 0 as libc::size_t); if err != 0 { return Err(io::Error::last_os_error()); } if sz == 0 { return Err(io::Error::last_os_error()); } - let mut v: Vec = Vec::with_capacity(sz as uint); + let mut v: Vec = Vec::with_capacity(sz as usize); let err = sysctl(mib.as_mut_ptr(), mib.len() as ::libc::c_uint, v.as_mut_ptr() as *mut libc::c_void, &mut sz, ptr::null_mut(), 0 as libc::size_t); if err != 0 { return Err(io::Error::last_os_error()); } if sz == 0 { return Err(io::Error::last_os_error()); } - v.set_len(sz as uint - 1); // chop off trailing NUL + v.set_len(sz as usize - 1); // chop off trailing NUL Ok(PathBuf::from(OsString::from_vec(v))) } } @@ -249,10 +249,10 @@ pub fn current_exe() -> io::Result { let mut sz: u32 = 0; _NSGetExecutablePath(ptr::null_mut(), &mut sz); if sz == 0 { return Err(io::Error::last_os_error()); } - let mut v: Vec = Vec::with_capacity(sz as uint); + let mut v: Vec = Vec::with_capacity(sz as usize); let err = _NSGetExecutablePath(v.as_mut_ptr() as *mut i8, &mut sz); if err != 0 { return Err(io::Error::last_os_error()); } - v.set_len(sz as uint - 1); // chop off trailing NUL + v.set_len(sz as usize - 1); // chop off trailing NUL Ok(PathBuf::from(OsString::from_vec(v))) } } diff --git a/src/libstd/sys/unix/pipe.rs b/src/libstd/sys/unix/pipe.rs index daa981720f6..f0071295bf2 100644 --- a/src/libstd/sys/unix/pipe.rs +++ b/src/libstd/sys/unix/pipe.rs @@ -151,7 +151,7 @@ impl UnixStream { ret } - pub fn read(&mut self, buf: &mut [u8]) -> IoResult { + pub fn read(&mut self, buf: &mut [u8]) -> IoResult { let fd = self.fd(); let dolock = || self.lock_nonblocking(); let doread = |nb| unsafe { @@ -167,7 +167,7 @@ impl UnixStream { pub fn write(&mut self, buf: &[u8]) -> IoResult<()> { let fd = self.fd(); let dolock = || self.lock_nonblocking(); - let dowrite = |nb: bool, buf: *const u8, len: uint| unsafe { + let dowrite = |nb: bool, buf: *const u8, len: usize| unsafe { let flags = if nb {c::MSG_DONTWAIT} else {0}; libc::send(fd, buf as *const _, diff --git a/src/libstd/sys/unix/process.rs b/src/libstd/sys/unix/process.rs index df0e8de3ff1..0d35ace185d 100644 --- a/src/libstd/sys/unix/process.rs +++ b/src/libstd/sys/unix/process.rs @@ -49,11 +49,11 @@ impl Process { self.pid } - pub unsafe fn kill(&self, signal: int) -> IoResult<()> { + pub unsafe fn kill(&self, signal: isize) -> IoResult<()> { Process::killpid(self.pid, signal) } - pub unsafe fn killpid(pid: pid_t, signal: int) -> IoResult<()> { + pub unsafe fn killpid(pid: pid_t, signal: isize) -> IoResult<()> { let r = libc::funcs::posix88::signal::kill(pid, signal as c_int); mkerr_libc(r) } @@ -454,7 +454,7 @@ impl Process { // with process timeouts, but libgreen should get there first // (currently libuv doesn't handle old signal handlers). if drain(read_fd) { - let i: uint = unsafe { mem::transmute(old.sa_handler) }; + let i: usize = unsafe { mem::transmute(old.sa_handler) }; if i != 0 { assert!(old.sa_flags & c::SA_SIGINFO == 0); (old.sa_handler)(c::SIGCHLD); @@ -618,8 +618,8 @@ fn translate_status(status: c_int) -> ProcessExit { } if imp::WIFEXITED(status) { - ExitStatus(imp::WEXITSTATUS(status) as int) + ExitStatus(imp::WEXITSTATUS(status) as isize) } else { - ExitSignal(imp::WTERMSIG(status) as int) + ExitSignal(imp::WTERMSIG(status) as isize) } } diff --git a/src/libstd/sys/unix/stack_overflow.rs b/src/libstd/sys/unix/stack_overflow.rs index 35706682047..6887095c53a 100644 --- a/src/libstd/sys/unix/stack_overflow.rs +++ b/src/libstd/sys/unix/stack_overflow.rs @@ -60,7 +60,7 @@ mod imp { // This is initialized in init() and only read from after - static mut PAGE_SIZE: uint = 0; + static mut PAGE_SIZE: usize = 0; #[no_stack_check] unsafe extern fn signal_handler(signum: libc::c_int, @@ -82,7 +82,7 @@ mod imp { stack::record_sp_limit(0); let guard = thread_info::stack_guard(); - let addr = (*info).si_addr as uint; + let addr = (*info).si_addr as usize; if guard == 0 || addr < guard - PAGE_SIZE || addr >= guard { term(signum); @@ -101,7 +101,7 @@ mod imp { panic!("failed to get page size"); } - PAGE_SIZE = psize as uint; + PAGE_SIZE = psize as usize; let mut action: sigaction = mem::zeroed(); action.sa_flags = SA_SIGINFO | SA_ONSTACK; diff --git a/src/libstd/sys/unix/sync.rs b/src/libstd/sys/unix/sync.rs index c7d704922cb..3c05fd602be 100644 --- a/src/libstd/sys/unix/sync.rs +++ b/src/libstd/sys/unix/sync.rs @@ -66,24 +66,24 @@ mod os { #[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))] - const __PTHREAD_MUTEX_SIZE__: uint = 56; + const __PTHREAD_MUTEX_SIZE__: usize = 56; #[cfg(any(target_arch = "x86", target_arch = "arm"))] - const __PTHREAD_MUTEX_SIZE__: uint = 40; + const __PTHREAD_MUTEX_SIZE__: usize = 40; #[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))] - const __PTHREAD_COND_SIZE__: uint = 40; + const __PTHREAD_COND_SIZE__: usize = 40; #[cfg(any(target_arch = "x86", target_arch = "arm"))] - const __PTHREAD_COND_SIZE__: uint = 24; + const __PTHREAD_COND_SIZE__: usize = 24; #[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))] - const __PTHREAD_RWLOCK_SIZE__: uint = 192; + const __PTHREAD_RWLOCK_SIZE__: usize = 192; #[cfg(any(target_arch = "x86", target_arch = "arm"))] - const __PTHREAD_RWLOCK_SIZE__: uint = 124; + const __PTHREAD_RWLOCK_SIZE__: usize = 124; const _PTHREAD_MUTEX_SIG_INIT: libc::c_long = 0x32AAABA7; const _PTHREAD_COND_SIG_INIT: libc::c_long = 0x3CB0B1BB; @@ -125,15 +125,15 @@ mod os { // minus 8 because we have an 'align' field #[cfg(target_arch = "x86_64")] - const __SIZEOF_PTHREAD_MUTEX_T: uint = 40 - 8; + const __SIZEOF_PTHREAD_MUTEX_T: usize = 40 - 8; #[cfg(any(target_arch = "x86", target_arch = "arm", target_arch = "mips", target_arch = "mipsel", target_arch = "powerpc"))] - const __SIZEOF_PTHREAD_MUTEX_T: uint = 24 - 8; + const __SIZEOF_PTHREAD_MUTEX_T: usize = 24 - 8; #[cfg(target_arch = "aarch64")] - const __SIZEOF_PTHREAD_MUTEX_T: uint = 48 - 8; + const __SIZEOF_PTHREAD_MUTEX_T: usize = 48 - 8; #[cfg(any(target_arch = "x86_64", target_arch = "x86", @@ -142,18 +142,18 @@ mod os { target_arch = "mips", target_arch = "mipsel", target_arch = "powerpc"))] - const __SIZEOF_PTHREAD_COND_T: uint = 48 - 8; + const __SIZEOF_PTHREAD_COND_T: usize = 48 - 8; #[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))] - const __SIZEOF_PTHREAD_RWLOCK_T: uint = 56 - 8; + const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56 - 8; #[cfg(any(target_arch = "x86", target_arch = "arm", target_arch = "mips", target_arch = "mipsel", target_arch = "powerpc"))] - const __SIZEOF_PTHREAD_RWLOCK_T: uint = 32 - 8; + const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32 - 8; #[repr(C)] pub struct pthread_mutex_t { diff --git a/src/libstd/sys/unix/tcp.rs b/src/libstd/sys/unix/tcp.rs index 2a6994824c7..a9f2198208b 100644 --- a/src/libstd/sys/unix/tcp.rs +++ b/src/libstd/sys/unix/tcp.rs @@ -64,7 +64,7 @@ impl TcpListener { pub fn fd(&self) -> sock_t { self.inner.fd() } - pub fn listen(self, backlog: int) -> IoResult { + pub fn listen(self, backlog: isize) -> IoResult { match unsafe { libc::listen(self.fd(), backlog as libc::c_int) } { -1 => Err(last_net_error()), _ => { diff --git a/src/libstd/sys/unix/timer.rs b/src/libstd/sys/unix/timer.rs index b6d2aca9a52..d9a162302fc 100644 --- a/src/libstd/sys/unix/timer.rs +++ b/src/libstd/sys/unix/timer.rs @@ -69,7 +69,7 @@ pub trait Callback { } pub struct Timer { - id: uint, + id: usize, inner: Option>, } @@ -78,7 +78,7 @@ pub struct Inner { interval: u64, repeat: bool, target: u64, - id: uint, + id: usize, } pub enum Req { @@ -87,7 +87,7 @@ pub enum Req { // Remove a timer based on its id and then send it back on the channel // provided - RemoveTimer(uint, Sender>), + RemoveTimer(usize, Sender>), } // returns the current time (in milliseconds) @@ -121,7 +121,7 @@ fn helper(input: libc::c_int, messages: Receiver, _: ()) { // signals the first requests in the queue, possible re-enqueueing it. fn signal(active: &mut Vec>, - dead: &mut Vec<(uint, Box)>) { + dead: &mut Vec<(usize, Box)>) { if active.is_empty() { return } let mut timer = active.remove(0); @@ -216,7 +216,7 @@ fn helper(input: libc::c_int, messages: Receiver, _: ()) { impl Timer { pub fn new() -> IoResult { - // See notes above regarding using int return value + // See notes above regarding using isize return value // instead of () HELPER.boot(|| {}, helper); @@ -244,7 +244,7 @@ impl Timer { tv_nsec: ((ms % 1000) * 1000000) as libc::c_long, }; while unsafe { libc::nanosleep(&to_sleep, &mut to_sleep) } != 0 { - if os::errno() as int != libc::EINTR as int { + if os::errno() as isize != libc::EINTR as isize { panic!("failed to sleep, but not because of EINTR?"); } } diff --git a/src/libstd/sys/unix/tty.rs b/src/libstd/sys/unix/tty.rs index e4973a8f9f3..2f6fd713bfb 100644 --- a/src/libstd/sys/unix/tty.rs +++ b/src/libstd/sys/unix/tty.rs @@ -46,7 +46,7 @@ impl TTY { } } - pub fn read(&mut self, buf: &mut [u8]) -> IoResult { + pub fn read(&mut self, buf: &mut [u8]) -> IoResult { self.fd.read(buf) } pub fn write(&mut self, buf: &[u8]) -> IoResult<()> { @@ -56,7 +56,7 @@ impl TTY { Err(sys_common::unimpl()) } - pub fn get_winsize(&mut self) -> IoResult<(int, int)> { + pub fn get_winsize(&mut self) -> IoResult<(isize, isize)> { unsafe { #[repr(C)] struct winsize { @@ -74,7 +74,7 @@ impl TTY { detail: None, }) } else { - Ok((size.ws_col as int, size.ws_row as int)) + Ok((size.ws_col as isize, size.ws_row as isize)) } } } diff --git a/src/libstd/sys/windows/backtrace.rs b/src/libstd/sys/windows/backtrace.rs index ffa4b37b487..509205a20b1 100644 --- a/src/libstd/sys/windows/backtrace.rs +++ b/src/libstd/sys/windows/backtrace.rs @@ -63,7 +63,7 @@ type StackWalk64Fn = *mut libc::c_void, *mut libc::c_void, *mut libc::c_void, *mut libc::c_void) -> libc::BOOL; -const MAX_SYM_NAME: uint = 2000; +const MAX_SYM_NAME: usize = 2000; const IMAGE_FILE_MACHINE_I386: libc::DWORD = 0x014c; const IMAGE_FILE_MACHINE_IA64: libc::DWORD = 0x0200; const IMAGE_FILE_MACHINE_AMD64: libc::DWORD = 0x8664; @@ -138,7 +138,7 @@ struct KDHELP64 { mod arch { use libc; - const MAXIMUM_SUPPORTED_EXTENSION: uint = 512; + const MAXIMUM_SUPPORTED_EXTENSION: usize = 512; #[repr(C)] pub struct CONTEXT { diff --git a/src/libstd/sys/windows/fs.rs b/src/libstd/sys/windows/fs.rs index e7a01478908..3330130c770 100644 --- a/src/libstd/sys/windows/fs.rs +++ b/src/libstd/sys/windows/fs.rs @@ -42,7 +42,7 @@ impl FileDesc { FileDesc { fd: fd, close_on_drop: close_on_drop } } - pub fn read(&self, buf: &mut [u8]) -> IoResult { + pub fn read(&self, buf: &mut [u8]) -> IoResult { let mut read = 0; let ret = unsafe { libc::ReadFile(self.handle(), buf.as_ptr() as libc::LPVOID, @@ -50,7 +50,7 @@ impl FileDesc { ptr::null_mut()) }; if ret != 0 { - Ok(read as uint) + Ok(read as usize) } else { Err(super::last_error()) } @@ -67,8 +67,8 @@ impl FileDesc { ptr::null_mut()) }; if ret != 0 { - remaining -= amt as uint; - cur = unsafe { cur.offset(amt as int) }; + remaining -= amt as usize; + cur = unsafe { cur.offset(amt as isize) }; } else { return Err(super::last_error()) } @@ -234,7 +234,7 @@ pub fn open(path: &Path, fm: FileMode, fa: FileAccess) -> IoResult { } } -pub fn mkdir(p: &Path, _mode: uint) -> IoResult<()> { +pub fn mkdir(p: &Path, _mode: usize) -> IoResult<()> { let p = try!(to_utf16(p)); super::mkerr_winbool(unsafe { // FIXME: turn mode into something useful? #2623 @@ -308,11 +308,11 @@ pub fn unlink(p: &Path) -> IoResult<()> { }; if stat.perm.intersects(old_io::USER_WRITE) { return Err(e) } - match chmod(p, (stat.perm | old_io::USER_WRITE).bits() as uint) { + match chmod(p, (stat.perm | old_io::USER_WRITE).bits() as usize) { Ok(()) => do_unlink(&p_utf16), Err(..) => { // Try to put it back as we found it - let _ = chmod(p, stat.perm.bits() as uint); + let _ = chmod(p, stat.perm.bits() as usize); Err(e) } } @@ -331,7 +331,7 @@ pub fn rename(old: &Path, new: &Path) -> IoResult<()> { }) } -pub fn chmod(p: &Path, mode: uint) -> IoResult<()> { +pub fn chmod(p: &Path, mode: usize) -> IoResult<()> { let p = try!(to_utf16(p)); mkerr_libc(unsafe { libc::wchmod(p.as_ptr(), mode as libc::c_int) @@ -343,7 +343,7 @@ pub fn rmdir(p: &Path) -> IoResult<()> { super::mkerr_winbool(unsafe { libc::RemoveDirectoryW(p.as_ptr()) }) } -pub fn chown(_p: &Path, _uid: int, _gid: int) -> IoResult<()> { +pub fn chown(_p: &Path, _uid: isize, _gid: isize) -> IoResult<()> { // libuv has this as a no-op, so seems like this should as well? Ok(()) } diff --git a/src/libstd/sys/windows/pipe.rs b/src/libstd/sys/windows/pipe.rs index 17fdd6755c6..064c003bd15 100644 --- a/src/libstd/sys/windows/pipe.rs +++ b/src/libstd/sys/windows/pipe.rs @@ -115,7 +115,7 @@ impl Event { initial_state as libc::BOOL, ptr::null()) }; - if event as uint == 0 { + if event as usize == 0 { Err(super::last_error()) } else { Ok(Event(event)) @@ -181,7 +181,7 @@ unsafe fn pipe(name: *const u16, init: bool) -> libc::HANDLE { } pub fn await(handle: libc::HANDLE, deadline: u64, - events: &[libc::HANDLE]) -> IoResult { + events: &[libc::HANDLE]) -> IoResult { use libc::consts::os::extra::{WAIT_FAILED, WAIT_TIMEOUT, WAIT_OBJECT_0}; // If we've got a timeout, use WaitForSingleObject in tandem with CancelIo @@ -204,7 +204,7 @@ pub fn await(handle: libc::HANDLE, deadline: u64, let _ = c::CancelIo(handle); Err(sys_common::timeout("operation timed out")) }, - n => Ok((n - WAIT_OBJECT_0) as uint) + n => Ok((n - WAIT_OBJECT_0) as usize) } } @@ -314,7 +314,7 @@ impl UnixStream { // `WaitNamedPipe` function, and this is indicated with an error // code of ERROR_PIPE_BUSY. let code = unsafe { libc::GetLastError() }; - if code as int != libc::ERROR_PIPE_BUSY as int { + if code as isize != libc::ERROR_PIPE_BUSY as isize { return Err(super::last_error()) } @@ -362,7 +362,7 @@ impl UnixStream { } } - pub fn read(&mut self, buf: &mut [u8]) -> IoResult { + pub fn read(&mut self, buf: &mut [u8]) -> IoResult { if self.read.is_none() { self.read = Some(try!(Event::new(true, false))); } @@ -390,7 +390,7 @@ impl UnixStream { &mut bytes_read, &mut overlapped) }; - if ret != 0 { return Ok(bytes_read as uint) } + if ret != 0 { return Ok(bytes_read as usize) } // If our errno doesn't say that the I/O is pending, then we hit some // legitimate error and return immediately. @@ -418,7 +418,7 @@ impl UnixStream { }; // If we succeeded, or we failed for some reason other than // CancelIoEx, return immediately - if ret != 0 { return Ok(bytes_read as uint) } + if ret != 0 { return Ok(bytes_read as usize) } if os::errno() != libc::ERROR_OPERATION_ABORTED as i32 { return Err(super::last_error()) } @@ -487,7 +487,7 @@ impl UnixStream { return Err(super::last_error()) } if !wait_succeeded.is_ok() { - let amt = offset + bytes_written as uint; + let amt = offset + bytes_written as usize; return if amt > 0 { Err(IoError { kind: old_io::ShortWrite(amt), @@ -504,7 +504,7 @@ impl UnixStream { continue // retry } } - offset += bytes_written as uint; + offset += bytes_written as usize; } Ok(()) } diff --git a/src/libstd/sys/windows/process.rs b/src/libstd/sys/windows/process.rs index e08a6e6b3cd..297f6e173ab 100644 --- a/src/libstd/sys/windows/process.rs +++ b/src/libstd/sys/windows/process.rs @@ -63,11 +63,11 @@ impl Process { self.pid } - pub unsafe fn kill(&self, signal: int) -> IoResult<()> { + pub unsafe fn kill(&self, signal: isize) -> IoResult<()> { Process::killpid(self.pid, signal) } - pub unsafe fn killpid(pid: pid_t, signal: int) -> IoResult<()> { + pub unsafe fn killpid(pid: pid_t, signal: isize) -> IoResult<()> { let handle = libc::OpenProcess(libc::PROCESS_TERMINATE | libc::PROCESS_QUERY_INFORMATION, libc::FALSE, pid as libc::DWORD); @@ -309,7 +309,7 @@ impl Process { } if status != STILL_ACTIVE { assert!(CloseHandle(process) != 0); - return Ok(ExitStatus(status as int)); + return Ok(ExitStatus(status as isize)); } let interval = if deadline == 0 { INFINITE @@ -394,7 +394,7 @@ fn make_command_line(prog: &CString, args: &[CString]) -> String { } } - fn append_char_at(cmd: &mut String, arg: &[char], i: uint) { + fn append_char_at(cmd: &mut String, arg: &[char], i: usize) { match arg[i] { '"' => { // Escape quotes. @@ -415,7 +415,7 @@ fn make_command_line(prog: &CString, args: &[CString]) -> String { } } - fn backslash_run_ends_in_quote(s: &[char], mut i: uint) -> bool { + fn backslash_run_ends_in_quote(s: &[char], mut i: usize) -> bool { while i < s.len() && s[i] == '\\' { i += 1; } diff --git a/src/libstd/sys/windows/stack_overflow.rs b/src/libstd/sys/windows/stack_overflow.rs index b0410701ee1..79b7de4f341 100644 --- a/src/libstd/sys/windows/stack_overflow.rs +++ b/src/libstd/sys/windows/stack_overflow.rs @@ -31,7 +31,7 @@ impl Drop for Handler { } // This is initialized in init() and only read from after -static mut PAGE_SIZE: uint = 0; +static mut PAGE_SIZE: usize = 0; #[no_stack_check] extern "system" fn vectored_handler(ExceptionInfo: *mut EXCEPTION_POINTERS) -> LONG { @@ -56,7 +56,7 @@ extern "system" fn vectored_handler(ExceptionInfo: *mut EXCEPTION_POINTERS) -> L pub unsafe fn init() { let mut info = mem::zeroed(); libc::GetSystemInfo(&mut info); - PAGE_SIZE = info.dwPageSize as uint; + PAGE_SIZE = info.dwPageSize as usize; if AddVectoredExceptionHandler(0, vectored_handler) == ptr::null_mut() { panic!("failed to install exception handler"); @@ -96,7 +96,7 @@ pub type PVECTORED_EXCEPTION_HANDLER = extern "system" pub type ULONG = libc::c_ulong; const EXCEPTION_CONTINUE_SEARCH: LONG = 0; -const EXCEPTION_MAXIMUM_PARAMETERS: uint = 15; +const EXCEPTION_MAXIMUM_PARAMETERS: usize = 15; const EXCEPTION_STACK_OVERFLOW: DWORD = 0xc00000fd; extern "system" { diff --git a/src/libstd/sys/windows/tcp.rs b/src/libstd/sys/windows/tcp.rs index 6e46bf97d1b..2ac8ac10aa9 100644 --- a/src/libstd/sys/windows/tcp.rs +++ b/src/libstd/sys/windows/tcp.rs @@ -77,7 +77,7 @@ impl TcpListener { pub fn socket(&self) -> sock_t { self.sock } - pub fn listen(self, backlog: int) -> IoResult { + pub fn listen(self, backlog: isize) -> IoResult { match unsafe { libc::listen(self.socket(), backlog as libc::c_int) } { -1 => Err(last_net_error()), diff --git a/src/libstd/sys/windows/thread.rs b/src/libstd/sys/windows/thread.rs index d1d4ad90081..98e4a737c7b 100644 --- a/src/libstd/sys/windows/thread.rs +++ b/src/libstd/sys/windows/thread.rs @@ -25,8 +25,8 @@ use time::Duration; pub type rust_thread = HANDLE; pub mod guard { - pub unsafe fn main() -> uint { 0 } - pub unsafe fn current() -> uint { 0 } + pub unsafe fn main() -> usize { 0 } + pub unsafe fn current() -> usize { 0 } pub unsafe fn init() {} } diff --git a/src/libstd/sys/windows/thread_local.rs b/src/libstd/sys/windows/thread_local.rs index c908c791247..cbabab8acb7 100644 --- a/src/libstd/sys/windows/thread_local.rs +++ b/src/libstd/sys/windows/thread_local.rs @@ -139,7 +139,7 @@ unsafe fn init_dtors() { let dtors = DTORS; DTORS = 1 as *mut _; Box::from_raw(dtors); - assert!(DTORS as uint == 1); // can't re-init after destructing + assert!(DTORS as usize == 1); // can't re-init after destructing DTOR_LOCK.unlock(); }); if res.is_ok() { @@ -152,8 +152,8 @@ unsafe fn init_dtors() { unsafe fn register_dtor(key: Key, dtor: Dtor) { DTOR_LOCK.lock(); init_dtors(); - assert!(DTORS as uint != 0); - assert!(DTORS as uint != 1, + assert!(DTORS as usize != 0); + assert!(DTORS as usize != 1, "cannot create new TLS keys after the main thread has exited"); (*DTORS).push((key, dtor)); DTOR_LOCK.unlock(); @@ -162,8 +162,8 @@ unsafe fn register_dtor(key: Key, dtor: Dtor) { unsafe fn unregister_dtor(key: Key) -> bool { DTOR_LOCK.lock(); init_dtors(); - assert!(DTORS as uint != 0); - assert!(DTORS as uint != 1, + assert!(DTORS as usize != 0); + assert!(DTORS as usize != 1, "cannot unregister destructors after the main thread has exited"); let ret = { let dtors = &mut *DTORS; diff --git a/src/libstd/sys/windows/timer.rs b/src/libstd/sys/windows/timer.rs index 9bcae926eea..8856cc26b2e 100644 --- a/src/libstd/sys/windows/timer.rs +++ b/src/libstd/sys/windows/timer.rs @@ -91,13 +91,13 @@ fn helper(input: libc::HANDLE, messages: Receiver, _: ()) { } } else { let remove = { - match &mut chans[idx as uint - 1] { + match &mut chans[idx as usize - 1] { &mut (ref mut c, oneshot) => { c.call(); oneshot } } }; if remove { - drop(objs.remove(idx as uint)); - drop(chans.remove(idx as uint - 1)); + drop(objs.remove(idx as usize)); + drop(chans.remove(idx as usize - 1)); } } } diff --git a/src/libstd/sys/windows/tty.rs b/src/libstd/sys/windows/tty.rs index 52f4cce4aa3..38faabf3276 100644 --- a/src/libstd/sys/windows/tty.rs +++ b/src/libstd/sys/windows/tty.rs @@ -92,7 +92,7 @@ impl TTY { } } - pub fn read(&mut self, buf: &mut [u8]) -> IoResult { + pub fn read(&mut self, buf: &mut [u8]) -> IoResult { // Read more if the buffer is empty if self.utf8.eof() { let mut utf16: Vec = repeat(0u16).take(0x1000).collect(); @@ -105,7 +105,7 @@ impl TTY { 0 => return Err(super::last_error()), _ => (), }; - utf16.truncate(num as uint); + utf16.truncate(num as usize); let utf8 = match String::from_utf16(&utf16) { Ok(utf8) => utf8.into_bytes(), Err(..) => return Err(invalid_encoding()), @@ -149,12 +149,12 @@ impl TTY { } } - pub fn get_winsize(&mut self) -> IoResult<(int, int)> { + pub fn get_winsize(&mut self) -> IoResult<(isize, isize)> { let mut info: CONSOLE_SCREEN_BUFFER_INFO = unsafe { mem::zeroed() }; match unsafe { GetConsoleScreenBufferInfo(self.handle, &mut info as *mut _) } { 0 => Err(super::last_error()), - _ => Ok(((info.srWindow.Right + 1 - info.srWindow.Left) as int, - (info.srWindow.Bottom + 1 - info.srWindow.Top) as int)), + _ => Ok(((info.srWindow.Right + 1 - info.srWindow.Left) as isize, + (info.srWindow.Bottom + 1 - info.srWindow.Top) as isize)), } } } diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs index f734d0c6132..236b16920a8 100644 --- a/src/libsyntax/ext/quote.rs +++ b/src/libsyntax/ext/quote.rs @@ -328,12 +328,12 @@ pub mod rt { impl_to_tokens! { () } impl_to_tokens! { char } impl_to_tokens! { bool } - impl_to_tokens! { int } + impl_to_tokens! { isize } impl_to_tokens! { i8 } impl_to_tokens! { i16 } impl_to_tokens! { i32 } impl_to_tokens! { i64 } - impl_to_tokens! { uint } + impl_to_tokens! { usize } impl_to_tokens! { u8 } impl_to_tokens! { u16 } impl_to_tokens! { u32 } diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 9af7b9ab633..a0bff7404c7 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -29,7 +29,6 @@ #![feature(box_syntax)] #![feature(collections)] #![feature(core)] -#![feature(int_uint)] #![feature(libc)] #![feature(old_path)] #![feature(quote, unsafe_destructor)] diff --git a/src/libterm/lib.rs b/src/libterm/lib.rs index 41e066cc94a..ed2d00d6ad7 100644 --- a/src/libterm/lib.rs +++ b/src/libterm/lib.rs @@ -57,7 +57,6 @@ #![feature(box_syntax)] #![feature(collections)] -#![feature(int_uint)] #![feature(rustc_private)] #![feature(staged_api)] #![feature(std_misc)] diff --git a/src/libterm/terminfo/mod.rs b/src/libterm/terminfo/mod.rs index 1d6657d5932..4840cd1fdda 100644 --- a/src/libterm/terminfo/mod.rs +++ b/src/libterm/terminfo/mod.rs @@ -82,7 +82,7 @@ impl Terminal for TerminfoTerminal { .get("setaf") .unwrap() , - &[Number(color as int)], &mut Variables::new()); + &[Number(color as isize)], &mut Variables::new()); if s.is_ok() { try!(self.out.write_all(&s.unwrap())); return Ok(true) @@ -99,7 +99,7 @@ impl Terminal for TerminfoTerminal { .get("setab") .unwrap() , - &[Number(color as int)], &mut Variables::new()); + &[Number(color as isize)], &mut Variables::new()); if s.is_ok() { try!(self.out.write_all(&s.unwrap())); return Ok(true) diff --git a/src/libterm/terminfo/parm.rs b/src/libterm/terminfo/parm.rs index 30b732781db..d6a4659c45a 100644 --- a/src/libterm/terminfo/parm.rs +++ b/src/libterm/terminfo/parm.rs @@ -27,12 +27,12 @@ enum States { PushParam, CharConstant, CharClose, - IntConstant(int), + IntConstant(isize), FormatPattern(Flags, FormatState), - SeekIfElse(int), - SeekIfElsePercent(int), - SeekIfEnd(int), - SeekIfEndPercent(int) + SeekIfElse(isize), + SeekIfElsePercent(isize), + SeekIfEnd(isize), + SeekIfEndPercent(isize) } #[derive(Copy, PartialEq)] @@ -47,7 +47,7 @@ enum FormatState { #[derive(Clone)] pub enum Param { Words(String), - Number(int) + Number(isize) } /// Container for static and dynamic variable arrays @@ -143,7 +143,7 @@ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables) '{' => state = IntConstant(0), 'l' => if stack.len() > 0 { match stack.pop().unwrap() { - Words(s) => stack.push(Number(s.len() as int)), + Words(s) => stack.push(Number(s.len() as isize)), _ => return Err("a non-str was used with %l".to_string()) } } else { return Err("stack is empty".to_string()) }, @@ -268,7 +268,7 @@ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables) ' ' => flags.space = true, '.' => fstate = FormatStatePrecision, '0'...'9' => { - flags.width = cur as uint - '0' as uint; + flags.width = cur as usize - '0' as usize; fstate = FormatStateWidth; } _ => unreachable!() @@ -305,12 +305,12 @@ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables) if cur >= 'A' && cur <= 'Z' { if stack.len() > 0 { let idx = (cur as u8) - b'A'; - vars.sta[idx as uint] = stack.pop().unwrap(); + vars.sta[idx as usize] = stack.pop().unwrap(); } else { return Err("stack is empty".to_string()) } } else if cur >= 'a' && cur <= 'z' { if stack.len() > 0 { let idx = (cur as u8) - b'a'; - vars.dyn[idx as uint] = stack.pop().unwrap(); + vars.dyn[idx as usize] = stack.pop().unwrap(); } else { return Err("stack is empty".to_string()) } } else { return Err("bad variable name in %P".to_string()); @@ -319,16 +319,16 @@ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables) GetVar => { if cur >= 'A' && cur <= 'Z' { let idx = (cur as u8) - b'A'; - stack.push(vars.sta[idx as uint].clone()); + stack.push(vars.sta[idx as usize].clone()); } else if cur >= 'a' && cur <= 'z' { let idx = (cur as u8) - b'a'; - stack.push(vars.dyn[idx as uint].clone()); + stack.push(vars.dyn[idx as usize].clone()); } else { return Err("bad variable name in %g".to_string()); } }, CharConstant => { - stack.push(Number(c as int)); + stack.push(Number(c as isize)); state = CharClose; }, CharClose => { @@ -343,10 +343,10 @@ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables) state = Nothing; } '0'...'9' => { - state = IntConstant(i*10 + (cur as int - '0' as int)); + state = IntConstant(i*10 + (cur as isize - '0' as isize)); old_state = Nothing; } - _ => return Err("bad int constant".to_string()) + _ => return Err("bad isize constant".to_string()) } } FormatPattern(ref mut flags, ref mut fstate) => { @@ -372,7 +372,7 @@ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables) flags.space = true; } (FormatStateFlags,'0'...'9') => { - flags.width = cur as uint - '0' as uint; + flags.width = cur as usize - '0' as usize; *fstate = FormatStateWidth; } (FormatStateFlags,'.') => { @@ -380,7 +380,7 @@ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables) } (FormatStateWidth,'0'...'9') => { let old = flags.width; - flags.width = flags.width * 10 + (cur as uint - '0' as uint); + flags.width = flags.width * 10 + (cur as usize - '0' as usize); if flags.width < old { return Err("format width overflow".to_string()) } } (FormatStateWidth,'.') => { @@ -388,7 +388,7 @@ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables) } (FormatStatePrecision,'0'...'9') => { let old = flags.precision; - flags.precision = flags.precision * 10 + (cur as uint - '0' as uint); + flags.precision = flags.precision * 10 + (cur as usize - '0' as usize); if flags.precision < old { return Err("format precision overflow".to_string()) } @@ -446,8 +446,8 @@ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables) #[derive(Copy, PartialEq)] struct Flags { - width: uint, - precision: uint, + width: usize, + precision: usize, alternate: bool, left: bool, sign: bool, diff --git a/src/libterm/terminfo/parser/compiled.rs b/src/libterm/terminfo/parser/compiled.rs index 8d0a9e6e971..01d191f3014 100644 --- a/src/libterm/terminfo/parser/compiled.rs +++ b/src/libterm/terminfo/parser/compiled.rs @@ -189,31 +189,31 @@ pub fn parse(file: &mut Read, longnames: bool) 0x011A_usize, magic as usize)); } - let names_bytes = try!(read_le_u16(file)) as int; - let bools_bytes = try!(read_le_u16(file)) as int; - let numbers_count = try!(read_le_u16(file)) as int; - let string_offsets_count = try!(read_le_u16(file)) as int; - let string_table_bytes = try!(read_le_u16(file)) as int; + let names_bytes = try!(read_le_u16(file)) as isize; + let bools_bytes = try!(read_le_u16(file)) as isize; + let numbers_count = try!(read_le_u16(file)) as isize; + let string_offsets_count = try!(read_le_u16(file)) as isize; + let string_table_bytes = try!(read_le_u16(file)) as isize; assert!(names_bytes > 0); - if (bools_bytes as uint) > boolnames.len() { + if (bools_bytes as usize) > boolnames.len() { return Err("incompatible file: more booleans than \ expected".to_string()); } - if (numbers_count as uint) > numnames.len() { + if (numbers_count as usize) > numnames.len() { return Err("incompatible file: more numbers than \ expected".to_string()); } - if (string_offsets_count as uint) > stringnames.len() { + if (string_offsets_count as usize) > stringnames.len() { return Err("incompatible file: more string offsets than \ expected".to_string()); } // don't read NUL - let bytes = try!(read_exact(file, names_bytes as uint - 1)); + let bytes = try!(read_exact(file, names_bytes as usize - 1)); let names_str = match String::from_utf8(bytes) { Ok(s) => s, Err(_) => return Err("input not utf-8".to_string()), @@ -230,7 +230,7 @@ pub fn parse(file: &mut Read, longnames: bool) for i in 0..bools_bytes { let b = try!(read_byte(file)); if b == 1 { - bools_map.insert(bnames[i as uint].to_string(), true); + bools_map.insert(bnames[i as usize].to_string(), true); } } } @@ -244,7 +244,7 @@ pub fn parse(file: &mut Read, longnames: bool) for i in 0..numbers_count { let n = try!(read_le_u16(file)); if n != 0xFFFF { - numbers_map.insert(nnames[i as uint].to_string(), n); + numbers_map.insert(nnames[i as usize].to_string(), n); } } } @@ -259,7 +259,7 @@ pub fn parse(file: &mut Read, longnames: bool) let string_table = try!(read_exact(file, string_table_bytes as usize)); - if string_table.len() != string_table_bytes as uint { + if string_table.len() != string_table_bytes as usize { return Err("error: hit EOF before end of string \ table".to_string()); } @@ -285,13 +285,13 @@ pub fn parse(file: &mut Read, longnames: bool) // Find the offset of the NUL we want to go to - let nulpos = string_table[offset as uint .. string_table_bytes as uint] + let nulpos = string_table[offset as usize .. string_table_bytes as usize] .iter().position(|&b| b == 0); match nulpos { Some(len) => { string_map.insert(name.to_string(), - string_table[offset as uint .. - (offset as uint + len)].to_vec()) + string_table[offset as usize .. + (offset as usize + len)].to_vec()) }, None => { return Err("invalid file: missing NUL in \ diff --git a/src/libterm/terminfo/searcher.rs b/src/libterm/terminfo/searcher.rs index 66ee2b1ba87..3083f8e8929 100644 --- a/src/libterm/terminfo/searcher.rs +++ b/src/libterm/terminfo/searcher.rs @@ -67,7 +67,7 @@ pub fn get_dbpath_for_term(term: &str) -> Option> { return Some(box newp); } // on some installations the dir is named after the hex of the char (e.g. OS X) - let f = format!("{:x}", first_char as uint); + let f = format!("{:x}", first_char as usize); let newp = p.join(&f).join(term); if newp.exists() { return Some(box newp); diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index c48c7e413d0..91c0db08aba 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -38,7 +38,6 @@ #![feature(box_syntax)] #![feature(collections)] #![feature(core)] -#![feature(int_uint)] #![feature(rustc_private)] #![feature(staged_api)] #![feature(std_misc)] @@ -129,7 +128,7 @@ enum NamePadding { } impl TestDesc { - fn padded_name(&self, column_count: uint, align: NamePadding) -> String { + fn padded_name(&self, column_count: usize, align: NamePadding) -> String { let mut name = String::from_str(self.name.as_slice()); let fill = column_count.saturating_sub(name.len()); let mut pad = repeat(" ").take(fill).collect::(); @@ -421,7 +420,7 @@ pub fn parse_opts(args: &[String]) -> Option { #[derive(Clone, PartialEq)] pub struct BenchSamples { ns_iter_summ: stats::Summary, - mb_s: uint, + mb_s: usize, } #[derive(Clone, PartialEq)] @@ -444,14 +443,14 @@ struct ConsoleTestState { log_out: Option, out: OutputLocation, use_color: bool, - total: uint, - passed: uint, - failed: uint, - ignored: uint, - measured: uint, + total: usize, + passed: usize, + failed: usize, + ignored: usize, + measured: usize, metrics: MetricMap, failures: Vec<(TestDesc, Vec )> , - max_name_len: uint, // number of columns to fill when aligning names + max_name_len: usize, // number of columns to fill when aligning names } impl ConsoleTestState { @@ -535,7 +534,7 @@ impl ConsoleTestState { } } - pub fn write_run_start(&mut self, len: uint) -> io::Result<()> { + pub fn write_run_start(&mut self, len: usize) -> io::Result<()> { self.total = len; let noun = if len != 1 { "tests" } else { "test" }; self.write_plain(&format!("\nrunning {} {}\n", len, noun)) @@ -635,13 +634,13 @@ impl ConsoleTestState { pub fn fmt_bench_samples(bs: &BenchSamples) -> String { if bs.mb_s != 0 { format!("{:>9} ns/iter (+/- {}) = {} MB/s", - bs.ns_iter_summ.median as uint, - (bs.ns_iter_summ.max - bs.ns_iter_summ.min) as uint, + bs.ns_iter_summ.median as usize, + (bs.ns_iter_summ.max - bs.ns_iter_summ.min) as usize, bs.mb_s) } else { format!("{:>9} ns/iter (+/- {})", - bs.ns_iter_summ.median as uint, - (bs.ns_iter_summ.max - bs.ns_iter_summ.min) as uint) + bs.ns_iter_summ.median as usize, + (bs.ns_iter_summ.max - bs.ns_iter_summ.min) as usize) } } @@ -689,7 +688,7 @@ pub fn run_tests_console(opts: &TestOpts, tests: Vec ) -> io::Res } let mut st = try!(ConsoleTestState::new(opts, None::)); - fn len_if_padded(t: &TestDescAndFn) -> uint { + fn len_if_padded(t: &TestDescAndFn) -> usize { match t.testfn.padding() { PadNone => 0, PadOnLeft | PadOnRight => t.desc.name.as_slice().len(), @@ -845,10 +844,10 @@ fn run_tests(opts: &TestOpts, } #[allow(deprecated)] -fn get_concurrency() -> uint { +fn get_concurrency() -> usize { match env::var("RUST_TEST_THREADS") { Ok(s) => { - let opt_n: Option = s.parse().ok(); + let opt_n: Option = s.parse().ok(); match opt_n { Some(n) if n > 0 => n, _ => panic!("RUST_TEST_THREADS is `{}`, should be a positive integer.", s) @@ -1164,7 +1163,7 @@ pub mod bench { BenchSamples { ns_iter_summ: ns_iter_summ, - mb_s: mb_s as uint + mb_s: mb_s as usize } } } @@ -1333,8 +1332,8 @@ mod tests { let names = vec!("sha1::test".to_string(), - "int::test_to_str".to_string(), - "int::test_pow".to_string(), + "isize::test_to_str".to_string(), + "isize::test_pow".to_string(), "test::do_not_run_ignored_tests".to_string(), "test::ignored_tests_result_in_ignored".to_string(), "test::first_free_arg_should_be_a_filter".to_string(), @@ -1361,8 +1360,8 @@ mod tests { let filtered = filter_tests(&opts, tests); let expected = - vec!("int::test_pow".to_string(), - "int::test_to_str".to_string(), + vec!("isize::test_pow".to_string(), + "isize::test_to_str".to_string(), "sha1::test".to_string(), "test::do_not_run_ignored_tests".to_string(), "test::filter_for_ignored_option".to_string(), diff --git a/src/test/auxiliary/ambig_impl_2_lib.rs b/src/test/auxiliary/ambig_impl_2_lib.rs index e56df439bc2..bd23fb88217 100644 --- a/src/test/auxiliary/ambig_impl_2_lib.rs +++ b/src/test/auxiliary/ambig_impl_2_lib.rs @@ -9,6 +9,6 @@ // except according to those terms. trait me { - fn me(&self) -> uint; + fn me(&self) -> usize; } -impl me for uint { fn me(&self) -> uint { *self } } +impl me for usize { fn me(&self) -> usize { *self } } diff --git a/src/test/auxiliary/anon_trait_static_method_lib.rs b/src/test/auxiliary/anon_trait_static_method_lib.rs index 666d2569c42..9d93d9689e7 100644 --- a/src/test/auxiliary/anon_trait_static_method_lib.rs +++ b/src/test/auxiliary/anon_trait_static_method_lib.rs @@ -9,7 +9,7 @@ // except according to those terms. pub struct Foo { - pub x: int + pub x: isize } impl Foo { diff --git a/src/test/auxiliary/associated-types-cc-lib.rs b/src/test/auxiliary/associated-types-cc-lib.rs index 44fbcf2150a..b3960c2707b 100644 --- a/src/test/auxiliary/associated-types-cc-lib.rs +++ b/src/test/auxiliary/associated-types-cc-lib.rs @@ -19,8 +19,8 @@ pub trait Bar { fn get(x: Option) -> ::T; } -impl Bar for int { - type T = uint; +impl Bar for isize { + type T = usize; - fn get(_: Option) -> uint { 22 } + fn get(_: Option) -> usize { 22 } } diff --git a/src/test/auxiliary/cci_borrow_lib.rs b/src/test/auxiliary/cci_borrow_lib.rs index 96af3203066..9c90510a857 100644 --- a/src/test/auxiliary/cci_borrow_lib.rs +++ b/src/test/auxiliary/cci_borrow_lib.rs @@ -8,6 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub fn foo(x: &uint) -> uint { +pub fn foo(x: &usize) -> usize { *x } diff --git a/src/test/auxiliary/cci_class.rs b/src/test/auxiliary/cci_class.rs index 50116b39737..08a13fd8bcc 100644 --- a/src/test/auxiliary/cci_class.rs +++ b/src/test/auxiliary/cci_class.rs @@ -10,12 +10,12 @@ pub mod kitties { pub struct cat { - meows : uint, + meows : usize, - pub how_hungry : int, + pub how_hungry : isize, } - pub fn cat(in_x : uint, in_y : int) -> cat { + pub fn cat(in_x : usize, in_y : isize) -> cat { cat { meows: in_x, how_hungry: in_y diff --git a/src/test/auxiliary/cci_class_2.rs b/src/test/auxiliary/cci_class_2.rs index 55fb424205e..7d147832f09 100644 --- a/src/test/auxiliary/cci_class_2.rs +++ b/src/test/auxiliary/cci_class_2.rs @@ -10,9 +10,9 @@ pub mod kitties { pub struct cat { - meows : uint, + meows : usize, - pub how_hungry : int, + pub how_hungry : isize, } @@ -20,7 +20,7 @@ pub mod kitties { pub fn speak(&self) {} } - pub fn cat(in_x : uint, in_y : int) -> cat { + pub fn cat(in_x : usize, in_y : isize) -> cat { cat { meows: in_x, how_hungry: in_y diff --git a/src/test/auxiliary/cci_class_3.rs b/src/test/auxiliary/cci_class_3.rs index 44d3a69fde4..ec1bf108dcb 100644 --- a/src/test/auxiliary/cci_class_3.rs +++ b/src/test/auxiliary/cci_class_3.rs @@ -10,17 +10,17 @@ pub mod kitties { pub struct cat { - meows : uint, + meows : usize, - pub how_hungry : int, + pub how_hungry : isize, } impl cat { pub fn speak(&mut self) { self.meows += 1; } - pub fn meow_count(&mut self) -> uint { self.meows } + pub fn meow_count(&mut self) -> usize { self.meows } } - pub fn cat(in_x : uint, in_y : int) -> cat { + pub fn cat(in_x : usize, in_y : isize) -> cat { cat { meows: in_x, how_hungry: in_y diff --git a/src/test/auxiliary/cci_class_4.rs b/src/test/auxiliary/cci_class_4.rs index c10ef805a65..300cc31632e 100644 --- a/src/test/auxiliary/cci_class_4.rs +++ b/src/test/auxiliary/cci_class_4.rs @@ -10,9 +10,9 @@ pub mod kitties { pub struct cat { - meows : uint, + meows : usize, - pub how_hungry : int, + pub how_hungry : isize, pub name : String, } @@ -41,7 +41,7 @@ pub mod kitties { } } - pub fn cat(in_x : uint, in_y : int, in_name: String) -> cat { + pub fn cat(in_x : usize, in_y : isize, in_name: String) -> cat { cat { meows: in_x, how_hungry: in_y, diff --git a/src/test/auxiliary/cci_class_5.rs b/src/test/auxiliary/cci_class_5.rs index d113859a6bd..7fe608f1634 100644 --- a/src/test/auxiliary/cci_class_5.rs +++ b/src/test/auxiliary/cci_class_5.rs @@ -10,15 +10,15 @@ pub mod kitties { pub struct cat { - meows : uint, - pub how_hungry : int, + meows : usize, + pub how_hungry : isize, } impl cat { fn nap(&self) {} } - pub fn cat(in_x : uint, in_y : int) -> cat { + pub fn cat(in_x : usize, in_y : isize) -> cat { cat { meows: in_x, how_hungry: in_y diff --git a/src/test/auxiliary/cci_class_6.rs b/src/test/auxiliary/cci_class_6.rs index 71552f4c97e..c902a6c7dca 100644 --- a/src/test/auxiliary/cci_class_6.rs +++ b/src/test/auxiliary/cci_class_6.rs @@ -12,9 +12,9 @@ pub mod kitties { pub struct cat { info : Vec , - meows : uint, + meows : usize, - pub how_hungry : int, + pub how_hungry : isize, } impl cat { @@ -22,10 +22,10 @@ pub mod kitties { self.meows += stuff.len(); } - pub fn meow_count(&mut self) -> uint { self.meows } + pub fn meow_count(&mut self) -> usize { self.meows } } - pub fn cat(in_x : uint, in_y : int, in_info: Vec ) -> cat { + pub fn cat(in_x : usize, in_y : isize, in_info: Vec ) -> cat { cat { meows: in_x, how_hungry: in_y, diff --git a/src/test/auxiliary/cci_class_cast.rs b/src/test/auxiliary/cci_class_cast.rs index 28fa354fef3..f54a39d61ef 100644 --- a/src/test/auxiliary/cci_class_cast.rs +++ b/src/test/auxiliary/cci_class_cast.rs @@ -12,8 +12,8 @@ pub mod kitty { use std::fmt; pub struct cat { - meows : uint, - pub how_hungry : int, + meows : usize, + pub how_hungry : isize, pub name : String, } @@ -50,7 +50,7 @@ pub mod kitty { } } - pub fn cat(in_x : uint, in_y : int, in_name: String) -> cat { + pub fn cat(in_x : usize, in_y : isize, in_name: String) -> cat { cat { meows: in_x, how_hungry: in_y, diff --git a/src/test/auxiliary/cci_const.rs b/src/test/auxiliary/cci_const.rs index 945004ede6d..ee8290050f9 100644 --- a/src/test/auxiliary/cci_const.rs +++ b/src/test/auxiliary/cci_const.rs @@ -12,5 +12,5 @@ pub extern fn bar() { } pub const foopy: &'static str = "hi there"; -pub const uint_val: uint = 12; -pub const uint_expr: uint = (1 << uint_val) - 1; +pub const uint_val: usize = 12; +pub const uint_expr: usize = (1 << uint_val) - 1; diff --git a/src/test/auxiliary/cci_const_block.rs b/src/test/auxiliary/cci_const_block.rs index a3bcbd201e1..76fe9fe5aa4 100644 --- a/src/test/auxiliary/cci_const_block.rs +++ b/src/test/auxiliary/cci_const_block.rs @@ -8,8 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub static BLOCK_FN_DEF: fn(uint) -> uint = { - fn foo(a: uint) -> uint { +pub static BLOCK_FN_DEF: fn(usize) -> usize = { + fn foo(a: usize) -> usize { a + 10 } foo diff --git a/src/test/auxiliary/cci_impl_lib.rs b/src/test/auxiliary/cci_impl_lib.rs index a650b30e593..d8921f4e09a 100644 --- a/src/test/auxiliary/cci_impl_lib.rs +++ b/src/test/auxiliary/cci_impl_lib.rs @@ -11,12 +11,12 @@ #![crate_name="cci_impl_lib"] pub trait uint_helpers { - fn to(&self, v: uint, f: F) where F: FnMut(uint); + fn to(&self, v: usize, f: F) where F: FnMut(usize); } -impl uint_helpers for uint { +impl uint_helpers for usize { #[inline] - fn to(&self, v: uint, mut f: F) where F: FnMut(uint) { + fn to(&self, v: usize, mut f: F) where F: FnMut(usize) { let mut i = *self; while i < v { f(i); diff --git a/src/test/auxiliary/cci_intrinsic.rs b/src/test/auxiliary/cci_intrinsic.rs index a3a3dbac2b5..b6e69d29f70 100644 --- a/src/test/auxiliary/cci_intrinsic.rs +++ b/src/test/auxiliary/cci_intrinsic.rs @@ -17,7 +17,7 @@ pub mod rusti { } #[inline(always)] -pub fn atomic_xchg(dst: *mut int, src: int) -> int { +pub fn atomic_xchg(dst: *mut isize, src: isize) -> isize { unsafe { rusti::atomic_xchg(dst, src) } diff --git a/src/test/auxiliary/cci_nested_lib.rs b/src/test/auxiliary/cci_nested_lib.rs index 587af956c77..8c1a283a72d 100644 --- a/src/test/auxiliary/cci_nested_lib.rs +++ b/src/test/auxiliary/cci_nested_lib.rs @@ -44,8 +44,8 @@ pub fn alist_get() -> alist { - fn eq_int(a: int, b: int) -> bool { a == b } +pub fn new_int_alist() -> alist { + fn eq_int(a: isize, b: isize) -> bool { a == b } return alist { eq_fn: eq_int, data: box RefCell::new(Vec::new()), @@ -53,9 +53,9 @@ pub fn new_int_alist() -> alist { } #[inline] -pub fn new_int_alist_2() -> alist { +pub fn new_int_alist_2() -> alist { #[inline] - fn eq_int(a: int, b: int) -> bool { a == b } + fn eq_int(a: isize, b: isize) -> bool { a == b } return alist { eq_fn: eq_int, data: box RefCell::new(Vec::new()), diff --git a/src/test/auxiliary/cci_no_inline_lib.rs b/src/test/auxiliary/cci_no_inline_lib.rs index f3ad2a3aeb9..4c6f808c619 100644 --- a/src/test/auxiliary/cci_no_inline_lib.rs +++ b/src/test/auxiliary/cci_no_inline_lib.rs @@ -12,7 +12,7 @@ // same as cci_iter_lib, more-or-less, but not marked inline -pub fn iter(v: Vec , mut f: F) where F: FnMut(uint) { +pub fn iter(v: Vec , mut f: F) where F: FnMut(usize) { let mut i = 0; let n = v.len(); while i < n { diff --git a/src/test/auxiliary/cfg_inner_static.rs b/src/test/auxiliary/cfg_inner_static.rs index 4331a1da2a2..b5b4390657b 100644 --- a/src/test/auxiliary/cfg_inner_static.rs +++ b/src/test/auxiliary/cfg_inner_static.rs @@ -11,7 +11,7 @@ // this used to just ICE on compiling pub fn foo() { if cfg!(foo) { - static a: int = 3; + static a: isize = 3; a } else { 3 }; } diff --git a/src/test/auxiliary/changing-crates-b.rs b/src/test/auxiliary/changing-crates-b.rs index 81f924e29da..7b1190fc085 100644 --- a/src/test/auxiliary/changing-crates-b.rs +++ b/src/test/auxiliary/changing-crates-b.rs @@ -12,4 +12,4 @@ extern crate a; -pub fn foo() { a::foo::(); } +pub fn foo() { a::foo::(); } diff --git a/src/test/auxiliary/crateresolve1-1.rs b/src/test/auxiliary/crateresolve1-1.rs index e26ea7c4fa6..050f2fe7329 100644 --- a/src/test/auxiliary/crateresolve1-1.rs +++ b/src/test/auxiliary/crateresolve1-1.rs @@ -12,4 +12,4 @@ #![crate_name = "crateresolve1"] #![crate_type = "lib"] -pub fn f() -> int { 10 } +pub fn f() -> isize { 10 } diff --git a/src/test/auxiliary/crateresolve1-2.rs b/src/test/auxiliary/crateresolve1-2.rs index 715171b143a..d19b3bafba5 100644 --- a/src/test/auxiliary/crateresolve1-2.rs +++ b/src/test/auxiliary/crateresolve1-2.rs @@ -12,4 +12,4 @@ #![crate_name = "crateresolve1"] #![crate_type = "lib"] -pub fn f() -> int { 20 } +pub fn f() -> isize { 20 } diff --git a/src/test/auxiliary/crateresolve1-3.rs b/src/test/auxiliary/crateresolve1-3.rs index f733b5b908a..c5096ac49a8 100644 --- a/src/test/auxiliary/crateresolve1-3.rs +++ b/src/test/auxiliary/crateresolve1-3.rs @@ -12,4 +12,4 @@ #![crate_name = "crateresolve1"] #![crate_type = "lib"] -pub fn f() -> int { 30 } +pub fn f() -> isize { 30 } diff --git a/src/test/auxiliary/crateresolve3-1.rs b/src/test/auxiliary/crateresolve3-1.rs index 473528c681e..0e02a8d96a3 100644 --- a/src/test/auxiliary/crateresolve3-1.rs +++ b/src/test/auxiliary/crateresolve3-1.rs @@ -12,4 +12,4 @@ #![crate_type = "lib"] -pub fn f() -> int { 10 } +pub fn f() -> isize { 10 } diff --git a/src/test/auxiliary/crateresolve3-2.rs b/src/test/auxiliary/crateresolve3-2.rs index 1e95fa6b639..6a11465b27c 100644 --- a/src/test/auxiliary/crateresolve3-2.rs +++ b/src/test/auxiliary/crateresolve3-2.rs @@ -12,4 +12,4 @@ #![crate_type = "lib"] -pub fn g() -> int { 20 } +pub fn g() -> isize { 20 } diff --git a/src/test/auxiliary/crateresolve4a-1.rs b/src/test/auxiliary/crateresolve4a-1.rs index 68a69f6dc90..579e93aa059 100644 --- a/src/test/auxiliary/crateresolve4a-1.rs +++ b/src/test/auxiliary/crateresolve4a-1.rs @@ -11,4 +11,4 @@ #![crate_name="crateresolve4a#0.1"] #![crate_type = "lib"] -pub fn f() -> int { 10 } +pub fn f() -> isize { 10 } diff --git a/src/test/auxiliary/crateresolve4a-2.rs b/src/test/auxiliary/crateresolve4a-2.rs index 6e23fddbce7..7da96e07b3f 100644 --- a/src/test/auxiliary/crateresolve4a-2.rs +++ b/src/test/auxiliary/crateresolve4a-2.rs @@ -11,4 +11,4 @@ #![crate_name="crateresolve4a#0.2"] #![crate_type = "lib"] -pub fn g() -> int { 20 } +pub fn g() -> isize { 20 } diff --git a/src/test/auxiliary/crateresolve4b-1.rs b/src/test/auxiliary/crateresolve4b-1.rs index 843fd57ee40..9e4b0d158ec 100644 --- a/src/test/auxiliary/crateresolve4b-1.rs +++ b/src/test/auxiliary/crateresolve4b-1.rs @@ -15,4 +15,4 @@ extern crate "crateresolve4a#0.2" as crateresolve4a; -pub fn f() -> int { crateresolve4a::g() } +pub fn f() -> isize { crateresolve4a::g() } diff --git a/src/test/auxiliary/crateresolve4b-2.rs b/src/test/auxiliary/crateresolve4b-2.rs index 28c89c79316..a50b8dbf957 100644 --- a/src/test/auxiliary/crateresolve4b-2.rs +++ b/src/test/auxiliary/crateresolve4b-2.rs @@ -15,4 +15,4 @@ extern crate "crateresolve4a#0.1" as crateresolve4a; -pub fn g() -> int { crateresolve4a::f() } +pub fn g() -> isize { crateresolve4a::f() } diff --git a/src/test/auxiliary/crateresolve5-1.rs b/src/test/auxiliary/crateresolve5-1.rs index 223e4f50ae8..eaec37ed417 100644 --- a/src/test/auxiliary/crateresolve5-1.rs +++ b/src/test/auxiliary/crateresolve5-1.rs @@ -12,7 +12,7 @@ #![crate_type = "lib"] -pub struct NameVal { pub name: String, pub val: int } +pub struct NameVal { pub name: String, pub val: isize } pub fn struct_nameval() -> NameVal { NameVal { name: "crateresolve5".to_string(), val: 10 } @@ -31,4 +31,4 @@ impl PartialEq for e { fn ne(&self, other: &e) -> bool { !nominal_eq(*self, *other) } } -pub fn f() -> int { 10 } +pub fn f() -> isize { 10 } diff --git a/src/test/auxiliary/crateresolve5-2.rs b/src/test/auxiliary/crateresolve5-2.rs index 38740886b37..14d28c709cd 100644 --- a/src/test/auxiliary/crateresolve5-2.rs +++ b/src/test/auxiliary/crateresolve5-2.rs @@ -12,7 +12,7 @@ #![crate_type = "lib"] -pub struct NameVal { pub name: String, pub val: int } +pub struct NameVal { pub name: String, pub val: isize } pub fn struct_nameval() -> NameVal { NameVal { name: "crateresolve5".to_string(), val: 10 } } @@ -30,4 +30,4 @@ pub fn nominal() -> e { e_val } pub fn nominal_neq(_e1: e, _e2: e) -> bool { false } -pub fn f() -> int { 20 } +pub fn f() -> isize { 20 } diff --git a/src/test/auxiliary/crateresolve7x.rs b/src/test/auxiliary/crateresolve7x.rs index 801ace7d804..c05d292eaea 100644 --- a/src/test/auxiliary/crateresolve7x.rs +++ b/src/test/auxiliary/crateresolve7x.rs @@ -14,10 +14,10 @@ // These both have the same version but differ in other metadata pub mod a { extern crate cr_1 (name = "crateresolve_calories", vers = "0.1", calories="100"); - pub fn f() -> int { cr_1::f() } + pub fn f() -> isize { cr_1::f() } } pub mod b { extern crate cr_2 (name = "crateresolve_calories", vers = "0.1", calories="200"); - pub fn f() -> int { cr_2::f() } + pub fn f() -> isize { cr_2::f() } } diff --git a/src/test/auxiliary/crateresolve8-1.rs b/src/test/auxiliary/crateresolve8-1.rs index 5262d662971..bc2a2d83bfe 100644 --- a/src/test/auxiliary/crateresolve8-1.rs +++ b/src/test/auxiliary/crateresolve8-1.rs @@ -13,4 +13,4 @@ #![crate_type = "lib"] -pub fn f() -> int { 20 } +pub fn f() -> isize { 20 } diff --git a/src/test/auxiliary/crateresolve_calories-1.rs b/src/test/auxiliary/crateresolve_calories-1.rs index 4dba722971e..c1705d687ab 100644 --- a/src/test/auxiliary/crateresolve_calories-1.rs +++ b/src/test/auxiliary/crateresolve_calories-1.rs @@ -11,4 +11,4 @@ #![crate_name="crateresolve_calories#0.1"] #![crate_type = "lib"] -pub fn f() -> int { 100 } +pub fn f() -> isize { 100 } diff --git a/src/test/auxiliary/crateresolve_calories-2.rs b/src/test/auxiliary/crateresolve_calories-2.rs index c7e26c8f506..2ae87daab4e 100644 --- a/src/test/auxiliary/crateresolve_calories-2.rs +++ b/src/test/auxiliary/crateresolve_calories-2.rs @@ -11,4 +11,4 @@ #![crate_name="crateresolve_calories#0.1"] #![crate_type = "lib"] -pub fn f() -> int { 200 } +pub fn f() -> isize { 200 } diff --git a/src/test/auxiliary/extern_calling_convention.rs b/src/test/auxiliary/extern_calling_convention.rs index d7e84a474e8..91a404bbba3 100644 --- a/src/test/auxiliary/extern_calling_convention.rs +++ b/src/test/auxiliary/extern_calling_convention.rs @@ -13,7 +13,7 @@ #[inline(never)] #[cfg(target_arch = "x86_64")] -pub extern "win64" fn foo(a: int, b: int, c: int, d: int) { +pub extern "win64" fn foo(a: isize, b: isize, c: isize, d: isize) { assert!(a == 1); assert!(b == 2); assert!(c == 3); @@ -25,7 +25,7 @@ pub extern "win64" fn foo(a: int, b: int, c: int, d: int) { #[inline(never)] #[cfg(any(target_arch = "x86", target_arch = "arm", target_arch = "aarch64"))] -pub extern fn foo(a: int, b: int, c: int, d: int) { +pub extern fn foo(a: isize, b: isize, c: isize, d: isize) { assert!(a == 1); assert!(b == 2); assert!(c == 3); diff --git a/src/test/auxiliary/go_trait.rs b/src/test/auxiliary/go_trait.rs index 4902766534a..0a921c8f5b3 100644 --- a/src/test/auxiliary/go_trait.rs +++ b/src/test/auxiliary/go_trait.rs @@ -11,33 +11,33 @@ // Common code used for tests that model the Fn/FnMut/FnOnce hierarchy. pub trait Go { - fn go(&self, arg: int); + fn go(&self, arg: isize); } -pub fn go(this: &G, arg: int) { +pub fn go(this: &G, arg: isize) { this.go(arg) } pub trait GoMut { - fn go_mut(&mut self, arg: int); + fn go_mut(&mut self, arg: isize); } -pub fn go_mut(this: &mut G, arg: int) { +pub fn go_mut(this: &mut G, arg: isize) { this.go_mut(arg) } pub trait GoOnce { - fn go_once(self, arg: int); + fn go_once(self, arg: isize); } -pub fn go_once(this: G, arg: int) { +pub fn go_once(this: G, arg: isize) { this.go_once(arg) } impl GoMut for G where G : Go { - fn go_mut(&mut self, arg: int) { + fn go_mut(&mut self, arg: isize) { go(&*self, arg) } } @@ -45,7 +45,7 @@ impl GoMut for G impl GoOnce for G where G : GoMut { - fn go_once(mut self, arg: int) { + fn go_once(mut self, arg: isize) { go_mut(&mut self, arg) } } diff --git a/src/test/auxiliary/impl_privacy_xc_1.rs b/src/test/auxiliary/impl_privacy_xc_1.rs index df4e0658cb8..ad3cdedf7ea 100644 --- a/src/test/auxiliary/impl_privacy_xc_1.rs +++ b/src/test/auxiliary/impl_privacy_xc_1.rs @@ -11,7 +11,7 @@ #![crate_type = "lib"] pub struct Fish { - pub x: int + pub x: isize } impl Fish { diff --git a/src/test/auxiliary/impl_privacy_xc_2.rs b/src/test/auxiliary/impl_privacy_xc_2.rs index 4d4b1bcc4cb..c3212b0fc6d 100644 --- a/src/test/auxiliary/impl_privacy_xc_2.rs +++ b/src/test/auxiliary/impl_privacy_xc_2.rs @@ -11,7 +11,7 @@ #![crate_type = "lib"] pub struct Fish { - pub x: int + pub x: isize } mod unexported { diff --git a/src/test/auxiliary/inherit_struct_lib.rs b/src/test/auxiliary/inherit_struct_lib.rs index fd049a25a0c..6f5ddfd37a5 100644 --- a/src/test/auxiliary/inherit_struct_lib.rs +++ b/src/test/auxiliary/inherit_struct_lib.rs @@ -12,11 +12,11 @@ #![feature(struct_inherit)] pub virtual struct S1 { - pub f1: int, + pub f1: isize, } pub struct S2 : S1 { - pub f2: int, + pub f2: isize, } pub fn test_s2(s2: S2) { diff --git a/src/test/auxiliary/inherited_stability.rs b/src/test/auxiliary/inherited_stability.rs index 77eb82f8022..c09cc53466d 100644 --- a/src/test/auxiliary/inherited_stability.rs +++ b/src/test/auxiliary/inherited_stability.rs @@ -43,7 +43,7 @@ pub trait Stable { fn stable(&self); } -impl Stable for uint { +impl Stable for usize { fn unstable(&self) {} fn stable(&self) {} } diff --git a/src/test/auxiliary/inner_static.rs b/src/test/auxiliary/inner_static.rs index ca5c6072cb3..0d15c13a4ef 100644 --- a/src/test/auxiliary/inner_static.rs +++ b/src/test/auxiliary/inner_static.rs @@ -15,43 +15,43 @@ pub mod test { pub struct A { pub v: T } impl A { - pub fn foo(&self) -> int { - static a: int = 5; + pub fn foo(&self) -> isize { + static a: isize = 5; return a } - pub fn bar(&self) -> int { - static a: int = 6; + pub fn bar(&self) -> isize { + static a: isize = 6; return a; } } } impl A { - pub fn foo(&self) -> int { - static a: int = 1; + pub fn foo(&self) -> isize { + static a: isize = 1; return a } - pub fn bar(&self) -> int { - static a: int = 2; + pub fn bar(&self) -> isize { + static a: isize = 2; return a; } } impl B { - pub fn foo(&self) -> int { - static a: int = 3; + pub fn foo(&self) -> isize { + static a: isize = 3; return a } - pub fn bar(&self) -> int { - static a: int = 4; + pub fn bar(&self) -> isize { + static a: isize = 4; return a; } } -pub fn foo() -> int { +pub fn foo() -> isize { let a = A { v: () }; let b = B { v: () }; let c = test::A { v: () }; diff --git a/src/test/auxiliary/issue-11224.rs b/src/test/auxiliary/issue-11224.rs index d66cfe9bf63..21935b6b9ab 100644 --- a/src/test/auxiliary/issue-11224.rs +++ b/src/test/auxiliary/issue-11224.rs @@ -15,12 +15,12 @@ mod inner { fn f(&self) { f(); } } - impl Trait for int {} + impl Trait for isize {} fn f() {} } pub fn foo() { - let a = &1i as &inner::Trait; + let a = &1is as &inner::Trait; a.f(); } diff --git a/src/test/auxiliary/issue-11225-1.rs b/src/test/auxiliary/issue-11225-1.rs index 88277af4a51..37543ea1d3c 100644 --- a/src/test/auxiliary/issue-11225-1.rs +++ b/src/test/auxiliary/issue-11225-1.rs @@ -13,7 +13,7 @@ mod inner { fn f(&self) { f(); } } - impl Trait for int {} + impl Trait for isize {} fn f() {} } diff --git a/src/test/auxiliary/issue-11225-2.rs b/src/test/auxiliary/issue-11225-2.rs index 848574a61fe..f12e4c9b6e7 100644 --- a/src/test/auxiliary/issue-11225-2.rs +++ b/src/test/auxiliary/issue-11225-2.rs @@ -25,7 +25,7 @@ pub trait Outer { fn foo(&self, t: T) { t.f(); } } -impl Outer for int {} +impl Outer for isize {} pub fn foo(t: T) { t.foo(inner::Foo); diff --git a/src/test/auxiliary/issue-11529.rs b/src/test/auxiliary/issue-11529.rs index a8a4c438e67..21ef99e3c3d 100644 --- a/src/test/auxiliary/issue-11529.rs +++ b/src/test/auxiliary/issue-11529.rs @@ -8,4 +8,4 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub struct A<'a>(pub &'a int); +pub struct A<'a>(pub &'a isize); diff --git a/src/test/auxiliary/issue-17718.rs b/src/test/auxiliary/issue-17718.rs index cbe56b00c13..67474e79021 100644 --- a/src/test/auxiliary/issue-17718.rs +++ b/src/test/auxiliary/issue-17718.rs @@ -10,13 +10,13 @@ use std::sync::atomic; -pub const C1: uint = 1; +pub const C1: usize = 1; pub const C2: atomic::AtomicUsize = atomic::ATOMIC_USIZE_INIT; pub const C3: fn() = foo; -pub const C4: uint = C1 * C1 + C1 / C1; -pub const C5: &'static uint = &C4; +pub const C4: usize = C1 * C1 + C1 / C1; +pub const C5: &'static usize = &C4; -pub static S1: uint = 3; +pub static S1: usize = 3; pub static S2: atomic::AtomicUsize = atomic::ATOMIC_USIZE_INIT; fn foo() {} diff --git a/src/test/auxiliary/issue-2414-a.rs b/src/test/auxiliary/issue-2414-a.rs index fe1ef549d06..8c414193bd6 100644 --- a/src/test/auxiliary/issue-2414-a.rs +++ b/src/test/auxiliary/issue-2414-a.rs @@ -11,7 +11,7 @@ #![crate_name="a"] #![crate_type = "lib"] -type t1 = uint; +type t1 = usize; trait foo { fn foo(&self); diff --git a/src/test/auxiliary/issue-2526.rs b/src/test/auxiliary/issue-2526.rs index 832665abdc2..e85a0a90aff 100644 --- a/src/test/auxiliary/issue-2526.rs +++ b/src/test/auxiliary/issue-2526.rs @@ -16,7 +16,7 @@ use std::marker; struct arc_destruct { - _data: int, + _data: isize, _marker: marker::PhantomData } @@ -25,7 +25,7 @@ impl Drop for arc_destruct { fn drop(&mut self) {} } -fn arc_destruct(data: int) -> arc_destruct { +fn arc_destruct(data: isize) -> arc_destruct { arc_destruct { _data: data, _marker: marker::PhantomData @@ -41,7 +41,7 @@ fn init() -> arc_destruct { } struct context_res { - ctx : int, + ctx : isize, } impl Drop for context_res { diff --git a/src/test/auxiliary/issue-5521.rs b/src/test/auxiliary/issue-5521.rs index 2ffdddcc798..82bd2b64204 100644 --- a/src/test/auxiliary/issue-5521.rs +++ b/src/test/auxiliary/issue-5521.rs @@ -11,4 +11,4 @@ use std::collections::HashMap; -pub type map = Box>; +pub type map = Box>; diff --git a/src/test/auxiliary/issue-8044.rs b/src/test/auxiliary/issue-8044.rs index 7bfd2e79641..8f328699ae0 100644 --- a/src/test/auxiliary/issue-8044.rs +++ b/src/test/auxiliary/issue-8044.rs @@ -21,5 +21,5 @@ pub fn leaf(value: V) -> TreeItem { } fn main() { - BTree:: { node: leaf(1) }; + BTree:: { node: leaf(1) }; } diff --git a/src/test/auxiliary/issue-9906.rs b/src/test/auxiliary/issue-9906.rs index 1e746bf39db..0da0b9fa47d 100644 --- a/src/test/auxiliary/issue-9906.rs +++ b/src/test/auxiliary/issue-9906.rs @@ -14,9 +14,9 @@ pub use other::FooBar; pub use other::foo; mod other { - pub struct FooBar{value: int} + pub struct FooBar{value: isize} impl FooBar{ - pub fn new(val: int) -> FooBar { + pub fn new(val: isize) -> FooBar { FooBar{value: val} } } diff --git a/src/test/auxiliary/issue13507.rs b/src/test/auxiliary/issue13507.rs index 4a8839abc7c..22ccb3dfacd 100644 --- a/src/test/auxiliary/issue13507.rs +++ b/src/test/auxiliary/issue13507.rs @@ -41,10 +41,10 @@ pub mod testtypes { pub type FooChar = char; // Tests ty_int (does not test all variants of IntTy) - pub type FooInt = int; + pub type FooInt = isize; // Tests ty_uint (does not test all variants of UintTy) - pub type FooUint = uint; + pub type FooUint = usize; // Tests ty_float (does not test all variants of FloatTy) pub type FooFloat = f64; @@ -53,8 +53,8 @@ pub mod testtypes { // Tests ty_enum pub enum FooEnum { - VarA(uint), - VarB(uint, uint) + VarA(usize), + VarB(usize, usize) } // Tests ty_uniq (of u8) @@ -71,14 +71,14 @@ pub mod testtypes { // Tests ty_trait pub trait FooTrait { - fn foo_method(&self) -> uint; - fn foo_static_method() -> uint; + fn foo_method(&self) -> usize; + fn foo_static_method() -> usize; } // Tests ty_struct pub struct FooStruct { - pub pub_foo_field: uint, - foo_field: uint + pub pub_foo_field: usize, + foo_field: usize } // Tests ty_tup diff --git a/src/test/auxiliary/issue_11680.rs b/src/test/auxiliary/issue_11680.rs index 249a1bab465..18f78750b15 100644 --- a/src/test/auxiliary/issue_11680.rs +++ b/src/test/auxiliary/issue_11680.rs @@ -9,11 +9,11 @@ // except according to those terms. enum Foo { - Bar(int) + Bar(isize) } pub mod test { enum Foo { - Bar(int) + Bar(isize) } } diff --git a/src/test/auxiliary/issue_17718_const_privacy.rs b/src/test/auxiliary/issue_17718_const_privacy.rs index 3657d39ff77..3901d73382f 100644 --- a/src/test/auxiliary/issue_17718_const_privacy.rs +++ b/src/test/auxiliary/issue_17718_const_privacy.rs @@ -10,9 +10,9 @@ pub use foo::FOO2; -pub const FOO: uint = 3; -const BAR: uint = 3; +pub const FOO: usize = 3; +const BAR: usize = 3; mod foo { - pub const FOO2: uint = 3; + pub const FOO2: usize = 3; } diff --git a/src/test/auxiliary/issue_19293.rs b/src/test/auxiliary/issue_19293.rs index 40c8eb9b23a..12894ad72e1 100644 --- a/src/test/auxiliary/issue_19293.rs +++ b/src/test/auxiliary/issue_19293.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub struct Foo (pub int); +pub struct Foo (pub isize); pub enum MyEnum { Foo(Foo), } diff --git a/src/test/auxiliary/issue_2723_a.rs b/src/test/auxiliary/issue_2723_a.rs index bd8857ceef7..44bea136a7c 100644 --- a/src/test/auxiliary/issue_2723_a.rs +++ b/src/test/auxiliary/issue_2723_a.rs @@ -9,6 +9,6 @@ // except according to those terms. -pub unsafe fn f(xs: Vec ) { +pub unsafe fn f(xs: Vec ) { xs.iter().map(|_x| { unsafe fn q() { panic!(); } }).collect::>(); } diff --git a/src/test/auxiliary/issue_3979_traits.rs b/src/test/auxiliary/issue_3979_traits.rs index 91faace7a3f..5c306be69c4 100644 --- a/src/test/auxiliary/issue_3979_traits.rs +++ b/src/test/auxiliary/issue_3979_traits.rs @@ -13,12 +13,12 @@ #![crate_type = "lib"] pub trait Positioned { - fn SetX(&mut self, int); - fn X(&self) -> int; + fn SetX(&mut self, isize); + fn X(&self) -> isize; } pub trait Movable: Positioned { - fn translate(&mut self, dx: int) { + fn translate(&mut self, dx: isize) { let x = self.X() + dx; self.SetX(x); } diff --git a/src/test/auxiliary/issue_9188.rs b/src/test/auxiliary/issue_9188.rs index d17e4afb5e8..8ff85cc359d 100644 --- a/src/test/auxiliary/issue_9188.rs +++ b/src/test/auxiliary/issue_9188.rs @@ -8,16 +8,16 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub fn foo() -> &'static int { +pub fn foo() -> &'static isize { if false { - static a: int = 4; + static a: isize = 4; return &a; } else { - static a: int = 5; + static a: isize = 5; return &a; } } -pub fn bar() -> &'static int { - foo::() +pub fn bar() -> &'static isize { + foo::() } diff --git a/src/test/auxiliary/lang-item-public.rs b/src/test/auxiliary/lang-item-public.rs index c5d4182eae6..3b4547e31f5 100644 --- a/src/test/auxiliary/lang-item-public.rs +++ b/src/test/auxiliary/lang-item-public.rs @@ -20,7 +20,7 @@ impl PhantomFn for U { } pub trait Sized : PhantomFn {} #[lang="panic"] -fn panic(_: &(&'static str, &'static str, uint)) -> ! { loop {} } +fn panic(_: &(&'static str, &'static str, usize)) -> ! { loop {} } #[lang = "stack_exhausted"] extern fn stack_exhausted() {} diff --git a/src/test/auxiliary/linkage-visibility.rs b/src/test/auxiliary/linkage-visibility.rs index fd3e9b9ac9d..d96dfd848f3 100644 --- a/src/test/auxiliary/linkage-visibility.rs +++ b/src/test/auxiliary/linkage-visibility.rs @@ -31,8 +31,8 @@ fn baz() { } pub fn test() { let lib = DynamicLibrary::open(None).unwrap(); unsafe { - assert!(lib.symbol::("foo").is_ok()); - assert!(lib.symbol::("baz").is_err()); - assert!(lib.symbol::("bar").is_err()); + assert!(lib.symbol::("foo").is_ok()); + assert!(lib.symbol::("baz").is_err()); + assert!(lib.symbol::("bar").is_err()); } } diff --git a/src/test/auxiliary/linkage1.rs b/src/test/auxiliary/linkage1.rs index a74c8c47cd9..ca4046d8163 100644 --- a/src/test/auxiliary/linkage1.rs +++ b/src/test/auxiliary/linkage1.rs @@ -9,6 +9,6 @@ // except according to those terms. #[no_mangle] -pub static foo: int = 3; +pub static foo: isize = 3; pub fn bar() {} diff --git a/src/test/auxiliary/lint_output_format.rs b/src/test/auxiliary/lint_output_format.rs index 1977e2aad28..50a9202a87b 100644 --- a/src/test/auxiliary/lint_output_format.rs +++ b/src/test/auxiliary/lint_output_format.rs @@ -16,16 +16,16 @@ #[stable(feature = "test_feature", since = "1.0.0")] #[deprecated(since = "1.0.0")] -pub fn foo() -> uint { +pub fn foo() -> usize { 20 } #[unstable(feature = "test_feature")] -pub fn bar() -> uint { +pub fn bar() -> usize { 40 } #[unstable(feature = "test_feature")] -pub fn baz() -> uint { +pub fn baz() -> usize { 30 } diff --git a/src/test/auxiliary/lint_stability.rs b/src/test/auxiliary/lint_stability.rs index d47575403e1..bb3b71bc244 100644 --- a/src/test/auxiliary/lint_stability.rs +++ b/src/test/auxiliary/lint_stability.rs @@ -101,20 +101,20 @@ pub trait UnstableTrait { fn dummy(&self) { } } #[stable(feature = "test_feature", since = "1.0.0")] #[deprecated(since = "1.0.0")] pub struct DeprecatedStruct { - #[stable(feature = "test_feature", since = "1.0.0")] pub i: int + #[stable(feature = "test_feature", since = "1.0.0")] pub i: isize } #[unstable(feature = "test_feature")] #[deprecated(since = "1.0.0")] pub struct DeprecatedUnstableStruct { - #[stable(feature = "test_feature", since = "1.0.0")] pub i: int + #[stable(feature = "test_feature", since = "1.0.0")] pub i: isize } #[unstable(feature = "test_feature")] pub struct UnstableStruct { - #[stable(feature = "test_feature", since = "1.0.0")] pub i: int + #[stable(feature = "test_feature", since = "1.0.0")] pub i: isize } #[stable(feature = "rust1", since = "1.0.0")] pub struct StableStruct { - #[stable(feature = "test_feature", since = "1.0.0")] pub i: int + #[stable(feature = "test_feature", since = "1.0.0")] pub i: isize } #[stable(feature = "test_feature", since = "1.0.0")] @@ -145,14 +145,14 @@ pub enum Enum { #[stable(feature = "test_feature", since = "1.0.0")] #[deprecated(since = "1.0.0")] -pub struct DeprecatedTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub int); +pub struct DeprecatedTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize); #[unstable(feature = "test_feature")] #[deprecated(since = "1.0.0")] -pub struct DeprecatedUnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub int); +pub struct DeprecatedUnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize); #[unstable(feature = "test_feature")] -pub struct UnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub int); +pub struct UnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize); #[stable(feature = "rust1", since = "1.0.0")] -pub struct StableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub int); +pub struct StableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize); #[macro_export] macro_rules! macro_test { diff --git a/src/test/auxiliary/logging_right_crate.rs b/src/test/auxiliary/logging_right_crate.rs index 974db7c9246..db26b10fc67 100644 --- a/src/test/auxiliary/logging_right_crate.rs +++ b/src/test/auxiliary/logging_right_crate.rs @@ -13,6 +13,6 @@ #[macro_use] extern crate log; pub fn foo() { - fn death() -> int { panic!() } + fn death() -> isize { panic!() } debug!("{}", (||{ death() })()); } diff --git a/src/test/auxiliary/macro_crate_nonterminal.rs b/src/test/auxiliary/macro_crate_nonterminal.rs index 922efc1aec3..4f75e2b5d75 100644 --- a/src/test/auxiliary/macro_crate_nonterminal.rs +++ b/src/test/auxiliary/macro_crate_nonterminal.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub fn increment(x: uint) -> uint { +pub fn increment(x: usize) -> usize { x + 1 } diff --git a/src/test/auxiliary/moves_based_on_type_lib.rs b/src/test/auxiliary/moves_based_on_type_lib.rs index 6ff6da716a9..f95be3f4a1d 100644 --- a/src/test/auxiliary/moves_based_on_type_lib.rs +++ b/src/test/auxiliary/moves_based_on_type_lib.rs @@ -11,7 +11,7 @@ #![crate_type="lib"] pub struct S { - x: int, + x: isize, } impl Drop for S { diff --git a/src/test/auxiliary/namespaced_enum_emulate_flat.rs b/src/test/auxiliary/namespaced_enum_emulate_flat.rs index 7412c17fd45..b7bde4a74a5 100644 --- a/src/test/auxiliary/namespaced_enum_emulate_flat.rs +++ b/src/test/auxiliary/namespaced_enum_emulate_flat.rs @@ -12,8 +12,8 @@ pub use Foo::*; pub enum Foo { A, - B(int), - C { a: int }, + B(isize), + C { a: isize }, } impl Foo { @@ -25,8 +25,8 @@ pub mod nest { pub enum Bar { D, - E(int), - F { a: int }, + E(isize), + F { a: isize }, } impl Bar { diff --git a/src/test/auxiliary/namespaced_enums.rs b/src/test/auxiliary/namespaced_enums.rs index 3c0138a7077..3bf39b788db 100644 --- a/src/test/auxiliary/namespaced_enums.rs +++ b/src/test/auxiliary/namespaced_enums.rs @@ -10,8 +10,8 @@ pub enum Foo { A, - B(int), - C { a: int }, + B(isize), + C { a: isize }, } impl Foo { diff --git a/src/test/auxiliary/nested_item.rs b/src/test/auxiliary/nested_item.rs index fc1bea5a9fd..63639c4cdb3 100644 --- a/src/test/auxiliary/nested_item.rs +++ b/src/test/auxiliary/nested_item.rs @@ -9,9 +9,9 @@ // except according to those terms. // original problem -pub fn foo() -> int { +pub fn foo() -> isize { { - static foo: int = 2; + static foo: isize = 2; foo } } @@ -20,7 +20,7 @@ pub fn foo() -> int { struct Foo; impl Foo { pub fn foo(&self) { - static X: uint = 1; + static X: usize = 1; } } @@ -35,6 +35,6 @@ impl> Parser { struct Bar; impl Foo { pub fn bar(&self) { - static X: uint = 1; + static X: usize = 1; } } diff --git a/src/test/auxiliary/newtype_struct_xc.rs b/src/test/auxiliary/newtype_struct_xc.rs index acd5ef0953e..be3414b7ad2 100644 --- a/src/test/auxiliary/newtype_struct_xc.rs +++ b/src/test/auxiliary/newtype_struct_xc.rs @@ -10,4 +10,4 @@ #![crate_type="lib"] -pub struct Au(pub int); +pub struct Au(pub isize); diff --git a/src/test/auxiliary/noexporttypelib.rs b/src/test/auxiliary/noexporttypelib.rs index 94b079b1dcf..5ae8e0d298e 100644 --- a/src/test/auxiliary/noexporttypelib.rs +++ b/src/test/auxiliary/noexporttypelib.rs @@ -8,5 +8,5 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub type oint = Option; +pub type oint = Option; pub fn foo() -> oint { Some(3) } diff --git a/src/test/auxiliary/plugin_crate_outlive_expansion_phase.rs b/src/test/auxiliary/plugin_crate_outlive_expansion_phase.rs index 6f5f5047548..5d93c131cad 100644 --- a/src/test/auxiliary/plugin_crate_outlive_expansion_phase.rs +++ b/src/test/auxiliary/plugin_crate_outlive_expansion_phase.rs @@ -20,7 +20,7 @@ use std::cell::RefCell; use rustc::plugin::Registry; struct Foo { - foo: int + foo: isize } impl Drop for Foo { diff --git a/src/test/auxiliary/priv-impl-prim-ty.rs b/src/test/auxiliary/priv-impl-prim-ty.rs index 8c07dd5b785..19cdede5518 100644 --- a/src/test/auxiliary/priv-impl-prim-ty.rs +++ b/src/test/auxiliary/priv-impl-prim-ty.rs @@ -12,7 +12,7 @@ pub trait A { fn frob(&self); } -impl A for int { fn frob(&self) {} } +impl A for isize { fn frob(&self) {} } pub fn frob(t: T) { t.frob(); diff --git a/src/test/auxiliary/privacy_tuple_struct.rs b/src/test/auxiliary/privacy_tuple_struct.rs index 2fb9d9923cb..141b6bdd604 100644 --- a/src/test/auxiliary/privacy_tuple_struct.rs +++ b/src/test/auxiliary/privacy_tuple_struct.rs @@ -9,6 +9,6 @@ // except according to those terms. pub struct A(()); -pub struct B(int); -pub struct C(pub int, int); -pub struct D(pub int); +pub struct B(isize); +pub struct C(pub isize, isize); +pub struct D(pub isize); diff --git a/src/test/auxiliary/pub_use_xcrate1.rs b/src/test/auxiliary/pub_use_xcrate1.rs index 8e1e591d94f..41aafd64cb3 100644 --- a/src/test/auxiliary/pub_use_xcrate1.rs +++ b/src/test/auxiliary/pub_use_xcrate1.rs @@ -9,5 +9,5 @@ // except according to those terms. pub struct Foo { - pub name: int + pub name: isize } diff --git a/src/test/auxiliary/reexported_static_methods.rs b/src/test/auxiliary/reexported_static_methods.rs index 3bad76f0e70..cc4db1a9581 100644 --- a/src/test/auxiliary/reexported_static_methods.rs +++ b/src/test/auxiliary/reexported_static_methods.rs @@ -17,8 +17,8 @@ pub trait Bar { fn bar() -> Self; } -impl Bar for int { - fn bar() -> int { 84 } +impl Bar for isize { + fn bar() -> isize { 84 } } pub mod sub_foo { @@ -26,8 +26,8 @@ pub mod sub_foo { fn foo() -> Self; } - impl Foo for int { - fn foo() -> int { 42 } + impl Foo for isize { + fn foo() -> isize { 42 } } pub struct Boz { @@ -35,7 +35,7 @@ pub mod sub_foo { } impl Boz { - pub fn boz(i: int) -> bool { + pub fn boz(i: isize) -> bool { i > 0 } } diff --git a/src/test/auxiliary/regions_bounded_method_type_parameters_cross_crate_lib.rs b/src/test/auxiliary/regions_bounded_method_type_parameters_cross_crate_lib.rs index 9c0716e2cc2..f49ac4fc8e4 100644 --- a/src/test/auxiliary/regions_bounded_method_type_parameters_cross_crate_lib.rs +++ b/src/test/auxiliary/regions_bounded_method_type_parameters_cross_crate_lib.rs @@ -12,12 +12,12 @@ // scenario work. This is the library portion of the test. pub enum MaybeOwned<'a> { - Owned(int), - Borrowed(&'a int) + Owned(isize), + Borrowed(&'a isize) } pub struct Inv<'a> { // invariant w/r/t 'a - x: &'a mut &'a int + x: &'a mut &'a isize } // I encountered a bug at some point with encoding the IntoMaybeOwned diff --git a/src/test/auxiliary/roman_numerals.rs b/src/test/auxiliary/roman_numerals.rs index a105cb7ae6c..72bd49b7b90 100644 --- a/src/test/auxiliary/roman_numerals.rs +++ b/src/test/auxiliary/roman_numerals.rs @@ -32,7 +32,7 @@ use rustc::plugin::Registry; fn expand_rn(cx: &mut ExtCtxt, sp: Span, args: &[TokenTree]) -> Box { - static NUMERALS: &'static [(&'static str, uint)] = &[ + static NUMERALS: &'static [(&'static str, usize)] = &[ ("M", 1000), ("CM", 900), ("D", 500), ("CD", 400), ("C", 100), ("XC", 90), ("L", 50), ("XL", 40), ("X", 10), ("IX", 9), ("V", 5), ("IV", 4), diff --git a/src/test/auxiliary/sepcomp-extern-lib.rs b/src/test/auxiliary/sepcomp-extern-lib.rs index 8f5d3b5768a..72f1f73a81b 100644 --- a/src/test/auxiliary/sepcomp-extern-lib.rs +++ b/src/test/auxiliary/sepcomp-extern-lib.rs @@ -9,6 +9,6 @@ // except according to those terms. #[no_mangle] -pub extern "C" fn foo() -> uint { +pub extern "C" fn foo() -> usize { 1234 } diff --git a/src/test/auxiliary/sepcomp_cci_lib.rs b/src/test/auxiliary/sepcomp_cci_lib.rs index 1cb7ead2cff..d62b9871402 100644 --- a/src/test/auxiliary/sepcomp_cci_lib.rs +++ b/src/test/auxiliary/sepcomp_cci_lib.rs @@ -9,9 +9,9 @@ // except according to those terms. #[inline] -pub fn cci_fn() -> uint { +pub fn cci_fn() -> usize { 1200 } #[inline] -pub static CCI_STATIC: uint = 34; +pub static CCI_STATIC: usize = 34; diff --git a/src/test/auxiliary/sepcomp_lib.rs b/src/test/auxiliary/sepcomp_lib.rs index d1d9e3b8ff3..9aa16fb2694 100644 --- a/src/test/auxiliary/sepcomp_lib.rs +++ b/src/test/auxiliary/sepcomp_lib.rs @@ -11,13 +11,13 @@ // compile-flags: -C codegen-units=3 --crate-type=rlib,dylib pub mod a { - pub fn one() -> uint { + pub fn one() -> usize { 1 } } pub mod b { - pub fn two() -> uint { + pub fn two() -> usize { 2 } } @@ -25,7 +25,7 @@ pub mod b { pub mod c { use a::one; use b::two; - pub fn three() -> uint { + pub fn three() -> usize { one() + two() } } diff --git a/src/test/auxiliary/static-function-pointer-aux.rs b/src/test/auxiliary/static-function-pointer-aux.rs index 27befee6f07..38ea619286e 100644 --- a/src/test/auxiliary/static-function-pointer-aux.rs +++ b/src/test/auxiliary/static-function-pointer-aux.rs @@ -10,7 +10,7 @@ #![crate_name="static-function-pointer-aux"] -pub fn f(x: int) -> int { -x } +pub fn f(x: isize) -> isize { -x } -pub static F: fn(int) -> int = f; -pub static mut MutF: fn(int) -> int = f; +pub static F: fn(isize) -> isize = f; +pub static mut MutF: fn(isize) -> isize = f; diff --git a/src/test/auxiliary/static_fn_inline_xc_aux.rs b/src/test/auxiliary/static_fn_inline_xc_aux.rs index 0cbd4378490..2193e12bceb 100644 --- a/src/test/auxiliary/static_fn_inline_xc_aux.rs +++ b/src/test/auxiliary/static_fn_inline_xc_aux.rs @@ -11,13 +11,13 @@ pub mod num { pub trait Num2 { - fn from_int2(n: int) -> Self; + fn from_int2(n: isize) -> Self; } } pub mod f64 { impl ::num::Num2 for f64 { #[inline] - fn from_int2(n: int) -> f64 { return n as f64; } + fn from_int2(n: isize) -> f64 { return n as f64; } } } diff --git a/src/test/auxiliary/static_fn_trait_xc_aux.rs b/src/test/auxiliary/static_fn_trait_xc_aux.rs index 8785a8085dc..44e875fbe3c 100644 --- a/src/test/auxiliary/static_fn_trait_xc_aux.rs +++ b/src/test/auxiliary/static_fn_trait_xc_aux.rs @@ -10,12 +10,12 @@ pub mod num { pub trait Num2 { - fn from_int2(n: int) -> Self; + fn from_int2(n: isize) -> Self; } } pub mod f64 { impl ::num::Num2 for f64 { - fn from_int2(n: int) -> f64 { return n as f64; } + fn from_int2(n: isize) -> f64 { return n as f64; } } } diff --git a/src/test/auxiliary/static_mut_xc.rs b/src/test/auxiliary/static_mut_xc.rs index 5660fd5b61f..9d677e3dc46 100644 --- a/src/test/auxiliary/static_mut_xc.rs +++ b/src/test/auxiliary/static_mut_xc.rs @@ -8,4 +8,4 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub static mut a: int = 3; +pub static mut a: isize = 3; diff --git a/src/test/auxiliary/static_priv_by_default.rs b/src/test/auxiliary/static_priv_by_default.rs index 6951ed729b2..859f38e809f 100644 --- a/src/test/auxiliary/static_priv_by_default.rs +++ b/src/test/auxiliary/static_priv_by_default.rs @@ -10,8 +10,8 @@ #![crate_type = "lib"] -static private: int = 0; -pub static public: int = 0; +static private: isize = 0; +pub static public: isize = 0; pub struct A(()); @@ -20,11 +20,11 @@ impl A { } mod foo { - pub static a: int = 0; + pub static a: isize = 0; pub fn b() {} pub struct c; pub enum d {} - pub type e = int; + pub type e = isize; pub struct A(()); @@ -33,11 +33,11 @@ mod foo { } // these are public so the parent can reexport them. - pub static reexported_a: int = 0; + pub static reexported_a: isize = 0; pub fn reexported_b() {} pub struct reexported_c; pub enum reexported_d {} - pub type reexported_e = int; + pub type reexported_e = isize; } pub mod bar { @@ -48,14 +48,14 @@ pub mod bar { pub use foo::reexported_e as i; } -pub static a: int = 0; +pub static a: isize = 0; pub fn b() {} pub struct c; pub enum d {} -pub type e = int; +pub type e = isize; -static j: int = 0; +static j: isize = 0; fn k() {} struct l; enum m {} -type n = int; +type n = isize; diff --git a/src/test/auxiliary/struct_destructuring_cross_crate.rs b/src/test/auxiliary/struct_destructuring_cross_crate.rs index 3f386ab55d5..26941b726d4 100644 --- a/src/test/auxiliary/struct_destructuring_cross_crate.rs +++ b/src/test/auxiliary/struct_destructuring_cross_crate.rs @@ -11,6 +11,6 @@ #![crate_type="lib"] pub struct S { - pub x: int, - pub y: int, + pub x: isize, + pub y: isize, } diff --git a/src/test/auxiliary/struct_field_privacy.rs b/src/test/auxiliary/struct_field_privacy.rs index e2c16ae8b5c..fe1dc9d1c8c 100644 --- a/src/test/auxiliary/struct_field_privacy.rs +++ b/src/test/auxiliary/struct_field_privacy.rs @@ -9,11 +9,11 @@ // except according to those terms. struct A { - a: int, - pub b: int, + a: isize, + pub b: isize, } pub struct B { - pub a: int, - b: int, + pub a: isize, + b: isize, } diff --git a/src/test/auxiliary/struct_variant_privacy.rs b/src/test/auxiliary/struct_variant_privacy.rs index 8d9b304aa51..40868fa3f70 100644 --- a/src/test/auxiliary/struct_variant_privacy.rs +++ b/src/test/auxiliary/struct_variant_privacy.rs @@ -9,5 +9,5 @@ // except according to those terms. enum Bar { - Baz { a: int } + Baz { a: isize } } diff --git a/src/test/auxiliary/svh-a-base.rs b/src/test/auxiliary/svh-a-base.rs index 6d4ea499b2b..7e10d2158ed 100644 --- a/src/test/auxiliary/svh-a-base.rs +++ b/src/test/auxiliary/svh-a-base.rs @@ -27,12 +27,12 @@ pub trait V : MarkerTrait {} impl U for () {} impl V for () {} -static A_CONSTANT : int = 2; +static A_CONSTANT : isize = 2; -pub fn foo(_: int) -> int { +pub fn foo(_: isize) -> isize { 3 } -pub fn an_unused_name() -> int { +pub fn an_unused_name() -> isize { 4 } diff --git a/src/test/auxiliary/svh-a-change-lit.rs b/src/test/auxiliary/svh-a-change-lit.rs index 61e4aaf3258..c5f38805511 100644 --- a/src/test/auxiliary/svh-a-change-lit.rs +++ b/src/test/auxiliary/svh-a-change-lit.rs @@ -27,12 +27,12 @@ pub trait V : MarkerTrait {} impl U for () {} impl V for () {} -static A_CONSTANT : int = 2; +static A_CONSTANT : isize = 2; -pub fn foo(_: int) -> int { +pub fn foo(_: isize) -> isize { 0 } -pub fn an_unused_name() -> int { +pub fn an_unused_name() -> isize { 4 } diff --git a/src/test/auxiliary/svh-a-change-significant-cfg.rs b/src/test/auxiliary/svh-a-change-significant-cfg.rs index cfdb0902b5d..3168e747eb6 100644 --- a/src/test/auxiliary/svh-a-change-significant-cfg.rs +++ b/src/test/auxiliary/svh-a-change-significant-cfg.rs @@ -27,14 +27,14 @@ pub trait V : MarkerTrait {} impl U for () {} impl V for () {} -static A_CONSTANT : int = 2; +static A_CONSTANT : isize = 2; #[cfg(some_flag)] -pub fn foo(_: int) -> int { +pub fn foo(_: isize) -> isize { 3 } #[cfg(not(some_flag))] -pub fn an_unused_name() -> int { +pub fn an_unused_name() -> isize { 4 } diff --git a/src/test/auxiliary/svh-a-change-trait-bound.rs b/src/test/auxiliary/svh-a-change-trait-bound.rs index e79738c0410..f86a43494f7 100644 --- a/src/test/auxiliary/svh-a-change-trait-bound.rs +++ b/src/test/auxiliary/svh-a-change-trait-bound.rs @@ -27,12 +27,12 @@ pub trait V : MarkerTrait {} impl U for () {} impl V for () {} -static A_CONSTANT : int = 2; +static A_CONSTANT : isize = 2; -pub fn foo(_: int) -> int { +pub fn foo(_: isize) -> isize { 3 } -pub fn an_unused_name() -> int { +pub fn an_unused_name() -> isize { 4 } diff --git a/src/test/auxiliary/svh-a-change-type-arg.rs b/src/test/auxiliary/svh-a-change-type-arg.rs index b22d553c02b..dc412b70044 100644 --- a/src/test/auxiliary/svh-a-change-type-arg.rs +++ b/src/test/auxiliary/svh-a-change-type-arg.rs @@ -27,12 +27,12 @@ pub trait V : MarkerTrait {} impl U for () {} impl V for () {} -static A_CONSTANT : int = 2; +static A_CONSTANT : isize = 2; -pub fn foo(_: i32) -> int { +pub fn foo(_: i32) -> isize { 3 } -pub fn an_unused_name() -> int { +pub fn an_unused_name() -> isize { 4 } diff --git a/src/test/auxiliary/svh-a-change-type-ret.rs b/src/test/auxiliary/svh-a-change-type-ret.rs index 78dbdc28b9f..0cfcbbb0554 100644 --- a/src/test/auxiliary/svh-a-change-type-ret.rs +++ b/src/test/auxiliary/svh-a-change-type-ret.rs @@ -27,9 +27,9 @@ pub trait V : MarkerTrait {} impl U for () {} impl V for () {} -static A_CONSTANT : int = 2; +static A_CONSTANT : isize = 2; -pub fn foo(_: int) -> i64 { +pub fn foo(_: isize) -> i64 { 3 } diff --git a/src/test/auxiliary/svh-a-change-type-static.rs b/src/test/auxiliary/svh-a-change-type-static.rs index 30592827039..e1e32095b5c 100644 --- a/src/test/auxiliary/svh-a-change-type-static.rs +++ b/src/test/auxiliary/svh-a-change-type-static.rs @@ -29,10 +29,10 @@ impl V for () {} static A_CONSTANT : i32 = 2; -pub fn foo(_: int) -> int { +pub fn foo(_: isize) -> isize { 3 } -pub fn an_unused_name() -> int { +pub fn an_unused_name() -> isize { 4 } diff --git a/src/test/auxiliary/svh-a-comment.rs b/src/test/auxiliary/svh-a-comment.rs index 4c457b099a4..9fd97376b66 100644 --- a/src/test/auxiliary/svh-a-comment.rs +++ b/src/test/auxiliary/svh-a-comment.rs @@ -27,13 +27,13 @@ pub trait V : MarkerTrait {} impl U for () {} impl V for () {} -static A_CONSTANT : int = 2; +static A_CONSTANT : isize = 2; -pub fn foo(_: int) -> int { +pub fn foo(_: isize) -> isize { // a comment does not affect the svh 3 } -pub fn an_unused_name() -> int { +pub fn an_unused_name() -> isize { 4 } diff --git a/src/test/auxiliary/svh-a-doc.rs b/src/test/auxiliary/svh-a-doc.rs index cab25ac9e4f..e64bde096b0 100644 --- a/src/test/auxiliary/svh-a-doc.rs +++ b/src/test/auxiliary/svh-a-doc.rs @@ -27,15 +27,15 @@ pub trait V : MarkerTrait {} impl U for () {} impl V for () {} -static A_CONSTANT : int = 2; +static A_CONSTANT : isize = 2; // Adding some documentation does not affect the svh. /// foo always returns three. -pub fn foo(_: int) -> int { +pub fn foo(_: isize) -> isize { 3 } -pub fn an_unused_name() -> int { +pub fn an_unused_name() -> isize { 4 } diff --git a/src/test/auxiliary/svh-a-macro.rs b/src/test/auxiliary/svh-a-macro.rs index 01926dc8abc..b16338f1e12 100644 --- a/src/test/auxiliary/svh-a-macro.rs +++ b/src/test/auxiliary/svh-a-macro.rs @@ -27,14 +27,14 @@ pub trait V : MarkerTrait {} impl U for () {} impl V for () {} -static A_CONSTANT : int = 2; +static A_CONSTANT : isize = 2; -pub fn foo(_: int) -> int { +pub fn foo(_: isize) -> isize { // a macro invocation in a function body does not affect the svh, // as long as it yields the same code. three!() } -pub fn an_unused_name() -> int { +pub fn an_unused_name() -> isize { 4 } diff --git a/src/test/auxiliary/svh-a-no-change.rs b/src/test/auxiliary/svh-a-no-change.rs index 6d4ea499b2b..7e10d2158ed 100644 --- a/src/test/auxiliary/svh-a-no-change.rs +++ b/src/test/auxiliary/svh-a-no-change.rs @@ -27,12 +27,12 @@ pub trait V : MarkerTrait {} impl U for () {} impl V for () {} -static A_CONSTANT : int = 2; +static A_CONSTANT : isize = 2; -pub fn foo(_: int) -> int { +pub fn foo(_: isize) -> isize { 3 } -pub fn an_unused_name() -> int { +pub fn an_unused_name() -> isize { 4 } diff --git a/src/test/auxiliary/svh-a-redundant-cfg.rs b/src/test/auxiliary/svh-a-redundant-cfg.rs index f3a31df94b3..8cadd7bdf41 100644 --- a/src/test/auxiliary/svh-a-redundant-cfg.rs +++ b/src/test/auxiliary/svh-a-redundant-cfg.rs @@ -27,14 +27,14 @@ pub trait V : MarkerTrait {} impl U for () {} impl V for () {} -static A_CONSTANT : int = 2; +static A_CONSTANT : isize = 2; // cfg attribute does not affect the svh, as long as it yields the same code. #[cfg(not(an_unused_name))] -pub fn foo(_: int) -> int { +pub fn foo(_: isize) -> isize { 3 } -pub fn an_unused_name() -> int { +pub fn an_unused_name() -> isize { 4 } diff --git a/src/test/auxiliary/svh-a-whitespace.rs b/src/test/auxiliary/svh-a-whitespace.rs index bec6b207c07..fcaf7790955 100644 --- a/src/test/auxiliary/svh-a-whitespace.rs +++ b/src/test/auxiliary/svh-a-whitespace.rs @@ -27,14 +27,14 @@ pub trait V : MarkerTrait {} impl U for () {} impl V for () {} -static A_CONSTANT : int = 2; +static A_CONSTANT : isize = 2; -pub fn foo(_: int) -> int { +pub fn foo(_: isize) -> isize { 3 } -pub fn an_unused_name() -> int { +pub fn an_unused_name() -> isize { 4 } diff --git a/src/test/auxiliary/svh-uta-base.rs b/src/test/auxiliary/svh-uta-base.rs index 67fdac5df03..6bd3ddab06c 100644 --- a/src/test/auxiliary/svh-uta-base.rs +++ b/src/test/auxiliary/svh-uta-base.rs @@ -18,14 +18,14 @@ #![crate_name = "uta"] mod traits { - pub trait TraitA { fn val(&self) -> int { 2 } } - pub trait TraitB { fn val(&self) -> int { 3 } } + pub trait TraitA { fn val(&self) -> isize { 2 } } + pub trait TraitB { fn val(&self) -> isize { 3 } } } impl traits::TraitA for () {} impl traits::TraitB for () {} -pub fn foo(_: int) -> int { +pub fn foo(_: isize) -> isize { use traits::TraitA; let v = (); v.val() diff --git a/src/test/auxiliary/svh-uta-change-use-trait.rs b/src/test/auxiliary/svh-uta-change-use-trait.rs index dfcf02c0ff5..e8634168177 100644 --- a/src/test/auxiliary/svh-uta-change-use-trait.rs +++ b/src/test/auxiliary/svh-uta-change-use-trait.rs @@ -18,14 +18,14 @@ #![crate_name = "uta"] mod traits { - pub trait TraitA { fn val(&self) -> int { 2 } } - pub trait TraitB { fn val(&self) -> int { 3 } } + pub trait TraitA { fn val(&self) -> isize { 2 } } + pub trait TraitB { fn val(&self) -> isize { 3 } } } impl traits::TraitA for () {} impl traits::TraitB for () {} -pub fn foo(_: int) -> int { +pub fn foo(_: isize) -> isize { use traits::TraitB; let v = (); v.val() diff --git a/src/test/auxiliary/syntax_extension_with_dll_deps_1.rs b/src/test/auxiliary/syntax_extension_with_dll_deps_1.rs index 338e04fbb07..fadeb024405 100644 --- a/src/test/auxiliary/syntax_extension_with_dll_deps_1.rs +++ b/src/test/auxiliary/syntax_extension_with_dll_deps_1.rs @@ -12,6 +12,6 @@ #![crate_type = "dylib"] -pub fn the_answer() -> int { +pub fn the_answer() -> isize { 2 } diff --git a/src/test/auxiliary/trait_bounds_on_structs_and_enums_xc.rs b/src/test/auxiliary/trait_bounds_on_structs_and_enums_xc.rs index beee83f9f7c..29cb0bc176a 100644 --- a/src/test/auxiliary/trait_bounds_on_structs_and_enums_xc.rs +++ b/src/test/auxiliary/trait_bounds_on_structs_and_enums_xc.rs @@ -17,7 +17,7 @@ pub struct Foo { } pub enum Bar { - ABar(int), + ABar(isize), BBar(T), - CBar(uint), + CBar(usize), } diff --git a/src/test/auxiliary/trait_default_method_xc_aux.rs b/src/test/auxiliary/trait_default_method_xc_aux.rs index 7424c21be3d..93da8862cf0 100644 --- a/src/test/auxiliary/trait_default_method_xc_aux.rs +++ b/src/test/auxiliary/trait_default_method_xc_aux.rs @@ -10,22 +10,22 @@ #![crate_name="trait_default_method_xc_aux"] -pub struct Something { pub x: int } +pub struct Something { pub x: isize } pub trait A { - fn f(&self) -> int; - fn g(&self) -> int { 10 } - fn h(&self) -> int { 11 } - fn lurr(x: &Self, y: &Self) -> int { x.g() + y.h() } + fn f(&self) -> isize; + fn g(&self) -> isize { 10 } + fn h(&self) -> isize { 11 } + fn lurr(x: &Self, y: &Self) -> isize { x.g() + y.h() } } -impl A for int { - fn f(&self) -> int { 10 } +impl A for isize { + fn f(&self) -> isize { 10 } } impl A for Something { - fn f(&self) -> int { 10 } + fn f(&self) -> isize { 10 } } pub trait B { @@ -33,7 +33,7 @@ pub trait B { fn staticthing(_z: &Self, x: T, y: U) -> (T, U) { (x, y) } } -impl B for int { } +impl B for isize { } impl B for bool { } @@ -45,8 +45,8 @@ pub trait TestEquality { } } -impl TestEquality for int { - fn test_eq(&self, rhs: &int) -> bool { +impl TestEquality for isize { + fn test_eq(&self, rhs: &isize) -> bool { *self == *rhs } } diff --git a/src/test/auxiliary/trait_default_method_xc_aux_2.rs b/src/test/auxiliary/trait_default_method_xc_aux_2.rs index 4239865d577..3ae9640e35d 100644 --- a/src/test/auxiliary/trait_default_method_xc_aux_2.rs +++ b/src/test/auxiliary/trait_default_method_xc_aux_2.rs @@ -13,10 +13,10 @@ extern crate "trait_default_method_xc_aux" as aux; use aux::A; -pub struct a_struct { pub x: int } +pub struct a_struct { pub x: isize } impl A for a_struct { - fn f(&self) -> int { 10 } + fn f(&self) -> isize { 10 } } // This function will need to get inlined, and badness may result. diff --git a/src/test/auxiliary/trait_impl_conflict.rs b/src/test/auxiliary/trait_impl_conflict.rs index 4a4de2455e3..0adedfd4eeb 100644 --- a/src/test/auxiliary/trait_impl_conflict.rs +++ b/src/test/auxiliary/trait_impl_conflict.rs @@ -13,5 +13,5 @@ pub trait Foo : ::std::marker::MarkerTrait { } -impl Foo for int { +impl Foo for isize { } diff --git a/src/test/auxiliary/trait_inheritance_auto_xc_2_aux.rs b/src/test/auxiliary/trait_inheritance_auto_xc_2_aux.rs index 9ef53795a26..af0128d9676 100644 --- a/src/test/auxiliary/trait_inheritance_auto_xc_2_aux.rs +++ b/src/test/auxiliary/trait_inheritance_auto_xc_2_aux.rs @@ -8,12 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub trait Foo { fn f(&self) -> int; } -pub trait Bar { fn g(&self) -> int; } -pub trait Baz { fn h(&self) -> int; } +pub trait Foo { fn f(&self) -> isize; } +pub trait Bar { fn g(&self) -> isize; } +pub trait Baz { fn h(&self) -> isize; } -pub struct A { pub x: int } +pub struct A { pub x: isize } -impl Foo for A { fn f(&self) -> int { 10 } } -impl Bar for A { fn g(&self) -> int { 20 } } -impl Baz for A { fn h(&self) -> int { 30 } } +impl Foo for A { fn f(&self) -> isize { 10 } } +impl Bar for A { fn g(&self) -> isize { 20 } } +impl Baz for A { fn h(&self) -> isize { 30 } } diff --git a/src/test/auxiliary/trait_inheritance_auto_xc_aux.rs b/src/test/auxiliary/trait_inheritance_auto_xc_aux.rs index 59fdaed744e..6be1f8c45f4 100644 --- a/src/test/auxiliary/trait_inheritance_auto_xc_aux.rs +++ b/src/test/auxiliary/trait_inheritance_auto_xc_aux.rs @@ -8,9 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub trait Foo { fn f(&self) -> int; } -pub trait Bar { fn g(&self) -> int; } -pub trait Baz { fn h(&self) -> int; } +pub trait Foo { fn f(&self) -> isize; } +pub trait Bar { fn g(&self) -> isize; } +pub trait Baz { fn h(&self) -> isize; } pub trait Quux: Foo + Bar + Baz { } diff --git a/src/test/auxiliary/trait_inheritance_cross_trait_call_xc_aux.rs b/src/test/auxiliary/trait_inheritance_cross_trait_call_xc_aux.rs index 0a84595124a..9eeb815c5de 100644 --- a/src/test/auxiliary/trait_inheritance_cross_trait_call_xc_aux.rs +++ b/src/test/auxiliary/trait_inheritance_cross_trait_call_xc_aux.rs @@ -10,13 +10,13 @@ pub trait Foo { - fn f(&self) -> int; + fn f(&self) -> isize; } pub struct A { - pub x: int + pub x: isize } impl Foo for A { - fn f(&self) -> int { 10 } + fn f(&self) -> isize { 10 } } diff --git a/src/test/auxiliary/trait_inheritance_overloading_xc.rs b/src/test/auxiliary/trait_inheritance_overloading_xc.rs index 36442ed6c19..1bfada612eb 100644 --- a/src/test/auxiliary/trait_inheritance_overloading_xc.rs +++ b/src/test/auxiliary/trait_inheritance_overloading_xc.rs @@ -16,7 +16,7 @@ pub trait MyNum : Add + Sub + Mul + Parti #[derive(Clone, Debug)] pub struct MyInt { - pub val: int + pub val: isize } impl Add for MyInt { @@ -45,4 +45,4 @@ impl PartialEq for MyInt { impl MyNum for MyInt {} -fn mi(v: int) -> MyInt { MyInt { val: v } } +fn mi(v: isize) -> MyInt { MyInt { val: v } } diff --git a/src/test/auxiliary/trait_safety_lib.rs b/src/test/auxiliary/trait_safety_lib.rs index d5437690acd..585a756fd07 100644 --- a/src/test/auxiliary/trait_safety_lib.rs +++ b/src/test/auxiliary/trait_safety_lib.rs @@ -11,9 +11,9 @@ // Simple smoke test that unsafe traits can be compiled etc. pub unsafe trait Foo { - fn foo(&self) -> int; + fn foo(&self) -> isize; } -unsafe impl Foo for int { - fn foo(&self) -> int { *self } +unsafe impl Foo for isize { + fn foo(&self) -> isize { *self } } diff --git a/src/test/auxiliary/typeid-intrinsic.rs b/src/test/auxiliary/typeid-intrinsic.rs index 82d07a9df4e..8b45b009281 100644 --- a/src/test/auxiliary/typeid-intrinsic.rs +++ b/src/test/auxiliary/typeid-intrinsic.rs @@ -14,12 +14,12 @@ use std::any::TypeId; pub struct A; pub struct B(Option); -pub struct C(Option); +pub struct C(Option); pub struct D(Option<&'static str>); -pub struct E(Result<&'static str, int>); +pub struct E(Result<&'static str, isize>); -pub type F = Option; -pub type G = uint; +pub type F = Option; +pub type G = usize; pub type H = &'static str; pub unsafe fn id_A() -> TypeId { TypeId::of::() } diff --git a/src/test/auxiliary/typeid-intrinsic2.rs b/src/test/auxiliary/typeid-intrinsic2.rs index 82d07a9df4e..8b45b009281 100644 --- a/src/test/auxiliary/typeid-intrinsic2.rs +++ b/src/test/auxiliary/typeid-intrinsic2.rs @@ -14,12 +14,12 @@ use std::any::TypeId; pub struct A; pub struct B(Option); -pub struct C(Option); +pub struct C(Option); pub struct D(Option<&'static str>); -pub struct E(Result<&'static str, int>); +pub struct E(Result<&'static str, isize>); -pub type F = Option; -pub type G = uint; +pub type F = Option; +pub type G = usize; pub type H = &'static str; pub unsafe fn id_A() -> TypeId { TypeId::of::() } diff --git a/src/test/auxiliary/unboxed-closures-cross-crate.rs b/src/test/auxiliary/unboxed-closures-cross-crate.rs index 26925a35067..dac20dd2f7a 100644 --- a/src/test/auxiliary/unboxed-closures-cross-crate.rs +++ b/src/test/auxiliary/unboxed-closures-cross-crate.rs @@ -13,7 +13,7 @@ use std::ops::Add; #[inline] -pub fn has_closures() -> uint { +pub fn has_closures() -> usize { let x = 1; let mut f = move || x; let y = 1; diff --git a/src/test/auxiliary/xc_private_method_lib.rs b/src/test/auxiliary/xc_private_method_lib.rs index 07c99ecefb8..5e7bc61943b 100644 --- a/src/test/auxiliary/xc_private_method_lib.rs +++ b/src/test/auxiliary/xc_private_method_lib.rs @@ -11,7 +11,7 @@ #![crate_type="lib"] pub struct Struct { - pub x: int + pub x: isize } impl Struct { @@ -19,14 +19,14 @@ impl Struct { Struct { x: 1 } } - fn meth_struct(&self) -> int { + fn meth_struct(&self) -> isize { self.x } } pub enum Enum { - Variant1(int), - Variant2(int) + Variant1(isize), + Variant2(isize) } impl Enum { @@ -34,7 +34,7 @@ impl Enum { Enum::Variant2(10) } - fn meth_enum(&self) -> int { + fn meth_enum(&self) -> isize { match *self { Enum::Variant1(x) | Enum::Variant2(x) => x diff --git a/src/test/auxiliary/xcrate_address_insignificant.rs b/src/test/auxiliary/xcrate_address_insignificant.rs index 9e62415a20b..5195839c067 100644 --- a/src/test/auxiliary/xcrate_address_insignificant.rs +++ b/src/test/auxiliary/xcrate_address_insignificant.rs @@ -8,11 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub fn foo() -> int { - static a: int = 3; +pub fn foo() -> isize { + static a: isize = 3; a } -pub fn bar() -> int { - foo::() +pub fn bar() -> isize { + foo::() } diff --git a/src/test/auxiliary/xcrate_static_addresses.rs b/src/test/auxiliary/xcrate_static_addresses.rs index 8065533dd73..652f11a71ec 100644 --- a/src/test/auxiliary/xcrate_static_addresses.rs +++ b/src/test/auxiliary/xcrate_static_addresses.rs @@ -9,22 +9,22 @@ // except according to those terms. #[inline(never)] -pub static global: int = 3; +pub static global: isize = 3; #[inline(never)] -static global0: int = 4; +static global0: isize = 4; #[inline(never)] -pub static global2: &'static int = &global0; +pub static global2: &'static isize = &global0; -pub fn verify_same(a: &'static int) { - let a = a as *const int as uint; - let b = &global as *const int as uint; +pub fn verify_same(a: &'static isize) { + let a = a as *const isize as usize; + let b = &global as *const isize as usize; assert_eq!(a, b); } -pub fn verify_same2(a: &'static int) { - let a = a as *const int as uint; - let b = global2 as *const int as uint; +pub fn verify_same2(a: &'static isize) { + let a = a as *const isize as usize; + let b = global2 as *const isize as usize; assert_eq!(a, b); } diff --git a/src/test/auxiliary/xcrate_struct_aliases.rs b/src/test/auxiliary/xcrate_struct_aliases.rs index 5556ee6971c..334f7829bd1 100644 --- a/src/test/auxiliary/xcrate_struct_aliases.rs +++ b/src/test/auxiliary/xcrate_struct_aliases.rs @@ -9,8 +9,8 @@ // except according to those terms. pub struct S { - pub x: int, - pub y: int, + pub x: isize, + pub y: isize, } pub type S2 = S; diff --git a/src/test/auxiliary/xcrate_unit_struct.rs b/src/test/auxiliary/xcrate_unit_struct.rs index 538abf00a67..6799cbc6f33 100644 --- a/src/test/auxiliary/xcrate_unit_struct.rs +++ b/src/test/auxiliary/xcrate_unit_struct.rs @@ -22,17 +22,17 @@ pub enum Unit { } #[derive(Copy)] -pub struct TupleStruct(pub uint, pub &'static str); +pub struct TupleStruct(pub usize, pub &'static str); // used by the cfail test #[derive(Copy)] pub struct StructWithFields { - foo: int, + foo: isize, } #[derive(Copy)] pub enum EnumWithVariants { EnumVariant, - EnumVariantArg(int) + EnumVariantArg(isize) } diff --git a/src/test/bench/msgsend-pipes-shared.rs b/src/test/bench/msgsend-pipes-shared.rs index fb95f92da77..c7748d59c6a 100644 --- a/src/test/bench/msgsend-pipes-shared.rs +++ b/src/test/bench/msgsend-pipes-shared.rs @@ -29,11 +29,11 @@ fn move_out(_x: T) {} enum request { get_count, - bytes(uint), + bytes(usize), stop } -fn server(requests: &Receiver, responses: &Sender) { +fn server(requests: &Receiver, responses: &Sender) { let mut count = 0; let mut done = false; while !done { @@ -55,8 +55,8 @@ fn run(args: &[String]) { let (to_parent, from_child) = channel(); let (to_child, from_parent) = channel(); - let size = args[1].parse::().unwrap(); - let workers = args[2].parse::().unwrap(); + let size = args[1].parse::().unwrap(); + let workers = args[2].parse::().unwrap(); let num_bytes = 100; let mut result = None; let mut p = Some((to_child, to_parent, from_parent)); diff --git a/src/test/bench/msgsend-pipes.rs b/src/test/bench/msgsend-pipes.rs index 6d702242d76..b6a6e06088a 100644 --- a/src/test/bench/msgsend-pipes.rs +++ b/src/test/bench/msgsend-pipes.rs @@ -23,12 +23,12 @@ use std::time::Duration; enum request { get_count, - bytes(uint), + bytes(usize), stop } -fn server(requests: &Receiver, responses: &Sender) { - let mut count: uint = 0; +fn server(requests: &Receiver, responses: &Sender) { + let mut count: usize = 0; let mut done = false; while !done { match requests.recv() { @@ -48,8 +48,8 @@ fn server(requests: &Receiver, responses: &Sender) { fn run(args: &[String]) { let (to_parent, from_child) = channel(); - let size = args[1].parse::().unwrap(); - let workers = args[2].parse::().unwrap(); + let size = args[1].parse::().unwrap(); + let workers = args[2].parse::().unwrap(); let num_bytes = 100; let mut result = None; let mut to_parent = Some(to_parent); diff --git a/src/test/bench/msgsend-ring-mutex-arcs.rs b/src/test/bench/msgsend-ring-mutex-arcs.rs index 6fb2c954e02..c87cdb617a4 100644 --- a/src/test/bench/msgsend-ring-mutex-arcs.rs +++ b/src/test/bench/msgsend-ring-mutex-arcs.rs @@ -25,15 +25,15 @@ use std::sync::{Arc, Future, Mutex, Condvar}; use std::time::Duration; // A poor man's pipe. -type pipe = Arc<(Mutex>, Condvar)>; +type pipe = Arc<(Mutex>, Condvar)>; -fn send(p: &pipe, msg: uint) { +fn send(p: &pipe, msg: usize) { let &(ref lock, ref cond) = &**p; let mut arr = lock.lock().unwrap(); arr.push(msg); cond.notify_one(); } -fn recv(p: &pipe) -> uint { +fn recv(p: &pipe) -> usize { let &(ref lock, ref cond) = &**p; let mut arr = lock.lock().unwrap(); while arr.is_empty() { @@ -48,7 +48,7 @@ fn init() -> (pipe,pipe) { } -fn thread_ring(i: uint, count: uint, num_chan: pipe, num_port: pipe) { +fn thread_ring(i: usize, count: usize, num_chan: pipe, num_port: pipe) { let mut num_chan = Some(num_chan); let mut num_port = Some(num_port); // Send/Receive lots of messages. @@ -74,8 +74,8 @@ fn main() { args.collect() }; - let num_tasks = args[1].parse::().unwrap(); - let msg_per_task = args[2].parse::().unwrap(); + let num_tasks = args[1].parse::().unwrap(); + let msg_per_task = args[2].parse::().unwrap(); let (num_chan, num_port) = init(); diff --git a/src/test/bench/noise.rs b/src/test/bench/noise.rs index 6cd75836187..c1384b37e09 100644 --- a/src/test/bench/noise.rs +++ b/src/test/bench/noise.rs @@ -61,9 +61,9 @@ impl Noise2DContext { } fn get_gradient(&self, x: i32, y: i32) -> Vec2 { - let idx = self.permutations[(x & 255) as uint] + - self.permutations[(y & 255) as uint]; - self.rgradients[(idx & 255) as uint] + let idx = self.permutations[(x & 255) as usize] + + self.permutations[(y & 255) as usize]; + self.rgradients[(idx & 255) as usize] } fn get_gradients(&self, x: f32, y: f32) -> ([Vec2; 4], [Vec2; 4]) { @@ -117,7 +117,7 @@ fn main() { for y in 0..256 { for x in 0..256 { - let idx = (pixels[y*256+x] / 0.2) as uint; + let idx = (pixels[y*256+x] / 0.2) as usize; print!("{}", symbols[idx]); } print!("\n"); diff --git a/src/test/bench/shootout-chameneos-redux.rs b/src/test/bench/shootout-chameneos-redux.rs index 4a8bb24270d..891d8143dd8 100644 --- a/src/test/bench/shootout-chameneos-redux.rs +++ b/src/test/bench/shootout-chameneos-redux.rs @@ -74,7 +74,7 @@ impl fmt::Debug for Color { #[derive(Copy)] struct CreatureInfo { - name: uint, + name: usize, color: Color } @@ -87,7 +87,7 @@ fn show_color_list(set: Vec) -> String { out } -fn show_digit(nn: uint) -> &'static str { +fn show_digit(nn: usize) -> &'static str { match nn { 0 => {" zero"} 1 => {" one"} @@ -103,7 +103,7 @@ fn show_digit(nn: uint) -> &'static str { } } -struct Number(uint); +struct Number(usize); impl fmt::Debug for Number { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let mut out = vec![]; @@ -139,7 +139,7 @@ fn transform(aa: Color, bb: Color) -> Color { } fn creature( - name: uint, + name: usize, mut color: Color, from_rendezvous: Receiver, to_rendezvous: Sender, @@ -172,7 +172,7 @@ fn creature( to_rendezvous_log.send(report).unwrap(); } -fn rendezvous(nn: uint, set: Vec) { +fn rendezvous(nn: usize, set: Vec) { // these ports will allow us to hear from the creatures let (to_rendezvous, from_creatures) = channel::(); diff --git a/src/test/bench/shootout-fannkuch-redux.rs b/src/test/bench/shootout-fannkuch-redux.rs index e23862f4286..3a1da4c32af 100644 --- a/src/test/bench/shootout-fannkuch-redux.rs +++ b/src/test/bench/shootout-fannkuch-redux.rs @@ -80,7 +80,7 @@ struct Perm { impl Perm { fn new(n: u32) -> Perm { let mut fact = [1; 16]; - for i in 1..n as uint + 1 { + for i in 1..n as usize + 1 { fact[i] = fact[i - 1] * i as u32; } Perm { @@ -99,7 +99,7 @@ impl Perm { *place = i as i32 + 1; } - for i in (1..self.n as uint).rev() { + for i in (1..self.n as usize).rev() { let d = idx / self.fact[i] as i32; self.cnt[i] = d; idx %= self.fact[i] as i32; @@ -107,7 +107,7 @@ impl Perm { *place = (*val) as u8 } - let d = d as uint; + let d = d as usize; for j in 0..i + 1 { self.perm.p[j] = if j + d <= i {pp[j + d]} else {pp[j+d-i-1]} as i32; } @@ -117,7 +117,7 @@ impl Perm { } fn count(&self) -> u32 { self.permcount } - fn max(&self) -> u32 { self.fact[self.n as uint] } + fn max(&self) -> u32 { self.fact[self.n as usize] } fn next(&mut self) -> P { next_permutation(&mut self.perm.p, &mut self.cnt); @@ -128,11 +128,11 @@ impl Perm { } -fn reverse(tperm: &mut [i32], k: uint) { +fn reverse(tperm: &mut [i32], k: usize) { tperm[..k].reverse() } -fn work(mut perm: Perm, n: uint, max: uint) -> (i32, i32) { +fn work(mut perm: Perm, n: usize, max: usize) -> (i32, i32) { let mut checksum = 0; let mut maxflips = 0; @@ -142,7 +142,7 @@ fn work(mut perm: Perm, n: uint, max: uint) -> (i32, i32) { let mut flips = 0; while p.p[0] != 1 { - let k = p.p[0] as uint; + let k = p.p[0] as usize; reverse(&mut p.p, k); flips += 1; } @@ -167,7 +167,7 @@ fn fannkuch(n: i32) -> (i32, i32) { let max = cmp::min(j+k, perm.max()); futures.push(thread::scoped(move|| { - work(perm, j as uint, max as uint) + work(perm, j as usize, max as usize) })) } diff --git a/src/test/bench/shootout-k-nucleotide-pipes.rs b/src/test/bench/shootout-k-nucleotide-pipes.rs index ebdc60cdd2b..de1d0103657 100644 --- a/src/test/bench/shootout-k-nucleotide-pipes.rs +++ b/src/test/bench/shootout-k-nucleotide-pipes.rs @@ -42,8 +42,8 @@ fn f64_cmp(x: f64, y: f64) -> Ordering { } // given a map, print a sorted version of it -fn sort_and_fmt(mm: &HashMap , uint>, total: uint) -> String { - fn pct(xx: uint, yy: uint) -> f64 { +fn sort_and_fmt(mm: &HashMap , usize>, total: usize) -> String { + fn pct(xx: usize, yy: usize) -> f64 { return (xx as f64) * 100.0 / (yy as f64); } @@ -74,7 +74,7 @@ fn sort_and_fmt(mm: &HashMap , uint>, total: uint) -> String { } // given a map, search for the frequency of a pattern -fn find(mm: &HashMap , uint>, key: String) -> uint { +fn find(mm: &HashMap , usize>, key: String) -> usize { let key = key.into_ascii_lowercase(); match mm.get(key.as_bytes()) { option::Option::None => { return 0; } @@ -83,7 +83,7 @@ fn find(mm: &HashMap , uint>, key: String) -> uint { } // given a map, increment the counter for a key -fn update_freq(mm: &mut HashMap , uint>, key: &[u8]) { +fn update_freq(mm: &mut HashMap , usize>, key: &[u8]) { let key = key.to_vec(); let newval = match mm.remove(&key) { Some(v) => v + 1, @@ -95,7 +95,7 @@ fn update_freq(mm: &mut HashMap , uint>, key: &[u8]) { // given a Vec, for each window call a function // i.e., for "hello" and windows of size four, // run it("hell") and it("ello"), then return "llo" -fn windows_with_carry(bb: &[u8], nn: uint, mut it: F) -> Vec where +fn windows_with_carry(bb: &[u8], nn: usize, mut it: F) -> Vec where F: FnMut(&[u8]), { let mut ii = 0; @@ -109,12 +109,12 @@ fn windows_with_carry(bb: &[u8], nn: uint, mut it: F) -> Vec where return bb[len - (nn - 1)..len].to_vec(); } -fn make_sequence_processor(sz: uint, +fn make_sequence_processor(sz: usize, from_parent: &Receiver>, to_parent: &Sender) { - let mut freqs: HashMap, uint> = HashMap::new(); + let mut freqs: HashMap, usize> = HashMap::new(); let mut carry = Vec::new(); - let mut total: uint = 0; + let mut total: usize = 0; let mut line: Vec; diff --git a/src/test/bench/shootout-nbody.rs b/src/test/bench/shootout-nbody.rs index 3748b65dacb..13154e025d2 100644 --- a/src/test/bench/shootout-nbody.rs +++ b/src/test/bench/shootout-nbody.rs @@ -45,7 +45,7 @@ use std::num::Float; const PI: f64 = 3.141592653589793; const SOLAR_MASS: f64 = 4.0 * PI * PI; const YEAR: f64 = 365.24; -const N_BODIES: uint = 5; +const N_BODIES: usize = 5; static BODIES: [Planet;N_BODIES] = [ // Sun @@ -103,7 +103,7 @@ struct Planet { mass: f64, } -fn advance(bodies: &mut [Planet;N_BODIES], dt: f64, steps: int) { +fn advance(bodies: &mut [Planet;N_BODIES], dt: f64, steps: isize) { for _ in 0..steps { let mut b_slice: &mut [_] = bodies; loop { diff --git a/src/test/bench/shootout-pfib.rs b/src/test/bench/shootout-pfib.rs index 4d9bc951fa3..ed20f4b6362 100644 --- a/src/test/bench/shootout-pfib.rs +++ b/src/test/bench/shootout-pfib.rs @@ -77,7 +77,7 @@ fn stress_task(id: isize) { } } -fn stress(num_tasks: int) { +fn stress(num_tasks: isize) { let mut results = Vec::new(); for i in 0..num_tasks { results.push(thread::spawn(move|| { diff --git a/src/test/bench/shootout-reverse-complement.rs b/src/test/bench/shootout-reverse-complement.rs index 8235b013a81..82ea234f6dd 100644 --- a/src/test/bench/shootout-reverse-complement.rs +++ b/src/test/bench/shootout-reverse-complement.rs @@ -92,12 +92,12 @@ impl Tables { /// Retrieves the complement for `i`. fn cpl8(&self, i: u8) -> u8 { - self.table8[i as uint] + self.table8[i as usize] } /// Retrieves the complement for `i`. fn cpl16(&self, i: u16) -> u16 { - self.table16[i as uint] + self.table16[i as usize] } } @@ -107,7 +107,7 @@ fn read_to_end(r: &mut R) -> IoResult> { // Reader::read_to_end() with a fast growing policy to limit // recopies. If MREMAP_RETAIN is implemented in the linux kernel // and jemalloc use it, this trick will become useless. - const CHUNK: uint = 64 * 1024; + const CHUNK: usize = 64 * 1024; let mut vec = Vec::with_capacity(CHUNK); loop { @@ -132,7 +132,7 @@ fn read_to_end(r: &mut R) -> IoResult> { } /// Finds the first position at which `b` occurs in `s`. -fn memchr(h: &[u8], n: u8) -> Option { +fn memchr(h: &[u8], n: u8) -> Option { use libc::{c_void, c_int, size_t}; let res = unsafe { libc::memchr(h.as_ptr() as *const c_void, n as c_int, h.len() as size_t) @@ -140,7 +140,7 @@ fn memchr(h: &[u8], n: u8) -> Option { if res.is_null() { None } else { - Some(res as uint - h.as_ptr() as uint) + Some(res as usize - h.as_ptr() as usize) } } @@ -171,7 +171,7 @@ impl<'a> Iterator for MutDnaSeqs<'a> { } /// Length of a normal line without the terminating \n. -const LINE_LEN: uint = 60; +const LINE_LEN: usize = 60; /// Compute the reverse complement. fn reverse_complement(seq: &mut [u8], tables: &Tables) { @@ -181,8 +181,8 @@ fn reverse_complement(seq: &mut [u8], tables: &Tables) { let mut i = LINE_LEN; while i < len { unsafe { - copy(seq.as_mut_ptr().offset((i - off + 1) as int), - seq.as_ptr().offset((i - off) as int), off); + copy(seq.as_mut_ptr().offset((i - off + 1) as isize), + seq.as_ptr().offset((i - off) as isize), off); *seq.get_unchecked_mut(i - off) = b'\n'; } i += LINE_LEN + 1; @@ -193,8 +193,8 @@ fn reverse_complement(seq: &mut [u8], tables: &Tables) { unsafe { let mut left = seq.as_mut_ptr() as *mut u16; // This is slow if len % 2 != 0 but still faster than bytewise operations. - let mut right = seq.as_mut_ptr().offset(len as int - 2) as *mut u16; - let end = left.offset(div as int); + let mut right = seq.as_mut_ptr().offset(len as isize - 2) as *mut u16; + let end = left.offset(div as isize); while left != end { let tmp = tables.cpl16(*left); *left = tables.cpl16(*right); diff --git a/src/test/bench/shootout-spectralnorm.rs b/src/test/bench/shootout-spectralnorm.rs index 3889b404d85..cd89b822035 100644 --- a/src/test/bench/shootout-spectralnorm.rs +++ b/src/test/bench/shootout-spectralnorm.rs @@ -64,7 +64,7 @@ fn main() { println!("{:.9}", answer); } -fn spectralnorm(n: uint) -> f64 { +fn spectralnorm(n: usize) -> f64 { assert!(n % 2 == 0, "only even lengths are accepted"); let mut u = repeat(1.0).take(n).collect::>(); let mut v = u.clone(); @@ -89,8 +89,8 @@ fn mult_Atv(v: &[f64], out: &mut [f64]) { parallel(out, |start, out| mult(v, out, start, |i, j| A(j, i))); } -fn mult(v: &[f64], out: &mut [f64], start: uint, a: F) - where F: Fn(uint, uint) -> f64 { +fn mult(v: &[f64], out: &mut [f64], start: usize, a: F) + where F: Fn(usize, usize) -> f64 { for (i, slot) in out.iter_mut().enumerate().map(|(i, s)| (i + start, s)) { let mut sum = f64x2(0.0, 0.0); for (j, chunk) in v.chunks(2).enumerate().map(|(j, s)| (2 * j, s)) { @@ -103,7 +103,7 @@ fn mult(v: &[f64], out: &mut [f64], start: uint, a: F) } } -fn A(i: uint, j: uint) -> f64 { +fn A(i: usize, j: usize) -> f64 { ((i + j) * (i + j + 1) / 2 + i + 1) as f64 } @@ -117,7 +117,7 @@ fn dot(v: &[f64], u: &[f64]) -> f64 { // sub-slice of `v`. fn parallel<'a,T, F>(v: &mut [T], ref f: F) where T: Send + Sync + 'a, - F: Fn(uint, &mut [T]) + Sync + 'a { + F: Fn(usize, &mut [T]) + Sync + 'a { let size = v.len() / os::num_cpus() + 1; v.chunks_mut(size).enumerate().map(|(i, chunk)| { thread::scoped(move|| { diff --git a/src/test/bench/task-perf-alloc-unwind.rs b/src/test/bench/task-perf-alloc-unwind.rs index d8f4603ab1a..9eba2c36390 100644 --- a/src/test/bench/task-perf-alloc-unwind.rs +++ b/src/test/bench/task-perf-alloc-unwind.rs @@ -29,7 +29,7 @@ fn main() { run(repeat, depth); } -fn run(repeat: int, depth: int) { +fn run(repeat: isize, depth: isize) { for _ in 0..repeat { let dur = Duration::span(|| { let _ = thread::spawn(move|| { @@ -65,7 +65,7 @@ fn r(l: Box) -> r { } } -fn recurse_or_panic(depth: int, st: Option) { +fn recurse_or_panic(depth: isize, st: Option) { if depth == 0 { panic!(); } else { diff --git a/src/test/bench/task-perf-jargon-metal-smoke.rs b/src/test/bench/task-perf-jargon-metal-smoke.rs index e36d685d7c6..4798e317ac8 100644 --- a/src/test/bench/task-perf-jargon-metal-smoke.rs +++ b/src/test/bench/task-perf-jargon-metal-smoke.rs @@ -21,7 +21,7 @@ use std::sync::mpsc::{channel, Sender}; use std::env; use std::thread; -fn child_generation(gens_left: uint, tx: Sender<()>) { +fn child_generation(gens_left: usize, tx: Sender<()>) { // This used to be O(n^2) in the number of generations that ever existed. // With this code, only as many generations are alive at a time as tasks // alive at a time, diff --git a/src/test/codegen/iterate-over-array.rs b/src/test/codegen/iterate-over-array.rs index b2cbd8821e4..a5b449285ef 100644 --- a/src/test/codegen/iterate-over-array.rs +++ b/src/test/codegen/iterate-over-array.rs @@ -9,7 +9,7 @@ // except according to those terms. #[no_mangle] -pub fn test(x: &[int]) -> int { +pub fn test(x: &[isize]) -> isize { let mut y = 0; let mut i = 0; while (i < x.len()) { diff --git a/src/test/codegen/scalar-function-call.rs b/src/test/codegen/scalar-function-call.rs index b95d6b03288..fe93c864fad 100644 --- a/src/test/codegen/scalar-function-call.rs +++ b/src/test/codegen/scalar-function-call.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn foo(x: int) -> int { +fn foo(x: isize) -> isize { x * x } diff --git a/src/test/codegen/single-return-value.rs b/src/test/codegen/single-return-value.rs index 948809a6326..5addba1724d 100644 --- a/src/test/codegen/single-return-value.rs +++ b/src/test/codegen/single-return-value.rs @@ -9,6 +9,6 @@ // except according to those terms. #[no_mangle] -pub fn test() -> int { +pub fn test() -> isize { 5 } diff --git a/src/test/codegen/small-dense-int-switch.rs b/src/test/codegen/small-dense-int-switch.rs index d75bc5209fd..cf05a2e2f8e 100644 --- a/src/test/codegen/small-dense-int-switch.rs +++ b/src/test/codegen/small-dense-int-switch.rs @@ -9,7 +9,7 @@ // except according to those terms. #[no_mangle] -pub fn test(x: int, y: int) -> int { +pub fn test(x: isize, y: isize) -> isize { match x { 1 => y, 2 => y*2, diff --git a/src/test/codegen/static-method-call-multi.rs b/src/test/codegen/static-method-call-multi.rs index 996d2203824..025f9b524c9 100644 --- a/src/test/codegen/static-method-call-multi.rs +++ b/src/test/codegen/static-method-call-multi.rs @@ -9,11 +9,11 @@ // except according to those terms. pub struct Struct { - field: int + field: isize } impl Struct { - fn method(&self, x: int) -> int { + fn method(&self, x: isize) -> isize { self.field + x } } @@ -23,6 +23,6 @@ pub fn test(a: &Struct, b: &Struct, c: &Struct, d: &Struct, - e: &Struct) -> int { + e: &Struct) -> isize { a.method(b.method(c.method(d.method(e.method(1))))) } diff --git a/src/test/codegen/static-method-call.rs b/src/test/codegen/static-method-call.rs index 9c5894fb97a..fca3784d9e0 100644 --- a/src/test/codegen/static-method-call.rs +++ b/src/test/codegen/static-method-call.rs @@ -9,16 +9,16 @@ // except according to those terms. pub struct Struct { - field: int + field: isize } impl Struct { - fn method(&self) -> int { + fn method(&self) -> isize { self.field } } #[no_mangle] -pub fn test(s: &Struct) -> int { +pub fn test(s: &Struct) -> isize { s.method() } diff --git a/src/test/codegen/virtual-method-call-struct-return.rs b/src/test/codegen/virtual-method-call-struct-return.rs index ff1a611c4ef..ae83409b45f 100644 --- a/src/test/codegen/virtual-method-call-struct-return.rs +++ b/src/test/codegen/virtual-method-call-struct-return.rs @@ -9,7 +9,7 @@ // except according to those terms. pub struct Stuff { - a: int, + a: isize, b: f64 } @@ -18,6 +18,6 @@ pub trait Trait { } #[no_mangle] -pub fn test(t: &Trait) -> int { +pub fn test(t: &Trait) -> isize { t.method().a } diff --git a/src/test/codegen/virtual-method-call.rs b/src/test/codegen/virtual-method-call.rs index 036c0957e99..9bfeef1f018 100644 --- a/src/test/codegen/virtual-method-call.rs +++ b/src/test/codegen/virtual-method-call.rs @@ -9,10 +9,10 @@ // except according to those terms. pub trait Trait { - fn method(&self) -> int; + fn method(&self) -> isize; } #[no_mangle] -pub fn test(t: &Trait) -> int { +pub fn test(t: &Trait) -> isize { t.method() } diff --git a/src/test/compile-fail/feature-gate-int-uint.rs b/src/test/compile-fail/feature-gate-int-uint.rs deleted file mode 100644 index 948e485ccf5..00000000000 --- a/src/test/compile-fail/feature-gate-int-uint.rs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![allow(dead_code, unused_variables)] -#![feature(rustc_attrs)] - -mod u { - type X = uint; //~ WARN the `uint` type is deprecated - struct Foo { - x: uint //~ WARN the `uint` type is deprecated - } - fn bar(x: uint) { //~ WARN the `uint` type is deprecated - 1_u; //~ WARN the `u` and `us` suffixes on integers are deprecated - 1_us; //~ WARN the `u` and `us` suffixes on integers are deprecated - } -} -mod i { - type X = int; //~ WARN the `int` type is deprecated - struct Foo { - x: int //~ WARN the `int` type is deprecated - } - fn bar(x: int) { //~ WARN the `int` type is deprecated - 1_i; //~ WARN the `i` and `is` suffixes on integers are deprecated - 1_is; //~ WARN the `i` and `is` suffixes on integers are deprecated - } -} - -#[rustc_error] -fn main() { //~ ERROR compilation successful -} diff --git a/src/test/compile-fail/issue-19660.rs b/src/test/compile-fail/issue-19660.rs index 77aba7335bd..4435ee0cb22 100644 --- a/src/test/compile-fail/issue-19660.rs +++ b/src/test/compile-fail/issue-19660.rs @@ -21,6 +21,6 @@ impl PhantomFn for U { } trait Sized : PhantomFn {} #[start] -fn main(_: int, _: *const *const u8) -> int { +fn main(_: isize, _: *const *const u8) -> isize { 0 } diff --git a/src/test/compile-fail/lint-type-limits.rs b/src/test/compile-fail/lint-type-limits.rs index c00bd2adaa2..f36c726c875 100644 --- a/src/test/compile-fail/lint-type-limits.rs +++ b/src/test/compile-fail/lint-type-limits.rs @@ -50,12 +50,12 @@ fn qux() { } fn quy() { - let i = -23_usize; //~ WARNING negation of unsigned int literal may be unintentional + let i = -23_us; //~ WARNING negation of unsigned int literal may be unintentional //~^ WARNING unused variable } fn quz() { - let i = 23_usize; + let i = 23_us; let j = -i; //~ WARNING negation of unsigned int variable may be unintentional //~^ WARNING unused variable } diff --git a/src/test/debuginfo/basic-types-globals-metadata.rs b/src/test/debuginfo/basic-types-globals-metadata.rs index 30a70fe0b37..2c44afa4b8a 100644 --- a/src/test/debuginfo/basic-types-globals-metadata.rs +++ b/src/test/debuginfo/basic-types-globals-metadata.rs @@ -48,13 +48,13 @@ // N.B. These are `mut` only so they don't constant fold away. static mut B: bool = false; -static mut I: int = -1; +static mut I: isize = -1; static mut C: char = 'a'; static mut I8: i8 = 68; static mut I16: i16 = -16; static mut I32: i32 = -32; static mut I64: i64 = -64; -static mut U: uint = 1; +static mut U: usize = 1; static mut U8: u8 = 100; static mut U16: u16 = 16; static mut U32: u32 = 32; diff --git a/src/test/debuginfo/basic-types-globals.rs b/src/test/debuginfo/basic-types-globals.rs index cb89879481b..745beab17be 100644 --- a/src/test/debuginfo/basic-types-globals.rs +++ b/src/test/debuginfo/basic-types-globals.rs @@ -53,13 +53,13 @@ // N.B. These are `mut` only so they don't constant fold away. static mut B: bool = false; -static mut I: int = -1; +static mut I: isize = -1; static mut C: char = 'a'; static mut I8: i8 = 68; static mut I16: i16 = -16; static mut I32: i32 = -32; static mut I64: i64 = -64; -static mut U: uint = 1; +static mut U: usize = 1; static mut U8: u8 = 100; static mut U16: u16 = 16; static mut U32: u32 = 32; diff --git a/src/test/debuginfo/basic-types-mut-globals.rs b/src/test/debuginfo/basic-types-mut-globals.rs index 7f82878e080..6540f268220 100644 --- a/src/test/debuginfo/basic-types-mut-globals.rs +++ b/src/test/debuginfo/basic-types-mut-globals.rs @@ -85,13 +85,13 @@ #![omit_gdb_pretty_printer_section] static mut B: bool = false; -static mut I: int = -1; +static mut I: isize = -1; static mut C: char = 'a'; static mut I8: i8 = 68; static mut I16: i16 = -16; static mut I32: i32 = -32; static mut I64: i64 = -64; -static mut U: uint = 1; +static mut U: usize = 1; static mut U8: u8 = 100; static mut U16: u16 = 16; static mut U32: u32 = 32; diff --git a/src/test/debuginfo/basic-types.rs b/src/test/debuginfo/basic-types.rs index 95483c16783..c9144b18b2f 100644 --- a/src/test/debuginfo/basic-types.rs +++ b/src/test/debuginfo/basic-types.rs @@ -60,7 +60,7 @@ // lldb-check:[...]$1 = -1 // NOTE: LLDB does not support 32bit chars -// d ebugger:print (uint)(c) +// d ebugger:print (usize)(c) // c heck:$3 = 97 // lldb-command:print i8 @@ -91,13 +91,13 @@ fn main() { let b: bool = false; - let i: int = -1; + let i: isize = -1; let c: char = 'a'; let i8: i8 = 68; let i16: i16 = -16; let i32: i32 = -32; let i64: i64 = -64; - let u: uint = 1; + let u: usize = 1; let u8: u8 = 100; let u16: u16 = 16; let u32: u32 = 32; diff --git a/src/test/debuginfo/borrowed-basic.rs b/src/test/debuginfo/borrowed-basic.rs index 52e81b7e046..b0f06bb8a75 100644 --- a/src/test/debuginfo/borrowed-basic.rs +++ b/src/test/debuginfo/borrowed-basic.rs @@ -114,8 +114,8 @@ fn main() { let bool_val: bool = true; let bool_ref: &bool = &bool_val; - let int_val: int = -1; - let int_ref: &int = &int_val; + let int_val: isize = -1; + let int_ref: &isize = &int_val; let char_val: char = 'a'; let char_ref: &char = &char_val; @@ -132,8 +132,8 @@ fn main() { let i64_val: i64 = -64; let i64_ref: &i64 = &i64_val; - let uint_val: uint = 1; - let uint_ref: &uint = &uint_val; + let uint_val: usize = 1; + let uint_ref: &usize = &uint_val; let u8_val: u8 = 100; let u8_ref: &u8 = &u8_val; diff --git a/src/test/debuginfo/borrowed-struct.rs b/src/test/debuginfo/borrowed-struct.rs index 4430ea9380d..70c24fc2ab0 100644 --- a/src/test/debuginfo/borrowed-struct.rs +++ b/src/test/debuginfo/borrowed-struct.rs @@ -67,20 +67,20 @@ #![omit_gdb_pretty_printer_section] struct SomeStruct { - x: int, + x: isize, y: f64 } fn main() { let stack_val: SomeStruct = SomeStruct { x: 10, y: 23.5 }; let stack_val_ref: &SomeStruct = &stack_val; - let stack_val_interior_ref_1: &int = &stack_val.x; + let stack_val_interior_ref_1: &isize = &stack_val.x; let stack_val_interior_ref_2: &f64 = &stack_val.y; let ref_to_unnamed: &SomeStruct = &SomeStruct { x: 11, y: 24.5 }; let unique_val: Box<_> = box SomeStruct { x: 13, y: 26.5 }; let unique_val_ref: &SomeStruct = &*unique_val; - let unique_val_interior_ref_1: &int = &unique_val.x; + let unique_val_interior_ref_1: &isize = &unique_val.x; let unique_val_interior_ref_2: &f64 = &unique_val.y; zzz(); // #break diff --git a/src/test/debuginfo/borrowed-unique-basic.rs b/src/test/debuginfo/borrowed-unique-basic.rs index 14a3d008f42..d8ce3af4789 100644 --- a/src/test/debuginfo/borrowed-unique-basic.rs +++ b/src/test/debuginfo/borrowed-unique-basic.rs @@ -118,8 +118,8 @@ fn main() { let bool_box: Box = box true; let bool_ref: &bool = &*bool_box; - let int_box: Box = box -1; - let int_ref: &int = &*int_box; + let int_box: Box = box -1; + let int_ref: &isize = &*int_box; let char_box: Box = box 'a'; let char_ref: &char = &*char_box; @@ -136,8 +136,8 @@ fn main() { let i64_box: Box = box -64; let i64_ref: &i64 = &*i64_box; - let uint_box: Box = box 1; - let uint_ref: &uint = &*uint_box; + let uint_box: Box = box 1; + let uint_ref: &usize = &*uint_box; let u8_box: Box = box 100; let u8_ref: &u8 = &*u8_box; diff --git a/src/test/debuginfo/by-value-non-immediate-argument.rs b/src/test/debuginfo/by-value-non-immediate-argument.rs index 3efda1e2f6a..bc1116b0641 100644 --- a/src/test/debuginfo/by-value-non-immediate-argument.rs +++ b/src/test/debuginfo/by-value-non-immediate-argument.rs @@ -74,7 +74,7 @@ #[derive(Clone)] struct Struct { - a: int, + a: isize, b: f64 } @@ -92,11 +92,11 @@ fn fun_fun(StructStruct { a: x, b: Struct { a: y, b: z } }: StructStruct) { zzz(); // #break } -fn tup(a: (int, uint, f64, f64)) { +fn tup(a: (isize, usize, f64, f64)) { zzz(); // #break } -struct Newtype(f64, f64, int, uint); +struct Newtype(f64, f64, isize, usize); fn new_type(a: Newtype) { zzz(); // #break diff --git a/src/test/debuginfo/by-value-self-argument-in-trait-impl.rs b/src/test/debuginfo/by-value-self-argument-in-trait-impl.rs index 2b2a9bf83f1..5bd872f9faf 100644 --- a/src/test/debuginfo/by-value-self-argument-in-trait-impl.rs +++ b/src/test/debuginfo/by-value-self-argument-in-trait-impl.rs @@ -51,16 +51,16 @@ trait Trait { fn method(self) -> Self; } -impl Trait for int { - fn method(self) -> int { +impl Trait for isize { + fn method(self) -> isize { zzz(); // #break self } } struct Struct { - x: uint, - y: uint, + x: usize, + y: usize, } impl Trait for Struct { @@ -70,15 +70,15 @@ impl Trait for Struct { } } -impl Trait for (f64, int, int, f64) { - fn method(self) -> (f64, int, int, f64) { +impl Trait for (f64, isize, isize, f64) { + fn method(self) -> (f64, isize, isize, f64) { zzz(); // #break self } } fn main() { - let _ = (1111 as int).method(); + let _ = (1111 as isize).method(); let _ = Struct { x: 2222, y: 3333 }.method(); let _ = (4444.5, 5555, 6666, 7777.5).method(); } diff --git a/src/test/debuginfo/destructured-fn-argument.rs b/src/test/debuginfo/destructured-fn-argument.rs index 51cced20439..d7ec5673258 100644 --- a/src/test/debuginfo/destructured-fn-argument.rs +++ b/src/test/debuginfo/destructured-fn-argument.rs @@ -325,18 +325,18 @@ enum Univariant { Unit(i32) } -struct TupleStruct (f64, int); +struct TupleStruct (f64, isize); -fn simple_tuple((a, b): (int, bool)) { +fn simple_tuple((a, b): (isize, bool)) { zzz(); // #break } -fn nested_tuple((a, (b, c)): (int, (u16, u16))) { +fn nested_tuple((a, (b, c)): (isize, (u16, u16))) { zzz(); // #break } -fn destructure_only_first_level((a, b): (int, (u32, u32))) { +fn destructure_only_first_level((a, b): (isize, (u32, u32))) { zzz(); // #break } @@ -348,7 +348,7 @@ fn struct_pattern(Struct { a: k, b: l }: Struct) { zzz(); // #break } -fn ignored_tuple_element((m, _, n): (int, u16, i32)) { +fn ignored_tuple_element((m, _, n): (isize, u16, i32)) { zzz(); // #break } @@ -370,27 +370,27 @@ fn complex_nesting(((u, v ), ((w, (x, Struct { a: y, b: z})), Struct { a: zzz(); // #break } -fn managed_box(&aa: &(int, int)) { +fn managed_box(&aa: &(isize, isize)) { zzz(); // #break } -fn borrowed_pointer(&bb: &(int, int)) { +fn borrowed_pointer(&bb: &(isize, isize)) { zzz(); // #break } -fn contained_borrowed_pointer((&cc, _): (&int, int)) { +fn contained_borrowed_pointer((&cc, _): (&isize, isize)) { zzz(); // #break } -fn unique_pointer(box dd: Box<(int, int, int)>) { +fn unique_pointer(box dd: Box<(isize, isize, isize)>) { zzz(); // #break } -fn ref_binding(ref ee: (int, int, int)) { +fn ref_binding(ref ee: (isize, isize, isize)) { zzz(); // #break } -fn ref_binding_in_tuple((ref ff, gg): (int, (int, int))) { +fn ref_binding_in_tuple((ref ff, gg): (isize, (isize, isize))) { zzz(); // #break } @@ -414,7 +414,7 @@ fn tuple_struct_with_ref_binding(TupleStruct(mm, ref nn): TupleStruct) { zzz(); // #break } -fn multiple_arguments((oo, pp): (int, int), qq : int) { +fn multiple_arguments((oo, pp): (isize, isize), qq : isize) { zzz(); // #break } @@ -442,7 +442,7 @@ fn main() { tuple_struct_with_ref_binding(TupleStruct(55.0, 56)); multiple_arguments((57, 58), 59); - fn nested_function(rr: int, (ss, tt): (int, int)) { + fn nested_function(rr: isize, (ss, tt): (isize, isize)) { zzz(); // #break } diff --git a/src/test/debuginfo/destructured-local.rs b/src/test/debuginfo/destructured-local.rs index cf0ca0b67a7..4b1c57e0afb 100644 --- a/src/test/debuginfo/destructured-local.rs +++ b/src/test/debuginfo/destructured-local.rs @@ -258,18 +258,18 @@ enum Univariant { Unit(i32) } -struct TupleStruct (f64, int); +struct TupleStruct (f64, isize); fn main() { // simple tuple - let (a, b) : (int, bool) = (1, false); + let (a, b) : (isize, bool) = (1, false); // nested tuple - let (c, (d, e)) : (int, (u16, u16)) = (2, (3, 4)); + let (c, (d, e)) : (isize, (u16, u16)) = (2, (3, 4)); // bind tuple-typed value to one name (destructure only first level) - let (f, g) : (int, (u32, u32)) = (5, (6, 7)); + let (f, g) : (isize, (u32, u32)) = (5, (6, 7)); // struct as tuple element let (h, i, j) : (i16, Struct, i16) = (8, Struct { a: 9, b: 10 }, 11); diff --git a/src/test/debuginfo/function-arg-initialization.rs b/src/test/debuginfo/function-arg-initialization.rs index c161600f2c3..d611e4a65a6 100644 --- a/src/test/debuginfo/function-arg-initialization.rs +++ b/src/test/debuginfo/function-arg-initialization.rs @@ -226,7 +226,7 @@ #![allow(unused_variables)] #![omit_gdb_pretty_printer_section] -fn immediate_args(a: int, b: bool, c: f64) { +fn immediate_args(a: isize, b: bool, c: f64) { ::std::old_io::print("") // #break } diff --git a/src/test/debuginfo/function-arguments.rs b/src/test/debuginfo/function-arguments.rs index 2ab3668abb9..21c2cc09a9f 100644 --- a/src/test/debuginfo/function-arguments.rs +++ b/src/test/debuginfo/function-arguments.rs @@ -58,7 +58,7 @@ fn main() { } } -fn fun(x: int, y: bool) -> (int, bool) { +fn fun(x: isize, y: bool) -> (isize, bool) { zzz(); // #break (x, y) diff --git a/src/test/debuginfo/function-prologue-stepping-no-stack-check.rs b/src/test/debuginfo/function-prologue-stepping-no-stack-check.rs index 99e31ab2302..0608e49b28c 100644 --- a/src/test/debuginfo/function-prologue-stepping-no-stack-check.rs +++ b/src/test/debuginfo/function-prologue-stepping-no-stack-check.rs @@ -250,7 +250,7 @@ #![omit_gdb_pretty_printer_section] #[no_stack_check] -fn immediate_args(a: int, b: bool, c: f64) { +fn immediate_args(a: isize, b: bool, c: f64) { ::std::old_io::print(""); } diff --git a/src/test/debuginfo/function-prologue-stepping-regular.rs b/src/test/debuginfo/function-prologue-stepping-regular.rs index 8312d16bcac..e1a77b34e7f 100644 --- a/src/test/debuginfo/function-prologue-stepping-regular.rs +++ b/src/test/debuginfo/function-prologue-stepping-regular.rs @@ -129,7 +129,7 @@ #![feature(old_io)] #![omit_gdb_pretty_printer_section] -fn immediate_args(a: int, b: bool, c: f64) { +fn immediate_args(a: isize, b: bool, c: f64) { () } diff --git a/src/test/debuginfo/gdb-pretty-struct-and-enums-pre-gdb-7-7.rs b/src/test/debuginfo/gdb-pretty-struct-and-enums-pre-gdb-7-7.rs index aa902a9b2d4..aa6051d7922 100644 --- a/src/test/debuginfo/gdb-pretty-struct-and-enums-pre-gdb-7-7.rs +++ b/src/test/debuginfo/gdb-pretty-struct-and-enums-pre-gdb-7-7.rs @@ -37,7 +37,7 @@ // gdb-check:$5 = CStyleEnumVar3 struct RegularStruct { - the_first_field: int, + the_first_field: isize, the_second_field: f64, the_third_field: bool, } diff --git a/src/test/debuginfo/gdb-pretty-struct-and-enums.rs b/src/test/debuginfo/gdb-pretty-struct-and-enums.rs index d47dee14f55..81af9c213a3 100644 --- a/src/test/debuginfo/gdb-pretty-struct-and-enums.rs +++ b/src/test/debuginfo/gdb-pretty-struct-and-enums.rs @@ -81,7 +81,7 @@ use self::MixedEnum::{MixedEnumCStyleVar, MixedEnumTupleVar, MixedEnumStructVar} use self::NestedEnum::{NestedVariant1, NestedVariant2}; struct RegularStruct { - the_first_field: int, + the_first_field: isize, the_second_field: f64, the_third_field: bool, the_fourth_field: &'static str, @@ -140,7 +140,7 @@ fn main() { let mixed_enum_struct_var = MixedEnumStructVar { field1: 108.5, field2: 109 }; let some = Some(110_usize); - let none: Option = None; + let none: Option = None; let some_fat = Some("abc"); let none_fat: Option<&'static str> = None; @@ -177,7 +177,7 @@ fn main() { } }; - let none_check1: Option<(uint, Vec)> = None; + let none_check1: Option<(usize, Vec)> = None; let none_check2: Option = None; zzz(); // #break diff --git a/src/test/debuginfo/generic-function.rs b/src/test/debuginfo/generic-function.rs index 76b7a3e729d..1748083b2ba 100644 --- a/src/test/debuginfo/generic-function.rs +++ b/src/test/debuginfo/generic-function.rs @@ -73,7 +73,7 @@ #[derive(Clone)] struct Struct { - a: int, + a: isize, b: f64 } diff --git a/src/test/debuginfo/generic-method-on-generic-struct.rs b/src/test/debuginfo/generic-method-on-generic-struct.rs index 07b6d745544..06053965ca7 100644 --- a/src/test/debuginfo/generic-method-on-generic-struct.rs +++ b/src/test/debuginfo/generic-method-on-generic-struct.rs @@ -121,17 +121,17 @@ struct Struct { impl Struct { - fn self_by_ref(&self, arg1: int, arg2: T2) -> int { + fn self_by_ref(&self, arg1: isize, arg2: T2) -> isize { zzz(); // #break arg1 } - fn self_by_val(self, arg1: int, arg2: T2) -> int { + fn self_by_val(self, arg1: isize, arg2: T2) -> isize { zzz(); // #break arg1 } - fn self_owned(self: Box>, arg1: int, arg2: T2) -> int { + fn self_owned(self: Box>, arg1: isize, arg2: T2) -> isize { zzz(); // #break arg1 } diff --git a/src/test/debuginfo/generic-static-method-on-struct-and-enum.rs b/src/test/debuginfo/generic-static-method-on-struct-and-enum.rs index eb1083f624f..f24b221ccec 100644 --- a/src/test/debuginfo/generic-static-method-on-struct-and-enum.rs +++ b/src/test/debuginfo/generic-static-method-on-struct-and-enum.rs @@ -34,26 +34,26 @@ #![omit_gdb_pretty_printer_section] struct Struct { - x: int + x: isize } impl Struct { - fn static_method(arg1: T1, arg2: T2) -> int { + fn static_method(arg1: T1, arg2: T2) -> isize { zzz(); // #break return 0; } } enum Enum { - Variant1 { x: int }, + Variant1 { x: isize }, Variant2, - Variant3(f64, int, char), + Variant3(f64, isize, char), } impl Enum { - fn static_method(arg1: T1, arg2: T2, arg3: T3) -> int { + fn static_method(arg1: T1, arg2: T2, arg3: T3) -> isize { zzz(); // #break return 1; } diff --git a/src/test/debuginfo/generic-trait-generic-static-default-method.rs b/src/test/debuginfo/generic-trait-generic-static-default-method.rs index 4382861fd20..45da87a5674 100644 --- a/src/test/debuginfo/generic-trait-generic-static-default-method.rs +++ b/src/test/debuginfo/generic-trait-generic-static-default-method.rs @@ -28,11 +28,11 @@ #![omit_gdb_pretty_printer_section] struct Struct { - x: int + x: isize } trait Trait { - fn generic_static_default_method(arg1: int, arg2: &(T1, T2)) -> int { + fn generic_static_default_method(arg1: isize, arg2: &(T1, T2)) -> isize { zzz(); // #break arg1 } @@ -43,8 +43,9 @@ impl Trait for Struct {} fn main() { // Is this really how to use these? - Trait::generic_static_default_method::(1000, &(1, 2.5)); - Trait::generic_static_default_method::(2000, &(3.5, (4, 5, 6))); + Trait::generic_static_default_method::(1000, &(1, 2.5)); + Trait::generic_static_default_method::(2000, + &(3.5, (4, 5, 6))); } diff --git a/src/test/debuginfo/issue12886.rs b/src/test/debuginfo/issue12886.rs index 424ba50e3c9..2268f07438f 100644 --- a/src/test/debuginfo/issue12886.rs +++ b/src/test/debuginfo/issue12886.rs @@ -28,7 +28,7 @@ // contained in the output, after calling `next` just once, we can be sure that we did not stop in // unwrap(). (The testing framework doesn't allow for checking that some text is *not* contained in // the output, which is why we have to make the test in this kind of roundabout way) -fn bar() -> int { +fn bar() -> isize { let s = Some(5).unwrap(); // #break s } diff --git a/src/test/debuginfo/lexical-scope-in-match.rs b/src/test/debuginfo/lexical-scope-in-match.rs index c2cddd25768..228799848c6 100644 --- a/src/test/debuginfo/lexical-scope-in-match.rs +++ b/src/test/debuginfo/lexical-scope-in-match.rs @@ -128,8 +128,8 @@ #![omit_gdb_pretty_printer_section] struct Struct { - x: int, - y: int + x: isize, + y: isize } fn main() { diff --git a/src/test/debuginfo/lexical-scope-in-stack-closure.rs b/src/test/debuginfo/lexical-scope-in-stack-closure.rs index 6a909ced818..c0b65fbb22b 100644 --- a/src/test/debuginfo/lexical-scope-in-stack-closure.rs +++ b/src/test/debuginfo/lexical-scope-in-stack-closure.rs @@ -78,7 +78,7 @@ fn main() { zzz(); // #break sentinel(); - let closure = |x: int| { + let closure = |x: isize| { zzz(); // #break sentinel(); diff --git a/src/test/debuginfo/lexical-scope-in-unique-closure.rs b/src/test/debuginfo/lexical-scope-in-unique-closure.rs index c0a5a31c9ce..5bae2aa7ae2 100644 --- a/src/test/debuginfo/lexical-scope-in-unique-closure.rs +++ b/src/test/debuginfo/lexical-scope-in-unique-closure.rs @@ -79,7 +79,7 @@ fn main() { zzz(); // #break sentinel(); - let unique_closure = |x:int| { + let unique_closure = |x:isize| { zzz(); // #break sentinel(); diff --git a/src/test/debuginfo/lexical-scopes-in-block-expression.rs b/src/test/debuginfo/lexical-scopes-in-block-expression.rs index c1ec837a4b8..63e2402c65d 100644 --- a/src/test/debuginfo/lexical-scopes-in-block-expression.rs +++ b/src/test/debuginfo/lexical-scopes-in-block-expression.rs @@ -350,14 +350,14 @@ #![allow(unused_assignments)] #![omit_gdb_pretty_printer_section] -static mut MUT_INT: int = 0; +static mut MUT_INT: isize = 0; struct Point { - x: int, - y: int + x: isize, + y: isize } -fn a_function(x: int) -> int { +fn a_function(x: isize) -> isize { x + 1 } @@ -502,7 +502,7 @@ fn main() { zzz(); // #break sentinel(); - val as uint + val as usize }]; zzz(); // #break diff --git a/src/test/debuginfo/limited-debuginfo.rs b/src/test/debuginfo/limited-debuginfo.rs index c140390604b..ea7d150164d 100644 --- a/src/test/debuginfo/limited-debuginfo.rs +++ b/src/test/debuginfo/limited-debuginfo.rs @@ -44,7 +44,7 @@ fn main() { fn zzz() {()} -fn some_function(a: int, b: int) { +fn some_function(a: isize, b: isize) { let some_variable = Struct { a: 11, b: 22 }; let some_other_variable = 23; @@ -53,4 +53,4 @@ fn some_function(a: int, b: int) { } } -fn some_other_function(a: int, b: int) -> bool { true } +fn some_other_function(a: isize, b: isize) -> bool { true } diff --git a/src/test/debuginfo/method-on-enum.rs b/src/test/debuginfo/method-on-enum.rs index 7172a880f4c..314ec472b69 100644 --- a/src/test/debuginfo/method-on-enum.rs +++ b/src/test/debuginfo/method-on-enum.rs @@ -123,17 +123,17 @@ enum Enum { impl Enum { - fn self_by_ref(&self, arg1: int, arg2: int) -> int { + fn self_by_ref(&self, arg1: isize, arg2: isize) -> isize { zzz(); // #break arg1 + arg2 } - fn self_by_val(self, arg1: int, arg2: int) -> int { + fn self_by_val(self, arg1: isize, arg2: isize) -> isize { zzz(); // #break arg1 + arg2 } - fn self_owned(self: Box, arg1: int, arg2: int) -> int { + fn self_owned(self: Box, arg1: isize, arg2: isize) -> isize { zzz(); // #break arg1 + arg2 } diff --git a/src/test/debuginfo/method-on-generic-struct.rs b/src/test/debuginfo/method-on-generic-struct.rs index bf6635f833f..564c2d26493 100644 --- a/src/test/debuginfo/method-on-generic-struct.rs +++ b/src/test/debuginfo/method-on-generic-struct.rs @@ -122,17 +122,17 @@ struct Struct { impl Struct { - fn self_by_ref(&self, arg1: int, arg2: int) -> int { + fn self_by_ref(&self, arg1: isize, arg2: isize) -> isize { zzz(); // #break arg1 + arg2 } - fn self_by_val(self, arg1: int, arg2: int) -> int { + fn self_by_val(self, arg1: isize, arg2: isize) -> isize { zzz(); // #break arg1 + arg2 } - fn self_owned(self: Box>, arg1: int, arg2: int) -> int { + fn self_owned(self: Box>, arg1: isize, arg2: isize) -> isize { zzz(); // #break arg1 + arg2 } diff --git a/src/test/debuginfo/method-on-struct.rs b/src/test/debuginfo/method-on-struct.rs index 54779e00708..eba4370e698 100644 --- a/src/test/debuginfo/method-on-struct.rs +++ b/src/test/debuginfo/method-on-struct.rs @@ -117,22 +117,22 @@ #[derive(Copy)] struct Struct { - x: int + x: isize } impl Struct { - fn self_by_ref(&self, arg1: int, arg2: int) -> int { + fn self_by_ref(&self, arg1: isize, arg2: isize) -> isize { zzz(); // #break self.x + arg1 + arg2 } - fn self_by_val(self, arg1: int, arg2: int) -> int { + fn self_by_val(self, arg1: isize, arg2: isize) -> isize { zzz(); // #break self.x + arg1 + arg2 } - fn self_owned(self: Box, arg1: int, arg2: int) -> int { + fn self_owned(self: Box, arg1: isize, arg2: isize) -> isize { zzz(); // #break self.x + arg1 + arg2 } diff --git a/src/test/debuginfo/method-on-trait.rs b/src/test/debuginfo/method-on-trait.rs index 7954bcae1b2..6df7cdfd47f 100644 --- a/src/test/debuginfo/method-on-trait.rs +++ b/src/test/debuginfo/method-on-trait.rs @@ -117,28 +117,28 @@ #[derive(Copy)] struct Struct { - x: int + x: isize } trait Trait { - fn self_by_ref(&self, arg1: int, arg2: int) -> int; - fn self_by_val(self, arg1: int, arg2: int) -> int; - fn self_owned(self: Box, arg1: int, arg2: int) -> int; + fn self_by_ref(&self, arg1: isize, arg2: isize) -> isize; + fn self_by_val(self, arg1: isize, arg2: isize) -> isize; + fn self_owned(self: Box, arg1: isize, arg2: isize) -> isize; } impl Trait for Struct { - fn self_by_ref(&self, arg1: int, arg2: int) -> int { + fn self_by_ref(&self, arg1: isize, arg2: isize) -> isize { zzz(); // #break self.x + arg1 + arg2 } - fn self_by_val(self, arg1: int, arg2: int) -> int { + fn self_by_val(self, arg1: isize, arg2: isize) -> isize { zzz(); // #break self.x + arg1 + arg2 } - fn self_owned(self: Box, arg1: int, arg2: int) -> int { + fn self_owned(self: Box, arg1: isize, arg2: isize) -> isize { zzz(); // #break self.x + arg1 + arg2 } diff --git a/src/test/debuginfo/method-on-tuple-struct.rs b/src/test/debuginfo/method-on-tuple-struct.rs index af128706650..b638e210dd3 100644 --- a/src/test/debuginfo/method-on-tuple-struct.rs +++ b/src/test/debuginfo/method-on-tuple-struct.rs @@ -116,21 +116,21 @@ #![omit_gdb_pretty_printer_section] #[derive(Copy)] -struct TupleStruct(int, f64); +struct TupleStruct(isize, f64); impl TupleStruct { - fn self_by_ref(&self, arg1: int, arg2: int) -> int { + fn self_by_ref(&self, arg1: isize, arg2: isize) -> isize { zzz(); // #break arg1 + arg2 } - fn self_by_val(self, arg1: int, arg2: int) -> int { + fn self_by_val(self, arg1: isize, arg2: isize) -> isize { zzz(); // #break arg1 + arg2 } - fn self_owned(self: Box, arg1: int, arg2: int) -> int { + fn self_owned(self: Box, arg1: isize, arg2: isize) -> isize { zzz(); // #break arg1 + arg2 } diff --git a/src/test/debuginfo/recursive-struct.rs b/src/test/debuginfo/recursive-struct.rs index fe262a7ea8d..4772ee10ff7 100644 --- a/src/test/debuginfo/recursive-struct.rs +++ b/src/test/debuginfo/recursive-struct.rs @@ -105,7 +105,7 @@ struct LongCycle4 { struct LongCycleWithAnonymousTypes { next: Opt>>>>>, - value: uint, + value: usize, } // This test case makes sure that recursive structs are properly described. The Node structs are diff --git a/src/test/debuginfo/self-in-default-method.rs b/src/test/debuginfo/self-in-default-method.rs index 008eeda92d0..f61b78d5449 100644 --- a/src/test/debuginfo/self-in-default-method.rs +++ b/src/test/debuginfo/self-in-default-method.rs @@ -116,21 +116,21 @@ #[derive(Copy)] struct Struct { - x: int + x: isize } trait Trait : Sized { - fn self_by_ref(&self, arg1: int, arg2: int) -> int { + fn self_by_ref(&self, arg1: isize, arg2: isize) -> isize { zzz(); // #break arg1 + arg2 } - fn self_by_val(self, arg1: int, arg2: int) -> int { + fn self_by_val(self, arg1: isize, arg2: isize) -> isize { zzz(); // #break arg1 + arg2 } - fn self_owned(self: Box, arg1: int, arg2: int) -> int { + fn self_owned(self: Box, arg1: isize, arg2: isize) -> isize { zzz(); // #break arg1 + arg2 } diff --git a/src/test/debuginfo/self-in-generic-default-method.rs b/src/test/debuginfo/self-in-generic-default-method.rs index 94e5f6f6c10..4ac436c9325 100644 --- a/src/test/debuginfo/self-in-generic-default-method.rs +++ b/src/test/debuginfo/self-in-generic-default-method.rs @@ -116,22 +116,22 @@ #[derive(Copy)] struct Struct { - x: int + x: isize } trait Trait : Sized { - fn self_by_ref(&self, arg1: int, arg2: T) -> int { + fn self_by_ref(&self, arg1: isize, arg2: T) -> isize { zzz(); // #break arg1 } - fn self_by_val(self, arg1: int, arg2: T) -> int { + fn self_by_val(self, arg1: isize, arg2: T) -> isize { zzz(); // #break arg1 } - fn self_owned(self: Box, arg1: int, arg2: T) -> int { + fn self_owned(self: Box, arg1: isize, arg2: T) -> isize { zzz(); // #break arg1 } diff --git a/src/test/debuginfo/static-method-on-struct-and-enum.rs b/src/test/debuginfo/static-method-on-struct-and-enum.rs index 48db69289c0..59fe96f9958 100644 --- a/src/test/debuginfo/static-method-on-struct-and-enum.rs +++ b/src/test/debuginfo/static-method-on-struct-and-enum.rs @@ -56,26 +56,26 @@ #![omit_gdb_pretty_printer_section] struct Struct { - x: int + x: isize } impl Struct { - fn static_method(arg1: int, arg2: int) -> int { + fn static_method(arg1: isize, arg2: isize) -> isize { zzz(); // #break arg1 + arg2 } } enum Enum { - Variant1 { x: int }, + Variant1 { x: isize }, Variant2, - Variant3(f64, int, char), + Variant3(f64, isize, char), } impl Enum { - fn static_method(arg1: int, arg2: f64, arg3: uint) -> int { + fn static_method(arg1: isize, arg2: f64, arg3: usize) -> isize { zzz(); // #break arg1 } diff --git a/src/test/debuginfo/trait-generic-static-default-method.rs b/src/test/debuginfo/trait-generic-static-default-method.rs index 2ecafb02ae5..d066af53e35 100644 --- a/src/test/debuginfo/trait-generic-static-default-method.rs +++ b/src/test/debuginfo/trait-generic-static-default-method.rs @@ -48,11 +48,11 @@ #![omit_gdb_pretty_printer_section] struct Struct { - x: int + x: isize } trait Trait { - fn generic_static_default_method(arg1: int, arg2: T) -> int { + fn generic_static_default_method(arg1: isize, arg2: T) -> isize { zzz(); // #break arg1 } @@ -64,7 +64,7 @@ fn main() { // Is this really how to use these? Trait::generic_static_default_method::(1000, 0.5); - Trait::generic_static_default_method::(2000, &(1, 2, 3)); + Trait::generic_static_default_method::(2000, &(1, 2, 3)); } diff --git a/src/test/debuginfo/trait-pointers.rs b/src/test/debuginfo/trait-pointers.rs index f74c9953f7d..3054f646b91 100644 --- a/src/test/debuginfo/trait-pointers.rs +++ b/src/test/debuginfo/trait-pointers.rs @@ -19,11 +19,11 @@ #![omit_gdb_pretty_printer_section] trait Trait { - fn method(&self) -> int { 0 } + fn method(&self) -> isize { 0 } } struct Struct { - a: int, + a: isize, b: f64 } diff --git a/src/test/debuginfo/var-captured-in-nested-closure.rs b/src/test/debuginfo/var-captured-in-nested-closure.rs index 05872e3fc36..d576aff8b1c 100644 --- a/src/test/debuginfo/var-captured-in-nested-closure.rs +++ b/src/test/debuginfo/var-captured-in-nested-closure.rs @@ -82,9 +82,9 @@ #![omit_gdb_pretty_printer_section] struct Struct { - a: int, + a: isize, b: f64, - c: uint + c: usize } fn main() { diff --git a/src/test/debuginfo/var-captured-in-sendable-closure.rs b/src/test/debuginfo/var-captured-in-sendable-closure.rs index 295d57f4cfa..2b27f938b30 100644 --- a/src/test/debuginfo/var-captured-in-sendable-closure.rs +++ b/src/test/debuginfo/var-captured-in-sendable-closure.rs @@ -44,9 +44,9 @@ #![omit_gdb_pretty_printer_section] struct Struct { - a: int, + a: isize, b: f64, - c: uint + c: usize } fn main() { @@ -80,7 +80,7 @@ fn main() { immedate_env(); } -fn do_something(_: &int, _:&int, _:&int) { +fn do_something(_: &isize, _:&isize, _:&isize) { } diff --git a/src/test/debuginfo/var-captured-in-stack-closure.rs b/src/test/debuginfo/var-captured-in-stack-closure.rs index 57dcac409ba..54ef42b48f1 100644 --- a/src/test/debuginfo/var-captured-in-stack-closure.rs +++ b/src/test/debuginfo/var-captured-in-stack-closure.rs @@ -74,9 +74,9 @@ #![omit_gdb_pretty_printer_section] struct Struct { - a: int, + a: isize, b: f64, - c: uint + c: usize } fn main() { diff --git a/src/test/pretty/blank-lines.rs b/src/test/pretty/blank-lines.rs index 1774edd3f76..4d135801dab 100644 --- a/src/test/pretty/blank-lines.rs +++ b/src/test/pretty/blank-lines.rs @@ -9,7 +9,7 @@ // except according to those terms. // pp-exact -fn f() -> [int; 3] { +fn f() -> [isize; 3] { let picard = 0; let data = 1; diff --git a/src/test/pretty/block-disambig.rs b/src/test/pretty/block-disambig.rs index c9cb72d8af7..6e75e085138 100644 --- a/src/test/pretty/block-disambig.rs +++ b/src/test/pretty/block-disambig.rs @@ -17,10 +17,10 @@ use std::cell::Cell; fn test1() { let val = &0; { } *val; } -fn test2() -> int { let val = &0; { } *val } +fn test2() -> isize { let val = &0; { } *val } #[derive(Copy)] -struct S { eax: int } +struct S { eax: isize } fn test3() { let regs = &Cell::new(S {eax: 0}); @@ -30,17 +30,17 @@ fn test3() { fn test4() -> bool { let regs = &true; if true { } *regs || false } -fn test5() -> (int, int) { { } (0, 1) } +fn test5() -> (isize, isize) { { } (0, 1) } fn test6() -> bool { { } (true || false) && true } -fn test7() -> uint { +fn test7() -> usize { let regs = &0; match true { true => { } _ => { } } - (*regs < 2) as uint + (*regs < 2) as usize } -fn test8() -> int { +fn test8() -> isize { let val = &0; match true { true => { } @@ -58,10 +58,10 @@ fn test9() { match true { true => { } _ => { } } regs.set(regs.get() + 1); } -fn test10() -> int { +fn test10() -> isize { let regs = vec!(0); match true { true => { } _ => { } } regs[0] } -fn test11() -> Vec { if true { } vec!(1, 2) } +fn test11() -> Vec { if true { } vec!(1, 2) } diff --git a/src/test/pretty/closure-reform-pretty.rs b/src/test/pretty/closure-reform-pretty.rs index 33a80f46946..63568dbcd5b 100644 --- a/src/test/pretty/closure-reform-pretty.rs +++ b/src/test/pretty/closure-reform-pretty.rs @@ -17,10 +17,10 @@ fn call_it(f: Box String>) { } fn call_this(f: F) where F: Fn(&str) + Send { } -fn call_that(f: F) where F: for<'a>Fn(&'a int, &'a int) -> int { } +fn call_that(f: F) where F: for<'a>Fn(&'a isize, &'a isize) -> isize { } -fn call_extern(f: fn() -> int) { } +fn call_extern(f: fn() -> isize) { } -fn call_abid_extern(f: extern "C" fn() -> int) { } +fn call_abid_extern(f: extern "C" fn() -> isize) { } pub fn main() { } diff --git a/src/test/pretty/disamb-stmt-expr.rs b/src/test/pretty/disamb-stmt-expr.rs index 0c4cd103b82..610d9a7782d 100644 --- a/src/test/pretty/disamb-stmt-expr.rs +++ b/src/test/pretty/disamb-stmt-expr.rs @@ -14,7 +14,7 @@ // preserved. They are needed to disambiguate `{return n+1}; - 0` from // `({return n+1}-0)`. -fn id(f: F) -> int where F: Fn() -> int { f() } +fn id(f: F) -> isize where F: Fn() -> isize { f() } -fn wsucc(_n: int) -> int { id(|| { 1 }) - 0 } +fn wsucc(_n: isize) -> isize { id(|| { 1 }) - 0 } fn main() { } diff --git a/src/test/pretty/do1.rs b/src/test/pretty/do1.rs index e0066053f3c..a85f85a395c 100644 --- a/src/test/pretty/do1.rs +++ b/src/test/pretty/do1.rs @@ -10,6 +10,6 @@ // pp-exact -fn f(f: F) where F: Fn(int) { f(10) } +fn f(f: F) where F: Fn(isize) { f(10) } fn main() { f(|i| { assert!(i == 10) }) } diff --git a/src/test/pretty/empty-impl.rs b/src/test/pretty/empty-impl.rs index f5205de5c1f..b30f2264355 100644 --- a/src/test/pretty/empty-impl.rs +++ b/src/test/pretty/empty-impl.rs @@ -9,7 +9,7 @@ // except according to those terms. trait X { fn dummy(&self) { } } -impl X for uint { } +impl X for usize { } trait Y { fn dummy(&self) { } } -impl Y for uint { } +impl Y for usize { } diff --git a/src/test/pretty/empty-lines.rs b/src/test/pretty/empty-lines.rs index 6a9cbef1015..3104941fb46 100644 --- a/src/test/pretty/empty-lines.rs +++ b/src/test/pretty/empty-lines.rs @@ -11,7 +11,7 @@ // Issue #759 // Whitespace under block opening should not expand forever -fn a() -> uint { +fn a() -> usize { 1 } diff --git a/src/test/pretty/for-comment.rs b/src/test/pretty/for-comment.rs index 0f2a667e11c..43c41deaaea 100644 --- a/src/test/pretty/for-comment.rs +++ b/src/test/pretty/for-comment.rs @@ -10,7 +10,7 @@ // pp-exact -fn f(v: &[int]) -> int { +fn f(v: &[isize]) -> isize { let mut n = 0; for e in v { n = *e; // This comment once triggered pretty printer bug diff --git a/src/test/pretty/path-type-bounds.rs b/src/test/pretty/path-type-bounds.rs index 42b2fe806e9..06d57b261e6 100644 --- a/src/test/pretty/path-type-bounds.rs +++ b/src/test/pretty/path-type-bounds.rs @@ -14,7 +14,7 @@ trait Tr { fn dummy(&self) { } } -impl Tr for int { } +impl Tr for isize { } fn foo<'a>(x: Box) -> Box { x } diff --git a/src/test/pretty/record-trailing-comma.rs b/src/test/pretty/record-trailing-comma.rs index 1cdf2e6de46..dd7fbf32dd3 100644 --- a/src/test/pretty/record-trailing-comma.rs +++ b/src/test/pretty/record-trailing-comma.rs @@ -11,8 +11,8 @@ // ignore-test // pp-exact struct Thing { - x: int, - y: int, + x: isize, + y: isize, } fn main() { diff --git a/src/test/pretty/struct-tuple.rs b/src/test/pretty/struct-tuple.rs index acd534ccbfa..82d430b2701 100644 --- a/src/test/pretty/struct-tuple.rs +++ b/src/test/pretty/struct-tuple.rs @@ -10,11 +10,11 @@ // pp-exact struct Foo; -struct Bar(int, int); +struct Bar(isize, isize); fn main() { struct Foo2; - struct Bar2(int, int, int); + struct Bar2(isize, isize, isize); let _a = Bar(5, 5); let _b = Foo; } diff --git a/src/test/pretty/trait-safety.rs b/src/test/pretty/trait-safety.rs index b96dbbf3cc9..95dfc751ff5 100644 --- a/src/test/pretty/trait-safety.rs +++ b/src/test/pretty/trait-safety.rs @@ -14,7 +14,7 @@ unsafe trait UnsafeTrait { fn foo(&self); } -unsafe impl UnsafeTrait for int { +unsafe impl UnsafeTrait for isize { fn foo(&self) { } } diff --git a/src/test/pretty/unary-op-disambig.rs b/src/test/pretty/unary-op-disambig.rs index 1592e010aaf..2a9066accd5 100644 --- a/src/test/pretty/unary-op-disambig.rs +++ b/src/test/pretty/unary-op-disambig.rs @@ -12,16 +12,16 @@ fn f() { } -fn block_semi() -> int { { f() }; -1 } +fn block_semi() -> isize { { f() }; -1 } -fn block_nosemi() -> int { ({ 0 }) - 1 } +fn block_nosemi() -> isize { ({ 0 }) - 1 } -fn if_semi() -> int { if true { f() } else { f() }; -1 } +fn if_semi() -> isize { if true { f() } else { f() }; -1 } -fn if_nosemi() -> int { (if true { 0 } else { 0 }) - 1 } +fn if_nosemi() -> isize { (if true { 0 } else { 0 }) - 1 } -fn alt_semi() -> int { match true { true => { f() } _ => { } }; -1 } +fn alt_semi() -> isize { match true { true => { f() } _ => { } }; -1 } -fn alt_no_semi() -> int { (match true { true => { 0 } _ => { 1 } }) - 1 } +fn alt_no_semi() -> isize { (match true { true => { 0 } _ => { 1 } }) - 1 } fn stmt() { { f() }; -1; } diff --git a/src/test/pretty/where-clauses.rs b/src/test/pretty/where-clauses.rs index ad582ac1b62..cca7707509f 100644 --- a/src/test/pretty/where-clauses.rs +++ b/src/test/pretty/where-clauses.rs @@ -10,6 +10,6 @@ // pp-exact -fn f<'a, 'b, T>(t: T) -> int where T: 'a, 'a:'b, T: Eq { 0 } +fn f<'a, 'b, T>(t: T) -> isize where T: 'a, 'a:'b, T: Eq { 0 } fn main() { } diff --git a/src/test/run-fail/args-panic.rs b/src/test/run-fail/args-panic.rs index eab7475bc86..47831f1af73 100644 --- a/src/test/run-fail/args-panic.rs +++ b/src/test/run-fail/args-panic.rs @@ -14,6 +14,6 @@ #![allow(unknown_features)] #![feature(box_syntax)] -fn f(_a: int, _b: int, _c: Box) { panic!("moop"); } +fn f(_a: isize, _b: isize, _c: Box) { panic!("moop"); } fn main() { f(1, panic!("meep"), box 42); } diff --git a/src/test/run-fail/bug-2470-bounds-check-overflow-2.rs b/src/test/run-fail/bug-2470-bounds-check-overflow-2.rs index 6dd329b7295..07fac8e39c4 100644 --- a/src/test/run-fail/bug-2470-bounds-check-overflow-2.rs +++ b/src/test/run-fail/bug-2470-bounds-check-overflow-2.rs @@ -11,7 +11,7 @@ // ignore-test // error-pattern:index out of bounds -use std::uint; +use std::usize; fn main() { let x = vec!(1_usize,2_usize,3_usize); @@ -21,7 +21,7 @@ fn main() { // length (in bytes), because the scaling of the index will cause it to // wrap around to a small number. - let idx = uint::MAX & !(uint::MAX >> 1_usize); + let idx = usize::MAX & !(usize::MAX >> 1_usize); println!("ov2 idx = 0x%x", idx); // This should panic. diff --git a/src/test/run-fail/bug-2470-bounds-check-overflow-3.rs b/src/test/run-fail/bug-2470-bounds-check-overflow-3.rs index ec7fde17101..b7aff8d1be1 100644 --- a/src/test/run-fail/bug-2470-bounds-check-overflow-3.rs +++ b/src/test/run-fail/bug-2470-bounds-check-overflow-3.rs @@ -25,8 +25,8 @@ fn main() { let idx = u64::MAX & !(u64::MAX >> 1_usize); println!("ov3 idx = 0x%8.8x%8.8x", - (idx >> 32) as uint, - idx as uint); + (idx >> 32) as usize, + idx as usize); // This should panic. println!("ov3 0x%x", x[idx]); diff --git a/src/test/run-fail/bug-2470-bounds-check-overflow.rs b/src/test/run-fail/bug-2470-bounds-check-overflow.rs index e48d749d945..5e3da8476af 100644 --- a/src/test/run-fail/bug-2470-bounds-check-overflow.rs +++ b/src/test/run-fail/bug-2470-bounds-check-overflow.rs @@ -22,13 +22,13 @@ fn main() { let x = vec!(1_usize,2_usize,3_usize); - let base = x.as_ptr() as uint; - let idx = base / mem::size_of::(); + let base = x.as_ptr() as usize; + let idx = base / mem::size_of::(); println!("ov1 base = 0x{:x}", base); println!("ov1 idx = 0x{:x}", idx); - println!("ov1 sizeof::() = 0x{:x}", mem::size_of::()); - println!("ov1 idx * sizeof::() = 0x{:x}", - idx * mem::size_of::()); + println!("ov1 sizeof::() = 0x{:x}", mem::size_of::()); + println!("ov1 idx * sizeof::() = 0x{:x}", + idx * mem::size_of::()); // This should panic. println!("ov1 0x{:x}", x[idx]); diff --git a/src/test/run-fail/bug-811.rs b/src/test/run-fail/bug-811.rs index 4ad81197286..fc64d7c1ba3 100644 --- a/src/test/run-fail/bug-811.rs +++ b/src/test/run-fail/bug-811.rs @@ -12,10 +12,10 @@ use std::marker::PhantomData; -fn test00_start(ch: chan_t, message: int) { send(ch, message); } +fn test00_start(ch: chan_t, message: isize) { send(ch, message); } -type task_id = int; -type port_id = int; +type task_id = isize; +type port_id = isize; struct chan_t { task: task_id, diff --git a/src/test/run-fail/die-macro-expr.rs b/src/test/run-fail/die-macro-expr.rs index f2253b7342e..16aa4d48d91 100644 --- a/src/test/run-fail/die-macro-expr.rs +++ b/src/test/run-fail/die-macro-expr.rs @@ -11,5 +11,5 @@ // error-pattern:test fn main() { - let __isize: int = panic!("test"); + let __isize: isize = panic!("test"); } diff --git a/src/test/run-fail/expr-if-panic-fn.rs b/src/test/run-fail/expr-if-panic-fn.rs index 987bee55c60..e9f493c16f1 100644 --- a/src/test/run-fail/expr-if-panic-fn.rs +++ b/src/test/run-fail/expr-if-panic-fn.rs @@ -12,6 +12,6 @@ fn f() -> ! { panic!() } -fn g() -> int { let x = if true { f() } else { 10 }; return x; } +fn g() -> isize { let x = if true { f() } else { 10 }; return x; } fn main() { g(); } diff --git a/src/test/run-fail/expr-match-panic-fn.rs b/src/test/run-fail/expr-match-panic-fn.rs index 069c1d5ed35..0269eb0af9c 100644 --- a/src/test/run-fail/expr-match-panic-fn.rs +++ b/src/test/run-fail/expr-match-panic-fn.rs @@ -12,6 +12,6 @@ fn f() -> ! { panic!() } -fn g() -> int { let x = match true { true => { f() } false => { 10 } }; return x; } +fn g() -> isize { let x = match true { true => { f() } false => { 10 } }; return x; } fn main() { g(); } diff --git a/src/test/run-fail/extern-panic.rs b/src/test/run-fail/extern-panic.rs index bddab59e3e4..f4a3adba76e 100644 --- a/src/test/run-fail/extern-panic.rs +++ b/src/test/run-fail/extern-panic.rs @@ -34,7 +34,7 @@ extern fn cb(data: libc::uintptr_t) -> libc::uintptr_t { } } -fn count(n: uint) -> uint { +fn count(n: usize) -> usize { unsafe { task::deschedule(); rustrt::rust_dbg_call(cb, n) diff --git a/src/test/run-fail/if-check-panic.rs b/src/test/run-fail/if-check-panic.rs index e3af5b2bbf5..8c4caccdb65 100644 --- a/src/test/run-fail/if-check-panic.rs +++ b/src/test/run-fail/if-check-panic.rs @@ -9,13 +9,13 @@ // except according to those terms. // error-pattern:Number is odd -fn even(x: uint) -> bool { +fn even(x: usize) -> bool { if x < 2 { return false; } else if x == 2 { return true; } else { return even(x - 2); } } -fn foo(x: uint) { +fn foo(x: usize) { if even(x) { println!("{}", x); } else { diff --git a/src/test/run-fail/issue-2061.rs b/src/test/run-fail/issue-2061.rs index 49449be52af..7213d3ef7c5 100644 --- a/src/test/run-fail/issue-2061.rs +++ b/src/test/run-fail/issue-2061.rs @@ -12,7 +12,7 @@ // error-pattern: task '
' has overflowed its stack struct R { - b: int, + b: isize, } impl Drop for R { diff --git a/src/test/run-fail/issue-2444.rs b/src/test/run-fail/issue-2444.rs index 2b20540501e..ce91af95d96 100644 --- a/src/test/run-fail/issue-2444.rs +++ b/src/test/run-fail/issue-2444.rs @@ -14,7 +14,7 @@ use std::sync::Arc; enum e { ee(Arc) } -fn foo() -> e {panic!();} +fn foo() -> e {panic!();} fn main() { let _f = foo(); diff --git a/src/test/run-fail/issue-948.rs b/src/test/run-fail/issue-948.rs index e51e8d93eb0..272d85d7b50 100644 --- a/src/test/run-fail/issue-948.rs +++ b/src/test/run-fail/issue-948.rs @@ -12,7 +12,7 @@ #![allow(unused_variables)] -struct Point { x: int, y: int } +struct Point { x: isize, y: isize } fn main() { let origin = Point {x: 0, y: 0}; diff --git a/src/test/run-fail/match-bot-panic.rs b/src/test/run-fail/match-bot-panic.rs index 2b1672ad4e5..c1f90bb8f2b 100644 --- a/src/test/run-fail/match-bot-panic.rs +++ b/src/test/run-fail/match-bot-panic.rs @@ -17,6 +17,6 @@ fn foo(s: String) { } fn main() { let i = - match Some::(3) { None:: => { panic!() } Some::(_) => { panic!() } }; + match Some::(3) { None:: => { panic!() } Some::(_) => { panic!() } }; foo(i); } diff --git a/src/test/run-fail/match-disc-bot.rs b/src/test/run-fail/match-disc-bot.rs index da08f53fcde..90b729a6dd2 100644 --- a/src/test/run-fail/match-disc-bot.rs +++ b/src/test/run-fail/match-disc-bot.rs @@ -10,5 +10,5 @@ // error-pattern:quux fn f() -> ! { panic!("quux") } -fn g() -> int { match f() { true => { 1 } false => { 0 } } } +fn g() -> isize { match f() { true => { 1 } false => { 0 } } } fn main() { g(); } diff --git a/src/test/run-fail/match-wildcards.rs b/src/test/run-fail/match-wildcards.rs index 5c1a9e1a5e7..54e24de3165 100644 --- a/src/test/run-fail/match-wildcards.rs +++ b/src/test/run-fail/match-wildcards.rs @@ -9,7 +9,7 @@ // except according to those terms. // error-pattern:squirrelcupcake -fn cmp() -> int { +fn cmp() -> isize { match (Some('a'), None::) { (Some(_), _) => { panic!("squirrelcupcake"); } (_, Some(_)) => { panic!(); } diff --git a/src/test/run-fail/panic-arg.rs b/src/test/run-fail/panic-arg.rs index 4d4f9317510..0e029b6ecbc 100644 --- a/src/test/run-fail/panic-arg.rs +++ b/src/test/run-fail/panic-arg.rs @@ -9,6 +9,6 @@ // except according to those terms. // error-pattern:woe -fn f(a: int) { println!("{}", a); } +fn f(a: isize) { println!("{}", a); } fn main() { f(panic!("woe")); } diff --git a/src/test/run-fail/result-get-panic.rs b/src/test/run-fail/result-get-panic.rs index df14efd6c3a..dbded107544 100644 --- a/src/test/run-fail/result-get-panic.rs +++ b/src/test/run-fail/result-get-panic.rs @@ -13,5 +13,5 @@ use std::result::Result::Err; fn main() { - println!("{}", Err::("kitty".to_string()).unwrap()); + println!("{}", Err::("kitty".to_string()).unwrap()); } diff --git a/src/test/run-fail/rt-set-exit-status-panic2.rs b/src/test/run-fail/rt-set-exit-status-panic2.rs index 2498b7c2be4..a71ce9ebab5 100644 --- a/src/test/run-fail/rt-set-exit-status-panic2.rs +++ b/src/test/run-fail/rt-set-exit-status-panic2.rs @@ -17,7 +17,7 @@ use std::os; use std::thread; struct r { - x:int, + x:isize, } // Setting the exit status after the runtime has already @@ -29,7 +29,7 @@ impl Drop for r { } } -fn r(x:int) -> r { +fn r(x:isize) -> r { r { x: x } diff --git a/src/test/run-fail/unwind-rec.rs b/src/test/run-fail/unwind-rec.rs index 1c72686b602..6df279b047f 100644 --- a/src/test/run-fail/unwind-rec.rs +++ b/src/test/run-fail/unwind-rec.rs @@ -11,11 +11,11 @@ // error-pattern:fail -fn build() -> Vec { +fn build() -> Vec { panic!(); } -struct Blk { node: Vec } +struct Blk { node: Vec } fn main() { let _blk = Blk { diff --git a/src/test/run-fail/unwind-rec2.rs b/src/test/run-fail/unwind-rec2.rs index 943b4cd7671..d5d60d18924 100644 --- a/src/test/run-fail/unwind-rec2.rs +++ b/src/test/run-fail/unwind-rec2.rs @@ -11,15 +11,15 @@ // error-pattern:fail -fn build1() -> Vec { +fn build1() -> Vec { vec!(0,0,0,0,0,0,0) } -fn build2() -> Vec { +fn build2() -> Vec { panic!(); } -struct Blk { node: Vec , span: Vec } +struct Blk { node: Vec , span: Vec } fn main() { let _blk = Blk { diff --git a/src/test/run-fail/vec-overrun.rs b/src/test/run-fail/vec-overrun.rs index c378e852f89..da52cd56a1a 100644 --- a/src/test/run-fail/vec-overrun.rs +++ b/src/test/run-fail/vec-overrun.rs @@ -12,8 +12,8 @@ fn main() { - let v: Vec = vec!(10); - let x: uint = 0; + let v: Vec = vec!(10); + let x: usize = 0; assert_eq!(v[x], 10); // Bounds-check panic. diff --git a/src/test/run-fail/while-body-panics.rs b/src/test/run-fail/while-body-panics.rs index 6a7d0a1d73e..cfe499f8a4a 100644 --- a/src/test/run-fail/while-body-panics.rs +++ b/src/test/run-fail/while-body-panics.rs @@ -11,4 +11,4 @@ #![allow(while_true)] // error-pattern:quux -fn main() { let _x: int = { while true { panic!("quux"); } ; 8 } ; } +fn main() { let _x: isize = { while true { panic!("quux"); } ; 8 } ; } diff --git a/src/test/run-make/extern-fn-reachable/main.rs b/src/test/run-make/extern-fn-reachable/main.rs index 2e1fad5a044..27537521564 100644 --- a/src/test/run-make/extern-fn-reachable/main.rs +++ b/src/test/run-make/extern-fn-reachable/main.rs @@ -18,10 +18,10 @@ pub fn main() { unsafe { let path = Path::new("libdylib.so"); let a = DynamicLibrary::open(Some(&path)).unwrap(); - assert!(a.symbol::("fun1").is_ok()); - assert!(a.symbol::("fun2").is_err()); - assert!(a.symbol::("fun3").is_err()); - assert!(a.symbol::("fun4").is_ok()); - assert!(a.symbol::("fun5").is_ok()); + assert!(a.symbol::("fun1").is_ok()); + assert!(a.symbol::("fun2").is_err()); + assert!(a.symbol::("fun3").is_err()); + assert!(a.symbol::("fun4").is_ok()); + assert!(a.symbol::("fun5").is_ok()); } } diff --git a/src/test/run-make/intrinsic-unreachable/exit-ret.rs b/src/test/run-make/intrinsic-unreachable/exit-ret.rs index 02c03445ef4..f5be5a055c3 100644 --- a/src/test/run-make/intrinsic-unreachable/exit-ret.rs +++ b/src/test/run-make/intrinsic-unreachable/exit-ret.rs @@ -11,7 +11,7 @@ #![feature(asm)] #![crate_type="lib"] -pub fn exit(n: uint) { +pub fn exit(n: usize) { unsafe { // Pretend this asm is an exit() syscall. asm!("" :: "r"(n) :: "volatile"); diff --git a/src/test/run-make/intrinsic-unreachable/exit-unreachable.rs b/src/test/run-make/intrinsic-unreachable/exit-unreachable.rs index aec76fdf1b2..81ed446595a 100644 --- a/src/test/run-make/intrinsic-unreachable/exit-unreachable.rs +++ b/src/test/run-make/intrinsic-unreachable/exit-unreachable.rs @@ -13,7 +13,7 @@ use std::intrinsics; -pub fn exit(n: uint) -> ! { +pub fn exit(n: usize) -> ! { unsafe { // Pretend this asm is an exit() syscall. asm!("" :: "r"(n) :: "volatile"); diff --git a/src/test/run-make/issue-7349/foo.rs b/src/test/run-make/issue-7349/foo.rs index 3a2ced80ef4..6c39b33be08 100644 --- a/src/test/run-make/issue-7349/foo.rs +++ b/src/test/run-make/issue-7349/foo.rs @@ -23,8 +23,8 @@ extern "C" fn outer_foreign() { } fn main() { - outer::(); - outer::(); - outer_foreign::(); - outer_foreign::(); + outer::(); + outer::(); + outer_foreign::(); + outer_foreign::(); } diff --git a/src/test/run-make/metadata-flag-frobs-symbols/foo.rs b/src/test/run-make/metadata-flag-frobs-symbols/foo.rs index ed04eed8cf7..baabdc9ad7b 100644 --- a/src/test/run-make/metadata-flag-frobs-symbols/foo.rs +++ b/src/test/run-make/metadata-flag-frobs-symbols/foo.rs @@ -11,6 +11,6 @@ #![crate_name = "foo"] #![crate_type = "rlib"] -static FOO: uint = 3; +static FOO: usize = 3; -pub fn foo() -> &'static uint { &FOO } +pub fn foo() -> &'static usize { &FOO } diff --git a/src/test/run-make/mixing-deps/both.rs b/src/test/run-make/mixing-deps/both.rs index 7696c27ad71..c44335e2bbc 100644 --- a/src/test/run-make/mixing-deps/both.rs +++ b/src/test/run-make/mixing-deps/both.rs @@ -11,4 +11,4 @@ #![crate_type = "rlib"] #![crate_type = "dylib"] -pub static foo: int = 4; +pub static foo: isize = 4; diff --git a/src/test/run-make/mixing-deps/dylib.rs b/src/test/run-make/mixing-deps/dylib.rs index d60cc05cc9f..78af525f386 100644 --- a/src/test/run-make/mixing-deps/dylib.rs +++ b/src/test/run-make/mixing-deps/dylib.rs @@ -13,4 +13,4 @@ extern crate both; use std::mem; -pub fn addr() -> uint { unsafe { mem::transmute(&both::foo) } } +pub fn addr() -> usize { unsafe { mem::transmute(&both::foo) } } diff --git a/src/test/run-make/mixing-deps/prog.rs b/src/test/run-make/mixing-deps/prog.rs index 8006987e9f3..c3d88016fda 100644 --- a/src/test/run-make/mixing-deps/prog.rs +++ b/src/test/run-make/mixing-deps/prog.rs @@ -14,6 +14,6 @@ extern crate both; use std::mem; fn main() { - assert_eq!(unsafe { mem::transmute::<&int, uint>(&both::foo) }, + assert_eq!(unsafe { mem::transmute::<&isize, usize>(&both::foo) }, dylib::addr()); } diff --git a/src/test/run-make/pretty-expanded/input.rs b/src/test/run-make/pretty-expanded/input.rs index b6137c3eba9..04bf17dc28a 100644 --- a/src/test/run-make/pretty-expanded/input.rs +++ b/src/test/run-make/pretty-expanded/input.rs @@ -15,8 +15,8 @@ extern crate serialize; #[derive(Encodable)] pub struct A; -#[derive(Encodable)] pub struct B(int); -#[derive(Encodable)] pub struct C { x: int } +#[derive(Encodable)] pub struct B(isize); +#[derive(Encodable)] pub struct C { x: isize } #[derive(Encodable)] pub enum D {} #[derive(Encodable)] pub enum E { y } -#[derive(Encodable)] pub enum F { z(int) } +#[derive(Encodable)] pub enum F { z(isize) } diff --git a/src/test/run-make/rustdoc-smoke/foo.rs b/src/test/run-make/rustdoc-smoke/foo.rs index f6b73021beb..494eb03d728 100644 --- a/src/test/run-make/rustdoc-smoke/foo.rs +++ b/src/test/run-make/rustdoc-smoke/foo.rs @@ -29,8 +29,8 @@ pub mod bar { pub trait Doge { fn dummy(&self) { } } // @has foo/bar/struct.Foo.html - pub struct Foo { x: int, y: uint } + pub struct Foo { x: isize, y: usize } // @has foo/bar/fn.prawns.html - pub fn prawns((a, b): (int, uint), Foo { x, y }: Foo) { } + pub fn prawns((a, b): (isize, usize), Foo { x, y }: Foo) { } } diff --git a/src/test/run-make/save-analysis/foo.rs b/src/test/run-make/save-analysis/foo.rs index 74251c3c63e..d2d97fbb888 100644 --- a/src/test/run-make/save-analysis/foo.rs +++ b/src/test/run-make/save-analysis/foo.rs @@ -53,9 +53,9 @@ fn test_alias(i: Option<::Item>) { let y = x.1; } -struct TupStruct(int, int, Box); +struct TupStruct(isize, isize, Box); -fn test_tup_struct(x: TupStruct) -> int { +fn test_tup_struct(x: TupStruct) -> isize { x.1 } diff --git a/src/test/run-make/sepcomp-cci-copies/cci_lib.rs b/src/test/run-make/sepcomp-cci-copies/cci_lib.rs index a7cd85db4a2..62bc3294286 100644 --- a/src/test/run-make/sepcomp-cci-copies/cci_lib.rs +++ b/src/test/run-make/sepcomp-cci-copies/cci_lib.rs @@ -11,6 +11,6 @@ #![crate_type = "rlib"] #[inline] -pub fn cci_fn() -> uint { +pub fn cci_fn() -> usize { 1234 } diff --git a/src/test/run-make/sepcomp-cci-copies/foo.rs b/src/test/run-make/sepcomp-cci-copies/foo.rs index b0642b64cda..e2321a44365 100644 --- a/src/test/run-make/sepcomp-cci-copies/foo.rs +++ b/src/test/run-make/sepcomp-cci-copies/foo.rs @@ -11,19 +11,19 @@ extern crate cci_lib; use cci_lib::{cci_fn}; -fn call1() -> uint { +fn call1() -> usize { cci_fn() } mod a { use cci_lib::cci_fn; - pub fn call2() -> uint { + pub fn call2() -> usize { cci_fn() } } mod b { - pub fn call3() -> uint { + pub fn call3() -> usize { 0 } } diff --git a/src/test/run-make/sepcomp-separate/foo.rs b/src/test/run-make/sepcomp-separate/foo.rs index fe6a7b5a18f..bfa2162e27d 100644 --- a/src/test/run-make/sepcomp-separate/foo.rs +++ b/src/test/run-make/sepcomp-separate/foo.rs @@ -8,18 +8,18 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn magic_fn() -> uint { +fn magic_fn() -> usize { 1234 } mod a { - pub fn magic_fn() -> uint { + pub fn magic_fn() -> usize { 2345 } } mod b { - pub fn magic_fn() -> uint { + pub fn magic_fn() -> usize { 3456 } } diff --git a/src/test/run-make/symbols-are-reasonable/lib.rs b/src/test/run-make/symbols-are-reasonable/lib.rs index 474a6782b61..8ba705bfb61 100644 --- a/src/test/run-make/symbols-are-reasonable/lib.rs +++ b/src/test/run-make/symbols-are-reasonable/lib.rs @@ -12,9 +12,9 @@ pub static X: &'static str = "foobarbaz"; pub static Y: &'static [u8] = include_bytes!("lib.rs"); trait Foo { fn dummy(&self) { } } -impl Foo for uint {} +impl Foo for usize {} pub fn dummy() { // force the vtable to be created - let _x = &1u as &Foo; + let _x = &1us as &Foo; } diff --git a/src/test/run-make/target-specs/foo.rs b/src/test/run-make/target-specs/foo.rs index acda8705b19..b13c41be559 100644 --- a/src/test/run-make/target-specs/foo.rs +++ b/src/test/run-make/target-specs/foo.rs @@ -22,7 +22,7 @@ trait Copy : PhantomFn { } trait Sized : PhantomFn { } #[lang="start"] -fn start(_main: *const u8, _argc: int, _argv: *const *const u8) -> int { 0 } +fn start(_main: *const u8, _argc: isize, _argv: *const *const u8) -> isize { 0 } extern { fn _foo() -> [u8; 16]; diff --git a/src/test/run-make/volatile-intrinsics/main.rs b/src/test/run-make/volatile-intrinsics/main.rs index bdd557b6cc2..217dee4b881 100644 --- a/src/test/run-make/volatile-intrinsics/main.rs +++ b/src/test/run-make/volatile-intrinsics/main.rs @@ -14,7 +14,7 @@ use std::intrinsics::{volatile_load, volatile_store}; pub fn main() { unsafe { - let mut i : int = 1; + let mut i : isize = 1; volatile_store(&mut i, 2); assert_eq!(volatile_load(&i), 2); } diff --git a/src/test/run-pass-fulldeps/issue-16822.rs b/src/test/run-pass-fulldeps/issue-16822.rs index 6306627df0f..6f02ffa42a7 100644 --- a/src/test/run-pass-fulldeps/issue-16822.rs +++ b/src/test/run-pass-fulldeps/issue-16822.rs @@ -15,7 +15,7 @@ extern crate "issue-16822" as lib; use std::cell::RefCell; struct App { - i: int + i: isize } impl lib::Update for App { diff --git a/src/test/run-pass-fulldeps/issue-18763-quote-token-tree.rs b/src/test/run-pass-fulldeps/issue-18763-quote-token-tree.rs index d4dc5627044..e1ef32b64d7 100644 --- a/src/test/run-pass-fulldeps/issue-18763-quote-token-tree.rs +++ b/src/test/run-pass-fulldeps/issue-18763-quote-token-tree.rs @@ -20,11 +20,11 @@ use syntax::ext::base::ExtCtxt; fn syntax_extension(cx: &ExtCtxt) { let _toks_1 = vec![quote_tokens!(cx, /** comment */ fn foo() {})]; let name = quote_tokens!(cx, bar); - let _toks_2 = vec![quote_item!(cx, static $name:int = 2;)]; + let _toks_2 = vec![quote_item!(cx, static $name:isize = 2;)]; let _toks_4 = quote_tokens!(cx, $name:static $name:sizeof); let _toks_3 = vec![quote_item!(cx, /// comment - fn foo() { let $name:int = 3; } + fn foo() { let $name:isize = 3; } )]; } diff --git a/src/test/run-pass-fulldeps/qquote.rs b/src/test/run-pass-fulldeps/qquote.rs index 92cb0d71e45..7e11b9d9f27 100644 --- a/src/test/run-pass-fulldeps/qquote.rs +++ b/src/test/run-pass-fulldeps/qquote.rs @@ -60,11 +60,11 @@ fn main() { check_pp(ext_cx, abc, pprust::print_expr, "23".to_string()); - let ty = quote_ty!(cx, int); - check_pp(ext_cx, ty, pprust::print_type, "int".to_string()); + let ty = quote_ty!(cx, isize); + check_pp(ext_cx, ty, pprust::print_type, "isize".to_string()); - let item = quote_item!(cx, static x : int = 10;).get(); - check_pp(ext_cx, item, pprust::print_item, "static x: int = 10;".to_string()); + let item = quote_item!(cx, static x : isize = 10;).get(); + check_pp(ext_cx, item, pprust::print_item, "static x: isize = 10;".to_string()); let stmt = quote_stmt!(cx, let x = 20;); check_pp(ext_cx, *stmt, pprust::print_stmt, "let x = 20;".to_string()); diff --git a/src/test/run-pass-fulldeps/quote-tokens.rs b/src/test/run-pass-fulldeps/quote-tokens.rs index 0e2e1f2dd86..f6ae71f8b6f 100644 --- a/src/test/run-pass-fulldeps/quote-tokens.rs +++ b/src/test/run-pass-fulldeps/quote-tokens.rs @@ -23,7 +23,7 @@ fn syntax_extension(cx: &ExtCtxt) { let p_toks : Vec = quote_tokens!(cx, (x, 1 .. 4, *)); let a: P = quote_expr!(cx, 1 + 2); - let _b: Option> = quote_item!(cx, static foo : int = $e_toks; ); + let _b: Option> = quote_item!(cx, static foo : isize = $e_toks; ); let _c: P = quote_pat!(cx, (x, 1 .. 4, *) ); let _d: Option> = quote_stmt!(cx, let x = $a; ); let _d: syntax::ast::Arm = quote_arm!(cx, (ref x, ref y) = (x, y) ); @@ -36,7 +36,7 @@ fn syntax_extension(cx: &ExtCtxt) { let i: Option> = quote_item!(cx, #[derive(Eq)] struct Foo; ); assert!(i.is_some()); - let _l: P = quote_ty!(cx, &int); + let _l: P = quote_ty!(cx, &isize); let _m: Vec = quote_matcher!(cx, $($foo:tt,)* bar); let _n: syntax::ast::Attribute = quote_attr!(cx, #![cfg(foo, bar = "baz")]); diff --git a/src/test/run-pass-valgrind/dst-dtor-2.rs b/src/test/run-pass-valgrind/dst-dtor-2.rs index 2cb5f77fdc3..59b593b1ab3 100644 --- a/src/test/run-pass-valgrind/dst-dtor-2.rs +++ b/src/test/run-pass-valgrind/dst-dtor-2.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -static mut DROP_RAN: int = 0; +static mut DROP_RAN: isize = 0; struct Foo; impl Drop for Foo { diff --git a/src/test/run-pass/alias-uninit-value.rs b/src/test/run-pass/alias-uninit-value.rs index f6ff0415259..77b9efb0012 100644 --- a/src/test/run-pass/alias-uninit-value.rs +++ b/src/test/run-pass/alias-uninit-value.rs @@ -16,7 +16,7 @@ enum sty { ty_nil, } -struct RawT {struct_: sty, cname: Option, hash: uint} +struct RawT {struct_: sty, cname: Option, hash: usize} fn mk_raw_ty(st: sty, cname: Option) -> RawT { return RawT {struct_: st, cname: cname, hash: 0}; diff --git a/src/test/run-pass/alloca-from-derived-tydesc.rs b/src/test/run-pass/alloca-from-derived-tydesc.rs index cd649310ae7..23a1e799801 100644 --- a/src/test/run-pass/alloca-from-derived-tydesc.rs +++ b/src/test/run-pass/alloca-from-derived-tydesc.rs @@ -17,4 +17,4 @@ struct R {v: Vec> } fn f() -> Vec { return Vec::new(); } -pub fn main() { let mut r: R = R {v: Vec::new()}; r.v = f(); } +pub fn main() { let mut r: R = R {v: Vec::new()}; r.v = f(); } diff --git a/src/test/run-pass/anon-trait-static-method.rs b/src/test/run-pass/anon-trait-static-method.rs index 98975c7f021..5889bfce3c4 100644 --- a/src/test/run-pass/anon-trait-static-method.rs +++ b/src/test/run-pass/anon-trait-static-method.rs @@ -9,7 +9,7 @@ // except according to those terms. struct Foo { - x: int + x: isize } impl Foo { diff --git a/src/test/run-pass/argument-passing.rs b/src/test/run-pass/argument-passing.rs index 2428d45256d..7101cfb5579 100644 --- a/src/test/run-pass/argument-passing.rs +++ b/src/test/run-pass/argument-passing.rs @@ -12,17 +12,17 @@ // pretty-expanded FIXME #23616 struct X { - x: int + x: isize } -fn f1(a: &mut X, b: &mut int, c: int) -> int { +fn f1(a: &mut X, b: &mut isize, c: isize) -> isize { let r = a.x + *b + c; a.x = 0; *b = 10; return r; } -fn f2(a: int, f: F) -> int where F: FnOnce(int) { f(1); return a; } +fn f2(a: isize, f: F) -> isize where F: FnOnce(isize) { f(1); return a; } pub fn main() { let mut a = X {x: 1}; diff --git a/src/test/run-pass/arith-0.rs b/src/test/run-pass/arith-0.rs index 24c63e5affc..a4365efbbbd 100644 --- a/src/test/run-pass/arith-0.rs +++ b/src/test/run-pass/arith-0.rs @@ -11,7 +11,7 @@ pub fn main() { - let a: int = 10; + let a: isize = 10; println!("{}", a); assert_eq!(a * (a - 1), 90); } diff --git a/src/test/run-pass/arith-1.rs b/src/test/run-pass/arith-1.rs index 1e043d77fa8..fd281ea1173 100644 --- a/src/test/run-pass/arith-1.rs +++ b/src/test/run-pass/arith-1.rs @@ -11,7 +11,7 @@ pub fn main() { - let i32_a: int = 10; + let i32_a: isize = 10; assert_eq!(i32_a, 10); assert_eq!(i32_a - 10, 0); assert_eq!(i32_a / 10, 1); @@ -22,8 +22,8 @@ pub fn main() { assert_eq!(i32_a * i32_a * i32_a, 1000); assert_eq!(i32_a * i32_a * i32_a * i32_a, 10000); assert_eq!(i32_a * i32_a / i32_a * i32_a, 100); - assert_eq!(i32_a * (i32_a - 1) << (2 + i32_a as uint), 368640); - let i32_b: int = 0x10101010; + assert_eq!(i32_a * (i32_a - 1) << (2 + i32_a as usize), 368640); + let i32_b: isize = 0x10101010; assert_eq!(i32_b + 1 - 1, i32_b); assert_eq!(i32_b << 1, i32_b << 1); assert_eq!(i32_b >> 1, i32_b >> 1); diff --git a/src/test/run-pass/arith-2.rs b/src/test/run-pass/arith-2.rs index 08412d1296c..0f4523c6818 100644 --- a/src/test/run-pass/arith-2.rs +++ b/src/test/run-pass/arith-2.rs @@ -13,7 +13,7 @@ // pretty-expanded FIXME #23616 pub fn main() { - let i32_c: int = 0x10101010; + let i32_c: isize = 0x10101010; assert!(i32_c + i32_c * 2 / 3 * 2 + (i32_c - 7 % 3) == i32_c + i32_c * 2 / 3 * 2 + (i32_c - 7 % 3)); } diff --git a/src/test/run-pass/artificial-block.rs b/src/test/run-pass/artificial-block.rs index 422816079d6..3348a6754ee 100644 --- a/src/test/run-pass/artificial-block.rs +++ b/src/test/run-pass/artificial-block.rs @@ -10,6 +10,6 @@ // pretty-expanded FIXME #23616 -fn f() -> int { { return 3; } } +fn f() -> isize { { return 3; } } pub fn main() { assert!((f() == 3)); } diff --git a/src/test/run-pass/as-precedence.rs b/src/test/run-pass/as-precedence.rs index ec89e2b3ee2..8e38128975b 100644 --- a/src/test/run-pass/as-precedence.rs +++ b/src/test/run-pass/as-precedence.rs @@ -11,9 +11,9 @@ // pretty-expanded FIXME #23616 fn main() { - assert_eq!(3 as uint * 3, 9); - assert_eq!(3 as (uint) * 3, 9); - assert_eq!(3 as (uint) / 3, 1); - assert_eq!(3 as uint + 3, 6); - assert_eq!(3 as (uint) + 3, 6); + assert_eq!(3 as usize * 3, 9); + assert_eq!(3 as (usize) * 3, 9); + assert_eq!(3 as (usize) / 3, 1); + assert_eq!(3 as usize + 3, 6); + assert_eq!(3 as (usize) + 3, 6); } diff --git a/src/test/run-pass/asm-in-out-operand.rs b/src/test/run-pass/asm-in-out-operand.rs index 6aeadbe203e..32924bcf744 100644 --- a/src/test/run-pass/asm-in-out-operand.rs +++ b/src/test/run-pass/asm-in-out-operand.rs @@ -36,8 +36,8 @@ pub fn main() { assert_eq!(2147483648, next_power_of_2(2147483647)); } - let mut y: int = 5; - let x: int; + let mut y: isize = 5; + let x: isize; unsafe { // Treat the output as initialization. asm!( diff --git a/src/test/run-pass/asm-out-assign.rs b/src/test/run-pass/asm-out-assign.rs index 7b1548a8d4f..3cb7f6400da 100644 --- a/src/test/run-pass/asm-out-assign.rs +++ b/src/test/run-pass/asm-out-assign.rs @@ -14,7 +14,7 @@ #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] pub fn main() { - let x: int; + let x: isize; unsafe { // Treat the output as initialization. asm!("mov $1, $0" : "=r"(x) : "r"(5_usize)); diff --git a/src/test/run-pass/assert-eq-macro-success.rs b/src/test/run-pass/assert-eq-macro-success.rs index c52e04322e9..9662e1ff33d 100644 --- a/src/test/run-pass/assert-eq-macro-success.rs +++ b/src/test/run-pass/assert-eq-macro-success.rs @@ -9,7 +9,7 @@ // except according to those terms. #[derive(PartialEq, Debug)] -struct Point { x : int } +struct Point { x : isize } pub fn main() { assert_eq!(14,14); diff --git a/src/test/run-pass/assign-assign.rs b/src/test/run-pass/assign-assign.rs index 5d93388f7f4..110f4720ceb 100644 --- a/src/test/run-pass/assign-assign.rs +++ b/src/test/run-pass/assign-assign.rs @@ -12,7 +12,7 @@ // pretty-expanded FIXME #23616 fn test_assign() { - let mut x: int; + let mut x: isize; let y: () = x = 10; assert_eq!(x, 10); assert_eq!(y, ()); @@ -25,7 +25,7 @@ fn test_assign() { } fn test_assign_op() { - let mut x: int = 0; + let mut x: isize = 0; let y: () = x += 10; assert_eq!(x, 10); assert_eq!(y, ()); diff --git a/src/test/run-pass/assignability-trait.rs b/src/test/run-pass/assignability-trait.rs index 4b22f84f78d..473f744a3ff 100644 --- a/src/test/run-pass/assignability-trait.rs +++ b/src/test/run-pass/assignability-trait.rs @@ -32,7 +32,7 @@ impl iterable for Vec { } } -fn length>(x: T) -> uint { +fn length>(x: T) -> usize { let mut len = 0; x.iterate(|_y| { len += 1; @@ -42,17 +42,17 @@ fn length>(x: T) -> uint { } pub fn main() { - let x: Vec = vec!(0,1,2,3); + let x: Vec = vec!(0,1,2,3); // Call a method - x.iterate(|y| { assert!(x[*y as uint] == *y); true }); + x.iterate(|y| { assert!(x[*y as usize] == *y); true }); // Call a parameterized function assert_eq!(length(x.clone()), x.len()); // Call a parameterized function, with type arguments that require // a borrow - assert_eq!(length::(&*x), x.len()); + assert_eq!(length::(&*x), x.len()); // Now try it with a type that *needs* to be borrowed let z = [0,1,2,3]; // Call a parameterized function - assert_eq!(length::(&z), z.len()); + assert_eq!(length::(&z), z.len()); } diff --git a/src/test/run-pass/associated-types-basic.rs b/src/test/run-pass/associated-types-basic.rs index 853b56ffb0c..d4ed2ee2d6e 100644 --- a/src/test/run-pass/associated-types-basic.rs +++ b/src/test/run-pass/associated-types-basic.rs @@ -19,11 +19,11 @@ trait Foo : MarkerTrait { } impl Foo for i32 { - type T = int; + type T = isize; } fn main() { let x: ::T = 22; - let y: int = 44; + let y: isize = 44; assert_eq!(x * 2, y); } diff --git a/src/test/run-pass/associated-types-binding-in-where-clause.rs b/src/test/run-pass/associated-types-binding-in-where-clause.rs index 87eeb23b7a3..82ebac7e5dc 100644 --- a/src/test/run-pass/associated-types-binding-in-where-clause.rs +++ b/src/test/run-pass/associated-types-binding-in-where-clause.rs @@ -20,9 +20,9 @@ pub trait Foo { #[derive(PartialEq)] pub struct Bar; -impl Foo for int { - type A = uint; - fn boo(&self) -> uint { 42 } +impl Foo for isize { + type A = usize; + fn boo(&self) -> usize { 42 } } impl Foo for char { @@ -34,7 +34,7 @@ fn foo_bar>(x: I) -> Bar { x.boo() } -fn foo_uint>(x: I) -> uint { +fn foo_uint>(x: I) -> usize { x.boo() } diff --git a/src/test/run-pass/associated-types-constant-type.rs b/src/test/run-pass/associated-types-constant-type.rs index b53e69e8d9d..5729fab475b 100644 --- a/src/test/run-pass/associated-types-constant-type.rs +++ b/src/test/run-pass/associated-types-constant-type.rs @@ -15,23 +15,23 @@ trait SignedUnsigned { fn convert(self) -> Self::Opposite; } -impl SignedUnsigned for int { - type Opposite = uint; +impl SignedUnsigned for isize { + type Opposite = usize; - fn convert(self) -> uint { - self as uint + fn convert(self) -> usize { + self as usize } } -impl SignedUnsigned for uint { - type Opposite = int; +impl SignedUnsigned for usize { + type Opposite = isize; - fn convert(self) -> int { - self as int + fn convert(self) -> isize { + self as isize } } -fn get(x: int) -> ::Opposite { +fn get(x: isize) -> ::Opposite { x.convert() } diff --git a/src/test/run-pass/associated-types-doubleendediterator-object.rs b/src/test/run-pass/associated-types-doubleendediterator-object.rs index 7354ae67add..5dc289194ff 100644 --- a/src/test/run-pass/associated-types-doubleendediterator-object.rs +++ b/src/test/run-pass/associated-types-doubleendediterator-object.rs @@ -13,7 +13,7 @@ #![allow(unknown_features)] #![feature(box_syntax)] -fn pairwise_sub(mut t: Box>) -> int { +fn pairwise_sub(mut t: Box>) -> isize { let mut result = 0; loop { let front = t.next(); diff --git a/src/test/run-pass/associated-types-in-default-method.rs b/src/test/run-pass/associated-types-in-default-method.rs index 5bf10ae132c..2a1b9bdd2fa 100644 --- a/src/test/run-pass/associated-types-in-default-method.rs +++ b/src/test/run-pass/associated-types-in-default-method.rs @@ -19,12 +19,12 @@ trait Get { } struct Struct { - x: int, + x: isize, } impl Get for Struct { - type Value = int; - fn get(&self) -> &int { + type Value = isize; + fn get(&self) -> &isize { &self.x } } diff --git a/src/test/run-pass/associated-types-in-fn.rs b/src/test/run-pass/associated-types-in-fn.rs index 4d286a4f9a4..40b10fbfcac 100644 --- a/src/test/run-pass/associated-types-in-fn.rs +++ b/src/test/run-pass/associated-types-in-fn.rs @@ -16,12 +16,12 @@ trait Get { } struct Struct { - x: int, + x: isize, } impl Get for Struct { - type Value = int; - fn get(&self) -> &int { + type Value = isize; + fn get(&self) -> &isize { &self.x } } diff --git a/src/test/run-pass/associated-types-in-impl-generics.rs b/src/test/run-pass/associated-types-in-impl-generics.rs index 41c53a5ad64..99a9b7c23fe 100644 --- a/src/test/run-pass/associated-types-in-impl-generics.rs +++ b/src/test/run-pass/associated-types-in-impl-generics.rs @@ -16,12 +16,12 @@ trait Get { } struct Struct { - x: int, + x: isize, } impl Get for Struct { - type Value = int; - fn get(&self) -> &int { + type Value = isize; + fn get(&self) -> &isize { &self.x } } diff --git a/src/test/run-pass/associated-types-in-inherent-method.rs b/src/test/run-pass/associated-types-in-inherent-method.rs index 7b8b041e7ef..0012d9d7596 100644 --- a/src/test/run-pass/associated-types-in-inherent-method.rs +++ b/src/test/run-pass/associated-types-in-inherent-method.rs @@ -16,12 +16,12 @@ trait Get { } struct Struct { - x: int, + x: isize, } impl Get for Struct { - type Value = int; - fn get(&self) -> &int { + type Value = isize; + fn get(&self) -> &isize { &self.x } } diff --git a/src/test/run-pass/associated-types-issue-20371.rs b/src/test/run-pass/associated-types-issue-20371.rs index 562deba4d93..a601dc0739a 100644 --- a/src/test/run-pass/associated-types-issue-20371.rs +++ b/src/test/run-pass/associated-types-issue-20371.rs @@ -17,6 +17,6 @@ use std::marker::MarkerTrait; -impl X for f64 { type Y = int; } +impl X for f64 { type Y = isize; } trait X : MarkerTrait { type Y; } fn main() {} diff --git a/src/test/run-pass/associated-types-iterator-binding.rs b/src/test/run-pass/associated-types-iterator-binding.rs index 56e39a44502..24c5a3e9a83 100644 --- a/src/test/run-pass/associated-types-iterator-binding.rs +++ b/src/test/run-pass/associated-types-iterator-binding.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -fn pairwise_sub>(mut t: T) -> int { +fn pairwise_sub>(mut t: T) -> isize { let mut result = 0; loop { let front = t.next(); diff --git a/src/test/run-pass/associated-types-projection-bound-in-supertraits.rs b/src/test/run-pass/associated-types-projection-bound-in-supertraits.rs index 24dae20b3e7..e150d015824 100644 --- a/src/test/run-pass/associated-types-projection-bound-in-supertraits.rs +++ b/src/test/run-pass/associated-types-projection-bound-in-supertraits.rs @@ -20,8 +20,8 @@ trait Not { } trait Int: Not + Sized { - fn count_ones(self) -> uint; - fn count_zeros(self) -> uint { + fn count_ones(self) -> usize; + fn count_zeros(self) -> usize { // neither works let x: Self = self.not(); 0 diff --git a/src/test/run-pass/associated-types-ref-in-struct-literal.rs b/src/test/run-pass/associated-types-ref-in-struct-literal.rs index 30b3871522c..945340008d8 100644 --- a/src/test/run-pass/associated-types-ref-in-struct-literal.rs +++ b/src/test/run-pass/associated-types-ref-in-struct-literal.rs @@ -18,8 +18,8 @@ pub trait Foo { fn dummy(&self) { } } -impl Foo for int { - type Bar = int; +impl Foo for isize { + type Bar = isize; } struct Thing { diff --git a/src/test/run-pass/associated-types-resolve-lifetime.rs b/src/test/run-pass/associated-types-resolve-lifetime.rs index 1ce4d6e341d..824291ea607 100644 --- a/src/test/run-pass/associated-types-resolve-lifetime.rs +++ b/src/test/run-pass/associated-types-resolve-lifetime.rs @@ -16,7 +16,7 @@ trait Get { trait Trait<'a> { type T: 'static; - type U: Get<&'a int>; + type U: Get<&'a isize>; fn dummy(&'a self) { } } diff --git a/src/test/run-pass/associated-types-return.rs b/src/test/run-pass/associated-types-return.rs index 87043b833fd..f190e81d8a6 100644 --- a/src/test/run-pass/associated-types-return.rs +++ b/src/test/run-pass/associated-types-return.rs @@ -20,14 +20,14 @@ pub trait Foo { #[derive(PartialEq)] pub struct Bar; -impl Foo for int { - type A = uint; - fn boo(&self) -> uint { 42 } +impl Foo for isize { + type A = usize; + fn boo(&self) -> usize { 42 } } impl Foo for Bar { - type A = int; - fn boo(&self) -> int { 43 } + type A = isize; + fn boo(&self) -> isize { 43 } } impl Foo for char { diff --git a/src/test/run-pass/associated-types-simple.rs b/src/test/run-pass/associated-types-simple.rs index 4c9deab4511..5a2761365bf 100644 --- a/src/test/run-pass/associated-types-simple.rs +++ b/src/test/run-pass/associated-types-simple.rs @@ -16,12 +16,12 @@ trait Get { } struct Struct { - x: int, + x: isize, } impl Get for Struct { - type Value = int; - fn get(&self) -> &int { + type Value = isize; + fn get(&self) -> &isize { &self.x } } diff --git a/src/test/run-pass/associated-types-sugar-path.rs b/src/test/run-pass/associated-types-sugar-path.rs index f8eff2f22fe..353b49b49ce 100644 --- a/src/test/run-pass/associated-types-sugar-path.rs +++ b/src/test/run-pass/associated-types-sugar-path.rs @@ -17,9 +17,9 @@ pub trait Foo { fn boo(&self) -> Self::A; } -impl Foo for int { - type A = uint; - fn boo(&self) -> uint { +impl Foo for isize { + type A = usize; + fn boo(&self) -> usize { 5 } } @@ -43,5 +43,5 @@ impl C for B { } pub fn main() { - let z: uint = bar(2, 4); + let z: usize = bar(2, 4); } diff --git a/src/test/run-pass/attr-no-drop-flag-size.rs b/src/test/run-pass/attr-no-drop-flag-size.rs index f135762d283..af8e4b7d4a1 100644 --- a/src/test/run-pass/attr-no-drop-flag-size.rs +++ b/src/test/run-pass/attr-no-drop-flag-size.rs @@ -26,5 +26,5 @@ impl Drop for Test { } pub fn main() { - assert_eq!(size_of::(), size_of::>()); + assert_eq!(size_of::(), size_of::>()); } diff --git a/src/test/run-pass/attr-start.rs b/src/test/run-pass/attr-start.rs index 08dce42c05b..bfafe04d600 100644 --- a/src/test/run-pass/attr-start.rs +++ b/src/test/run-pass/attr-start.rs @@ -13,6 +13,6 @@ #![feature(start)] #[start] -fn start(_argc: int, _argv: *const *const u8) -> int { +fn start(_argc: isize, _argv: *const *const u8) -> isize { return 0; } diff --git a/src/test/run-pass/auto-encode.rs b/src/test/run-pass/auto-encode.rs index 2b84adcb15c..2df0bb35597 100644 --- a/src/test/run-pass/auto-encode.rs +++ b/src/test/run-pass/auto-encode.rs @@ -43,7 +43,7 @@ fn test_rbml<'a, 'b, A: #[derive(Decodable, Encodable)] enum Expr { - Val(uint), + Val(usize), Plus(@Expr, @Expr), Minus(@Expr, @Expr) } @@ -103,23 +103,23 @@ impl cmp::Eq for Quark { impl cmp::Eq for CLike { fn eq(&self, other: &CLike) -> bool { - (*self) as int == *other as int + (*self) as isize == *other as isize } fn ne(&self, other: &CLike) -> bool { !self.eq(other) } } #[derive(Decodable, Encodable, Eq)] struct Spanned { - lo: uint, - hi: uint, + lo: usize, + hi: usize, node: T, } #[derive(Decodable, Encodable)] -struct SomeStruct { v: Vec } +struct SomeStruct { v: Vec } #[derive(Decodable, Encodable)] -struct Point {x: uint, y: uint} +struct Point {x: usize, y: usize} #[derive(Decodable, Encodable)] enum Quark { diff --git a/src/test/run-pass/auto-instantiate.rs b/src/test/run-pass/auto-instantiate.rs index cd4c66cb321..4a1bfa3eb42 100644 --- a/src/test/run-pass/auto-instantiate.rs +++ b/src/test/run-pass/auto-instantiate.rs @@ -10,7 +10,7 @@ #[derive(Debug)] struct Pair { a: T, b: U } -struct Triple { x: int, y: int, z: int } +struct Triple { x: isize, y: isize, z: isize } fn f(x: T, y: U) -> Pair { return Pair {a: x, b: y}; } diff --git a/src/test/run-pass/auto-ref-bounded-ty-param.rs b/src/test/run-pass/auto-ref-bounded-ty-param.rs index ee3738518cd..77ec0e1791f 100644 --- a/src/test/run-pass/auto-ref-bounded-ty-param.rs +++ b/src/test/run-pass/auto-ref-bounded-ty-param.rs @@ -13,7 +13,7 @@ trait Foo { } struct Bar { - x: int + x: isize } trait Baz { diff --git a/src/test/run-pass/auto-ref.rs b/src/test/run-pass/auto-ref.rs index 6dc67905427..0ad2303a769 100644 --- a/src/test/run-pass/auto-ref.rs +++ b/src/test/run-pass/auto-ref.rs @@ -9,7 +9,7 @@ // except according to those terms. struct Foo { - x: int, + x: isize, } trait Stuff { diff --git a/src/test/run-pass/autobind.rs b/src/test/run-pass/autobind.rs index cf3b7d41b3a..7d30b549ebe 100644 --- a/src/test/run-pass/autobind.rs +++ b/src/test/run-pass/autobind.rs @@ -13,7 +13,7 @@ fn f(x: Vec) -> T { return x.into_iter().next().unwrap(); } -fn g(act: F) -> int where F: FnOnce(Vec) -> int { return act(vec!(1, 2, 3)); } +fn g(act: F) -> isize where F: FnOnce(Vec) -> isize { return act(vec!(1, 2, 3)); } pub fn main() { assert_eq!(g(f), 1); diff --git a/src/test/run-pass/autoderef-and-borrow-method-receiver.rs b/src/test/run-pass/autoderef-and-borrow-method-receiver.rs index 6d7e150093e..a4c6cdd544c 100644 --- a/src/test/run-pass/autoderef-and-borrow-method-receiver.rs +++ b/src/test/run-pass/autoderef-and-borrow-method-receiver.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 struct Foo { - x: int, + x: isize, } impl Foo { diff --git a/src/test/run-pass/autoderef-method-on-trait.rs b/src/test/run-pass/autoderef-method-on-trait.rs index 0bec3af4273..d7eee85f502 100644 --- a/src/test/run-pass/autoderef-method-on-trait.rs +++ b/src/test/run-pass/autoderef-method-on-trait.rs @@ -14,14 +14,14 @@ #![feature(box_syntax)] trait double { - fn double(self: Box) -> uint; + fn double(self: Box) -> usize; } -impl double for uint { - fn double(self: Box) -> uint { *self * 2 } +impl double for usize { + fn double(self: Box) -> usize { *self * 2 } } pub fn main() { - let x: Box<_> = box() (box 3u as Box); + let x: Box<_> = box() (box 3us as Box); assert_eq!(x.double(), 6); } diff --git a/src/test/run-pass/autoderef-method-priority.rs b/src/test/run-pass/autoderef-method-priority.rs index bab0403e79d..6c52035b708 100644 --- a/src/test/run-pass/autoderef-method-priority.rs +++ b/src/test/run-pass/autoderef-method-priority.rs @@ -14,15 +14,15 @@ #![feature(box_syntax)] trait double { - fn double(self) -> uint; + fn double(self) -> usize; } -impl double for uint { - fn double(self) -> uint { self } +impl double for usize { + fn double(self) -> usize { self } } -impl double for Box { - fn double(self) -> uint { *self * 2 } +impl double for Box { + fn double(self) -> usize { *self * 2 } } pub fn main() { diff --git a/src/test/run-pass/autoderef-method-twice-but-not-thrice.rs b/src/test/run-pass/autoderef-method-twice-but-not-thrice.rs index e9f70346089..809ab0a3521 100644 --- a/src/test/run-pass/autoderef-method-twice-but-not-thrice.rs +++ b/src/test/run-pass/autoderef-method-twice-but-not-thrice.rs @@ -14,11 +14,11 @@ #![feature(box_syntax)] trait double { - fn double(self: Box) -> uint; + fn double(self: Box) -> usize; } -impl double for Box { - fn double(self: Box>) -> uint { **self * 2 } +impl double for Box { + fn double(self: Box>) -> usize { **self * 2 } } pub fn main() { diff --git a/src/test/run-pass/autoderef-method-twice.rs b/src/test/run-pass/autoderef-method-twice.rs index 7558733adf1..9c7828c8938 100644 --- a/src/test/run-pass/autoderef-method-twice.rs +++ b/src/test/run-pass/autoderef-method-twice.rs @@ -14,11 +14,11 @@ #![feature(box_syntax)] trait double { - fn double(self: Box) -> uint; + fn double(self: Box) -> usize; } -impl double for uint { - fn double(self: Box) -> uint { *self * 2 } +impl double for usize { + fn double(self: Box) -> usize { *self * 2 } } pub fn main() { diff --git a/src/test/run-pass/autoderef-method.rs b/src/test/run-pass/autoderef-method.rs index 1754a370768..e63dd07eb07 100644 --- a/src/test/run-pass/autoderef-method.rs +++ b/src/test/run-pass/autoderef-method.rs @@ -14,11 +14,11 @@ #![feature(box_syntax)] trait double { - fn double(self: Box) -> uint; + fn double(self: Box) -> usize; } -impl double for uint { - fn double(self: Box) -> uint { *self * 2 } +impl double for usize { + fn double(self: Box) -> usize { *self * 2 } } pub fn main() { diff --git a/src/test/run-pass/autoref-intermediate-types-issue-3585.rs b/src/test/run-pass/autoref-intermediate-types-issue-3585.rs index 37ba355956c..0f935776fc5 100644 --- a/src/test/run-pass/autoref-intermediate-types-issue-3585.rs +++ b/src/test/run-pass/autoref-intermediate-types-issue-3585.rs @@ -24,7 +24,7 @@ impl Foo for Box { } } -impl Foo for uint { +impl Foo for usize { fn foo(&self) -> String { format!("{}", *self) } diff --git a/src/test/run-pass/bind-field-short-with-modifiers.rs b/src/test/run-pass/bind-field-short-with-modifiers.rs index c7b770d0a2b..e61ff61a216 100644 --- a/src/test/run-pass/bind-field-short-with-modifiers.rs +++ b/src/test/run-pass/bind-field-short-with-modifiers.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 pub fn main() { - struct Foo { x: int, y: int } + struct Foo { x: isize, y: isize } let mut f = Foo { x: 10, y: 0 }; match f { Foo { ref mut x, .. } => *x = 11, diff --git a/src/test/run-pass/binops.rs b/src/test/run-pass/binops.rs index b36eb4bf2f6..2b8fcd303b6 100644 --- a/src/test/run-pass/binops.rs +++ b/src/test/run-pass/binops.rs @@ -61,11 +61,11 @@ fn test_ptr() { #[derive(PartialEq, Debug)] struct p { - x: int, - y: int, + x: isize, + y: isize, } -fn p(x: int, y: int) -> p { +fn p(x: isize, y: isize) -> p { p { x: x, y: y @@ -78,8 +78,8 @@ fn test_class() { unsafe { println!("q = {:x}, r = {:x}", - (::std::mem::transmute::<*const p, uint>(&q)), - (::std::mem::transmute::<*const p, uint>(&r))); + (::std::mem::transmute::<*const p, usize>(&q)), + (::std::mem::transmute::<*const p, usize>(&r))); } assert_eq!(q, r); r.y = 17; diff --git a/src/test/run-pass/bitwise.rs b/src/test/run-pass/bitwise.rs index 8418681b6b1..d6117a04e35 100644 --- a/src/test/run-pass/bitwise.rs +++ b/src/test/run-pass/bitwise.rs @@ -11,17 +11,17 @@ #[cfg(any(target_arch = "x86", target_arch = "arm"))] fn target() { - assert_eq!(-1000 as uint >> 3_usize, 536870787_usize); + assert_eq!(-1000 as usize >> 3_usize, 536870787_usize); } #[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))] fn target() { - assert_eq!(-1000 as uint >> 3_usize, 2305843009213693827_usize); + assert_eq!(-1000 as usize >> 3_usize, 2305843009213693827_usize); } fn general() { - let mut a: int = 1; - let mut b: int = 2; + let mut a: isize = 1; + let mut b: isize = 2; a ^= b; b ^= a; a = a ^ b; diff --git a/src/test/run-pass/block-arg-call-as.rs b/src/test/run-pass/block-arg-call-as.rs index a745e52efeb..5944438e20d 100644 --- a/src/test/run-pass/block-arg-call-as.rs +++ b/src/test/run-pass/block-arg-call-as.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -fn asBlock(f: F) -> uint where F: FnOnce() -> uint { +fn asBlock(f: F) -> usize where F: FnOnce() -> usize { return f(); } diff --git a/src/test/run-pass/block-fn-coerce.rs b/src/test/run-pass/block-fn-coerce.rs index 059f4e37494..0addd33c1e4 100644 --- a/src/test/run-pass/block-fn-coerce.rs +++ b/src/test/run-pass/block-fn-coerce.rs @@ -10,10 +10,10 @@ // pretty-expanded FIXME #23616 -fn force(f: F) -> int where F: FnOnce() -> int { return f(); } +fn force(f: F) -> isize where F: FnOnce() -> isize { return f(); } pub fn main() { - fn f() -> int { return 7; } + fn f() -> isize { return 7; } assert_eq!(force(f), 7); let g = {||force(f)}; assert_eq!(g(), 7); diff --git a/src/test/run-pass/borrow-by-val-method-receiver.rs b/src/test/run-pass/borrow-by-val-method-receiver.rs index bcaf94953d6..7efda12192a 100644 --- a/src/test/run-pass/borrow-by-val-method-receiver.rs +++ b/src/test/run-pass/borrow-by-val-method-receiver.rs @@ -15,7 +15,7 @@ trait Foo { fn foo(self); } -impl<'a> Foo for &'a [int] { +impl<'a> Foo for &'a [isize] { fn foo(self) {} } diff --git a/src/test/run-pass/borrow-tuple-fields.rs b/src/test/run-pass/borrow-tuple-fields.rs index 381afd94e3b..7cf61bd569d 100644 --- a/src/test/run-pass/borrow-tuple-fields.rs +++ b/src/test/run-pass/borrow-tuple-fields.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -struct Foo(int, int); +struct Foo(isize, isize); fn main() { let x = (1, 2); diff --git a/src/test/run-pass/borrowck-assign-to-subfield.rs b/src/test/run-pass/borrowck-assign-to-subfield.rs index f30a50e37d8..ee74a054408 100644 --- a/src/test/run-pass/borrowck-assign-to-subfield.rs +++ b/src/test/run-pass/borrowck-assign-to-subfield.rs @@ -12,11 +12,11 @@ pub fn main() { struct A { - a: int, + a: isize, w: B, } struct B { - a: int + a: isize } let mut p = A { a: 1, diff --git a/src/test/run-pass/borrowck-binding-mutbl.rs b/src/test/run-pass/borrowck-binding-mutbl.rs index a0ad3cc6ca1..10e9a1b51e2 100644 --- a/src/test/run-pass/borrowck-binding-mutbl.rs +++ b/src/test/run-pass/borrowck-binding-mutbl.rs @@ -11,9 +11,9 @@ // pretty-expanded FIXME #23616 -struct F { f: Vec } +struct F { f: Vec } -fn impure(_v: &[int]) { +fn impure(_v: &[isize]) { } pub fn main() { diff --git a/src/test/run-pass/borrowck-borrow-from-expr-block.rs b/src/test/run-pass/borrowck-borrow-from-expr-block.rs index ff61036d2c3..24c7285b1fb 100644 --- a/src/test/run-pass/borrowck-borrow-from-expr-block.rs +++ b/src/test/run-pass/borrowck-borrow-from-expr-block.rs @@ -13,14 +13,14 @@ #![allow(unknown_features)] #![feature(box_syntax)] -fn borrow(x: &int, f: F) where F: FnOnce(&int) { +fn borrow(x: &isize, f: F) where F: FnOnce(&isize) { f(x) } -fn test1(x: &Box) { +fn test1(x: &Box) { borrow(&*(*x).clone(), |p| { - let x_a = &**x as *const int; - assert!((x_a as uint) != (p as *const int as uint)); + let x_a = &**x as *const isize; + assert!((x_a as usize) != (p as *const isize as usize)); assert_eq!(unsafe{*x_a}, *p); }) } diff --git a/src/test/run-pass/borrowck-borrow-of-mut-base-ptr-safe.rs b/src/test/run-pass/borrowck-borrow-of-mut-base-ptr-safe.rs index eb61c747aea..b716a1a27a1 100644 --- a/src/test/run-pass/borrowck-borrow-of-mut-base-ptr-safe.rs +++ b/src/test/run-pass/borrowck-borrow-of-mut-base-ptr-safe.rs @@ -15,12 +15,12 @@ // pretty-expanded FIXME #23616 -fn foo<'a>(mut t0: &'a mut int, - mut t1: &'a mut int) { - let p: &int = &*t0; // Freezes `*t0` +fn foo<'a>(mut t0: &'a mut isize, + mut t1: &'a mut isize) { + let p: &isize = &*t0; // Freezes `*t0` let mut t2 = &t0; - let q: &int = &**t2; // Freezes `*t0`, but that's ok... - let r: &int = &*t0; // ...after all, could do same thing directly. + let q: &isize = &**t2; // Freezes `*t0`, but that's ok... + let r: &isize = &*t0; // ...after all, could do same thing directly. } pub fn main() { diff --git a/src/test/run-pass/borrowck-field-sensitivity.rs b/src/test/run-pass/borrowck-field-sensitivity.rs index 10e4ad3eb97..d97564a2914 100644 --- a/src/test/run-pass/borrowck-field-sensitivity.rs +++ b/src/test/run-pass/borrowck-field-sensitivity.rs @@ -13,8 +13,8 @@ #![allow(unknown_features)] #![feature(box_syntax)] -struct A { a: int, b: Box } -struct B { a: Box, b: Box } +struct A { a: isize, b: Box } +struct B { a: Box, b: Box } fn move_after_copy() { let x = A { a: 1, b: box 2 }; diff --git a/src/test/run-pass/borrowck-freeze-frozen-mut.rs b/src/test/run-pass/borrowck-freeze-frozen-mut.rs index 8e8e012fdbf..eaa78553d85 100644 --- a/src/test/run-pass/borrowck-freeze-frozen-mut.rs +++ b/src/test/run-pass/borrowck-freeze-frozen-mut.rs @@ -16,7 +16,7 @@ struct MutSlice<'a, T:'a> { data: &'a mut [T] } -fn get<'a, T>(ms: &'a MutSlice<'a, T>, index: uint) -> &'a T { +fn get<'a, T>(ms: &'a MutSlice<'a, T>, index: usize) -> &'a T { &ms.data[index] } diff --git a/src/test/run-pass/borrowck-lend-args.rs b/src/test/run-pass/borrowck-lend-args.rs index b0cf5d81aa9..f1f0274c5cc 100644 --- a/src/test/run-pass/borrowck-lend-args.rs +++ b/src/test/run-pass/borrowck-lend-args.rs @@ -11,17 +11,17 @@ // pretty-expanded FIXME #23616 -fn borrow(_v: &int) {} +fn borrow(_v: &isize) {} -fn borrow_from_arg_imm_ref(v: Box) { +fn borrow_from_arg_imm_ref(v: Box) { borrow(&*v); } -fn borrow_from_arg_mut_ref(v: &mut Box) { +fn borrow_from_arg_mut_ref(v: &mut Box) { borrow(&**v); } -fn borrow_from_arg_copy(v: Box) { +fn borrow_from_arg_copy(v: Box) { borrow(&*v); } diff --git a/src/test/run-pass/borrowck-macro-interaction-issue-6304.rs b/src/test/run-pass/borrowck-macro-interaction-issue-6304.rs index 1170c5be9b5..b40504f37d4 100644 --- a/src/test/run-pass/borrowck-macro-interaction-issue-6304.rs +++ b/src/test/run-pass/borrowck-macro-interaction-issue-6304.rs @@ -17,11 +17,11 @@ #![feature(box_syntax)] struct Foo { - a: int + a: isize } pub enum Bar { - Bar1, Bar2(int, Box), + Bar1, Bar2(isize, Box), } impl Foo { @@ -38,7 +38,7 @@ impl Foo { } } - fn check_id(&mut self, s: int) { panic!() } + fn check_id(&mut self, s: isize) { panic!() } } pub fn main() { } diff --git a/src/test/run-pass/borrowck-move-by-capture-ok.rs b/src/test/run-pass/borrowck-move-by-capture-ok.rs index 0ea18a6abe4..7c03c6a9a48 100644 --- a/src/test/run-pass/borrowck-move-by-capture-ok.rs +++ b/src/test/run-pass/borrowck-move-by-capture-ok.rs @@ -16,6 +16,6 @@ pub fn main() { let bar: Box<_> = box 3; - let h = || -> int { *bar }; + let h = || -> isize { *bar }; assert_eq!(h(), 3); } diff --git a/src/test/run-pass/borrowck-mut-uniq.rs b/src/test/run-pass/borrowck-mut-uniq.rs index d35600ef22e..f535c5fcfc9 100644 --- a/src/test/run-pass/borrowck-mut-uniq.rs +++ b/src/test/run-pass/borrowck-mut-uniq.rs @@ -14,9 +14,9 @@ use std::mem::swap; #[derive(Debug)] -struct Ints {sum: Box, values: Vec } +struct Ints {sum: Box, values: Vec } -fn add_int(x: &mut Ints, v: int) { +fn add_int(x: &mut Ints, v: isize) { *x.sum += v; let mut values = Vec::new(); swap(&mut values, &mut x.values); @@ -24,7 +24,7 @@ fn add_int(x: &mut Ints, v: int) { swap(&mut values, &mut x.values); } -fn iter_ints(x: &Ints, mut f: F) -> bool where F: FnMut(&int) -> bool { +fn iter_ints(x: &Ints, mut f: F) -> bool where F: FnMut(&isize) -> bool { let l = x.values.len(); (0..l).all(|i| f(&x.values[i])) } @@ -35,7 +35,7 @@ pub fn main() { add_int(&mut *ints, 44); iter_ints(&*ints, |i| { - println!("int = {:?}", *i); + println!("isize = {:?}", *i); true }); diff --git a/src/test/run-pass/borrowck-mut-vec-as-imm-slice.rs b/src/test/run-pass/borrowck-mut-vec-as-imm-slice.rs index 313dab18a31..4d37bcb5a48 100644 --- a/src/test/run-pass/borrowck-mut-vec-as-imm-slice.rs +++ b/src/test/run-pass/borrowck-mut-vec-as-imm-slice.rs @@ -11,13 +11,13 @@ // pretty-expanded FIXME #23616 -fn want_slice(v: &[int]) -> int { +fn want_slice(v: &[isize]) -> isize { let mut sum = 0; for i in v { sum += *i; } sum } -fn has_mut_vec(v: Vec ) -> int { +fn has_mut_vec(v: Vec ) -> isize { want_slice(&v) } diff --git a/src/test/run-pass/borrowck-nested-calls.rs b/src/test/run-pass/borrowck-nested-calls.rs index 315f6c80d4e..fa50eaa6a88 100644 --- a/src/test/run-pass/borrowck-nested-calls.rs +++ b/src/test/run-pass/borrowck-nested-calls.rs @@ -12,12 +12,12 @@ // Test that (safe) nested calls with `&mut` receivers are permitted. -struct Foo {a: uint, b: uint} +struct Foo {a: usize, b: usize} impl Foo { - pub fn inc_a(&mut self, v: uint) { self.a += v; } + pub fn inc_a(&mut self, v: usize) { self.a += v; } - pub fn next_b(&mut self) -> uint { + pub fn next_b(&mut self) -> usize { let b = self.b; self.b += 1; b diff --git a/src/test/run-pass/borrowck-pat-enum.rs b/src/test/run-pass/borrowck-pat-enum.rs index 74ce8ef2e45..b29cb63f6fa 100644 --- a/src/test/run-pass/borrowck-pat-enum.rs +++ b/src/test/run-pass/borrowck-pat-enum.rs @@ -10,7 +10,7 @@ // ignore-pretty -fn match_ref(v: Option) -> int { +fn match_ref(v: Option) -> isize { match v { Some(ref i) => { *i @@ -19,24 +19,24 @@ fn match_ref(v: Option) -> int { } } -fn match_ref_unused(v: Option) { +fn match_ref_unused(v: Option) { match v { Some(_) => {} None => {} } } -fn impure(_i: int) { +fn impure(_i: isize) { } -fn match_imm_reg(v: &Option) { +fn match_imm_reg(v: &Option) { match *v { Some(ref i) => {impure(*i)} // OK because immutable None => {} } } -fn match_mut_reg(v: &mut Option) { +fn match_mut_reg(v: &mut Option) { match *v { Some(ref i) => {impure(*i)} // OK, frozen None => {} diff --git a/src/test/run-pass/borrowck-rvalues-mutable.rs b/src/test/run-pass/borrowck-rvalues-mutable.rs index e7ff379b433..1b20f6c7061 100644 --- a/src/test/run-pass/borrowck-rvalues-mutable.rs +++ b/src/test/run-pass/borrowck-rvalues-mutable.rs @@ -11,11 +11,11 @@ // pretty-expanded FIXME #23616 struct Counter { - value: uint + value: usize } impl Counter { - fn new(v: uint) -> Counter { + fn new(v: usize) -> Counter { Counter {value: v} } @@ -24,11 +24,11 @@ impl Counter { self } - fn get(&self) -> uint { + fn get(&self) -> usize { self.value } - fn get_and_inc(&mut self) -> uint { + fn get_and_inc(&mut self) -> usize { let v = self.value; self.value += 1; v diff --git a/src/test/run-pass/borrowck-scope-of-deref-issue-4666.rs b/src/test/run-pass/borrowck-scope-of-deref-issue-4666.rs index 488c014eac7..36a84a62d48 100644 --- a/src/test/run-pass/borrowck-scope-of-deref-issue-4666.rs +++ b/src/test/run-pass/borrowck-scope-of-deref-issue-4666.rs @@ -15,14 +15,14 @@ // pretty-expanded FIXME #23616 struct Box { - x: uint + x: usize } impl Box { - fn get(&self) -> &uint { + fn get(&self) -> &usize { &self.x } - fn set(&mut self, x: uint) { + fn set(&mut self, x: usize) { self.x = x; } } diff --git a/src/test/run-pass/borrowck-uniq-via-ref.rs b/src/test/run-pass/borrowck-uniq-via-ref.rs index c7199fccff6..0ec87599c63 100644 --- a/src/test/run-pass/borrowck-uniq-via-ref.rs +++ b/src/test/run-pass/borrowck-uniq-via-ref.rs @@ -12,7 +12,7 @@ // pretty-expanded FIXME #23616 struct Rec { - f: Box, + f: Box, } struct Outer { @@ -24,12 +24,12 @@ struct Inner { } struct Innermost { - h: Box, + h: Box, } -fn borrow(_v: &int) {} +fn borrow(_v: &isize) {} -fn box_mut(v: &mut Box) { +fn box_mut(v: &mut Box) { borrow(&**v); // OK: &mut -> &imm } @@ -41,7 +41,7 @@ fn box_mut_recs(v: &mut Outer) { borrow(&*v.f.g.h); // OK: &mut -> &imm } -fn box_imm(v: &Box) { +fn box_imm(v: &Box) { borrow(&**v); // OK } diff --git a/src/test/run-pass/borrowck-univariant-enum.rs b/src/test/run-pass/borrowck-univariant-enum.rs index 0ce2709c02d..84efe190367 100644 --- a/src/test/run-pass/borrowck-univariant-enum.rs +++ b/src/test/run-pass/borrowck-univariant-enum.rs @@ -15,7 +15,7 @@ use std::cell::Cell; #[derive(Copy)] enum newtype { - newvar(int) + newvar(isize) } pub fn main() { diff --git a/src/test/run-pass/borrowck-use-mut-borrow.rs b/src/test/run-pass/borrowck-use-mut-borrow.rs index b646c741e7d..7ad81b6be6e 100644 --- a/src/test/run-pass/borrowck-use-mut-borrow.rs +++ b/src/test/run-pass/borrowck-use-mut-borrow.rs @@ -13,7 +13,7 @@ #![allow(unknown_features)] #![feature(box_syntax)] -struct A { a: int, b: Box } +struct A { a: isize, b: Box } fn field_copy_after_field_borrow() { let mut x = A { a: 1, b: box 2 }; diff --git a/src/test/run-pass/borrowed-ptr-pattern-3.rs b/src/test/run-pass/borrowed-ptr-pattern-3.rs index eaad5944e68..c8cc29b9bda 100644 --- a/src/test/run-pass/borrowed-ptr-pattern-3.rs +++ b/src/test/run-pass/borrowed-ptr-pattern-3.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -fn foo<'r>(s: &'r uint) -> bool { +fn foo<'r>(s: &'r usize) -> bool { match s { &3 => true, _ => false diff --git a/src/test/run-pass/borrowed-ptr-pattern-option.rs b/src/test/run-pass/borrowed-ptr-pattern-option.rs index 9588663aa18..14b6c32a11e 100644 --- a/src/test/run-pass/borrowed-ptr-pattern-option.rs +++ b/src/test/run-pass/borrowed-ptr-pattern-option.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -fn select<'r>(x: &'r Option, y: &'r Option) -> &'r Option { +fn select<'r>(x: &'r Option, y: &'r Option) -> &'r Option { match (x, y) { (&None, &None) => x, (&Some(_), _) => x, diff --git a/src/test/run-pass/break-value.rs b/src/test/run-pass/break-value.rs index 4c4600590ee..e5a035fb562 100644 --- a/src/test/run-pass/break-value.rs +++ b/src/test/run-pass/break-value.rs @@ -10,6 +10,6 @@ // pretty-expanded FIXME #23616 -fn int_id(x: int) -> int { return x; } +fn int_id(x: isize) -> isize { return x; } pub fn main() { loop { int_id(break); } } diff --git a/src/test/run-pass/bug-7183-generics.rs b/src/test/run-pass/bug-7183-generics.rs index 625cd98bdf8..5467ed10e98 100644 --- a/src/test/run-pass/bug-7183-generics.rs +++ b/src/test/run-pass/bug-7183-generics.rs @@ -19,7 +19,7 @@ fn hello(s:&S) -> String{ s.say("hello") } -impl Speak for int { +impl Speak for isize { fn say(&self, s:&str) -> String { format!("{}: {}", s, *self) } @@ -39,8 +39,8 @@ pub fn main() { assert_eq!(3.hi(), "hello: 3".to_string()); assert_eq!(Some(Some(3)).hi(), "something!something!hello: 3".to_string()); - assert_eq!(None::.hi(), "hello - none".to_string()); + assert_eq!(None::.hi(), "hello - none".to_string()); - assert_eq!(Some(None::).hi(), "something!hello - none".to_string()); + assert_eq!(Some(None::).hi(), "something!hello - none".to_string()); assert_eq!(Some(3).hi(), "something!hello: 3".to_string()); } diff --git a/src/test/run-pass/builtin-superkinds-capabilities-xc.rs b/src/test/run-pass/builtin-superkinds-capabilities-xc.rs index 0ff8c0c6ba0..082f5944fd3 100644 --- a/src/test/run-pass/builtin-superkinds-capabilities-xc.rs +++ b/src/test/run-pass/builtin-superkinds-capabilities-xc.rs @@ -32,7 +32,7 @@ fn foo(val: T, chan: Sender) { } pub fn main() { - let (tx, rx): (Sender>, Receiver>) = channel(); + let (tx, rx): (Sender>, Receiver>) = channel(); foo(X(31337), tx); assert!(rx.recv().unwrap() == X(31337)); } diff --git a/src/test/run-pass/builtin-superkinds-capabilities.rs b/src/test/run-pass/builtin-superkinds-capabilities.rs index d016a92f465..594fb5ec707 100644 --- a/src/test/run-pass/builtin-superkinds-capabilities.rs +++ b/src/test/run-pass/builtin-superkinds-capabilities.rs @@ -25,7 +25,7 @@ fn foo(val: T, chan: Sender) { } pub fn main() { - let (tx, rx): (Sender, Receiver) = channel(); + let (tx, rx): (Sender, Receiver) = channel(); foo(31337, tx); assert!(rx.recv().unwrap() == 31337); } diff --git a/src/test/run-pass/builtin-superkinds-simple.rs b/src/test/run-pass/builtin-superkinds-simple.rs index e8d59b267fe..8a954de9d0a 100644 --- a/src/test/run-pass/builtin-superkinds-simple.rs +++ b/src/test/run-pass/builtin-superkinds-simple.rs @@ -14,6 +14,6 @@ trait Foo : Send { } -impl Foo for int { } +impl Foo for isize { } pub fn main() { } diff --git a/src/test/run-pass/by-value-self-in-mut-slot.rs b/src/test/run-pass/by-value-self-in-mut-slot.rs index baca7dc13f1..464c24fc8b0 100644 --- a/src/test/run-pass/by-value-self-in-mut-slot.rs +++ b/src/test/run-pass/by-value-self-in-mut-slot.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 struct X { - a: int + a: isize } trait Changer { diff --git a/src/test/run-pass/c-stack-returning-int64.rs b/src/test/run-pass/c-stack-returning-int64.rs index a9f80de8605..dcf1b554006 100644 --- a/src/test/run-pass/c-stack-returning-int64.rs +++ b/src/test/run-pass/c-stack-returning-int64.rs @@ -26,9 +26,9 @@ mod mlibc { } } -fn atol(s: String) -> int { +fn atol(s: String) -> isize { let c = CString::new(s).unwrap(); - unsafe { mlibc::atol(c.as_ptr()) as int } + unsafe { mlibc::atol(c.as_ptr()) as isize } } fn atoll(s: String) -> i64 { diff --git a/src/test/run-pass/call-closure-from-overloaded-op.rs b/src/test/run-pass/call-closure-from-overloaded-op.rs index cef48aadab5..e3ee282ec2a 100644 --- a/src/test/run-pass/call-closure-from-overloaded-op.rs +++ b/src/test/run-pass/call-closure-from-overloaded-op.rs @@ -10,10 +10,10 @@ // pretty-expanded FIXME #23616 -fn foo() -> int { 22 } +fn foo() -> isize { 22 } pub fn main() { - let mut x: Vec int> = Vec::new(); + let mut x: Vec isize> = Vec::new(); x.push(foo); assert_eq!((x[0])(), 22); } diff --git a/src/test/run-pass/capture-clauses-unboxed-closures.rs b/src/test/run-pass/capture-clauses-unboxed-closures.rs index c4f89bbcd32..448ed76fe96 100644 --- a/src/test/run-pass/capture-clauses-unboxed-closures.rs +++ b/src/test/run-pass/capture-clauses-unboxed-closures.rs @@ -21,6 +21,6 @@ fn each<'a,T,F:FnMut(&'a T)>(x: &'a [T], mut f: F) { fn main() { let mut sum = 0; let elems = [ 1, 2, 3, 4, 5 ]; - each(&elems, |val: &uint| sum += *val); + each(&elems, |val: &usize| sum += *val); assert_eq!(sum, 15); } diff --git a/src/test/run-pass/cast-in-array-size.rs b/src/test/run-pass/cast-in-array-size.rs index e79bab1b7b0..6f1fafba563 100644 --- a/src/test/run-pass/cast-in-array-size.rs +++ b/src/test/run-pass/cast-in-array-size.rs @@ -12,11 +12,11 @@ // issues #10618 and #16382 // pretty-expanded FIXME #23616 -const SIZE: int = 25; +const SIZE: isize = 25; fn main() { - let _a: [bool; 1 as uint]; - let _b: [int; SIZE as uint] = [1; SIZE as uint]; - let _c: [bool; '\n' as uint] = [true; '\n' as uint]; - let _d: [bool; true as uint] = [true; true as uint]; + let _a: [bool; 1 as usize]; + let _b: [isize; SIZE as usize] = [1; SIZE as usize]; + let _c: [bool; '\n' as usize] = [true; '\n' as usize]; + let _d: [bool; true as usize] = [true; true as usize]; } diff --git a/src/test/run-pass/cast-region-to-uint.rs b/src/test/run-pass/cast-region-to-uint.rs index deb0c0d0dc0..f5180ea260f 100644 --- a/src/test/run-pass/cast-region-to-uint.rs +++ b/src/test/run-pass/cast-region-to-uint.rs @@ -9,6 +9,6 @@ // except according to those terms. pub fn main() { - let x: int = 3; - println!("&x={:x}", (&x as *const int as uint)); + let x: isize = 3; + println!("&x={:x}", (&x as *const isize as usize)); } diff --git a/src/test/run-pass/cast.rs b/src/test/run-pass/cast.rs index 3eec130d5a9..03a73555f85 100644 --- a/src/test/run-pass/cast.rs +++ b/src/test/run-pass/cast.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 pub fn main() { - let i: int = 'Q' as int; + let i: isize = 'Q' as isize; assert_eq!(i, 0x51); let u: u32 = i as u32; assert_eq!(u, 0x51 as u32); diff --git a/src/test/run-pass/cell-does-not-clone.rs b/src/test/run-pass/cell-does-not-clone.rs index d7a74adc02d..c87a3e8bb93 100644 --- a/src/test/run-pass/cell-does-not-clone.rs +++ b/src/test/run-pass/cell-does-not-clone.rs @@ -14,7 +14,7 @@ use std::cell::Cell; #[derive(Copy)] struct Foo { - x: int + x: isize } impl Clone for Foo { diff --git a/src/test/run-pass/cfgs-on-items.rs b/src/test/run-pass/cfgs-on-items.rs index 7d25321fae1..5c22d5c8690 100644 --- a/src/test/run-pass/cfgs-on-items.rs +++ b/src/test/run-pass/cfgs-on-items.rs @@ -14,23 +14,23 @@ // pretty-expanded FIXME #23616 #[cfg(all(fooA, not(bar)))] -fn foo1() -> int { 1 } +fn foo1() -> isize { 1 } // !fooA AND !bar #[cfg(all(not(fooA), not(bar)))] -fn foo2() -> int { 2 } +fn foo2() -> isize { 2 } // fooC OR (fooB AND !bar) #[cfg(any(fooC, all(fooB, not(bar))))] -fn foo2() -> int { 3 } +fn foo2() -> isize { 3 } // fooA AND bar #[cfg(all(fooA, bar))] -fn foo3() -> int { 2 } +fn foo3() -> isize { 2 } // !(fooA AND bar) #[cfg(not(all(fooA, bar)))] -fn foo3() -> int { 3 } +fn foo3() -> isize { 3 } pub fn main() { assert_eq!(1, foo1()); diff --git a/src/test/run-pass/check-static-mut-slices.rs b/src/test/run-pass/check-static-mut-slices.rs index adf041b04d6..19c3458ef7b 100644 --- a/src/test/run-pass/check-static-mut-slices.rs +++ b/src/test/run-pass/check-static-mut-slices.rs @@ -12,7 +12,7 @@ // pretty-expanded FIXME #23616 -static mut TEST: &'static mut [int] = &mut [1]; +static mut TEST: &'static mut [isize] = &mut [1]; pub fn main() { unsafe { diff --git a/src/test/run-pass/check-static-slice.rs b/src/test/run-pass/check-static-slice.rs index 260668e48e9..8a7ae1de9bc 100644 --- a/src/test/run-pass/check-static-slice.rs +++ b/src/test/run-pass/check-static-slice.rs @@ -13,22 +13,22 @@ // pretty-expanded FIXME #23616 -const aa: [int; 3] = [1, 2, 3]; -const ab: &'static [int; 3] = &aa; -const ac: &'static [int] = ab; -const ad: &'static [int] = &aa; -const ae: &'static [int; 3] = &[1, 2, 3]; -const af: &'static [int] = &[1, 2, 3]; +const aa: [isize; 3] = [1, 2, 3]; +const ab: &'static [isize; 3] = &aa; +const ac: &'static [isize] = ab; +const ad: &'static [isize] = &aa; +const ae: &'static [isize; 3] = &[1, 2, 3]; +const af: &'static [isize] = &[1, 2, 3]; -static ca: int = aa[0]; -static cb: int = ab[1]; -static cc: int = ac[2]; -static cd: int = ad[0]; -static ce: int = ae[1]; -static cf: int = af[2]; +static ca: isize = aa[0]; +static cb: isize = ab[1]; +static cc: isize = ac[2]; +static cd: isize = ad[0]; +static ce: isize = ae[1]; +static cf: isize = af[2]; fn main () { - let b: &[int] = &[1, 2, 3]; + let b: &[isize] = &[1, 2, 3]; assert!(ac == b); assert!(ad == b); assert!(af == b); diff --git a/src/test/run-pass/class-cast-to-trait-multiple-types.rs b/src/test/run-pass/class-cast-to-trait-multiple-types.rs index 4f1654e6031..e5acad3a3ad 100644 --- a/src/test/run-pass/class-cast-to-trait-multiple-types.rs +++ b/src/test/run-pass/class-cast-to-trait-multiple-types.rs @@ -10,17 +10,17 @@ trait noisy { - fn speak(&mut self) -> int; + fn speak(&mut self) -> isize; } struct dog { - barks: uint, + barks: usize, - volume: int, + volume: isize, } impl dog { - fn bark(&mut self) -> int { + fn bark(&mut self) -> isize { println!("Woof {} {}", self.barks, self.volume); self.barks += 1_usize; if self.barks % 3_usize == 0_usize { @@ -35,7 +35,7 @@ impl dog { } impl noisy for dog { - fn speak(&mut self) -> int { + fn speak(&mut self) -> isize { self.bark() } } @@ -49,26 +49,26 @@ fn dog() -> dog { #[derive(Clone)] struct cat { - meows: uint, + meows: usize, - how_hungry: int, + how_hungry: isize, name: String, } impl noisy for cat { - fn speak(&mut self) -> int { - self.meow() as int + fn speak(&mut self) -> isize { + self.meow() as isize } } impl cat { - pub fn meow_count(&self) -> uint { + pub fn meow_count(&self) -> usize { self.meows } } impl cat { - fn meow(&mut self) -> uint { + fn meow(&mut self) -> usize { println!("Meow"); self.meows += 1_usize; if self.meows % 5_usize == 0_usize { @@ -78,7 +78,7 @@ impl cat { } } -fn cat(in_x: uint, in_y: int, in_name: String) -> cat { +fn cat(in_x: usize, in_y: isize, in_name: String) -> cat { cat { meows: in_x, how_hungry: in_y, diff --git a/src/test/run-pass/class-cast-to-trait.rs b/src/test/run-pass/class-cast-to-trait.rs index 01513ab6f47..adb0b6cd0a7 100644 --- a/src/test/run-pass/class-cast-to-trait.rs +++ b/src/test/run-pass/class-cast-to-trait.rs @@ -16,8 +16,8 @@ trait noisy { } struct cat { - meows: uint, - how_hungry: int, + meows: usize, + how_hungry: isize, name: String, } @@ -49,7 +49,7 @@ impl cat { } } -fn cat(in_x : uint, in_y : int, in_name: String) -> cat { +fn cat(in_x : usize, in_y : isize, in_name: String) -> cat { cat { meows: in_x, how_hungry: in_y, diff --git a/src/test/run-pass/class-dtor.rs b/src/test/run-pass/class-dtor.rs index 6884ac8c075..05ec2bc0ac7 100644 --- a/src/test/run-pass/class-dtor.rs +++ b/src/test/run-pass/class-dtor.rs @@ -11,8 +11,8 @@ // pretty-expanded FIXME #23616 struct cat { - done : extern fn(uint), - meows : uint, + done : extern fn(usize), + meows : usize, } impl Drop for cat { @@ -21,7 +21,7 @@ impl Drop for cat { } } -fn cat(done: extern fn(uint)) -> cat { +fn cat(done: extern fn(usize)) -> cat { cat { meows: 0, done: done diff --git a/src/test/run-pass/class-exports.rs b/src/test/run-pass/class-exports.rs index 05228b30c41..675acf1dd62 100644 --- a/src/test/run-pass/class-exports.rs +++ b/src/test/run-pass/class-exports.rs @@ -17,7 +17,7 @@ use kitty::cat; mod kitty { pub struct cat { - meows: uint, + meows: usize, name: String, } diff --git a/src/test/run-pass/class-impl-very-parameterized-trait.rs b/src/test/run-pass/class-impl-very-parameterized-trait.rs index c3ced512afa..57c1fd80bd5 100644 --- a/src/test/run-pass/class-impl-very-parameterized-trait.rs +++ b/src/test/run-pass/class-impl-very-parameterized-trait.rs @@ -16,20 +16,20 @@ enum cat_type { tuxedo, tabby, tortoiseshell } impl cmp::PartialEq for cat_type { fn eq(&self, other: &cat_type) -> bool { - ((*self) as uint) == ((*other) as uint) + ((*self) as usize) == ((*other) as usize) } fn ne(&self, other: &cat_type) -> bool { !(*self).eq(other) } } // Very silly -- this just returns the value of the name field -// for any int value that's less than the meows field +// for any isize value that's less than the meows field // ok: T should be in scope when resolving the trait ref for map struct cat { // Yes, you can have negative meows - meows : int, + meows : isize, - how_hungry : int, + how_hungry : isize, name : T, } @@ -46,26 +46,26 @@ impl cat { return false; } } - fn len(&self) -> uint { self.meows as uint } + fn len(&self) -> usize { self.meows as usize } fn is_empty(&self) -> bool { self.meows == 0 } fn clear(&mut self) {} - fn contains_key(&self, k: &int) -> bool { *k <= self.meows } + fn contains_key(&self, k: &isize) -> bool { *k <= self.meows } - fn find(&self, k: &int) -> Option<&T> { + fn find(&self, k: &isize) -> Option<&T> { if *k <= self.meows { Some(&self.name) } else { None } } - fn insert(&mut self, k: int, _: T) -> bool { + fn insert(&mut self, k: isize, _: T) -> bool { self.meows += k; true } - fn find_mut(&mut self, _k: &int) -> Option<&mut T> { panic!() } + fn find_mut(&mut self, _k: &isize) -> Option<&mut T> { panic!() } - fn remove(&mut self, k: &int) -> bool { + fn remove(&mut self, k: &isize) -> bool { if self.find(k).is_some() { self.meows -= *k; true } else { @@ -73,20 +73,20 @@ impl cat { } } - fn pop(&mut self, _k: &int) -> Option { panic!() } + fn pop(&mut self, _k: &isize) -> Option { panic!() } - fn swap(&mut self, _k: int, _v: T) -> Option { panic!() } + fn swap(&mut self, _k: isize, _v: T) -> Option { panic!() } } impl cat { - pub fn get(&self, k: &int) -> &T { + pub fn get(&self, k: &isize) -> &T { match self.find(k) { Some(v) => { v } None => { panic!("epic fail"); } } } - pub fn new(in_x: int, in_y: int, in_name: T) -> cat { + pub fn new(in_x: isize, in_y: isize, in_name: T) -> cat { cat{meows: in_x, how_hungry: in_y, name: in_name } } } diff --git a/src/test/run-pass/class-implement-trait-cross-crate.rs b/src/test/run-pass/class-implement-trait-cross-crate.rs index bd05221b8c7..5a1dc930efa 100644 --- a/src/test/run-pass/class-implement-trait-cross-crate.rs +++ b/src/test/run-pass/class-implement-trait-cross-crate.rs @@ -13,9 +13,9 @@ extern crate cci_class_trait; use cci_class_trait::animals::noisy; struct cat { - meows: uint, + meows: usize, - how_hungry : int, + how_hungry : isize, name : String, } @@ -47,7 +47,7 @@ impl cat { } } -fn cat(in_x : uint, in_y : int, in_name: String) -> cat { +fn cat(in_x : usize, in_y : isize, in_name: String) -> cat { cat { meows: in_x, how_hungry: in_y, diff --git a/src/test/run-pass/class-implement-traits.rs b/src/test/run-pass/class-implement-traits.rs index 87e6e5f675e..394af6b9ecd 100644 --- a/src/test/run-pass/class-implement-traits.rs +++ b/src/test/run-pass/class-implement-traits.rs @@ -15,9 +15,9 @@ trait noisy { #[derive(Clone)] struct cat { - meows : uint, + meows : usize, - how_hungry : int, + how_hungry : isize, name : String, } @@ -48,7 +48,7 @@ impl noisy for cat { fn speak(&mut self) { self.meow(); } } -fn cat(in_x : uint, in_y : int, in_name: String) -> cat { +fn cat(in_x : usize, in_y : isize, in_name: String) -> cat { cat { meows: in_x, how_hungry: in_y, diff --git a/src/test/run-pass/class-methods.rs b/src/test/run-pass/class-methods.rs index 2959938e373..d454bdd73a1 100644 --- a/src/test/run-pass/class-methods.rs +++ b/src/test/run-pass/class-methods.rs @@ -11,17 +11,17 @@ // pretty-expanded FIXME #23616 struct cat { - meows : uint, + meows : usize, - how_hungry : int, + how_hungry : isize, } impl cat { pub fn speak(&mut self) { self.meows += 1; } - pub fn meow_count(&mut self) -> uint { self.meows } + pub fn meow_count(&mut self) -> usize { self.meows } } -fn cat(in_x: uint, in_y: int) -> cat { +fn cat(in_x: usize, in_y: isize) -> cat { cat { meows: in_x, how_hungry: in_y diff --git a/src/test/run-pass/class-poly-methods.rs b/src/test/run-pass/class-poly-methods.rs index 9e74a100204..27f872d532c 100644 --- a/src/test/run-pass/class-poly-methods.rs +++ b/src/test/run-pass/class-poly-methods.rs @@ -13,19 +13,19 @@ struct cat { info : Vec , - meows : uint, + meows : usize, - how_hungry : int, + how_hungry : isize, } impl cat { pub fn speak(&mut self, stuff: Vec ) { self.meows += stuff.len(); } - pub fn meow_count(&mut self) -> uint { self.meows } + pub fn meow_count(&mut self) -> usize { self.meows } } -fn cat(in_x : uint, in_y : int, in_info: Vec ) -> cat { +fn cat(in_x : usize, in_y : isize, in_info: Vec ) -> cat { cat { meows: in_x, how_hungry: in_y, @@ -34,7 +34,7 @@ fn cat(in_x : uint, in_y : int, in_info: Vec ) -> cat { } pub fn main() { - let mut nyan : cat = cat::(52, 99, vec!(9)); + let mut nyan : cat = cat::(52, 99, vec!(9)); let mut kitty = cat(1000, 2, vec!("tabby".to_string())); assert_eq!(nyan.how_hungry, 99); assert_eq!(kitty.how_hungry, 2); diff --git a/src/test/run-pass/class-separate-impl.rs b/src/test/run-pass/class-separate-impl.rs index 2bdc053675f..52853658c82 100644 --- a/src/test/run-pass/class-separate-impl.rs +++ b/src/test/run-pass/class-separate-impl.rs @@ -14,9 +14,9 @@ use std::fmt; struct cat { - meows : uint, + meows : usize, - how_hungry : int, + how_hungry : isize, name : String, } @@ -46,7 +46,7 @@ impl cat { } } -fn cat(in_x : uint, in_y : int, in_name: String) -> cat { +fn cat(in_x : usize, in_y : isize, in_name: String) -> cat { cat { meows: in_x, how_hungry: in_y, diff --git a/src/test/run-pass/class-typarams.rs b/src/test/run-pass/class-typarams.rs index 6cd8f4c658c..cc9a118ba19 100644 --- a/src/test/run-pass/class-typarams.rs +++ b/src/test/run-pass/class-typarams.rs @@ -13,17 +13,17 @@ use std::marker::PhantomData; struct cat { - meows : uint, - how_hungry : int, + meows : usize, + how_hungry : isize, m: PhantomData } impl cat { pub fn speak(&mut self) { self.meows += 1; } - pub fn meow_count(&mut self) -> uint { self.meows } + pub fn meow_count(&mut self) -> usize { self.meows } } -fn cat(in_x : uint, in_y : int) -> cat { +fn cat(in_x : usize, in_y : isize) -> cat { cat { meows: in_x, how_hungry: in_y, @@ -33,6 +33,6 @@ fn cat(in_x : uint, in_y : int) -> cat { pub fn main() { - let _nyan : cat = cat::(52, 99); + let _nyan : cat = cat::(52, 99); // let mut kitty = cat(1000, 2); } diff --git a/src/test/run-pass/classes-simple-method.rs b/src/test/run-pass/classes-simple-method.rs index 8fc4f47dc02..0d9f859d2d1 100644 --- a/src/test/run-pass/classes-simple-method.rs +++ b/src/test/run-pass/classes-simple-method.rs @@ -11,16 +11,16 @@ // pretty-expanded FIXME #23616 struct cat { - meows : uint, + meows : usize, - how_hungry : int, + how_hungry : isize, } impl cat { pub fn speak(&mut self) {} } -fn cat(in_x : uint, in_y : int) -> cat { +fn cat(in_x : usize, in_y : isize) -> cat { cat { meows: in_x, how_hungry: in_y diff --git a/src/test/run-pass/classes-simple.rs b/src/test/run-pass/classes-simple.rs index ff5ef145bcd..f520623a75a 100644 --- a/src/test/run-pass/classes-simple.rs +++ b/src/test/run-pass/classes-simple.rs @@ -11,12 +11,12 @@ // pretty-expanded FIXME #23616 struct cat { - meows : uint, + meows : usize, - how_hungry : int, + how_hungry : isize, } -fn cat(in_x : uint, in_y : int) -> cat { +fn cat(in_x : usize, in_y : isize) -> cat { cat { meows: in_x, how_hungry: in_y diff --git a/src/test/run-pass/classes.rs b/src/test/run-pass/classes.rs index 4fabca491be..fa0dda11233 100644 --- a/src/test/run-pass/classes.rs +++ b/src/test/run-pass/classes.rs @@ -9,9 +9,9 @@ // except according to those terms. struct cat { - meows : uint, + meows : usize, - how_hungry : int, + how_hungry : isize, name : String, } @@ -40,7 +40,7 @@ impl cat { } } -fn cat(in_x : uint, in_y : int, in_name: String) -> cat { +fn cat(in_x : usize, in_y : isize, in_name: String) -> cat { cat { meows: in_x, how_hungry: in_y, diff --git a/src/test/run-pass/cleanup-arm-conditional.rs b/src/test/run-pass/cleanup-arm-conditional.rs index 8dff34bdc1f..b62f2b2a8eb 100644 --- a/src/test/run-pass/cleanup-arm-conditional.rs +++ b/src/test/run-pass/cleanup-arm-conditional.rs @@ -28,15 +28,15 @@ use std::os; -struct Test { x: int } +struct Test { x: isize } impl Test { - fn get_x(&self) -> Option> { + fn get_x(&self) -> Option> { Some(box self.x) } } -fn do_something(t: &Test) -> int { +fn do_something(t: &Test) -> isize { // The cleanup scope for the result of `t.get_x()` should be the // arm itself and not the match, otherwise we'll (potentially) get diff --git a/src/test/run-pass/cleanup-rvalue-during-if-and-while.rs b/src/test/run-pass/cleanup-rvalue-during-if-and-while.rs index 7fd7ab90fc2..1d0030fd3d3 100644 --- a/src/test/run-pass/cleanup-rvalue-during-if-and-while.rs +++ b/src/test/run-pass/cleanup-rvalue-during-if-and-while.rs @@ -19,7 +19,7 @@ struct Temporary; -static mut DROPPED: int = 0; +static mut DROPPED: isize = 0; impl Drop for Temporary { fn drop(&mut self) { diff --git a/src/test/run-pass/cleanup-rvalue-temp-during-incomplete-alloc.rs b/src/test/run-pass/cleanup-rvalue-temp-during-incomplete-alloc.rs index 24c95bbb6de..3b5421e5aff 100644 --- a/src/test/run-pass/cleanup-rvalue-temp-during-incomplete-alloc.rs +++ b/src/test/run-pass/cleanup-rvalue-temp-during-incomplete-alloc.rs @@ -35,13 +35,13 @@ enum Conzabble { Bickwick(Foo) } -struct Foo { field: Box } +struct Foo { field: Box } -fn do_it(x: &[uint]) -> Foo { +fn do_it(x: &[usize]) -> Foo { panic!() } -fn get_bar(x: uint) -> Vec { vec!(x * 2) } +fn get_bar(x: usize) -> Vec { vec!(x * 2) } pub fn fails() { let x = 2; diff --git a/src/test/run-pass/cleanup-shortcircuit.rs b/src/test/run-pass/cleanup-shortcircuit.rs index d448934f781..0cfe739018c 100644 --- a/src/test/run-pass/cleanup-shortcircuit.rs +++ b/src/test/run-pass/cleanup-shortcircuit.rs @@ -35,6 +35,6 @@ pub fn main() { if args.len() >= 2 && args[1] == "signal" { // Raise a segfault. - unsafe { *(0 as *mut int) = 0; } + unsafe { *(0 as *mut isize) = 0; } } } diff --git a/src/test/run-pass/clone-with-exterior.rs b/src/test/run-pass/clone-with-exterior.rs index cfbcc52e602..fa663105ccd 100644 --- a/src/test/run-pass/clone-with-exterior.rs +++ b/src/test/run-pass/clone-with-exterior.rs @@ -16,8 +16,8 @@ use std::thread::Thread; struct Pair { - a: int, - b: int + a: isize, + b: isize } pub fn main() { diff --git a/src/test/run-pass/cmp-default.rs b/src/test/run-pass/cmp-default.rs index fbe871a1bff..2b7557c7bc5 100644 --- a/src/test/run-pass/cmp-default.rs +++ b/src/test/run-pass/cmp-default.rs @@ -24,7 +24,7 @@ impl PartialEq for Fool { } } -struct Int(int); +struct Int(isize); impl PartialEq for Int { fn eq(&self, other: &Int) -> bool { @@ -42,7 +42,7 @@ impl PartialOrd for Int { } } -struct RevInt(int); +struct RevInt(isize); impl PartialEq for RevInt { fn eq(&self, other: &RevInt) -> bool { diff --git a/src/test/run-pass/coerce-expect-unsized.rs b/src/test/run-pass/coerce-expect-unsized.rs index 1b12cbd33df..6926879856c 100644 --- a/src/test/run-pass/coerce-expect-unsized.rs +++ b/src/test/run-pass/coerce-expect-unsized.rs @@ -19,8 +19,8 @@ use std::fmt::Debug; // rvalue expressions to be unsized. See #20169 for more information. pub fn main() { - // FIXME #22405: We cannot infer the type `Box<[int; k]>` for - // the r-value expression from the context `Box<[int]>`, and + // FIXME #22405: We cannot infer the type `Box<[isize; k]>` for + // the r-value expression from the context `Box<[isize]>`, and // therefore the `box EXPR` desugaring breaks down. // // One could reasonably claim that the `box EXPR` desugaring is @@ -28,24 +28,24 @@ pub fn main() { // eventually fix that, at which point the `Box::new` calls below // should be replaced wth uses of `box`. - let _: Box<[int]> = Box::new({ [1, 2, 3] }); - let _: Box<[int]> = Box::new(if true { [1, 2, 3] } else { [1, 3, 4] }); - let _: Box<[int]> = Box::new(match true { true => [1, 2, 3], false => [1, 3, 4] }); - let _: Box _> = Box::new({ |x| (x as u8) }); + let _: Box<[isize]> = Box::new({ [1, 2, 3] }); + let _: Box<[isize]> = Box::new(if true { [1, 2, 3] } else { [1, 3, 4] }); + let _: Box<[isize]> = Box::new(match true { true => [1, 2, 3], false => [1, 3, 4] }); + let _: Box _> = Box::new({ |x| (x as u8) }); let _: Box = Box::new(if true { false } else { true }); let _: Box = Box::new(match true { true => 'a', false => 'b' }); - let _: &[int] = &{ [1, 2, 3] }; - let _: &[int] = &if true { [1, 2, 3] } else { [1, 3, 4] }; - let _: &[int] = &match true { true => [1, 2, 3], false => [1, 3, 4] }; - let _: &Fn(int) -> _ = &{ |x| (x as u8) }; + let _: &[isize] = &{ [1, 2, 3] }; + let _: &[isize] = &if true { [1, 2, 3] } else { [1, 3, 4] }; + let _: &[isize] = &match true { true => [1, 2, 3], false => [1, 3, 4] }; + let _: &Fn(isize) -> _ = &{ |x| (x as u8) }; let _: &Debug = &if true { false } else { true }; let _: &Debug = &match true { true => 'a', false => 'b' }; - let _: Box<[int]> = Box::new([1, 2, 3]); - let _: Box _> = Box::new(|x| (x as u8)); + let _: Box<[isize]> = Box::new([1, 2, 3]); + let _: Box _> = Box::new(|x| (x as u8)); - let _: Vec _>> = vec![ + let _: Vec _>> = vec![ Box::new(|x| (x as u8)), Box::new(|x| (x as i16 as u8)), ]; diff --git a/src/test/run-pass/coerce-match-calls.rs b/src/test/run-pass/coerce-match-calls.rs index b3eec9939c2..c2f6b4c4ac4 100644 --- a/src/test/run-pass/coerce-match-calls.rs +++ b/src/test/run-pass/coerce-match-calls.rs @@ -15,9 +15,9 @@ use std::boxed::Box; pub fn main() { - let _: Box<[int]> = if true { Box::new([1, 2, 3]) } else { Box::new([1]) }; + let _: Box<[isize]> = if true { Box::new([1, 2, 3]) } else { Box::new([1]) }; - let _: Box<[int]> = match true { true => Box::new([1, 2, 3]), false => Box::new([1]) }; + let _: Box<[isize]> = match true { true => Box::new([1, 2, 3]), false => Box::new([1]) }; // Check we don't get over-keen at propagating coercions in the case of casts. let x = if true { 42 } else { 42u8 } as u16; diff --git a/src/test/run-pass/coerce-match.rs b/src/test/run-pass/coerce-match.rs index 01627f1a837..6bf5c4d596f 100644 --- a/src/test/run-pass/coerce-match.rs +++ b/src/test/run-pass/coerce-match.rs @@ -16,10 +16,10 @@ #![feature(box_syntax)] pub fn main() { - let _: Box<[int]> = + let _: Box<[isize]> = if true { let b: Box<_> = box [1, 2, 3]; b } else { let b: Box<_> = box [1]; b }; - let _: Box<[int]> = match true { + let _: Box<[isize]> = match true { true => { let b: Box<_> = box [1, 2, 3]; b } false => { let b: Box<_> = box [1]; b } }; diff --git a/src/test/run-pass/coerce-reborrow-imm-ptr-arg.rs b/src/test/run-pass/coerce-reborrow-imm-ptr-arg.rs index 7812f0088b1..581764d4a3b 100644 --- a/src/test/run-pass/coerce-reborrow-imm-ptr-arg.rs +++ b/src/test/run-pass/coerce-reborrow-imm-ptr-arg.rs @@ -10,15 +10,15 @@ // pretty-expanded FIXME #23616 -fn negate(x: &int) -> int { +fn negate(x: &isize) -> isize { -*x } -fn negate_mut(y: &mut int) -> int { +fn negate_mut(y: &mut isize) -> isize { negate(y) } -fn negate_imm(y: &int) -> int { +fn negate_imm(y: &isize) -> isize { negate(y) } diff --git a/src/test/run-pass/coerce-reborrow-imm-ptr-rcvr.rs b/src/test/run-pass/coerce-reborrow-imm-ptr-rcvr.rs index 4638c51bbf7..6000b358acf 100644 --- a/src/test/run-pass/coerce-reborrow-imm-ptr-rcvr.rs +++ b/src/test/run-pass/coerce-reborrow-imm-ptr-rcvr.rs @@ -11,14 +11,14 @@ // pretty-expanded FIXME #23616 struct SpeechMaker { - speeches: uint + speeches: usize } impl SpeechMaker { - pub fn how_many(&self) -> uint { self.speeches } + pub fn how_many(&self) -> usize { self.speeches } } -fn foo(speaker: &SpeechMaker) -> uint { +fn foo(speaker: &SpeechMaker) -> usize { speaker.how_many() + 33 } diff --git a/src/test/run-pass/coerce-reborrow-imm-vec-arg.rs b/src/test/run-pass/coerce-reborrow-imm-vec-arg.rs index edc8df64a20..1786d5b54f3 100644 --- a/src/test/run-pass/coerce-reborrow-imm-vec-arg.rs +++ b/src/test/run-pass/coerce-reborrow-imm-vec-arg.rs @@ -10,17 +10,17 @@ // pretty-expanded FIXME #23616 -fn sum(x: &[int]) -> int { +fn sum(x: &[isize]) -> isize { let mut sum = 0; for y in x { sum += *y; } return sum; } -fn sum_mut(y: &mut [int]) -> int { +fn sum_mut(y: &mut [isize]) -> isize { sum(y) } -fn sum_imm(y: &[int]) -> int { +fn sum_imm(y: &[isize]) -> isize { sum(y) } diff --git a/src/test/run-pass/coerce-reborrow-imm-vec-rcvr.rs b/src/test/run-pass/coerce-reborrow-imm-vec-rcvr.rs index dcef1983200..2e41ff3a560 100644 --- a/src/test/run-pass/coerce-reborrow-imm-vec-rcvr.rs +++ b/src/test/run-pass/coerce-reborrow-imm-vec-rcvr.rs @@ -11,11 +11,11 @@ // pretty-expanded FIXME #23616 -fn bar(v: &mut [uint]) -> Vec { +fn bar(v: &mut [usize]) -> Vec { v.to_vec() } -fn bip(v: &[uint]) -> Vec { +fn bip(v: &[usize]) -> Vec { v.to_vec() } diff --git a/src/test/run-pass/coerce-reborrow-mut-ptr-arg.rs b/src/test/run-pass/coerce-reborrow-mut-ptr-arg.rs index 9f6444c43c7..b70146ea2d3 100644 --- a/src/test/run-pass/coerce-reborrow-mut-ptr-arg.rs +++ b/src/test/run-pass/coerce-reborrow-mut-ptr-arg.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 struct SpeechMaker { - speeches: uint + speeches: usize } fn talk(x: &mut SpeechMaker) { diff --git a/src/test/run-pass/coerce-reborrow-mut-ptr-rcvr.rs b/src/test/run-pass/coerce-reborrow-mut-ptr-rcvr.rs index 1751979db8c..5f4cc569ac4 100644 --- a/src/test/run-pass/coerce-reborrow-mut-ptr-rcvr.rs +++ b/src/test/run-pass/coerce-reborrow-mut-ptr-rcvr.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 struct SpeechMaker { - speeches: uint + speeches: usize } impl SpeechMaker { diff --git a/src/test/run-pass/coerce-reborrow-mut-vec-arg.rs b/src/test/run-pass/coerce-reborrow-mut-vec-arg.rs index ab8b6818f43..803f86e0fb1 100644 --- a/src/test/run-pass/coerce-reborrow-mut-vec-arg.rs +++ b/src/test/run-pass/coerce-reborrow-mut-vec-arg.rs @@ -11,11 +11,11 @@ // pretty-expanded FIXME #23616 -fn reverse(v: &mut [uint]) { +fn reverse(v: &mut [usize]) { v.reverse(); } -fn bar(v: &mut [uint]) { +fn bar(v: &mut [usize]) { reverse(v); reverse(v); reverse(v); diff --git a/src/test/run-pass/coerce-reborrow-mut-vec-rcvr.rs b/src/test/run-pass/coerce-reborrow-mut-vec-rcvr.rs index 06ff3824cd2..a5fac127356 100644 --- a/src/test/run-pass/coerce-reborrow-mut-vec-rcvr.rs +++ b/src/test/run-pass/coerce-reborrow-mut-vec-rcvr.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 -fn bar(v: &mut [uint]) { +fn bar(v: &mut [usize]) { v.reverse(); v.reverse(); v.reverse(); diff --git a/src/test/run-pass/coherence-impl-in-fn.rs b/src/test/run-pass/coherence-impl-in-fn.rs index f91ccf6120a..134549d747a 100644 --- a/src/test/run-pass/coherence-impl-in-fn.rs +++ b/src/test/run-pass/coherence-impl-in-fn.rs @@ -15,7 +15,7 @@ pub fn main() { enum x { foo } impl ::std::cmp::PartialEq for x { fn eq(&self, other: &x) -> bool { - (*self) as int == (*other) as int + (*self) as isize == (*other) as isize } fn ne(&self, other: &x) -> bool { !(*self).eq(other) } } diff --git a/src/test/run-pass/coherence-multidispatch-tuple.rs b/src/test/run-pass/coherence-multidispatch-tuple.rs index 8ca79f1d4f1..07477f96c0d 100644 --- a/src/test/run-pass/coherence-multidispatch-tuple.rs +++ b/src/test/run-pass/coherence-multidispatch-tuple.rs @@ -17,15 +17,15 @@ use std::default::Default; // heterogeneous pair. trait MyTrait { - fn get(&self) -> uint; + fn get(&self) -> usize; } impl MyTrait for (T,T) { - fn get(&self) -> uint { 0 } + fn get(&self) -> usize { 0 } } -impl MyTrait for (uint,int) { - fn get(&self) -> uint { 0 } +impl MyTrait for (usize,isize) { + fn get(&self) -> usize { 0 } } fn main() { diff --git a/src/test/run-pass/coherence-where-clause.rs b/src/test/run-pass/coherence-where-clause.rs index 9f980e161b0..8ab340d1bff 100644 --- a/src/test/run-pass/coherence-where-clause.rs +++ b/src/test/run-pass/coherence-where-clause.rs @@ -25,7 +25,7 @@ impl MyTrait for T #[derive(Clone, Copy, Debug, PartialEq)] struct MyType { - dummy: uint + dummy: usize } impl MyTrait for MyType { diff --git a/src/test/run-pass/comm.rs b/src/test/run-pass/comm.rs index cf318c50cff..43f10cfd060 100644 --- a/src/test/run-pass/comm.rs +++ b/src/test/run-pass/comm.rs @@ -22,7 +22,7 @@ pub fn main() { assert_eq!(y, 10); } -fn child(c: &Sender) { +fn child(c: &Sender) { println!("sending"); c.send(10).unwrap(); println!("value sent"); diff --git a/src/test/run-pass/compare-generic-enums.rs b/src/test/run-pass/compare-generic-enums.rs index 9b049ede859..69945584876 100644 --- a/src/test/run-pass/compare-generic-enums.rs +++ b/src/test/run-pass/compare-generic-enums.rs @@ -10,9 +10,9 @@ // pretty-expanded FIXME #23616 -type an_int = int; +type an_int = isize; -fn cmp(x: Option, y: Option) -> bool { +fn cmp(x: Option, y: Option) -> bool { x == y } diff --git a/src/test/run-pass/complex.rs b/src/test/run-pass/complex.rs index f8c8ac20d72..6bb9503c2b0 100644 --- a/src/test/run-pass/complex.rs +++ b/src/test/run-pass/complex.rs @@ -11,20 +11,20 @@ -type t = int; +type t = isize; fn nothing() { } fn putstr(_s: String) { } -fn putint(_i: int) { - let mut i: int = 33; +fn putint(_i: isize) { + let mut i: isize = 33; while i < 36 { putstr("hi".to_string()); i = i + 1; } } -fn zerg(i: int) -> int { return i; } +fn zerg(i: isize) -> isize { return i; } -fn foo(x: int) -> int { +fn foo(x: isize) -> isize { let mut y: t = x + 2; putstr("hello".to_string()); while y < 10 { putint(y); if y * 3 == 4 { y = y + 2; nothing(); } } @@ -35,7 +35,7 @@ fn foo(x: int) -> int { } pub fn main() { - let x: int = 2 + 2; + let x: isize = 2 + 2; println!("{}", x); println!("hello, world"); println!("{}", 10); diff --git a/src/test/run-pass/conditional-compile.rs b/src/test/run-pass/conditional-compile.rs index 590912f6e91..e6660bb9ae8 100644 --- a/src/test/run-pass/conditional-compile.rs +++ b/src/test/run-pass/conditional-compile.rs @@ -31,7 +31,7 @@ mod rustrt { } #[cfg(bogus)] -type t = int; +type t = isize; type t = bool; @@ -42,21 +42,21 @@ enum tg { bar, } #[cfg(bogus)] struct r { - i: int, + i: isize, } #[cfg(bogus)] -fn r(i:int) -> r { +fn r(i:isize) -> r { r { i: i } } struct r { - i: int, + i: isize, } -fn r(i:int) -> r { +fn r(i:isize) -> r { r { i: i } @@ -100,8 +100,8 @@ fn test_in_fn_ctxt() { f(); #[cfg(bogus)] - static i: int = 0; - static i: int = 1; + static i: isize = 0; + static i: isize = 1; assert_eq!(i, 1); } @@ -122,7 +122,7 @@ mod test_use_statements { mod test_methods { struct Foo { - bar: uint + bar: usize } impl Fooable for Foo { diff --git a/src/test/run-pass/const-binops.rs b/src/test/run-pass/const-binops.rs index 8b8fcfccc1c..1a95220cda5 100644 --- a/src/test/run-pass/const-binops.rs +++ b/src/test/run-pass/const-binops.rs @@ -19,40 +19,40 @@ macro_rules! assert_approx_eq { }) } -static A: int = -4 + 3; -static A2: uint = 3 + 3; +static A: isize = -4 + 3; +static A2: usize = 3 + 3; static B: f64 = 3.0 + 2.7; -static C: int = 3 - 4; -static D: uint = 3 - 3; +static C: isize = 3 - 4; +static D: usize = 3 - 3; static E: f64 = 3.0 - 2.7; -static E2: int = -3 * 3; -static F: uint = 3 * 3; +static E2: isize = -3 * 3; +static F: usize = 3 * 3; static G: f64 = 3.3 * 3.3; -static H: int = 3 / -1; -static I: uint = 3 / 3; +static H: isize = 3 / -1; +static I: usize = 3 / 3; static J: f64 = 3.3 / 3.3; static N: bool = true && false; static O: bool = true || false; -static P: int = 3 & 1; -static Q: uint = 1 & 3; +static P: isize = 3 & 1; +static Q: usize = 1 & 3; -static R: int = 3 | 1; -static S: uint = 1 | 3; +static R: isize = 3 | 1; +static S: usize = 1 | 3; -static T: int = 3 ^ 1; -static U: uint = 1 ^ 3; +static T: isize = 3 ^ 1; +static U: usize = 1 ^ 3; -static V: int = 1 << 3; +static V: isize = 1 << 3; // NOTE: better shr coverage -static W: int = 1024 >> 4; -static X: uint = 1024 >> 4; +static W: isize = 1024 >> 4; +static X: usize = 1024 >> 4; static Y: bool = 1 == 1; static Z: bool = 1.0f64 == 1.0; diff --git a/src/test/run-pass/const-block-item-macro-codegen.rs b/src/test/run-pass/const-block-item-macro-codegen.rs index 06fbccdec06..b9e8dbf41d7 100644 --- a/src/test/run-pass/const-block-item-macro-codegen.rs +++ b/src/test/run-pass/const-block-item-macro-codegen.rs @@ -15,12 +15,12 @@ struct MyType { desc: &'static str, - data: uint, - code: fn(uint, uint) -> uint + data: usize, + code: fn(usize, usize) -> usize } impl MyType { - fn eval(&self, a: uint) -> uint { + fn eval(&self, a: usize) -> usize { (self.code)(self.data, a) } } @@ -28,7 +28,7 @@ impl MyType { macro_rules! codegen { ($e:expr, $v:expr) => { { - fn generated(a: uint, b: uint) -> uint { + fn generated(a: usize, b: usize) -> usize { a - ($e * b) } MyType { diff --git a/src/test/run-pass/const-block-item.rs b/src/test/run-pass/const-block-item.rs index 1f7e942ea5a..897e5382261 100644 --- a/src/test/run-pass/const-block-item.rs +++ b/src/test/run-pass/const-block-item.rs @@ -12,35 +12,35 @@ mod foo { pub trait Value { - fn value(&self) -> uint; + fn value(&self) -> usize; } } -static BLOCK_USE: uint = { +static BLOCK_USE: usize = { use foo::Value; 100 }; -static BLOCK_PUB_USE: uint = { +static BLOCK_PUB_USE: usize = { pub use foo::Value; 200 }; -static BLOCK_STRUCT_DEF: uint = { +static BLOCK_STRUCT_DEF: usize = { struct Foo { - a: uint + a: usize } Foo{ a: 300 }.a }; -static BLOCK_FN_DEF: fn(uint) -> uint = { - fn foo(a: uint) -> uint { +static BLOCK_FN_DEF: fn(usize) -> usize = { + fn foo(a: usize) -> usize { a + 10 } foo }; -static BLOCK_MACRO_RULES: uint = { +static BLOCK_MACRO_RULES: usize = { macro_rules! baz { () => (412) } diff --git a/src/test/run-pass/const-bound.rs b/src/test/run-pass/const-bound.rs index 37101303ed9..5c2985ffa77 100644 --- a/src/test/run-pass/const-bound.rs +++ b/src/test/run-pass/const-bound.rs @@ -15,7 +15,7 @@ fn foo(x: T) -> T { x } -struct F { field: int } +struct F { field: isize } pub fn main() { /*foo(1); diff --git a/src/test/run-pass/const-const.rs b/src/test/run-pass/const-const.rs index 16d71f52d98..d75a5a7eb1c 100644 --- a/src/test/run-pass/const-const.rs +++ b/src/test/run-pass/const-const.rs @@ -10,8 +10,8 @@ // pretty-expanded FIXME #23616 -const a: int = 1; -const b: int = a + 2; +const a: isize = 1; +const b: isize = a + 2; pub fn main() { assert_eq!(b, 3); diff --git a/src/test/run-pass/const-contents.rs b/src/test/run-pass/const-contents.rs index af6af776c3d..2dfb88dee0b 100644 --- a/src/test/run-pass/const-contents.rs +++ b/src/test/run-pass/const-contents.rs @@ -12,12 +12,12 @@ // pretty-expanded FIXME #23616 -static lsl : int = 1 << 2; -static add : int = 1 + 2; +static lsl : isize = 1 << 2; +static add : isize = 1 + 2; static addf : f64 = 1.0 + 2.0; -static not : int = !0; +static not : isize = !0; static notb : bool = !true; -static neg : int = -(1); +static neg : isize = -(1); pub fn main() { assert_eq!(lsl, 4); diff --git a/src/test/run-pass/const-cross-crate-const.rs b/src/test/run-pass/const-cross-crate-const.rs index a92c2aab312..e36a55361ec 100644 --- a/src/test/run-pass/const-cross-crate-const.rs +++ b/src/test/run-pass/const-cross-crate-const.rs @@ -14,8 +14,8 @@ extern crate cci_const; static foo: &'static str = cci_const::foopy; -static a: uint = cci_const::uint_val; -static b: uint = cci_const::uint_expr + 5; +static a: usize = cci_const::uint_val; +static b: usize = cci_const::uint_expr + 5; pub fn main() { assert_eq!(a, 12); diff --git a/src/test/run-pass/const-deref.rs b/src/test/run-pass/const-deref.rs index 7b2bb0d31f9..1648332fe2c 100644 --- a/src/test/run-pass/const-deref.rs +++ b/src/test/run-pass/const-deref.rs @@ -10,8 +10,8 @@ // pretty-expanded FIXME #23616 -const C: &'static int = &1000; -static D: int = *C; +const C: &'static isize = &1000; +static D: isize = *C; pub fn main() { assert_eq!(D, 1000); diff --git a/src/test/run-pass/const-enum-byref-self.rs b/src/test/run-pass/const-enum-byref-self.rs index 8dcd67c0578..e99e1aac8af 100644 --- a/src/test/run-pass/const-enum-byref-self.rs +++ b/src/test/run-pass/const-enum-byref-self.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -enum E { V, VV(int) } +enum E { V, VV(isize) } static C: E = E::V; impl E { diff --git a/src/test/run-pass/const-enum-byref.rs b/src/test/run-pass/const-enum-byref.rs index 7cf2dcfa890..4905eaace68 100644 --- a/src/test/run-pass/const-enum-byref.rs +++ b/src/test/run-pass/const-enum-byref.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -enum E { V, VV(int) } +enum E { V, VV(isize) } static C: E = E::V; fn f(a: &E) { diff --git a/src/test/run-pass/const-enum-cast.rs b/src/test/run-pass/const-enum-cast.rs index 11e02338f41..3d73933c6f6 100644 --- a/src/test/run-pass/const-enum-cast.rs +++ b/src/test/run-pass/const-enum-cast.rs @@ -14,10 +14,10 @@ enum A { A1, A2 } enum B { B1=0, B2=2 } pub fn main () { - static c1: int = A::A2 as int; - static c2: int = B::B2 as int; - let a1 = A::A2 as int; - let a2 = B::B2 as int; + static c1: isize = A::A2 as isize; + static c2: isize = B::B2 as isize; + let a1 = A::A2 as isize; + let a2 = B::B2 as isize; assert_eq!(c1, 1); assert_eq!(c2, 2); assert_eq!(a1, 1); diff --git a/src/test/run-pass/const-enum-ptr.rs b/src/test/run-pass/const-enum-ptr.rs index d7503ff8d7d..d34b5381df9 100644 --- a/src/test/run-pass/const-enum-ptr.rs +++ b/src/test/run-pass/const-enum-ptr.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -enum E { V0, V1(int) } +enum E { V0, V1(isize) } static C: &'static E = &E::V0; pub fn main() { diff --git a/src/test/run-pass/const-enum-structlike.rs b/src/test/run-pass/const-enum-structlike.rs index 57cf2b61925..113f20e21e1 100644 --- a/src/test/run-pass/const-enum-structlike.rs +++ b/src/test/run-pass/const-enum-structlike.rs @@ -12,7 +12,7 @@ enum E { S0 { s: String }, - S1 { u: uint } + S1 { u: usize } } static C: E = E::S1 { u: 23 }; diff --git a/src/test/run-pass/const-enum-vec-index.rs b/src/test/run-pass/const-enum-vec-index.rs index 98e236bfccb..fcaf8b8844b 100644 --- a/src/test/run-pass/const-enum-vec-index.rs +++ b/src/test/run-pass/const-enum-vec-index.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -enum E { V1(int), V0 } +enum E { V1(isize), V0 } const C: &'static [E] = &[E::V0, E::V1(0xDEADBEE)]; static C0: E = C[0]; static C1: E = C[1]; diff --git a/src/test/run-pass/const-enum-vec-ptr.rs b/src/test/run-pass/const-enum-vec-ptr.rs index 8eb9a425b86..936d72ac65e 100644 --- a/src/test/run-pass/const-enum-vec-ptr.rs +++ b/src/test/run-pass/const-enum-vec-ptr.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -enum E { V1(int), V0 } +enum E { V1(isize), V0 } static C: &'static [E] = &[E::V0, E::V1(0xDEADBEE), E::V0]; pub fn main() { diff --git a/src/test/run-pass/const-enum-vector.rs b/src/test/run-pass/const-enum-vector.rs index 64940015802..6fdf0c3948f 100644 --- a/src/test/run-pass/const-enum-vector.rs +++ b/src/test/run-pass/const-enum-vector.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -enum E { V1(int), V0 } +enum E { V1(isize), V0 } static C: [E; 3] = [E::V0, E::V1(0xDEADBEE), E::V0]; pub fn main() { diff --git a/src/test/run-pass/const-expr-in-fixed-length-vec.rs b/src/test/run-pass/const-expr-in-fixed-length-vec.rs index 82d9bb2b1e1..6cf9239e2e4 100644 --- a/src/test/run-pass/const-expr-in-fixed-length-vec.rs +++ b/src/test/run-pass/const-expr-in-fixed-length-vec.rs @@ -15,7 +15,7 @@ pub fn main() { - const FOO: uint = 2; - let _v: [int; FOO*3]; + const FOO: usize = 2; + let _v: [isize; FOO*3]; } diff --git a/src/test/run-pass/const-expr-in-vec-repeat.rs b/src/test/run-pass/const-expr-in-vec-repeat.rs index 29eefd20502..fc3e6749f6e 100644 --- a/src/test/run-pass/const-expr-in-vec-repeat.rs +++ b/src/test/run-pass/const-expr-in-vec-repeat.rs @@ -14,7 +14,7 @@ pub fn main() { - const FOO: uint = 2; + const FOO: usize = 2; let _v = [0; FOO*3*2/2]; } diff --git a/src/test/run-pass/const-fields-and-indexing.rs b/src/test/run-pass/const-fields-and-indexing.rs index 0819e0becbf..55d6b60c192 100644 --- a/src/test/run-pass/const-fields-and-indexing.rs +++ b/src/test/run-pass/const-fields-and-indexing.rs @@ -8,21 +8,21 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -const x : [int; 4] = [1,2,3,4]; -static p : int = x[2]; -const y : &'static [int] = &[1,2,3,4]; -static q : int = y[2]; +const x : [isize; 4] = [1,2,3,4]; +static p : isize = x[2]; +const y : &'static [isize] = &[1,2,3,4]; +static q : isize = y[2]; -struct S {a: int, b: int} +struct S {a: isize, b: isize} const s : S = S {a: 10, b: 20}; -static t : int = s.b; +static t : isize = s.b; -struct K {a: int, b: int, c: D} -struct D { d: int, e: int } +struct K {a: isize, b: isize, c: D} +struct D { d: isize, e: isize } const k : K = K {a: 10, b: 20, c: D {d: 30, e: 40}}; -static m : int = k.c.e; +static m : isize = k.c.e; pub fn main() { println!("{}", p); diff --git a/src/test/run-pass/const-fn-val.rs b/src/test/run-pass/const-fn-val.rs index 972d4ca607b..3e1058dc27d 100644 --- a/src/test/run-pass/const-fn-val.rs +++ b/src/test/run-pass/const-fn-val.rs @@ -10,13 +10,13 @@ // pretty-expanded FIXME #23616 -fn foo() -> int { +fn foo() -> isize { return 0xca7f000d; } -struct Bar where F: FnMut() -> int { f: F } +struct Bar where F: FnMut() -> isize { f: F } -static mut b : Bar int> = Bar { f: foo as fn() -> int}; +static mut b : Bar isize> = Bar { f: foo as fn() -> isize}; pub fn main() { unsafe { assert_eq!((b.f)(), 0xca7f000d); } diff --git a/src/test/run-pass/const-negative.rs b/src/test/run-pass/const-negative.rs index 44222609e13..59b2c3e36aa 100644 --- a/src/test/run-pass/const-negative.rs +++ b/src/test/run-pass/const-negative.rs @@ -12,7 +12,7 @@ // pretty-expanded FIXME #23616 -static toplevel_mod: int = -1; +static toplevel_mod: isize = -1; pub fn main() { assert_eq!(toplevel_mod, -1); diff --git a/src/test/run-pass/const-nullary-univariant-enum.rs b/src/test/run-pass/const-nullary-univariant-enum.rs index 88be3c23588..d0e9e5d6106 100644 --- a/src/test/run-pass/const-nullary-univariant-enum.rs +++ b/src/test/run-pass/const-nullary-univariant-enum.rs @@ -18,8 +18,8 @@ enum Foo { static X: Foo = Foo::Bar; pub fn main() { - assert_eq!((X as uint), 0xDEADBEE); - assert_eq!((Y as uint), 0xDEADBEE); + assert_eq!((X as usize), 0xDEADBEE); + assert_eq!((Y as usize), 0xDEADBEE); } static Y: Foo = Foo::Bar; diff --git a/src/test/run-pass/const-region-ptrs-noncopy.rs b/src/test/run-pass/const-region-ptrs-noncopy.rs index 8af169dfce9..8932853fbf4 100644 --- a/src/test/run-pass/const-region-ptrs-noncopy.rs +++ b/src/test/run-pass/const-region-ptrs-noncopy.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 type Big = [u64; 8]; -struct Pair<'a> { a: int, b: &'a Big } +struct Pair<'a> { a: isize, b: &'a Big } const x: &'static Big = &([13, 14, 10, 13, 11, 14, 14, 15]); const y: &'static Pair<'static> = &Pair {a: 15, b: x}; diff --git a/src/test/run-pass/const-region-ptrs.rs b/src/test/run-pass/const-region-ptrs.rs index e5d3f0ece0c..c783d4b8184 100644 --- a/src/test/run-pass/const-region-ptrs.rs +++ b/src/test/run-pass/const-region-ptrs.rs @@ -8,9 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -struct Pair<'a> { a: int, b: &'a int } +struct Pair<'a> { a: isize, b: &'a isize } -const x: &'static int = &10; +const x: &'static isize = &10; const y: &'static Pair<'static> = &Pair {a: 15, b: x}; diff --git a/src/test/run-pass/const-struct.rs b/src/test/run-pass/const-struct.rs index 27c514160c0..3cd58c6c52a 100644 --- a/src/test/run-pass/const-struct.rs +++ b/src/test/run-pass/const-struct.rs @@ -11,7 +11,7 @@ use std::cmp; #[derive(Debug)] -struct foo { a: int, b: int, c: int } +struct foo { a: isize, b: isize, c: isize } impl cmp::PartialEq for foo { fn eq(&self, other: &foo) -> bool { diff --git a/src/test/run-pass/const-tuple-struct.rs b/src/test/run-pass/const-tuple-struct.rs index 55cbae6b1d2..ccf1b06bacb 100644 --- a/src/test/run-pass/const-tuple-struct.rs +++ b/src/test/run-pass/const-tuple-struct.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -struct Bar(int, int); +struct Bar(isize, isize); static X: Bar = Bar(1, 2); diff --git a/src/test/run-pass/const-vec-syntax.rs b/src/test/run-pass/const-vec-syntax.rs index 3485e23dd0d..a577bbd8278 100644 --- a/src/test/run-pass/const-vec-syntax.rs +++ b/src/test/run-pass/const-vec-syntax.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -fn f(_: &[int]) {} +fn f(_: &[isize]) {} pub fn main() { let v = [ 1, 2, 3 ]; diff --git a/src/test/run-pass/const-vecs-and-slices.rs b/src/test/run-pass/const-vecs-and-slices.rs index 26874b9f9d5..758812054cd 100644 --- a/src/test/run-pass/const-vecs-and-slices.rs +++ b/src/test/run-pass/const-vecs-and-slices.rs @@ -8,10 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -static x : [int; 4] = [1,2,3,4]; -static y : &'static [int] = &[1,2,3,4]; -static z : &'static [int; 4] = &[1,2,3,4]; -static zz : &'static [int] = &[1,2,3,4]; +static x : [isize; 4] = [1,2,3,4]; +static y : &'static [isize] = &[1,2,3,4]; +static z : &'static [isize; 4] = &[1,2,3,4]; +static zz : &'static [isize] = &[1,2,3,4]; pub fn main() { println!("{}", x[1]); diff --git a/src/test/run-pass/const.rs b/src/test/run-pass/const.rs index 8f78d54c701..95ae514636e 100644 --- a/src/test/run-pass/const.rs +++ b/src/test/run-pass/const.rs @@ -10,6 +10,6 @@ -static i: int = 10; +static i: isize = 10; pub fn main() { println!("{}", i); } diff --git a/src/test/run-pass/consts-in-patterns.rs b/src/test/run-pass/consts-in-patterns.rs index c66030c6045..c2f7cf4d625 100644 --- a/src/test/run-pass/consts-in-patterns.rs +++ b/src/test/run-pass/consts-in-patterns.rs @@ -10,11 +10,11 @@ // pretty-expanded FIXME #23616 -const FOO: int = 10; -const BAR: int = 3; +const FOO: isize = 10; +const BAR: isize = 3; pub fn main() { - let x: int = 3; + let x: isize = 3; let y = match x { FOO => 1, BAR => 2, diff --git a/src/test/run-pass/dead-code-leading-underscore.rs b/src/test/run-pass/dead-code-leading-underscore.rs index 801ca0e64f0..6e3f8a28812 100644 --- a/src/test/run-pass/dead-code-leading-underscore.rs +++ b/src/test/run-pass/dead-code-leading-underscore.rs @@ -12,12 +12,12 @@ #![deny(dead_code)] -static _X: uint = 0; +static _X: usize = 0; fn _foo() {} struct _Y { - _z: uint + _z: usize } enum _Z {} @@ -26,7 +26,7 @@ impl _Y { fn _bar() {} } -type _A = int; +type _A = isize; mod _bar { fn _qux() {} diff --git a/src/test/run-pass/deep.rs b/src/test/run-pass/deep.rs index d691703f437..16636fadbf8 100644 --- a/src/test/run-pass/deep.rs +++ b/src/test/run-pass/deep.rs @@ -13,8 +13,8 @@ // pretty-expanded FIXME #23616 -fn f(x: int) -> int { - if x == 1 { return 1; } else { let y: int = 1 + f(x - 1); return y; } +fn f(x: isize) -> isize { + if x == 1 { return 1; } else { let y: isize = 1 + f(x - 1); return y; } } pub fn main() { assert!((f(5000) == 5000)); } diff --git a/src/test/run-pass/default-method-parsing.rs b/src/test/run-pass/default-method-parsing.rs index d19debce00f..5ccb66a76bf 100644 --- a/src/test/run-pass/default-method-parsing.rs +++ b/src/test/run-pass/default-method-parsing.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 trait Foo { - fn m(&self, _:int) { } + fn m(&self, _:isize) { } } pub fn main() { } diff --git a/src/test/run-pass/default-method-simple.rs b/src/test/run-pass/default-method-simple.rs index 547f342243c..61de804a80a 100644 --- a/src/test/run-pass/default-method-simple.rs +++ b/src/test/run-pass/default-method-simple.rs @@ -18,7 +18,7 @@ trait Foo { } struct A { - x: int + x: isize } impl Foo for A { diff --git a/src/test/run-pass/default-method-supertrait-vtable.rs b/src/test/run-pass/default-method-supertrait-vtable.rs index 727cada21fa..3b1e04be78d 100644 --- a/src/test/run-pass/default-method-supertrait-vtable.rs +++ b/src/test/run-pass/default-method-supertrait-vtable.rs @@ -14,24 +14,24 @@ // Tests that we can call a function bounded over a supertrait from // a default method -fn require_y(x: T) -> int { x.y() } +fn require_y(x: T) -> isize { x.y() } trait Y { - fn y(self) -> int; + fn y(self) -> isize; } trait Z: Y + Sized { - fn x(self) -> int { + fn x(self) -> isize { require_y(self) } } -impl Y for int { - fn y(self) -> int { self } +impl Y for isize { + fn y(self) -> isize { self } } -impl Z for int {} +impl Z for isize {} pub fn main() { assert_eq!(12.x(), 12); diff --git a/src/test/run-pass/deref-mut-on-ref.rs b/src/test/run-pass/deref-mut-on-ref.rs index b3c13e165db..8820003d3b2 100644 --- a/src/test/run-pass/deref-mut-on-ref.rs +++ b/src/test/run-pass/deref-mut-on-ref.rs @@ -14,12 +14,12 @@ use std::ops::{Deref, DerefMut}; -fn inc + DerefMut>(mut t: T) { +fn inc + DerefMut>(mut t: T) { *t += 1; } fn main() { - let mut x: int = 5; + let mut x: isize = 5; inc(&mut x); assert_eq!(x, 6); } diff --git a/src/test/run-pass/deref-on-ref.rs b/src/test/run-pass/deref-on-ref.rs index 4519a8311b0..84bfbd82297 100644 --- a/src/test/run-pass/deref-on-ref.rs +++ b/src/test/run-pass/deref-on-ref.rs @@ -19,11 +19,11 @@ fn deref>(t: T) -> U { } fn main() { - let x: int = 3; + let x: isize = 3; let y = deref(&x); assert_eq!(y, 3); - let mut x: int = 4; + let mut x: isize = 4; let y = deref(&mut x); assert_eq!(y, 4); } diff --git a/src/test/run-pass/deref.rs b/src/test/run-pass/deref.rs index 4249801b0bc..4722ddd64c8 100644 --- a/src/test/run-pass/deref.rs +++ b/src/test/run-pass/deref.rs @@ -14,6 +14,6 @@ #![feature(box_syntax)] pub fn main() { - let x: Box = box 10; - let _y: int = *x; + let x: Box = box 10; + let _y: isize = *x; } diff --git a/src/test/run-pass/deriving-clone-generic-enum.rs b/src/test/run-pass/deriving-clone-generic-enum.rs index a4fd77f8993..8a07bad6961 100644 --- a/src/test/run-pass/deriving-clone-generic-enum.rs +++ b/src/test/run-pass/deriving-clone-generic-enum.rs @@ -18,5 +18,5 @@ enum E { } pub fn main() { - let _ = E::A::(1).clone(); + let _ = E::A::(1).clone(); } diff --git a/src/test/run-pass/deriving-clone-struct.rs b/src/test/run-pass/deriving-clone-struct.rs index 4e0eb37abc5..8bca8345085 100644 --- a/src/test/run-pass/deriving-clone-struct.rs +++ b/src/test/run-pass/deriving-clone-struct.rs @@ -12,13 +12,13 @@ #[derive(Clone)] struct S { - _int: int, + _int: isize, _i8: i8, _i16: i16, _i32: i32, _i64: i64, - _uint: uint, + _uint: usize, _u8: u8, _u16: u16, _u32: u32, diff --git a/src/test/run-pass/deriving-cmp-shortcircuit.rs b/src/test/run-pass/deriving-cmp-shortcircuit.rs index 65bf040b387..1669f3fdd3d 100644 --- a/src/test/run-pass/deriving-cmp-shortcircuit.rs +++ b/src/test/run-pass/deriving-cmp-shortcircuit.rs @@ -33,7 +33,7 @@ impl Ord for FailCmp { #[derive(PartialEq,PartialOrd,Eq,Ord)] struct ShortCircuit { - x: int, + x: isize, y: FailCmp } diff --git a/src/test/run-pass/deriving-encodable-decodable-cell-refcell.rs b/src/test/run-pass/deriving-encodable-decodable-cell-refcell.rs index 2c8efc25774..d116c2dfc2a 100644 --- a/src/test/run-pass/deriving-encodable-decodable-cell-refcell.rs +++ b/src/test/run-pass/deriving-encodable-decodable-cell-refcell.rs @@ -23,7 +23,7 @@ use serialize::json; #[derive(Encodable, Decodable)] struct A { - baz: int + baz: isize } #[derive(Encodable, Decodable)] diff --git a/src/test/run-pass/deriving-encodable-decodable.rs b/src/test/run-pass/deriving-encodable-decodable.rs index ea43163775c..cc6b88c788a 100644 --- a/src/test/run-pass/deriving-encodable-decodable.rs +++ b/src/test/run-pass/deriving-encodable-decodable.rs @@ -27,22 +27,22 @@ use serialize::{Encodable, Decodable}; #[derive(Encodable, Decodable, Eq, Rand)] struct A; #[derive(Encodable, Decodable, Eq, Rand)] -struct B(int); +struct B(isize); #[derive(Encodable, Decodable, Eq, Rand)] -struct C(int, int, uint); +struct C(isize, isize, usize); #[derive(Encodable, Decodable, Eq, Rand)] struct D { - a: int, - b: uint, + a: isize, + b: usize, } #[derive(Encodable, Decodable, Eq, Rand)] enum E { E1, - E2(uint), + E2(usize), E3(D), - E4{ x: uint }, + E4{ x: usize }, } #[derive(Encodable, Decodable, Eq, Rand)] @@ -74,6 +74,6 @@ pub fn main() { for _ in 0..20 { roundtrip::(); roundtrip::(); - roundtrip::>(); + roundtrip::>(); } } diff --git a/src/test/run-pass/deriving-enum-single-variant.rs b/src/test/run-pass/deriving-enum-single-variant.rs index 925a5875171..d45247c593e 100644 --- a/src/test/run-pass/deriving-enum-single-variant.rs +++ b/src/test/run-pass/deriving-enum-single-variant.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -pub type task_id = int; +pub type task_id = isize; #[derive(PartialEq)] pub enum Task { diff --git a/src/test/run-pass/deriving-global.rs b/src/test/run-pass/deriving-global.rs index 842de6e4984..2ca34e91b62 100644 --- a/src/test/run-pass/deriving-global.rs +++ b/src/test/run-pass/deriving-global.rs @@ -22,21 +22,21 @@ mod submod { Clone, Debug, Rand, Encodable, Decodable)] - enum A { A1(uint), A2(int) } + enum A { A1(usize), A2(isize) } #[derive(PartialEq, PartialOrd, Eq, Ord, Hash, Clone, Debug, Rand, Encodable, Decodable)] - struct B { x: uint, y: int } + struct B { x: usize, y: isize } #[derive(PartialEq, PartialOrd, Eq, Ord, Hash, Clone, Debug, Rand, Encodable, Decodable)] - struct C(uint, int); + struct C(usize, isize); } diff --git a/src/test/run-pass/deriving-hash.rs b/src/test/run-pass/deriving-hash.rs index 216a4c9cf00..ce7ba9f25eb 100644 --- a/src/test/run-pass/deriving-hash.rs +++ b/src/test/run-pass/deriving-hash.rs @@ -16,9 +16,9 @@ use std::hash::{Hash, SipHasher}; #[derive(Hash)] struct Person { - id: uint, + id: usize, name: String, - phone: uint, + phone: usize, } fn hash(t: &T) -> u64 { diff --git a/src/test/run-pass/deriving-in-fn.rs b/src/test/run-pass/deriving-in-fn.rs index bf2c2b01e6a..435d15aab8f 100644 --- a/src/test/run-pass/deriving-in-fn.rs +++ b/src/test/run-pass/deriving-in-fn.rs @@ -11,7 +11,7 @@ pub fn main() { #[derive(Debug)] struct Foo { - foo: int, + foo: isize, } let f = Foo { foo: 10 }; diff --git a/src/test/run-pass/deriving-meta-multiple.rs b/src/test/run-pass/deriving-meta-multiple.rs index 87df9a12505..a2d22699fcc 100644 --- a/src/test/run-pass/deriving-meta-multiple.rs +++ b/src/test/run-pass/deriving-meta-multiple.rs @@ -17,8 +17,8 @@ use std::hash::{Hash, SipHasher}; #[derive(Clone)] #[derive(Hash)] struct Foo { - bar: uint, - baz: int + bar: usize, + baz: isize } fn hash(_t: &T) {} diff --git a/src/test/run-pass/deriving-meta.rs b/src/test/run-pass/deriving-meta.rs index 2d25cdf71b0..f1c930828d2 100644 --- a/src/test/run-pass/deriving-meta.rs +++ b/src/test/run-pass/deriving-meta.rs @@ -14,8 +14,8 @@ use std::hash::{Hash, SipHasher}; #[derive(PartialEq, Clone, Hash)] struct Foo { - bar: uint, - baz: int + bar: usize, + baz: isize } fn hash(_t: &T) {} diff --git a/src/test/run-pass/deriving-rand.rs b/src/test/run-pass/deriving-rand.rs index 61f266f6d81..b960c2ddd4a 100644 --- a/src/test/run-pass/deriving-rand.rs +++ b/src/test/run-pass/deriving-rand.rs @@ -18,7 +18,7 @@ use std::rand; struct A; #[derive(Rand)] -struct B(int, int); +struct B(isize, isize); #[derive(Rand)] struct C { @@ -29,7 +29,7 @@ struct C { #[derive(Rand)] enum D { D0, - D1(uint), + D1(usize), D2 { x: (), y: () } } diff --git a/src/test/run-pass/deriving-self-lifetime-totalord-totaleq.rs b/src/test/run-pass/deriving-self-lifetime-totalord-totaleq.rs index 3277435e485..7a0d35f6f49 100644 --- a/src/test/run-pass/deriving-self-lifetime-totalord-totaleq.rs +++ b/src/test/run-pass/deriving-self-lifetime-totalord-totaleq.rs @@ -14,7 +14,7 @@ use std::cmp::Ordering::{Less,Equal,Greater}; #[derive(Eq,Ord)] struct A<'a> { - x: &'a int + x: &'a isize } pub fn main() { let (a, b) = (A { x: &1 }, A { x: &2 }); diff --git a/src/test/run-pass/deriving-self-lifetime.rs b/src/test/run-pass/deriving-self-lifetime.rs index 44609b6d653..89771ed13bf 100644 --- a/src/test/run-pass/deriving-self-lifetime.rs +++ b/src/test/run-pass/deriving-self-lifetime.rs @@ -12,7 +12,7 @@ #[derive(Eq,Ord)] struct A<'a> { - x: &'a int + x: &'a isize } pub fn main() { diff --git a/src/test/run-pass/deriving-show-2.rs b/src/test/run-pass/deriving-show-2.rs index acd07bc98d3..2b7438fd845 100644 --- a/src/test/run-pass/deriving-show-2.rs +++ b/src/test/run-pass/deriving-show-2.rs @@ -15,19 +15,19 @@ enum A {} #[derive(Debug)] enum B { B1, B2, B3 } #[derive(Debug)] -enum C { C1(int), C2(B), C3(String) } +enum C { C1(isize), C2(B), C3(String) } #[derive(Debug)] -enum D { D1{ a: int } } +enum D { D1{ a: isize } } #[derive(Debug)] struct E; #[derive(Debug)] -struct F(int); +struct F(isize); #[derive(Debug)] -struct G(int, int); +struct G(isize, isize); #[derive(Debug)] -struct H { a: int } +struct H { a: isize } #[derive(Debug)] -struct I { a: int, b: int } +struct I { a: isize, b: isize } #[derive(Debug)] struct J(Custom); diff --git a/src/test/run-pass/deriving-show.rs b/src/test/run-pass/deriving-show.rs index 7986b97685f..1f30f3ecedc 100644 --- a/src/test/run-pass/deriving-show.rs +++ b/src/test/run-pass/deriving-show.rs @@ -12,16 +12,16 @@ struct Unit; #[derive(Debug)] -struct Tuple(int, uint); +struct Tuple(isize, usize); #[derive(Debug)] -struct Struct { x: int, y: uint } +struct Struct { x: isize, y: usize } #[derive(Debug)] enum Enum { Nullary, - Variant(int, uint), - StructVariant { x: int, y : uint } + Variant(isize, usize), + StructVariant { x: isize, y : usize } } macro_rules! t { diff --git a/src/test/run-pass/deriving-via-extension-enum.rs b/src/test/run-pass/deriving-via-extension-enum.rs index 9761a87d4aa..f43f5162196 100644 --- a/src/test/run-pass/deriving-via-extension-enum.rs +++ b/src/test/run-pass/deriving-via-extension-enum.rs @@ -10,7 +10,7 @@ #[derive(PartialEq, Debug)] enum Foo { - Bar(int, int), + Bar(isize, isize), Baz(f64, f64) } diff --git a/src/test/run-pass/deriving-via-extension-hash-enum.rs b/src/test/run-pass/deriving-via-extension-hash-enum.rs index c0921070bc2..249661f003f 100644 --- a/src/test/run-pass/deriving-via-extension-hash-enum.rs +++ b/src/test/run-pass/deriving-via-extension-hash-enum.rs @@ -12,8 +12,8 @@ #[derive(Hash)] enum Foo { - Bar(int, char), - Baz(char, int) + Bar(isize, char), + Baz(char, isize) } #[derive(Hash)] diff --git a/src/test/run-pass/deriving-via-extension-hash-struct.rs b/src/test/run-pass/deriving-via-extension-hash-struct.rs index 791d3dd9549..42f0e456270 100644 --- a/src/test/run-pass/deriving-via-extension-hash-struct.rs +++ b/src/test/run-pass/deriving-via-extension-hash-struct.rs @@ -12,9 +12,9 @@ #[derive(Hash)] struct Foo { - x: int, - y: int, - z: int + x: isize, + y: isize, + z: isize } pub fn main() {} diff --git a/src/test/run-pass/deriving-via-extension-struct-like-enum-variant.rs b/src/test/run-pass/deriving-via-extension-struct-like-enum-variant.rs index ed92a3baab9..5f9d9b6fb21 100644 --- a/src/test/run-pass/deriving-via-extension-struct-like-enum-variant.rs +++ b/src/test/run-pass/deriving-via-extension-struct-like-enum-variant.rs @@ -10,7 +10,7 @@ #[derive(PartialEq, Debug)] enum S { - X { x: int, y: int }, + X { x: isize, y: isize }, Y } diff --git a/src/test/run-pass/deriving-via-extension-struct-tuple.rs b/src/test/run-pass/deriving-via-extension-struct-tuple.rs index 9319a4f752d..f9e1ea4a623 100644 --- a/src/test/run-pass/deriving-via-extension-struct-tuple.rs +++ b/src/test/run-pass/deriving-via-extension-struct-tuple.rs @@ -9,7 +9,7 @@ // except according to those terms. #[derive(PartialEq, Debug)] -struct Foo(int, int, String); +struct Foo(isize, isize, String); pub fn main() { let a1 = Foo(5, 6, "abc".to_string()); diff --git a/src/test/run-pass/deriving-via-extension-struct.rs b/src/test/run-pass/deriving-via-extension-struct.rs index e32e080cacb..624fb4a58e1 100644 --- a/src/test/run-pass/deriving-via-extension-struct.rs +++ b/src/test/run-pass/deriving-via-extension-struct.rs @@ -10,9 +10,9 @@ #[derive(PartialEq, Debug)] struct Foo { - x: int, - y: int, - z: int, + x: isize, + y: isize, + z: isize, } pub fn main() { diff --git a/src/test/run-pass/deriving-via-extension-type-params.rs b/src/test/run-pass/deriving-via-extension-type-params.rs index 1a31743b4c0..4d88dbbca37 100644 --- a/src/test/run-pass/deriving-via-extension-type-params.rs +++ b/src/test/run-pass/deriving-via-extension-type-params.rs @@ -10,9 +10,9 @@ #[derive(PartialEq, Hash, Debug)] struct Foo { - x: int, + x: isize, y: T, - z: int + z: isize } pub fn main() { diff --git a/src/test/run-pass/die-macro.rs b/src/test/run-pass/die-macro.rs index 45b743383b1..6a81ebe67ba 100644 --- a/src/test/run-pass/die-macro.rs +++ b/src/test/run-pass/die-macro.rs @@ -17,7 +17,7 @@ fn f() { panic!(); - let _x: int = panic!(); + let _x: isize = panic!(); } pub fn main() { diff --git a/src/test/run-pass/div-mod.rs b/src/test/run-pass/div-mod.rs index f838f3554d5..237cfe19dc4 100644 --- a/src/test/run-pass/div-mod.rs +++ b/src/test/run-pass/div-mod.rs @@ -14,8 +14,8 @@ // pretty-expanded FIXME #23616 pub fn main() { - let x: int = 15; - let y: int = 5; + let x: isize = 15; + let y: isize = 5; assert_eq!(x / 5, 3); assert_eq!(x / 4, 3); assert_eq!(x / 3, 5); diff --git a/src/test/run-pass/double-ref.rs b/src/test/run-pass/double-ref.rs index 4ee08edb52d..13ce6a07e36 100644 --- a/src/test/run-pass/double-ref.rs +++ b/src/test/run-pass/double-ref.rs @@ -11,23 +11,23 @@ // pretty-expanded FIXME #23616 fn check_expr() { - let _: & uint = &1; - let _: & & uint = &&1; - let _: & & & uint = &&&1; - let _: & & & uint = & &&1; - let _: & & & & uint = &&&&1; - let _: & & & & uint = & &&&1; - let _: & & & & & uint = &&&&&1; + let _: & usize = &1; + let _: & & usize = &&1; + let _: & & & usize = &&&1; + let _: & & & usize = & &&1; + let _: & & & & usize = &&&&1; + let _: & & & & usize = & &&&1; + let _: & & & & & usize = &&&&&1; } fn check_ty() { - let _: &uint = & 1; - let _: &&uint = & & 1; - let _: &&&uint = & & & 1; - let _: & &&uint = & & & 1; - let _: &&&&uint = & & & & 1; - let _: & &&&uint = & & & & 1; - let _: &&&&&uint = & & & & & 1; + let _: &usize = & 1; + let _: &&usize = & & 1; + let _: &&&usize = & & & 1; + let _: & &&usize = & & & 1; + let _: &&&&usize = & & & & 1; + let _: & &&&usize = & & & & 1; + let _: &&&&&usize = & & & & & 1; } fn check_pat() { diff --git a/src/test/run-pass/drop-on-empty-block-exit.rs b/src/test/run-pass/drop-on-empty-block-exit.rs index a52dd133e07..268de8ec55c 100644 --- a/src/test/run-pass/drop-on-empty-block-exit.rs +++ b/src/test/run-pass/drop-on-empty-block-exit.rs @@ -13,7 +13,7 @@ #![allow(unknown_features)] #![feature(box_syntax)] -enum t { foo(Box), } +enum t { foo(Box), } pub fn main() { let tt = t::foo(box 10); diff --git a/src/test/run-pass/drop-on-ret.rs b/src/test/run-pass/drop-on-ret.rs index f0b5d78707a..fc517fa592f 100644 --- a/src/test/run-pass/drop-on-ret.rs +++ b/src/test/run-pass/drop-on-ret.rs @@ -13,7 +13,7 @@ // pretty-expanded FIXME #23616 -fn f() -> int { +fn f() -> isize { if true { let _s: String = "should not leak".to_string(); return 1; diff --git a/src/test/run-pass/drop-struct-as-object.rs b/src/test/run-pass/drop-struct-as-object.rs index bb8119d5274..efb98160a3e 100644 --- a/src/test/run-pass/drop-struct-as-object.rs +++ b/src/test/run-pass/drop-struct-as-object.rs @@ -16,18 +16,18 @@ #![allow(unknown_features)] #![feature(box_syntax)] -static mut value: uint = 0; +static mut value: usize = 0; struct Cat { - name : uint, + name : usize, } trait Dummy { - fn get(&self) -> uint; + fn get(&self) -> usize; } impl Dummy for Cat { - fn get(&self) -> uint { self.name } + fn get(&self) -> usize { self.name } } impl Drop for Cat { diff --git a/src/test/run-pass/drop-trait-enum.rs b/src/test/run-pass/drop-trait-enum.rs index 353bd7a9ce0..ce675547a68 100644 --- a/src/test/run-pass/drop-trait-enum.rs +++ b/src/test/run-pass/drop-trait-enum.rs @@ -32,7 +32,7 @@ impl Drop for SendOnDrop { enum Foo { SimpleVariant(Sender), - NestedVariant(Box, SendOnDrop, Sender), + NestedVariant(Box, SendOnDrop, Sender), FailingVariant { on_drop: SendOnDrop } } diff --git a/src/test/run-pass/drop-trait.rs b/src/test/run-pass/drop-trait.rs index 8cbfee6c78d..21740eb3930 100644 --- a/src/test/run-pass/drop-trait.rs +++ b/src/test/run-pass/drop-trait.rs @@ -9,7 +9,7 @@ // except according to those terms. struct Foo { - x: int + x: isize } impl Drop for Foo { diff --git a/src/test/run-pass/dst-deref-mut.rs b/src/test/run-pass/dst-deref-mut.rs index b0bc61e3f8b..3b2b7493fd0 100644 --- a/src/test/run-pass/dst-deref-mut.rs +++ b/src/test/run-pass/dst-deref-mut.rs @@ -15,25 +15,25 @@ use std::ops::{Deref, DerefMut}; pub struct Arr { - ptr: Box<[uint]> + ptr: Box<[usize]> } impl Deref for Arr { - type Target = [uint]; + type Target = [usize]; - fn deref(&self) -> &[uint] { + fn deref(&self) -> &[usize] { panic!(); } } impl DerefMut for Arr { - fn deref_mut(&mut self) -> &mut [uint] { + fn deref_mut(&mut self) -> &mut [usize] { &mut *self.ptr } } pub fn foo(arr: &mut Arr) { - let x: &mut [uint] = &mut **arr; + let x: &mut [usize] = &mut **arr; assert!(x[0] == 1); assert!(x[1] == 2); assert!(x[2] == 3); diff --git a/src/test/run-pass/dst-deref.rs b/src/test/run-pass/dst-deref.rs index 838352b3a14..c8e658beef8 100644 --- a/src/test/run-pass/dst-deref.rs +++ b/src/test/run-pass/dst-deref.rs @@ -15,20 +15,20 @@ use std::ops::Deref; pub struct Arr { - ptr: Box<[uint]> + ptr: Box<[usize]> } impl Deref for Arr { - type Target = [uint]; + type Target = [usize]; - fn deref(&self) -> &[uint] { + fn deref(&self) -> &[usize] { &*self.ptr } } pub fn foo(arr: &Arr) { assert!(arr.len() == 3); - let x: &[uint] = &**arr; + let x: &[usize] = &**arr; assert!(x[0] == 1); assert!(x[1] == 2); assert!(x[2] == 3); diff --git a/src/test/run-pass/dst-index.rs b/src/test/run-pass/dst-index.rs index 62bdda95dee..df4cd74740c 100644 --- a/src/test/run-pass/dst-index.rs +++ b/src/test/run-pass/dst-index.rs @@ -20,21 +20,21 @@ use std::fmt::Debug; struct S; -impl Index for S { +impl Index for S { type Output = str; - fn index<'a>(&'a self, _: uint) -> &'a str { + fn index<'a>(&'a self, _: usize) -> &'a str { "hello" } } struct T; -impl Index for T { +impl Index for T { type Output = Debug + 'static; - fn index<'a>(&'a self, idx: uint) -> &'a (Debug + 'static) { - static X: uint = 42; + fn index<'a>(&'a self, idx: usize) -> &'a (Debug + 'static) { + static X: usize = 42; &X as &(Debug + 'static) } } diff --git a/src/test/run-pass/dst-raw.rs b/src/test/run-pass/dst-raw.rs index 6e8288d36e8..c8f8218cc28 100644 --- a/src/test/run-pass/dst-raw.rs +++ b/src/test/run-pass/dst-raw.rs @@ -13,14 +13,14 @@ // pretty-expanded FIXME #23616 trait Trait { - fn foo(&self) -> int; + fn foo(&self) -> isize; } struct A { - f: int + f: isize } impl Trait for A { - fn foo(&self) -> int { + fn foo(&self) -> isize { self.f } } diff --git a/src/test/run-pass/dst-struct-sole.rs b/src/test/run-pass/dst-struct-sole.rs index e3b6061cbdc..fd19d02e688 100644 --- a/src/test/run-pass/dst-struct-sole.rs +++ b/src/test/run-pass/dst-struct-sole.rs @@ -17,7 +17,7 @@ struct Fat { } // x is a fat pointer -fn foo(x: &Fat<[int]>) { +fn foo(x: &Fat<[isize]>) { let y = &x.ptr; assert!(x.ptr.len() == 3); assert!(y[0] == 1); @@ -51,11 +51,11 @@ pub fn main() { foo(&f1); let f2 = &f1; foo(f2); - let f3: &Fat<[int]> = f2; + let f3: &Fat<[isize]> = f2; foo(f3); - let f4: &Fat<[int]> = &f1; + let f4: &Fat<[isize]> = &f1; foo(f4); - let f5: &Fat<[int]> = &Fat { ptr: [1, 2, 3] }; + let f5: &Fat<[isize]> = &Fat { ptr: [1, 2, 3] }; foo(f5); // With a vec of Bars. @@ -72,14 +72,14 @@ pub fn main() { foo2(f5); // Assignment. - let f5: &mut Fat<[int]> = &mut Fat { ptr: [1, 2, 3] }; + let f5: &mut Fat<[isize]> = &mut Fat { ptr: [1, 2, 3] }; f5.ptr[1] = 34; assert!(f5.ptr[0] == 1); assert!(f5.ptr[1] == 34); assert!(f5.ptr[2] == 3); // Zero size vec. - let f5: &Fat<[int]> = &Fat { ptr: [] }; + let f5: &Fat<[isize]> = &Fat { ptr: [] }; assert!(f5.ptr.len() == 0); let f5: &Fat<[Bar]> = &Fat { ptr: [] }; assert!(f5.ptr.len() == 0); diff --git a/src/test/run-pass/dst-struct.rs b/src/test/run-pass/dst-struct.rs index 50ba85ad718..055b61b25fb 100644 --- a/src/test/run-pass/dst-struct.rs +++ b/src/test/run-pass/dst-struct.rs @@ -14,13 +14,13 @@ #![feature(box_syntax)] struct Fat { - f1: int, + f1: isize, f2: &'static str, ptr: T } // x is a fat pointer -fn foo(x: &Fat<[int]>) { +fn foo(x: &Fat<[isize]>) { let y = &x.ptr; assert!(x.ptr.len() == 3); assert!(y[0] == 1); @@ -39,7 +39,7 @@ fn foo2(x: &Fat<[T]>) { assert!(x.f2 == "some str"); } -fn foo3(x: &Fat>) { +fn foo3(x: &Fat>) { let y = &x.ptr.ptr; assert!(x.f1 == 5); assert!(x.f2 == "some str"); @@ -70,11 +70,11 @@ pub fn main() { foo(&f1); let f2 = &f1; foo(f2); - let f3: &Fat<[int]> = f2; + let f3: &Fat<[isize]> = f2; foo(f3); - let f4: &Fat<[int]> = &f1; + let f4: &Fat<[isize]> = &f1; foo(f4); - let f5: &Fat<[int]> = &Fat { f1: 5, f2: "some str", ptr: [1, 2, 3] }; + let f5: &Fat<[isize]> = &Fat { f1: 5, f2: "some str", ptr: [1, 2, 3] }; foo(f5); // With a vec of Bars. @@ -91,14 +91,14 @@ pub fn main() { foo2(f5); // Assignment. - let f5: &mut Fat<[int]> = &mut Fat { f1: 5, f2: "some str", ptr: [1, 2, 3] }; + let f5: &mut Fat<[isize]> = &mut Fat { f1: 5, f2: "some str", ptr: [1, 2, 3] }; f5.ptr[1] = 34; assert!(f5.ptr[0] == 1); assert!(f5.ptr[1] == 34); assert!(f5.ptr[2] == 3); // Zero size vec. - let f5: &Fat<[int]> = &Fat { f1: 5, f2: "some str", ptr: [] }; + let f5: &Fat<[isize]> = &Fat { f1: 5, f2: "some str", ptr: [] }; assert!(f5.ptr.len() == 0); let f5: &Fat<[Bar]> = &Fat { f1: 5, f2: "some str", ptr: [] }; assert!(f5.ptr.len() == 0); @@ -108,28 +108,28 @@ pub fn main() { foo3(&f1); let f2 = &f1; foo3(f2); - let f3: &Fat> = f2; + let f3: &Fat> = f2; foo3(f3); - let f4: &Fat> = &f1; + let f4: &Fat> = &f1; foo3(f4); - let f5: &Fat> = + let f5: &Fat> = &Fat { f1: 5, f2: "some str", ptr: Fat { f1: 8, f2: "deep str", ptr: [1, 2, 3]} }; foo3(f5); // Box. let f1 = Box::new([1, 2, 3]); assert!((*f1)[1] == 2); - let f2: Box<[int]> = f1; + let f2: Box<[isize]> = f1; assert!((*f2)[1] == 2); // Nested Box. - let f1 : Box> = box Fat { f1: 5, f2: "some str", ptr: [1, 2, 3] }; + let f1 : Box> = box Fat { f1: 5, f2: "some str", ptr: [1, 2, 3] }; foo(&*f1); - let f2 : Box> = f1; + let f2 : Box> = f1; foo(&*f2); // FIXME (#22405): Replace `Box::new` with `box` here when/if possible. - let f3 : Box> = + let f3 : Box> = Box::>::new(Fat { f1: 5, f2: "some str", ptr: [1, 2, 3] }); foo(&*f3); } diff --git a/src/test/run-pass/dst-trait.rs b/src/test/run-pass/dst-trait.rs index 3fcbe71df67..ede4b8c442e 100644 --- a/src/test/run-pass/dst-trait.rs +++ b/src/test/run-pass/dst-trait.rs @@ -14,7 +14,7 @@ #![feature(box_syntax)] struct Fat { - f1: int, + f1: isize, f2: &'static str, ptr: T } @@ -24,19 +24,19 @@ struct Bar; #[derive(Copy, PartialEq, Eq)] struct Bar1 { - f: int + f: isize } trait ToBar { fn to_bar(&self) -> Bar; - fn to_val(&self) -> int; + fn to_val(&self) -> isize; } impl ToBar for Bar { fn to_bar(&self) -> Bar { *self } - fn to_val(&self) -> int { + fn to_val(&self) -> isize { 0 } } @@ -44,7 +44,7 @@ impl ToBar for Bar1 { fn to_bar(&self) -> Bar { Bar } - fn to_val(&self) -> int { + fn to_val(&self) -> isize { self.f } } diff --git a/src/test/run-pass/early-ret-binop-add.rs b/src/test/run-pass/early-ret-binop-add.rs index a8c20dfb8c1..b01d6523bf0 100644 --- a/src/test/run-pass/early-ret-binop-add.rs +++ b/src/test/run-pass/early-ret-binop-add.rs @@ -10,5 +10,5 @@ // pretty-expanded FIXME #23616 -fn wsucc(n: int) -> int { 0 + { return n + 1 } } +fn wsucc(n: isize) -> isize { 0 + { return n + 1 } } pub fn main() { } diff --git a/src/test/run-pass/early-vtbl-resolution.rs b/src/test/run-pass/early-vtbl-resolution.rs index efe96b96a34..2d2cf6fbf0a 100644 --- a/src/test/run-pass/early-vtbl-resolution.rs +++ b/src/test/run-pass/early-vtbl-resolution.rs @@ -13,12 +13,12 @@ trait thing { fn foo(&self) -> Option; } -impl thing for int { +impl thing for isize { fn foo(&self) -> Option { None } } fn foo_func>(x: B) -> Option { x.foo() } -struct A { a: int } +struct A { a: isize } pub fn main() { let _x: Option = foo_func(0); diff --git a/src/test/run-pass/empty-mutable-vec.rs b/src/test/run-pass/empty-mutable-vec.rs index 881103210e4..757579faa17 100644 --- a/src/test/run-pass/empty-mutable-vec.rs +++ b/src/test/run-pass/empty-mutable-vec.rs @@ -13,4 +13,4 @@ #![allow(unused_mut)] -pub fn main() { let mut _v: Vec = Vec::new(); } +pub fn main() { let mut _v: Vec = Vec::new(); } diff --git a/src/test/run-pass/empty-tag.rs b/src/test/run-pass/empty-tag.rs index 95af729e5e1..ff2a70467ea 100644 --- a/src/test/run-pass/empty-tag.rs +++ b/src/test/run-pass/empty-tag.rs @@ -13,7 +13,7 @@ enum chan { chan_t, } impl PartialEq for chan { fn eq(&self, other: &chan) -> bool { - ((*self) as uint) == ((*other) as uint) + ((*self) as usize) == ((*other) as usize) } fn ne(&self, other: &chan) -> bool { !(*self).eq(other) } } diff --git a/src/test/run-pass/enum-alignment.rs b/src/test/run-pass/enum-alignment.rs index ecab5232644..df779d0d713 100644 --- a/src/test/run-pass/enum-alignment.rs +++ b/src/test/run-pass/enum-alignment.rs @@ -12,13 +12,13 @@ use std::mem; -fn addr_of(ptr: &T) -> uint { - ptr as *const T as uint +fn addr_of(ptr: &T) -> usize { + ptr as *const T as usize } fn is_aligned(ptr: &T) -> bool { unsafe { - let addr: uint = mem::transmute(ptr); + let addr: usize = mem::transmute(ptr); (addr % mem::min_align_of::()) == 0 } } diff --git a/src/test/run-pass/enum-clike-ffi-as-int.rs b/src/test/run-pass/enum-clike-ffi-as-int.rs index 2920fd4f734..f129a515341 100644 --- a/src/test/run-pass/enum-clike-ffi-as-int.rs +++ b/src/test/run-pass/enum-clike-ffi-as-int.rs @@ -31,11 +31,11 @@ enum Foo { } #[inline(never)] -extern "C" fn foo(_x: uint) -> Foo { Foo::B } +extern "C" fn foo(_x: usize) -> Foo { Foo::B } pub fn main() { unsafe { - let f: extern "C" fn(uint) -> u32 = ::std::mem::transmute(foo); + let f: extern "C" fn(usize) -> u32 = ::std::mem::transmute(foo); assert_eq!(f(0xDEADBEEF), Foo::B as u32); } } diff --git a/src/test/run-pass/enum-discr.rs b/src/test/run-pass/enum-discr.rs index a1224b93418..5c01d544cf5 100644 --- a/src/test/run-pass/enum-discr.rs +++ b/src/test/run-pass/enum-discr.rs @@ -27,6 +27,6 @@ enum Hero { pub fn main() { let pet: Animal = Animal::Snake; let hero: Hero = Hero::Superman; - assert!(pet as uint == 3); - assert!(hero as int == -2); + assert!(pet as usize == 3); + assert!(hero as isize == -2); } diff --git a/src/test/run-pass/enum-discrim-manual-sizing.rs b/src/test/run-pass/enum-discrim-manual-sizing.rs index 323b349643d..b23cfa9f32b 100644 --- a/src/test/run-pass/enum-discrim-manual-sizing.rs +++ b/src/test/run-pass/enum-discrim-manual-sizing.rs @@ -60,13 +60,13 @@ enum Eu64 { Bu64 = 1 } -#[repr(int)] +#[repr(isize)] enum Eint { Aint = 0, Bint = 1 } -#[repr(uint)] +#[repr(usize)] enum Euint { Auint = 0, Buint = 1 @@ -81,6 +81,6 @@ pub fn main() { assert_eq!(size_of::(), 4); assert_eq!(size_of::(), 8); assert_eq!(size_of::(), 8); - assert_eq!(size_of::(), size_of::()); - assert_eq!(size_of::(), size_of::()); + assert_eq!(size_of::(), size_of::()); + assert_eq!(size_of::(), size_of::()); } diff --git a/src/test/run-pass/enum-disr-val-pretty.rs b/src/test/run-pass/enum-disr-val-pretty.rs index 533d328628a..9a2f45d0079 100644 --- a/src/test/run-pass/enum-disr-val-pretty.rs +++ b/src/test/run-pass/enum-disr-val-pretty.rs @@ -21,6 +21,6 @@ pub fn main() { test_color(color::imaginary, -1, "imaginary".to_string()); } -fn test_color(color: color, val: int, _name: String) { - assert!(color as int == val); +fn test_color(color: color, val: isize, _name: String) { + assert!(color as isize == val); } diff --git a/src/test/run-pass/enum-null-pointer-opt.rs b/src/test/run-pass/enum-null-pointer-opt.rs index b8819ab61e8..9fc799a97f6 100644 --- a/src/test/run-pass/enum-null-pointer-opt.rs +++ b/src/test/run-pass/enum-null-pointer-opt.rs @@ -23,13 +23,13 @@ trait Trait { fn dummy(&self) { } } fn main() { // Functions - assert_eq!(size_of::(), size_of::>()); - assert_eq!(size_of::(), size_of::>()); + assert_eq!(size_of::(), size_of::>()); + assert_eq!(size_of::(), size_of::>()); // Slices - &str / &[T] / &mut [T] assert_eq!(size_of::<&str>(), size_of::>()); - assert_eq!(size_of::<&[int]>(), size_of::>()); - assert_eq!(size_of::<&mut [int]>(), size_of::>()); + assert_eq!(size_of::<&[isize]>(), size_of::>()); + assert_eq!(size_of::<&mut [isize]>(), size_of::>()); // Traits - Box / &Trait / &mut Trait assert_eq!(size_of::>(), size_of::>>()); @@ -37,33 +37,33 @@ fn main() { assert_eq!(size_of::<&mut Trait>(), size_of::>()); // Pointers - Box - assert_eq!(size_of::>(), size_of::>>()); + assert_eq!(size_of::>(), size_of::>>()); // The optimization can't apply to raw pointers - assert!(size_of::>() != size_of::<*const int>()); - assert!(Some(0 as *const int).is_some()); // Can't collapse None to null + assert!(size_of::>() != size_of::<*const isize>()); + assert!(Some(0 as *const isize).is_some()); // Can't collapse None to null struct Foo { - _a: Box + _a: Box } - struct Bar(Box); + struct Bar(Box); // Should apply through structs assert_eq!(size_of::(), size_of::>()); assert_eq!(size_of::(), size_of::>()); // and tuples - assert_eq!(size_of::<(u8, Box)>(), size_of::)>>()); + assert_eq!(size_of::<(u8, Box)>(), size_of::)>>()); // and fixed-size arrays - assert_eq!(size_of::<[Box; 1]>(), size_of::; 1]>>()); + assert_eq!(size_of::<[Box; 1]>(), size_of::; 1]>>()); // Should apply to NonZero - assert_eq!(size_of::>(), size_of::>>()); + assert_eq!(size_of::>(), size_of::>>()); assert_eq!(size_of::>(), size_of::>>()); // Should apply to types that use NonZero internally - assert_eq!(size_of::>(), size_of::>>()); - assert_eq!(size_of::>(), size_of::>>()); - assert_eq!(size_of::>(), size_of::>>()); + assert_eq!(size_of::>(), size_of::>>()); + assert_eq!(size_of::>(), size_of::>>()); + assert_eq!(size_of::>(), size_of::>>()); // Should apply to types that have NonZero transitively assert_eq!(size_of::(), size_of::>()); diff --git a/src/test/run-pass/enum-nullable-const-null-with-fields.rs b/src/test/run-pass/enum-nullable-const-null-with-fields.rs index 2284c1427c0..3a7c7ea9a71 100644 --- a/src/test/run-pass/enum-nullable-const-null-with-fields.rs +++ b/src/test/run-pass/enum-nullable-const-null-with-fields.rs @@ -13,7 +13,7 @@ use std::result::Result; use std::result::Result::Ok; -static C: Result<(), Box> = Ok(()); +static C: Result<(), Box> = Ok(()); // This is because of yet another bad assertion (ICE) about the null side of a nullable enum. // So we won't actually compile if the bug is present, but we check the value in main anyway. diff --git a/src/test/run-pass/enum-size-variance.rs b/src/test/run-pass/enum-size-variance.rs index 39ab8316958..0bf5df5d610 100644 --- a/src/test/run-pass/enum-size-variance.rs +++ b/src/test/run-pass/enum-size-variance.rs @@ -17,26 +17,26 @@ enum Enum1 { } enum Enum2 { A, B, C } -enum Enum3 { D(int), E, F } +enum Enum3 { D(isize), E, F } -enum Enum4 { H(int), I(int), J } +enum Enum4 { H(isize), I(isize), J } enum Enum5 { //~ ERROR three times larger - L(int, int, int, int), //~ NOTE this variant is the largest - M(int), + L(isize, isize, isize, isize), //~ NOTE this variant is the largest + M(isize), N } enum Enum6 { O(T), P(U), - Q(int) + Q(isize) } #[allow(enum_size_variance)] enum Enum7 { - R(int, int, int, int), - S(int), + R(isize, isize, isize, isize), + S(isize), T } pub fn main() { } diff --git a/src/test/run-pass/enum-vec-initializer.rs b/src/test/run-pass/enum-vec-initializer.rs index 5be8ca6c6cb..037ee5f7777 100644 --- a/src/test/run-pass/enum-vec-initializer.rs +++ b/src/test/run-pass/enum-vec-initializer.rs @@ -14,13 +14,13 @@ enum Flopsy { Bunny = 2 } -const BAR:uint = Flopsy::Bunny as uint; -const BAR2:uint = BAR; +const BAR:usize = Flopsy::Bunny as usize; +const BAR2:usize = BAR; pub fn main() { - let _v = [0; Flopsy::Bunny as uint]; + let _v = [0; Flopsy::Bunny as usize]; let _v = [0; BAR]; let _v = [0; BAR2]; - const BAR3:uint = BAR2; + const BAR3:usize = BAR2; let _v = [0; BAR3]; } diff --git a/src/test/run-pass/evec-internal.rs b/src/test/run-pass/evec-internal.rs index 28b5f781b5c..b3771f38482 100644 --- a/src/test/run-pass/evec-internal.rs +++ b/src/test/run-pass/evec-internal.rs @@ -13,16 +13,16 @@ // Doesn't work; needs a design decision. pub fn main() { - let x : [int; 5] = [1,2,3,4,5]; - let _y : [int; 5] = [1,2,3,4,5]; + let x : [isize; 5] = [1,2,3,4,5]; + let _y : [isize; 5] = [1,2,3,4,5]; let mut z = [1,2,3,4,5]; z = x; assert_eq!(z[0], 1); assert_eq!(z[4], 5); - let a : [int; 5] = [1,1,1,1,1]; - let b : [int; 5] = [2,2,2,2,2]; - let c : [int; 5] = [2,2,2,2,3]; + let a : [isize; 5] = [1,1,1,1,1]; + let b : [isize; 5] = [2,2,2,2,2]; + let c : [isize; 5] = [2,2,2,2,3]; log(debug, a); diff --git a/src/test/run-pass/evec-slice.rs b/src/test/run-pass/evec-slice.rs index 734ac306653..52ccbe52d46 100644 --- a/src/test/run-pass/evec-slice.rs +++ b/src/test/run-pass/evec-slice.rs @@ -11,16 +11,16 @@ #![allow(dead_assignment)] pub fn main() { - let x : &[int] = &[1,2,3,4,5]; - let mut z : &[int] = &[1,2,3,4,5]; + let x : &[isize] = &[1,2,3,4,5]; + let mut z : &[isize] = &[1,2,3,4,5]; z = x; assert_eq!(z[0], 1); assert_eq!(z[4], 5); - let a : &[int] = &[1,1,1,1,1]; - let b : &[int] = &[2,2,2,2,2]; - let c : &[int] = &[2,2,2,2,3]; - let cc : &[int] = &[2,2,2,2,2,2]; + let a : &[isize] = &[1,1,1,1,1]; + let b : &[isize] = &[2,2,2,2,2]; + let c : &[isize] = &[2,2,2,2,3]; + let cc : &[isize] = &[2,2,2,2,2,2]; println!("{:?}", a); diff --git a/src/test/run-pass/explicit-i-suffix.rs b/src/test/run-pass/explicit-i-suffix.rs index 6029b488f08..fa3970b6280 100644 --- a/src/test/run-pass/explicit-i-suffix.rs +++ b/src/test/run-pass/explicit-i-suffix.rs @@ -11,11 +11,11 @@ // pretty-expanded FIXME #23616 pub fn main() { - let x: int = 8; + let x: isize = 8; let y = 9; x + y; - let q: int = -8; + let q: isize = -8; let r = -9; q + r; } diff --git a/src/test/run-pass/explicit-self-closures.rs b/src/test/run-pass/explicit-self-closures.rs index 4fcac31c533..cb3a28d19d2 100644 --- a/src/test/run-pass/explicit-self-closures.rs +++ b/src/test/run-pass/explicit-self-closures.rs @@ -13,11 +13,11 @@ // pretty-expanded FIXME #23616 struct Box { - x: uint + x: usize } impl Box { - pub fn set_many(&mut self, xs: &[uint]) { + pub fn set_many(&mut self, xs: &[usize]) { for x in xs { self.x = *x; } } } diff --git a/src/test/run-pass/explicit-self-generic.rs b/src/test/run-pass/explicit-self-generic.rs index c4b8099e850..25f09ee94b0 100644 --- a/src/test/run-pass/explicit-self-generic.rs +++ b/src/test/run-pass/explicit-self-generic.rs @@ -14,7 +14,7 @@ #![feature(box_syntax)] #[derive(Copy)] -struct LM { resize_at: uint, size: uint } +struct LM { resize_at: usize, size: usize } enum HashMap { HashMap_(LM, Vec<(K,V)>) @@ -27,7 +27,7 @@ fn linear_map() -> HashMap { } impl HashMap { - pub fn len(&mut self) -> uint { + pub fn len(&mut self) -> usize { match *self { HashMap::HashMap_(ref l, _) => l.size } diff --git a/src/test/run-pass/explicit-self-objects-uniq.rs b/src/test/run-pass/explicit-self-objects-uniq.rs index ce0cdf0d249..08ea638f93a 100644 --- a/src/test/run-pass/explicit-self-objects-uniq.rs +++ b/src/test/run-pass/explicit-self-objects-uniq.rs @@ -18,7 +18,7 @@ trait Foo { } struct S { - x: int + x: isize } impl Foo for S { diff --git a/src/test/run-pass/explicit-self.rs b/src/test/run-pass/explicit-self.rs index 1d013c3abc8..b81090555ea 100644 --- a/src/test/run-pass/explicit-self.rs +++ b/src/test/run-pass/explicit-self.rs @@ -52,7 +52,7 @@ struct thing { #[derive(Clone)] struct A { - a: int + a: isize } fn thing(x: A) -> thing { @@ -62,10 +62,10 @@ fn thing(x: A) -> thing { } impl thing { - pub fn bar(self: Box) -> int { self.x.a } - pub fn quux(&self) -> int { self.x.a } + pub fn bar(self: Box) -> isize { self.x.a } + pub fn quux(&self) -> isize { self.x.a } pub fn baz<'a>(&'a self) -> &'a A { &self.x } - pub fn spam(self) -> int { self.x.a } + pub fn spam(self) -> isize { self.x.a } } trait Nus { fn f(&self); } diff --git a/src/test/run-pass/export-glob-imports-target.rs b/src/test/run-pass/export-glob-imports-target.rs index debe9b0ddf1..4f821ebcc18 100644 --- a/src/test/run-pass/export-glob-imports-target.rs +++ b/src/test/run-pass/export-glob-imports-target.rs @@ -18,7 +18,7 @@ mod foo { use foo::bar::*; pub mod bar { - pub static a : int = 10; + pub static a : isize = 10; } pub fn zum() { let _b = a; diff --git a/src/test/run-pass/expr-block-fn.rs b/src/test/run-pass/expr-block-fn.rs index 821dfbec0be..c88721471b6 100644 --- a/src/test/run-pass/expr-block-fn.rs +++ b/src/test/run-pass/expr-block-fn.rs @@ -13,7 +13,7 @@ // pretty-expanded FIXME #23616 fn test_fn() { - fn ten() -> int { return 10; } + fn ten() -> isize { return 10; } let rs = ten; assert!((rs() == 10)); } diff --git a/src/test/run-pass/expr-block-generic-unique2.rs b/src/test/run-pass/expr-block-generic-unique2.rs index 81d4078a3e9..bd293677395 100644 --- a/src/test/run-pass/expr-block-generic-unique2.rs +++ b/src/test/run-pass/expr-block-generic-unique2.rs @@ -19,8 +19,8 @@ fn test_generic(expected: T, eq: F) where T: Clone, F: FnOnce(T, T) -> boo } fn test_vec() { - fn compare_vec(v1: Box, v2: Box) -> bool { return v1 == v2; } - test_generic::, _>(box 1, compare_vec); + fn compare_vec(v1: Box, v2: Box) -> bool { return v1 == v2; } + test_generic::, _>(box 1, compare_vec); } pub fn main() { test_vec(); } diff --git a/src/test/run-pass/expr-block-generic.rs b/src/test/run-pass/expr-block-generic.rs index e4040238cd5..d26c6e62f53 100644 --- a/src/test/run-pass/expr-block-generic.rs +++ b/src/test/run-pass/expr-block-generic.rs @@ -22,8 +22,8 @@ fn test_bool() { #[derive(Clone)] struct Pair { - a: int, - b: int, + a: isize, + b: isize, } fn test_rec() { diff --git a/src/test/run-pass/expr-block-slot.rs b/src/test/run-pass/expr-block-slot.rs index 5f4515924e7..57b5a426f5c 100644 --- a/src/test/run-pass/expr-block-slot.rs +++ b/src/test/run-pass/expr-block-slot.rs @@ -12,8 +12,8 @@ // pretty-expanded FIXME #23616 -struct A { a: int } -struct V { v: int } +struct A { a: isize } +struct V { v: isize } pub fn main() { let a = { let b = A {a: 3}; b }; diff --git a/src/test/run-pass/expr-block.rs b/src/test/run-pass/expr-block.rs index dd4c4d0cd73..64f86237ab3 100644 --- a/src/test/run-pass/expr-block.rs +++ b/src/test/run-pass/expr-block.rs @@ -17,7 +17,7 @@ fn test_basic() { let rs: bool = { true }; assert!((rs)); } -struct RS { v1: int, v2: int } +struct RS { v1: isize, v2: isize } fn test_rec() { let rs = { RS {v1: 10, v2: 20} }; assert!((rs.v2 == 20)); } diff --git a/src/test/run-pass/expr-copy.rs b/src/test/run-pass/expr-copy.rs index f236f699938..80729fb2164 100644 --- a/src/test/run-pass/expr-copy.rs +++ b/src/test/run-pass/expr-copy.rs @@ -16,7 +16,7 @@ fn f(arg: &mut A) { } #[derive(Copy)] -struct A { a: int } +struct A { a: isize } pub fn main() { let mut x = A {a: 10}; diff --git a/src/test/run-pass/expr-fn.rs b/src/test/run-pass/expr-fn.rs index 51ef5f00ab7..0c9151cec7d 100644 --- a/src/test/run-pass/expr-fn.rs +++ b/src/test/run-pass/expr-fn.rs @@ -12,12 +12,12 @@ // pretty-expanded FIXME #23616 fn test_int() { - fn f() -> int { 10 } + fn f() -> isize { 10 } assert_eq!(f(), 10); } fn test_vec() { - fn f() -> Vec { vec!(10, 11) } + fn f() -> Vec { vec!(10, 11) } let vect = f(); assert_eq!(vect[1], 11); } @@ -28,22 +28,22 @@ fn test_generic() { } fn test_alt() { - fn f() -> int { match true { false => { 10 } true => { 20 } } } + fn f() -> isize { match true { false => { 10 } true => { 20 } } } assert_eq!(f(), 20); } fn test_if() { - fn f() -> int { if true { 10 } else { 20 } } + fn f() -> isize { if true { 10 } else { 20 } } assert_eq!(f(), 10); } fn test_block() { - fn f() -> int { { 10 } } + fn f() -> isize { { 10 } } assert_eq!(f(), 10); } fn test_ret() { - fn f() -> int { + fn f() -> isize { return 10 // no semi } @@ -53,7 +53,7 @@ fn test_ret() { // From issue #372 fn test_372() { - fn f() -> int { let x = { 3 }; x } + fn f() -> isize { let x = { 3 }; x } assert_eq!(f(), 3); } diff --git a/src/test/run-pass/expr-if-generic.rs b/src/test/run-pass/expr-if-generic.rs index 3f1c059ffee..47e79de6b11 100644 --- a/src/test/run-pass/expr-if-generic.rs +++ b/src/test/run-pass/expr-if-generic.rs @@ -25,8 +25,8 @@ fn test_bool() { #[derive(Clone)] struct Pair { - a: int, - b: int, + a: isize, + b: isize, } fn test_rec() { diff --git a/src/test/run-pass/expr-if-struct.rs b/src/test/run-pass/expr-if-struct.rs index ee2c0715043..ad397830638 100644 --- a/src/test/run-pass/expr-if-struct.rs +++ b/src/test/run-pass/expr-if-struct.rs @@ -15,7 +15,7 @@ // Tests for if as expressions returning nominal types #[derive(Copy)] -struct I { i: int } +struct I { i: isize } fn test_rec() { let rs = if true { I {i: 100} } else { I {i: 101} }; @@ -27,7 +27,7 @@ enum mood { happy, sad, } impl PartialEq for mood { fn eq(&self, other: &mood) -> bool { - ((*self) as uint) == ((*other) as uint) + ((*self) as usize) == ((*other) as usize) } fn ne(&self, other: &mood) -> bool { !(*self).eq(other) } } diff --git a/src/test/run-pass/expr-match-generic-unique2.rs b/src/test/run-pass/expr-match-generic-unique2.rs index d8e3172ea47..95f47d005d3 100644 --- a/src/test/run-pass/expr-match-generic-unique2.rs +++ b/src/test/run-pass/expr-match-generic-unique2.rs @@ -22,8 +22,8 @@ fn test_generic(expected: T, eq: F) where F: FnOnce(T, T) -> bool { } fn test_vec() { - fn compare_box(v1: Box, v2: Box) -> bool { return v1 == v2; } - test_generic::, _>(box 1, compare_box); + fn compare_box(v1: Box, v2: Box) -> bool { return v1 == v2; } + test_generic::, _>(box 1, compare_box); } pub fn main() { test_vec(); } diff --git a/src/test/run-pass/expr-match-generic.rs b/src/test/run-pass/expr-match-generic.rs index 513197be8f3..f8e82de9a0a 100644 --- a/src/test/run-pass/expr-match-generic.rs +++ b/src/test/run-pass/expr-match-generic.rs @@ -25,8 +25,8 @@ fn test_bool() { #[derive(Clone)] struct Pair { - a: int, - b: int, + a: isize, + b: isize, } fn test_rec() { diff --git a/src/test/run-pass/expr-match-struct.rs b/src/test/run-pass/expr-match-struct.rs index e4ce71200b5..91ad142c386 100644 --- a/src/test/run-pass/expr-match-struct.rs +++ b/src/test/run-pass/expr-match-struct.rs @@ -14,7 +14,7 @@ // Tests for match as expressions resulting in struct types #[derive(Copy)] -struct R { i: int } +struct R { i: isize } fn test_rec() { let rs = match true { true => R {i: 100}, _ => panic!() }; @@ -26,7 +26,7 @@ enum mood { happy, sad, } impl PartialEq for mood { fn eq(&self, other: &mood) -> bool { - ((*self) as uint) == ((*other) as uint) + ((*self) as usize) == ((*other) as usize) } fn ne(&self, other: &mood) -> bool { !(*self).eq(other) } } diff --git a/src/test/run-pass/exterior.rs b/src/test/run-pass/exterior.rs index 8e050aa3f4d..25a990383e4 100644 --- a/src/test/run-pass/exterior.rs +++ b/src/test/run-pass/exterior.rs @@ -14,7 +14,7 @@ use std::cell::Cell; #[derive(Copy)] -struct Point {x: int, y: int, z: int} +struct Point {x: isize, y: isize, z: isize} fn f(p: &Cell) { assert!((p.get().z == 12)); diff --git a/src/test/run-pass/extern-call-direct.rs b/src/test/run-pass/extern-call-direct.rs index bd05b3ce5a4..38cd4a8d79d 100644 --- a/src/test/run-pass/extern-call-direct.rs +++ b/src/test/run-pass/extern-call-direct.rs @@ -12,7 +12,7 @@ // pretty-expanded FIXME #23616 -extern fn f(x: uint) -> uint { x * 2 } +extern fn f(x: usize) -> usize { x * 2 } pub fn main() { let x = f(22); diff --git a/src/test/run-pass/extern-compare-with-return-type.rs b/src/test/run-pass/extern-compare-with-return-type.rs index 2d633b1de69..09411c9c6eb 100644 --- a/src/test/run-pass/extern-compare-with-return-type.rs +++ b/src/test/run-pass/extern-compare-with-return-type.rs @@ -15,20 +15,20 @@ extern fn voidret1() {} extern fn voidret2() {} -extern fn uintret() -> uint { 22 } +extern fn uintret() -> usize { 22 } -extern fn uintvoidret(_x: uint) {} +extern fn uintvoidret(_x: usize) {} -extern fn uintuintuintuintret(x: uint, y: uint, z: uint) -> uint { x+y+z } -type uintuintuintuintret = extern fn(uint,uint,uint) -> uint; +extern fn uintuintuintuintret(x: usize, y: usize, z: usize) -> usize { x+y+z } +type uintuintuintuintret = extern fn(usize,usize,usize) -> usize; pub fn main() { assert!(voidret1 as extern fn() == voidret1 as extern fn()); assert!(voidret1 as extern fn() != voidret2 as extern fn()); - assert!(uintret as extern fn() -> uint == uintret as extern fn() -> uint); + assert!(uintret as extern fn() -> usize == uintret as extern fn() -> usize); - assert!(uintvoidret as extern fn(uint) == uintvoidret as extern fn(uint)); + assert!(uintvoidret as extern fn(usize) == uintvoidret as extern fn(usize)); assert!(uintuintuintuintret as uintuintuintuintret == uintuintuintuintret as uintuintuintuintret); diff --git a/src/test/run-pass/fact.rs b/src/test/run-pass/fact.rs index 172ec2f0905..5cb2abbfb0a 100644 --- a/src/test/run-pass/fact.rs +++ b/src/test/run-pass/fact.rs @@ -11,7 +11,7 @@ -fn f(x: int) -> int { +fn f(x: isize) -> isize { // println!("in f:"); println!("{}", x); @@ -22,7 +22,7 @@ fn f(x: int) -> int { } else { // println!("recurring"); - let y: int = x * f(x - 1); + let y: isize = x * f(x - 1); // println!("returned"); println!("{}", y); diff --git a/src/test/run-pass/fixup-deref-mut.rs b/src/test/run-pass/fixup-deref-mut.rs index 09683c43ece..900da3c2d6a 100644 --- a/src/test/run-pass/fixup-deref-mut.rs +++ b/src/test/run-pass/fixup-deref-mut.rs @@ -32,12 +32,12 @@ impl DerefMut for Own { } struct Point { - x: int, - y: int + x: isize, + y: isize } impl Point { - fn get(&mut self) -> (int, int) { + fn get(&mut self) -> (isize, isize) { (self.x, self.y) } } diff --git a/src/test/run-pass/fn-bare-assign.rs b/src/test/run-pass/fn-bare-assign.rs index 0fd0f6a110d..d83dc785805 100644 --- a/src/test/run-pass/fn-bare-assign.rs +++ b/src/test/run-pass/fn-bare-assign.rs @@ -10,12 +10,12 @@ // pretty-expanded FIXME #23616 -fn f(i: int, called: &mut bool) { +fn f(i: isize, called: &mut bool) { assert_eq!(i, 10); *called = true; } -fn g(f: fn(int, v: &mut bool), called: &mut bool) { +fn g(f: fn(isize, v: &mut bool), called: &mut bool) { f(10, called); } diff --git a/src/test/run-pass/fn-bare-size.rs b/src/test/run-pass/fn-bare-size.rs index b373294e243..117cf13584f 100644 --- a/src/test/run-pass/fn-bare-size.rs +++ b/src/test/run-pass/fn-bare-size.rs @@ -14,5 +14,5 @@ use std::mem; pub fn main() { // Bare functions should just be a pointer - assert_eq!(mem::size_of::(), mem::size_of::()); + assert_eq!(mem::size_of::(), mem::size_of::()); } diff --git a/src/test/run-pass/fn-bare-spawn.rs b/src/test/run-pass/fn-bare-spawn.rs index 8a167245610..0a3c8916270 100644 --- a/src/test/run-pass/fn-bare-spawn.rs +++ b/src/test/run-pass/fn-bare-spawn.rs @@ -16,7 +16,7 @@ fn spawn(val: T, f: fn(T)) { f(val); } -fn f(i: int) { +fn f(i: isize) { assert_eq!(i, 100); } diff --git a/src/test/run-pass/fn-item-type-cast.rs b/src/test/run-pass/fn-item-type-cast.rs index 7f9248f4d2a..f8b1582c515 100644 --- a/src/test/run-pass/fn-item-type-cast.rs +++ b/src/test/run-pass/fn-item-type-cast.rs @@ -12,9 +12,9 @@ // pretty-expanded FIXME #23616 -fn foo(x: int) -> int { x * 2 } -fn bar(x: int) -> int { x * 4 } -type IntMap = fn(int) -> int; +fn foo(x: isize) -> isize { x * 2 } +fn bar(x: isize) -> isize { x * 4 } +type IntMap = fn(isize) -> isize; fn eq(x: T, y: T) { } diff --git a/src/test/run-pass/fn-item-type-coerce.rs b/src/test/run-pass/fn-item-type-coerce.rs index 34489555dbc..67899bfd683 100644 --- a/src/test/run-pass/fn-item-type-coerce.rs +++ b/src/test/run-pass/fn-item-type-coerce.rs @@ -12,9 +12,9 @@ // pretty-expanded FIXME #23616 -fn foo(x: int) -> int { x * 2 } -fn bar(x: int) -> int { x * 4 } -type IntMap = fn(int) -> int; +fn foo(x: isize) -> isize { x * 2 } +fn bar(x: isize) -> isize { x * 4 } +type IntMap = fn(isize) -> isize; fn eq(x: T, y: T) { } diff --git a/src/test/run-pass/fn-lval.rs b/src/test/run-pass/fn-lval.rs index efb58474118..13c96f43468 100644 --- a/src/test/run-pass/fn-lval.rs +++ b/src/test/run-pass/fn-lval.rs @@ -13,8 +13,8 @@ // pretty-expanded FIXME #23616 -fn foo(_f: fn(int) -> int) { } +fn foo(_f: fn(isize) -> isize) { } -fn id(x: int) -> int { return x; } +fn id(x: isize) -> isize { return x; } pub fn main() { foo(id); } diff --git a/src/test/run-pass/fn-pattern-expected-type-2.rs b/src/test/run-pass/fn-pattern-expected-type-2.rs index 4e2c8facaf8..66a7123c795 100644 --- a/src/test/run-pass/fn-pattern-expected-type-2.rs +++ b/src/test/run-pass/fn-pattern-expected-type-2.rs @@ -9,7 +9,7 @@ // except according to those terms. pub fn main() { - let v : &[(int,int)] = &[ (1, 2), (3, 4), (5, 6) ]; + let v : &[(isize,isize)] = &[ (1, 2), (3, 4), (5, 6) ]; for &(x, y) in v { println!("{}", y); println!("{}", x); diff --git a/src/test/run-pass/fn-pattern-expected-type.rs b/src/test/run-pass/fn-pattern-expected-type.rs index 2287df4b105..352d0b13c64 100644 --- a/src/test/run-pass/fn-pattern-expected-type.rs +++ b/src/test/run-pass/fn-pattern-expected-type.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 pub fn main() { - let f = |(x, y): (int, int)| { + let f = |(x, y): (isize, isize)| { assert_eq!(x, 1); assert_eq!(y, 2); }; diff --git a/src/test/run-pass/for-destruct.rs b/src/test/run-pass/for-destruct.rs index 2db01b1aa40..9d8c432e982 100644 --- a/src/test/run-pass/for-destruct.rs +++ b/src/test/run-pass/for-destruct.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -struct Pair { x: int, y: int } +struct Pair { x: isize, y: isize } pub fn main() { for elt in &(vec!(Pair {x: 10, y: 20}, Pair {x: 30, y: 0})) { diff --git a/src/test/run-pass/for-loop-goofiness.rs b/src/test/run-pass/for-loop-goofiness.rs index 8784af18886..4b6b6dcf1d5 100644 --- a/src/test/run-pass/for-loop-goofiness.rs +++ b/src/test/run-pass/for-loop-goofiness.rs @@ -15,7 +15,7 @@ enum BogusOption { Some(T), } -type Iterator = int; +type Iterator = isize; pub fn main() { let x = [ 3, 3, 3 ]; diff --git a/src/test/run-pass/for-loop-no-std.rs b/src/test/run-pass/for-loop-no-std.rs index 769d9116f5a..63738b47517 100644 --- a/src/test/run-pass/for-loop-no-std.rs +++ b/src/test/run-pass/for-loop-no-std.rs @@ -21,7 +21,7 @@ extern crate "std" as other; use core::slice::SliceExt; #[start] -fn start(_argc: int, _argv: *const *const u8) -> int { +fn start(_argc: isize, _argv: *const *const u8) -> isize { for _ in [1,2,3].iter() { } 0 } diff --git a/src/test/run-pass/for-loop-panic.rs b/src/test/run-pass/for-loop-panic.rs index 7664e74cd33..908932fe396 100644 --- a/src/test/run-pass/for-loop-panic.rs +++ b/src/test/run-pass/for-loop-panic.rs @@ -11,4 +11,4 @@ // pretty-expanded FIXME #23616 -pub fn main() { let x: Vec = Vec::new(); for _ in &x { panic!("moop"); } } +pub fn main() { let x: Vec = Vec::new(); for _ in &x { panic!("moop"); } } diff --git a/src/test/run-pass/foreach-nested.rs b/src/test/run-pass/foreach-nested.rs index 45e57e8a7e8..075539b621a 100644 --- a/src/test/run-pass/foreach-nested.rs +++ b/src/test/run-pass/foreach-nested.rs @@ -11,13 +11,13 @@ // pretty-expanded FIXME #23616 -fn two(mut it: F) where F: FnMut(int) { it(0); it(1); } +fn two(mut it: F) where F: FnMut(isize) { it(0); it(1); } pub fn main() { - let mut a: Vec = vec!(-1, -1, -1, -1); - let mut p: int = 0; + let mut a: Vec = vec!(-1, -1, -1, -1); + let mut p: isize = 0; two(|i| { - two(|j| { a[p as uint] = 10 * i + j; p += 1; }) + two(|j| { a[p as usize] = 10 * i + j; p += 1; }) }); assert_eq!(a[0], 0); assert_eq!(a[1], 1); diff --git a/src/test/run-pass/foreach-put-structured.rs b/src/test/run-pass/foreach-put-structured.rs index 029dddb7a21..028e31d76aa 100644 --- a/src/test/run-pass/foreach-put-structured.rs +++ b/src/test/run-pass/foreach-put-structured.rs @@ -10,15 +10,15 @@ -fn pairs(mut it: F) where F: FnMut((int, int)) { - let mut i: int = 0; - let mut j: int = 0; +fn pairs(mut it: F) where F: FnMut((isize, isize)) { + let mut i: isize = 0; + let mut j: isize = 0; while i < 10 { it((i, j)); i += 1; j += i; } } pub fn main() { - let mut i: int = 10; - let mut j: int = 0; + let mut i: isize = 10; + let mut j: isize = 0; pairs(|p| { let (_0, _1) = p; println!("{}", _0); diff --git a/src/test/run-pass/foreach-simple-outer-slot.rs b/src/test/run-pass/foreach-simple-outer-slot.rs index 9ccb2dd56cf..674c2e34482 100644 --- a/src/test/run-pass/foreach-simple-outer-slot.rs +++ b/src/test/run-pass/foreach-simple-outer-slot.rs @@ -12,14 +12,14 @@ pub fn main() { - let mut sum: int = 0; + let mut sum: isize = 0; first_ten(|i| { println!("main"); println!("{}", i); sum = sum + i; }); println!("sum"); println!("{}", sum); assert_eq!(sum, 45); } -fn first_ten(mut it: F) where F: FnMut(int) { - let mut i: int = 0; +fn first_ten(mut it: F) where F: FnMut(isize) { + let mut i: isize = 0; while i < 10 { println!("first_ten"); it(i); i = i + 1; } } diff --git a/src/test/run-pass/foreign-call-no-runtime.rs b/src/test/run-pass/foreign-call-no-runtime.rs index 3c5abba902d..2d3ff62a005 100644 --- a/src/test/run-pass/foreign-call-no-runtime.rs +++ b/src/test/run-pass/foreign-call-no-runtime.rs @@ -33,7 +33,7 @@ pub fn main() { extern fn callback(data: libc::uintptr_t) { unsafe { - let data: *const int = mem::transmute(data); + let data: *const isize = mem::transmute(data); assert_eq!(*data, 100); } } diff --git a/src/test/run-pass/foreign-fn-linkname.rs b/src/test/run-pass/foreign-fn-linkname.rs index b7fe3705e10..5db83d50b61 100644 --- a/src/test/run-pass/foreign-fn-linkname.rs +++ b/src/test/run-pass/foreign-fn-linkname.rs @@ -25,11 +25,11 @@ mod mlibc { } } -fn strlen(str: String) -> uint { +fn strlen(str: String) -> usize { // C string is terminated with a zero let s = CString::new(str).unwrap(); unsafe { - mlibc::my_strlen(s.as_ptr()) as uint + mlibc::my_strlen(s.as_ptr()) as usize } } diff --git a/src/test/run-pass/format-no-std.rs b/src/test/run-pass/format-no-std.rs index 71934b42c33..a4bf95d5467 100644 --- a/src/test/run-pass/format-no-std.rs +++ b/src/test/run-pass/format-no-std.rs @@ -21,7 +21,7 @@ extern crate "std" as other; use collections::string::ToString; #[start] -fn start(_argc: int, _argv: *const *const u8) -> int { +fn start(_argc: isize, _argv: *const *const u8) -> isize { let s = format!("{}", 1_isize); assert_eq!(s, "1".to_string()); diff --git a/src/test/run-pass/fsu-moves-and-copies.rs b/src/test/run-pass/fsu-moves-and-copies.rs index e04fa36d80b..fecaf279d04 100644 --- a/src/test/run-pass/fsu-moves-and-copies.rs +++ b/src/test/run-pass/fsu-moves-and-copies.rs @@ -18,28 +18,28 @@ use std::marker::NoCopy as NP; -struct ncint { np: NP, v: int } -fn ncint(v: int) -> ncint { ncint { np: NP, v: v } } +struct ncint { np: NP, v: isize } +fn ncint(v: isize) -> ncint { ncint { np: NP, v: v } } -struct NoFoo { copied: int, nocopy: ncint, } +struct NoFoo { copied: isize, nocopy: ncint, } impl NoFoo { - fn new(x:int,y:int) -> NoFoo { NoFoo { copied: x, nocopy: ncint(y) } } + fn new(x:isize,y:isize) -> NoFoo { NoFoo { copied: x, nocopy: ncint(y) } } } -struct MoveFoo { copied: int, moved: Box, } +struct MoveFoo { copied: isize, moved: Box, } impl MoveFoo { - fn new(x:int,y:int) -> MoveFoo { MoveFoo { copied: x, moved: box y } } + fn new(x:isize,y:isize) -> MoveFoo { MoveFoo { copied: x, moved: box y } } } struct DropNoFoo { inner: NoFoo } impl DropNoFoo { - fn new(x:int,y:int) -> DropNoFoo { DropNoFoo { inner: NoFoo::new(x,y) } } + fn new(x:isize,y:isize) -> DropNoFoo { DropNoFoo { inner: NoFoo::new(x,y) } } } impl Drop for DropNoFoo { fn drop(&mut self) { } } struct DropMoveFoo { inner: MoveFoo } impl DropMoveFoo { - fn new(x:int,y:int) -> DropMoveFoo { DropMoveFoo { inner: MoveFoo::new(x,y) } } + fn new(x:isize,y:isize) -> DropMoveFoo { DropMoveFoo { inner: MoveFoo::new(x,y) } } } impl Drop for DropMoveFoo { fn drop(&mut self) { } } diff --git a/src/test/run-pass/fun-call-variants.rs b/src/test/run-pass/fun-call-variants.rs index 526787c8b9c..0fe4bbcb7a2 100644 --- a/src/test/run-pass/fun-call-variants.rs +++ b/src/test/run-pass/fun-call-variants.rs @@ -10,13 +10,13 @@ // pretty-expanded FIXME #23616 -fn ho(f: F) -> int where F: FnOnce(int) -> int { let n: int = f(3); return n; } +fn ho(f: F) -> isize where F: FnOnce(isize) -> isize { let n: isize = f(3); return n; } -fn direct(x: int) -> int { return x + 1; } +fn direct(x: isize) -> isize { return x + 1; } pub fn main() { - let a: int = direct(3); // direct - let b: int = ho(direct); // indirect unbound + let a: isize = direct(3); // direct + let b: isize = ho(direct); // indirect unbound assert_eq!(a, b); } diff --git a/src/test/run-pass/fun-indirect-call.rs b/src/test/run-pass/fun-indirect-call.rs index b04377d3616..48dfcb73da4 100644 --- a/src/test/run-pass/fun-indirect-call.rs +++ b/src/test/run-pass/fun-indirect-call.rs @@ -13,10 +13,10 @@ // pretty-expanded FIXME #23616 -fn f() -> int { return 42; } +fn f() -> isize { return 42; } pub fn main() { - let g: fn() -> int = f; - let i: int = g(); + let g: fn() -> isize = f; + let i: isize = g(); assert_eq!(i, 42); } diff --git a/src/test/run-pass/func-arg-incomplete-pattern.rs b/src/test/run-pass/func-arg-incomplete-pattern.rs index 4476ce309c4..28337237085 100644 --- a/src/test/run-pass/func-arg-incomplete-pattern.rs +++ b/src/test/run-pass/func-arg-incomplete-pattern.rs @@ -17,18 +17,18 @@ #![feature(box_syntax)] struct Foo { - x: Box, - y: Box, + x: Box, + y: Box, } -fn foo(Foo {x, ..}: Foo) -> *const uint { - let addr: *const uint = &*x; +fn foo(Foo {x, ..}: Foo) -> *const usize { + let addr: *const usize = &*x; addr } pub fn main() { let obj: Box<_> = box 1; - let objptr: *const uint = &*obj; + let objptr: *const usize = &*obj; let f = Foo {x: obj, y: box 2}; let xptr = foo(f); assert_eq!(objptr, xptr); diff --git a/src/test/run-pass/func-arg-ref-pattern.rs b/src/test/run-pass/func-arg-ref-pattern.rs index 5893eec63f0..fcc00afb00b 100644 --- a/src/test/run-pass/func-arg-ref-pattern.rs +++ b/src/test/run-pass/func-arg-ref-pattern.rs @@ -20,18 +20,18 @@ #![feature(box_patterns)] #![feature(box_syntax)] -fn getaddr(box ref x: Box) -> *const uint { - let addr: *const uint = &*x; +fn getaddr(box ref x: Box) -> *const usize { + let addr: *const usize = &*x; addr } -fn checkval(box ref x: Box) -> uint { +fn checkval(box ref x: Box) -> usize { *x } pub fn main() { let obj: Box<_> = box 1; - let objptr: *const uint = &*obj; + let objptr: *const usize = &*obj; let xptr = getaddr(obj); assert_eq!(objptr, xptr); diff --git a/src/test/run-pass/func-arg-wild-pattern.rs b/src/test/run-pass/func-arg-wild-pattern.rs index 2eb6279455e..4f74ca0ff72 100644 --- a/src/test/run-pass/func-arg-wild-pattern.rs +++ b/src/test/run-pass/func-arg-wild-pattern.rs @@ -13,7 +13,7 @@ // pretty-expanded FIXME #23616 -fn foo((x, _): (int, int)) -> int { +fn foo((x, _): (isize, isize)) -> isize { x } diff --git a/src/test/run-pass/functional-struct-upd.rs b/src/test/run-pass/functional-struct-upd.rs index 8c686aba5f3..240d49d718f 100644 --- a/src/test/run-pass/functional-struct-upd.rs +++ b/src/test/run-pass/functional-struct-upd.rs @@ -10,8 +10,8 @@ #[derive(Debug)] struct Foo { - x: int, - y: int + x: isize, + y: isize } pub fn main() { diff --git a/src/test/run-pass/generic-alias-unique.rs b/src/test/run-pass/generic-alias-unique.rs index 42062b89cfd..b8d7c2140be 100644 --- a/src/test/run-pass/generic-alias-unique.rs +++ b/src/test/run-pass/generic-alias-unique.rs @@ -15,7 +15,7 @@ fn id(t: T) -> T { return t; } pub fn main() { let expected: Box<_> = box 100; - let actual = id::>(expected.clone()); + let actual = id::>(expected.clone()); println!("{}", *actual); assert_eq!(*expected, *actual); } diff --git a/src/test/run-pass/generic-default-type-params-cross-crate.rs b/src/test/run-pass/generic-default-type-params-cross-crate.rs index c76d942575c..4cf9f93bcac 100644 --- a/src/test/run-pass/generic-default-type-params-cross-crate.rs +++ b/src/test/run-pass/generic-default-type-params-cross-crate.rs @@ -19,8 +19,8 @@ struct Vec(Option<(T,A)>); struct Foo; fn main() { - let _a = Vec::(None); - let _b = Vec::(None); - let _c = default_type_params_xc::FakeVec:: { f: None }; - let _d = default_type_params_xc::FakeVec:: { f: None }; + let _a = Vec::(None); + let _b = Vec::(None); + let _c = default_type_params_xc::FakeVec:: { f: None }; + let _d = default_type_params_xc::FakeVec:: { f: None }; } diff --git a/src/test/run-pass/generic-default-type-params.rs b/src/test/run-pass/generic-default-type-params.rs index e7ef1d42f5f..e30cb765798 100644 --- a/src/test/run-pass/generic-default-type-params.rs +++ b/src/test/run-pass/generic-default-type-params.rs @@ -8,12 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -struct Foo { +struct Foo { a: A } -impl Foo { - fn bar_int(&self) -> int { +impl Foo { + fn bar_int(&self) -> isize { self.a } } @@ -26,7 +26,7 @@ impl Foo { impl Foo { fn bar(&self) { - let (i, c): (int, char) = self.a; + let (i, c): (isize, char) = self.a; assert_eq!(Foo { a: i }.bar_int(), i); assert_eq!(Foo { a: c }.bar_char(), c); } @@ -39,7 +39,7 @@ impl Foo { } fn default_foo(x: Foo) { - let (i, c): (int, char) = x.a; + let (i, c): (isize, char) = x.a; assert_eq!(i, 1); assert_eq!(c, 'a'); diff --git a/src/test/run-pass/generic-derived-type.rs b/src/test/run-pass/generic-derived-type.rs index 0db03b46748..74a71873e28 100644 --- a/src/test/run-pass/generic-derived-type.rs +++ b/src/test/run-pass/generic-derived-type.rs @@ -22,7 +22,7 @@ fn f(t: T) -> Pair { } pub fn main() { - let b = f::(10); + let b = f::(10); println!("{}" ,b.a); println!("{}", b.b); assert_eq!(b.a, 10); diff --git a/src/test/run-pass/generic-exterior-unique.rs b/src/test/run-pass/generic-exterior-unique.rs index 7265b021adc..0e3ce3869bf 100644 --- a/src/test/run-pass/generic-exterior-unique.rs +++ b/src/test/run-pass/generic-exterior-unique.rs @@ -18,7 +18,7 @@ struct Recbox {x: Box} fn reclift(t: T) -> Recbox { return Recbox {x: box t}; } pub fn main() { - let foo: int = 17; - let rbfoo: Recbox = reclift::(foo); + let foo: isize = 17; + let rbfoo: Recbox = reclift::(foo); assert_eq!(*rbfoo.x, foo); } diff --git a/src/test/run-pass/generic-fn-infer.rs b/src/test/run-pass/generic-fn-infer.rs index 0eb17c41307..e01f5073722 100644 --- a/src/test/run-pass/generic-fn-infer.rs +++ b/src/test/run-pass/generic-fn-infer.rs @@ -17,4 +17,4 @@ fn id(x: T) -> T { return x; } -pub fn main() { let x: int = 42; let y: int = id(x); assert!((x == y)); } +pub fn main() { let x: isize = 42; let y: isize = id(x); assert!((x == y)); } diff --git a/src/test/run-pass/generic-fn-twice.rs b/src/test/run-pass/generic-fn-twice.rs index 04a8824abed..b37c73f7f75 100644 --- a/src/test/run-pass/generic-fn-twice.rs +++ b/src/test/run-pass/generic-fn-twice.rs @@ -17,4 +17,4 @@ mod foomod { pub fn foo() { } } -pub fn main() { foomod::foo::(); foomod::foo::(); } +pub fn main() { foomod::foo::(); foomod::foo::(); } diff --git a/src/test/run-pass/generic-fn.rs b/src/test/run-pass/generic-fn.rs index 8da8c680847..82b03abf057 100644 --- a/src/test/run-pass/generic-fn.rs +++ b/src/test/run-pass/generic-fn.rs @@ -13,7 +13,7 @@ fn id(x: T) -> T { return x; } #[derive(Copy)] -struct Triple {x: int, y: int, z: int} +struct Triple {x: isize, y: isize, z: isize} pub fn main() { let mut x = 62; @@ -22,7 +22,7 @@ pub fn main() { let mut b = 'b'; let p: Triple = Triple {x: 65, y: 66, z: 67}; let mut q: Triple = Triple {x: 68, y: 69, z: 70}; - y = id::(x); + y = id::(x); println!("{}", y); assert_eq!(x, y); b = id::(a); diff --git a/src/test/run-pass/generic-object.rs b/src/test/run-pass/generic-object.rs index 4934b9de36c..44b32f62f92 100644 --- a/src/test/run-pass/generic-object.rs +++ b/src/test/run-pass/generic-object.rs @@ -18,17 +18,17 @@ trait Foo { } struct S { - x: int + x: isize } -impl Foo for S { - fn get(&self) -> int { +impl Foo for S { + fn get(&self) -> isize { self.x } } pub fn main() { let x = box S { x: 1 }; - let y = x as Box>; + let y = x as Box>; assert_eq!(y.get(), 1); } diff --git a/src/test/run-pass/generic-recursive-tag.rs b/src/test/run-pass/generic-recursive-tag.rs index 845375d9b84..863e0d7e333 100644 --- a/src/test/run-pass/generic-recursive-tag.rs +++ b/src/test/run-pass/generic-recursive-tag.rs @@ -16,9 +16,9 @@ enum list { cons(Box, Box>), nil, } pub fn main() { - let _a: list = - list::cons::(box 10, - box list::cons::(box 12, - box list::cons::(box 13, - box list::nil::))); + let _a: list = + list::cons::(box 10, + box list::cons::(box 12, + box list::cons::(box 13, + box list::nil::))); } diff --git a/src/test/run-pass/generic-tag-match.rs b/src/test/run-pass/generic-tag-match.rs index 64eb4e49869..830c982e13c 100644 --- a/src/test/run-pass/generic-tag-match.rs +++ b/src/test/run-pass/generic-tag-match.rs @@ -18,4 +18,4 @@ fn altfoo(f: foo) { assert!((hit)); } -pub fn main() { altfoo::(foo::arm::(10)); } +pub fn main() { altfoo::(foo::arm::(10)); } diff --git a/src/test/run-pass/generic-tag-values.rs b/src/test/run-pass/generic-tag-values.rs index 6ed85588363..fef26593eac 100644 --- a/src/test/run-pass/generic-tag-values.rs +++ b/src/test/run-pass/generic-tag-values.rs @@ -10,11 +10,11 @@ enum noption { some(T), } -struct Pair { x: int, y: int } +struct Pair { x: isize, y: isize } pub fn main() { - let nop: noption = noption::some::(5); - match nop { noption::some::(n) => { println!("{}", n); assert!((n == 5)); } } + let nop: noption = noption::some::(5); + match nop { noption::some::(n) => { println!("{}", n); assert!((n == 5)); } } let nop2: noption = noption::some(Pair{x: 17, y: 42}); match nop2 { noption::some(t) => { diff --git a/src/test/run-pass/generic-tag.rs b/src/test/run-pass/generic-tag.rs index 38f6707d9ef..942bdb97ba2 100644 --- a/src/test/run-pass/generic-tag.rs +++ b/src/test/run-pass/generic-tag.rs @@ -18,6 +18,6 @@ enum option { some(Box), none, } pub fn main() { - let mut a: option = option::some::(box 10); - a = option::none::; + let mut a: option = option::some::(box 10); + a = option::none::; } diff --git a/src/test/run-pass/generic-temporary.rs b/src/test/run-pass/generic-temporary.rs index 3db794d88f0..8b63fb94b52 100644 --- a/src/test/run-pass/generic-temporary.rs +++ b/src/test/run-pass/generic-temporary.rs @@ -9,9 +9,9 @@ // except according to those terms. -fn mk() -> int { return 1; } +fn mk() -> isize { return 1; } -fn chk(a: int) { println!("{}", a); assert!((a == 1)); } +fn chk(a: isize) { println!("{}", a); assert!((a == 1)); } fn apply(produce: fn() -> T, consume: fn(T)) { @@ -19,7 +19,7 @@ fn apply(produce: fn() -> T, } pub fn main() { - let produce: fn() -> int = mk; - let consume: fn(v: int) = chk; - apply::(produce, consume); + let produce: fn() -> isize = mk; + let consume: fn(v: isize) = chk; + apply::(produce, consume); } diff --git a/src/test/run-pass/generic-type.rs b/src/test/run-pass/generic-type.rs index 6f93ae0d42b..73fc3a0d802 100644 --- a/src/test/run-pass/generic-type.rs +++ b/src/test/run-pass/generic-type.rs @@ -15,7 +15,7 @@ struct Pair {x: T, y: T} pub fn main() { - let x: Pair = Pair {x: 10, y: 12}; + let x: Pair = Pair {x: 10, y: 12}; assert_eq!(x.x, 10); assert_eq!(x.y, 12); } diff --git a/src/test/run-pass/generic-unique.rs b/src/test/run-pass/generic-unique.rs index 4c5072b10c9..9cf98364eb9 100644 --- a/src/test/run-pass/generic-unique.rs +++ b/src/test/run-pass/generic-unique.rs @@ -18,6 +18,6 @@ struct Triple { x: T, y: T, z: T } fn box_it(x: Triple) -> Box> { return box x; } pub fn main() { - let x: Box> = box_it::(Triple{x: 1, y: 2, z: 3}); + let x: Box> = box_it::(Triple{x: 1, y: 2, z: 3}); assert_eq!(x.y, 2); } diff --git a/src/test/run-pass/global-scope.rs b/src/test/run-pass/global-scope.rs index 73c15382d9e..64d9368a88b 100644 --- a/src/test/run-pass/global-scope.rs +++ b/src/test/run-pass/global-scope.rs @@ -11,10 +11,10 @@ // pretty-expanded FIXME #23616 -pub fn f() -> int { return 1; } +pub fn f() -> isize { return 1; } pub mod foo { - pub fn f() -> int { return 2; } + pub fn f() -> isize { return 2; } pub fn g() { assert!((f() == 2)); assert!((::f() == 1)); } } diff --git a/src/test/run-pass/guards-not-exhaustive.rs b/src/test/run-pass/guards-not-exhaustive.rs index f038353ada2..59ec14e097e 100644 --- a/src/test/run-pass/guards-not-exhaustive.rs +++ b/src/test/run-pass/guards-not-exhaustive.rs @@ -11,9 +11,9 @@ // pretty-expanded FIXME #23616 #[derive(Copy)] -enum Q { R(Option) } +enum Q { R(Option) } -fn xyzzy(q: Q) -> uint { +fn xyzzy(q: Q) -> usize { match q { Q::R(S) if S.is_some() => { 0 } _ => 1 diff --git a/src/test/run-pass/guards.rs b/src/test/run-pass/guards.rs index 59e7c3782e1..598172ac18e 100644 --- a/src/test/run-pass/guards.rs +++ b/src/test/run-pass/guards.rs @@ -11,14 +11,14 @@ // pretty-expanded FIXME #23616 #[derive(Copy)] -struct Pair { x: int, y: int } +struct Pair { x: isize, y: isize } pub fn main() { - let a: int = + let a: isize = match 10 { x if x < 7 => { 1 } x if x < 11 => { 2 } 10 => { 3 } _ => { 4 } }; assert_eq!(a, 2); - let b: int = + let b: isize = match (Pair {x: 10, y: 20}) { x if x.x < 5 && x.y < 5 => { 1 } Pair {x: x, y: y} if x == 10 && y == 20 => { 2 } diff --git a/src/test/run-pass/hashmap-memory.rs b/src/test/run-pass/hashmap-memory.rs index 93ff1820734..3d1b74438a8 100644 --- a/src/test/run-pass/hashmap-memory.rs +++ b/src/test/run-pass/hashmap-memory.rs @@ -31,7 +31,7 @@ mod map_reduce { pub type mapper = extern fn(String, putter); - enum ctrl_proto { find_reducer(Vec, Sender), mapper_done, } + enum ctrl_proto { find_reducer(Vec, Sender), mapper_done, } fn start_mappers(ctrl: Sender, inputs: Vec) { for i in &inputs { @@ -44,7 +44,7 @@ mod map_reduce { fn map_task(ctrl: Sender, input: String) { let mut intermediates = HashMap::new(); - fn emit(im: &mut HashMap, + fn emit(im: &mut HashMap, ctrl: Sender, key: String, _val: String) { if im.contains_key(&key) { @@ -71,13 +71,13 @@ mod map_reduce { // This task becomes the master control task. It spawns others // to do the rest. - let mut reducers: HashMap; + let mut reducers: HashMap; reducers = HashMap::new(); start_mappers(tx, inputs.clone()); - let mut num_mappers = inputs.len() as int; + let mut num_mappers = inputs.len() as isize; while num_mappers > 0 { match rx.recv().unwrap() { diff --git a/src/test/run-pass/hrtb-binder-levels-in-object-types.rs b/src/test/run-pass/hrtb-binder-levels-in-object-types.rs index 495c1ccf1f4..bcd519bc25d 100644 --- a/src/test/run-pass/hrtb-binder-levels-in-object-types.rs +++ b/src/test/run-pass/hrtb-binder-levels-in-object-types.rs @@ -16,11 +16,11 @@ // pretty-expanded FIXME #23616 trait Typer<'tcx> { - fn method(&self, data: &'tcx int) -> &'tcx int { data } + fn method(&self, data: &'tcx isize) -> &'tcx isize { data } } struct Tcx<'tcx> { - fields: &'tcx int + fields: &'tcx isize } impl<'tcx> Typer<'tcx> for Tcx<'tcx> { diff --git a/src/test/run-pass/hrtb-debruijn-object-types-in-closures.rs b/src/test/run-pass/hrtb-debruijn-object-types-in-closures.rs index 9cb588b1010..6761cc12876 100644 --- a/src/test/run-pass/hrtb-debruijn-object-types-in-closures.rs +++ b/src/test/run-pass/hrtb-debruijn-object-types-in-closures.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 trait Typer<'tcx> { - fn method(&self, data: &'tcx int) -> &'tcx int { data } + fn method(&self, data: &'tcx isize) -> &'tcx isize { data } fn dummy(&self) { } } diff --git a/src/test/run-pass/hrtb-fn-like-trait-object.rs b/src/test/run-pass/hrtb-fn-like-trait-object.rs index 676c7b8245a..858179fb5fe 100644 --- a/src/test/run-pass/hrtb-fn-like-trait-object.rs +++ b/src/test/run-pass/hrtb-fn-like-trait-object.rs @@ -16,7 +16,7 @@ trait FnLike { fn call(&self, arg: A) -> R; } -type FnObject<'b> = for<'a> FnLike<&'a int, &'a int> + 'b; +type FnObject<'b> = for<'a> FnLike<&'a isize, &'a isize> + 'b; struct Identity; diff --git a/src/test/run-pass/hrtb-fn-like-trait.rs b/src/test/run-pass/hrtb-fn-like-trait.rs index d837dafc759..8b4c2aec845 100644 --- a/src/test/run-pass/hrtb-fn-like-trait.rs +++ b/src/test/run-pass/hrtb-fn-like-trait.rs @@ -25,7 +25,7 @@ impl<'a, T> FnLike<&'a T, &'a T> for Identity { } fn call_repeatedly(f: F) - where F : for<'a> FnLike<&'a int, &'a int> + where F : for<'a> FnLike<&'a isize, &'a isize> { let x = 3; let y = f.call(&x); diff --git a/src/test/run-pass/hrtb-precedence-of-plus-where-clause.rs b/src/test/run-pass/hrtb-precedence-of-plus-where-clause.rs index f27fb297176..bc00a0758f4 100644 --- a/src/test/run-pass/hrtb-precedence-of-plus-where-clause.rs +++ b/src/test/run-pass/hrtb-precedence-of-plus-where-clause.rs @@ -12,23 +12,23 @@ #![feature(unboxed_closures)] -// Test that `F : Fn(int) -> int + Send` is interpreted as two +// Test that `F : Fn(isize) -> isize + Send` is interpreted as two // distinct bounds on `F`. fn foo1(f: F) - where F : FnOnce(int) -> int + Send + where F : FnOnce(isize) -> isize + Send { bar(f); } fn foo2(f: F) - where F : FnOnce(int) -> int + Send + where F : FnOnce(isize) -> isize + Send { baz(f); } fn bar(f: F) { } -fn baz int>(f: F) { } +fn baz isize>(f: F) { } fn main() {} diff --git a/src/test/run-pass/hrtb-precedence-of-plus.rs b/src/test/run-pass/hrtb-precedence-of-plus.rs index 2c247c80990..892f2f1ae9d 100644 --- a/src/test/run-pass/hrtb-precedence-of-plus.rs +++ b/src/test/run-pass/hrtb-precedence-of-plus.rs @@ -13,11 +13,11 @@ #![allow(unknown_features)] #![feature(unboxed_closures)] -// Test that `Fn(int) -> int + 'static` parses as `(Fn(int) -> int) + -// 'static` and not `Fn(int) -> (int + 'static)`. The latter would +// Test that `Fn(isize) -> isize + 'static` parses as `(Fn(isize) -> isize) + +// 'static` and not `Fn(isize) -> (isize + 'static)`. The latter would // cause a compilation error. Issue #18772. -fn adder(y: int) -> Box int + 'static> { +fn adder(y: isize) -> Box isize + 'static> { // FIXME (#22405): Replace `Box::new` with `box` here when/if possible. Box::new(move |x| y + x) } diff --git a/src/test/run-pass/hrtb-resolve-lifetime.rs b/src/test/run-pass/hrtb-resolve-lifetime.rs index bdebadd5411..bdbcda89099 100644 --- a/src/test/run-pass/hrtb-resolve-lifetime.rs +++ b/src/test/run-pass/hrtb-resolve-lifetime.rs @@ -16,7 +16,7 @@ trait FnLike { fn call(&self, arg: A) -> R; } -type FnObject<'b> = for<'a> FnLike<&'a int, &'a int> + 'b; +type FnObject<'b> = for<'a> FnLike<&'a isize, &'a isize> + 'b; fn main() { } diff --git a/src/test/run-pass/hrtb-trait-object-passed-to-closure.rs b/src/test/run-pass/hrtb-trait-object-passed-to-closure.rs index 1f63349b2d8..48d0959630f 100644 --- a/src/test/run-pass/hrtb-trait-object-passed-to-closure.rs +++ b/src/test/run-pass/hrtb-trait-object-passed-to-closure.rs @@ -15,17 +15,17 @@ // pretty-expanded FIXME #23616 trait PrinterSupport<'ast> { - fn ast_map(&self) -> Option<&'ast uint> { None } + fn ast_map(&self) -> Option<&'ast usize> { None } } struct NoAnn<'ast> { - f: Option<&'ast uint> + f: Option<&'ast usize> } impl<'ast> PrinterSupport<'ast> for NoAnn<'ast> { } -fn foo<'ast, G>(f: Option<&'ast uint>, g: G) where G: FnOnce(&PrinterSupport) { +fn foo<'ast, G>(f: Option<&'ast usize>, g: G) where G: FnOnce(&PrinterSupport) { let annotation = NoAnn { f: f }; g(&annotation) } diff --git a/src/test/run-pass/hrtb-unboxed-closure-trait.rs b/src/test/run-pass/hrtb-unboxed-closure-trait.rs index c34e1a4862f..008e7ddbc9c 100644 --- a/src/test/run-pass/hrtb-unboxed-closure-trait.rs +++ b/src/test/run-pass/hrtb-unboxed-closure-trait.rs @@ -12,11 +12,11 @@ #![feature(unboxed_closures)] -fn foo(f: F) { +fn foo(f: F) { let x = 22; f(&x); } fn main() { - foo(|x: &int| println!("{}", *x)); + foo(|x: &isize| println!("{}", *x)); } diff --git a/src/test/run-pass/hygiene-dodging-1.rs b/src/test/run-pass/hygiene-dodging-1.rs index 8421f47e94d..e5acc4a2edd 100644 --- a/src/test/run-pass/hygiene-dodging-1.rs +++ b/src/test/run-pass/hygiene-dodging-1.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 mod x { - pub fn g() -> uint {14} + pub fn g() -> usize {14} } pub fn main(){ diff --git a/src/test/run-pass/hygienic-labels-in-let.rs b/src/test/run-pass/hygienic-labels-in-let.rs index cca0e5b163c..589d6e1581b 100644 --- a/src/test/run-pass/hygienic-labels-in-let.rs +++ b/src/test/run-pass/hygienic-labels-in-let.rs @@ -34,7 +34,7 @@ macro_rules! run_once { pub fn main() { let mut i = 0; - let j: int = { + let j: isize = { 'x: loop { // this 'x should refer to the outer loop, lexically loop_x!(break 'x); @@ -44,7 +44,7 @@ pub fn main() { }; assert_eq!(j, 1); - let k: int = { + let k: isize = { 'x: for _ in 0..1 { // ditto loop_x!(break 'x); @@ -54,7 +54,7 @@ pub fn main() { }; assert_eq!(k, 1); - let l: int = { + let l: isize = { 'x: for _ in 0..1 { // ditto while_true!(break 'x); @@ -64,7 +64,7 @@ pub fn main() { }; assert_eq!(l, 1); - let n: int = { + let n: isize = { 'x: for _ in 0..1 { // ditto run_once!(continue 'x); diff --git a/src/test/run-pass/if-bot.rs b/src/test/run-pass/if-bot.rs index 44c834d233f..e66a8c85723 100644 --- a/src/test/run-pass/if-bot.rs +++ b/src/test/run-pass/if-bot.rs @@ -9,6 +9,6 @@ // except according to those terms. pub fn main() { - let i: int = if false { panic!() } else { 5 }; + let i: isize = if false { panic!() } else { 5 }; println!("{}", i); } diff --git a/src/test/run-pass/if-check.rs b/src/test/run-pass/if-check.rs index 766cced4c26..c72cd10a082 100644 --- a/src/test/run-pass/if-check.rs +++ b/src/test/run-pass/if-check.rs @@ -8,13 +8,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn even(x: uint) -> bool { +fn even(x: usize) -> bool { if x < 2 { return false; } else if x == 2 { return true; } else { return even(x - 2); } } -fn foo(x: uint) { +fn foo(x: usize) { if even(x) { println!("{}", x); } else { diff --git a/src/test/run-pass/if-let.rs b/src/test/run-pass/if-let.rs index 1286b29309a..c41d02f9b33 100644 --- a/src/test/run-pass/if-let.rs +++ b/src/test/run-pass/if-let.rs @@ -22,7 +22,7 @@ pub fn main() { worked = true; } assert!(worked); - let clause: uint; + let clause: usize; if let None = Some("test") { clause = 1; } else if 4_usize > 5 { @@ -42,8 +42,8 @@ pub fn main() { enum Foo { One, - Two(uint), - Three(String, int) + Two(usize), + Three(String, isize) } let foo = Foo::Three("three".to_string(), 42); diff --git a/src/test/run-pass/ignore-all-the-things.rs b/src/test/run-pass/ignore-all-the-things.rs index 839ec6457e1..2fc8b999e86 100644 --- a/src/test/run-pass/ignore-all-the-things.rs +++ b/src/test/run-pass/ignore-all-the-things.rs @@ -12,8 +12,8 @@ #![feature(advanced_slice_patterns)] -struct Foo(int, int, int, int); -struct Bar{a: int, b: int, c: int, d: int} +struct Foo(isize, isize, isize, isize); +struct Bar{a: isize, b: isize, c: isize, d: isize} pub fn main() { let Foo(..) = Foo(5, 5, 5, 5); diff --git a/src/test/run-pass/impl-implicit-trait.rs b/src/test/run-pass/impl-implicit-trait.rs index 33a44b3bcd6..7f1d576e099 100644 --- a/src/test/run-pass/impl-implicit-trait.rs +++ b/src/test/run-pass/impl-implicit-trait.rs @@ -21,7 +21,7 @@ impl option_ { enum option__ { none__, - some__(int) + some__(isize) } impl option__ { diff --git a/src/test/run-pass/import.rs b/src/test/run-pass/import.rs index 3470b54ccbb..c2b459d2887 100644 --- a/src/test/run-pass/import.rs +++ b/src/test/run-pass/import.rs @@ -9,7 +9,7 @@ // except according to those terms. mod foo { - pub fn x(y: int) { println!("{}", y); } + pub fn x(y: isize) { println!("{}", y); } } mod bar { diff --git a/src/test/run-pass/import8.rs b/src/test/run-pass/import8.rs index 532c3843284..0f3891bf067 100644 --- a/src/test/run-pass/import8.rs +++ b/src/test/run-pass/import8.rs @@ -13,7 +13,7 @@ use foo::x; use foo::x as z; mod foo { - pub fn x(y: int) { println!("{}", y); } + pub fn x(y: isize) { println!("{}", y); } } pub fn main() { x(10); z(10); } diff --git a/src/test/run-pass/infer-fn-tail-expr.rs b/src/test/run-pass/infer-fn-tail-expr.rs index c599f224999..f00005fc7d0 100644 --- a/src/test/run-pass/infer-fn-tail-expr.rs +++ b/src/test/run-pass/infer-fn-tail-expr.rs @@ -13,6 +13,6 @@ // pretty-expanded FIXME #23616 -fn f() -> Vec { Vec::new() } +fn f() -> Vec { Vec::new() } pub fn main() { } diff --git a/src/test/run-pass/infinite-loops.rs b/src/test/run-pass/infinite-loops.rs index e4168ea1452..e8c5996f4fa 100644 --- a/src/test/run-pass/infinite-loops.rs +++ b/src/test/run-pass/infinite-loops.rs @@ -14,7 +14,7 @@ */ // ignore-test -fn loopy(n: int) { +fn loopy(n: isize) { if n > 0 { spawn(move|| { loopy(n - 1) }); spawn(move|| { loopy(n - 1) }); } loop { } } diff --git a/src/test/run-pass/init-res-into-things.rs b/src/test/run-pass/init-res-into-things.rs index 3d1fff7b5f0..eb50fbed774 100644 --- a/src/test/run-pass/init-res-into-things.rs +++ b/src/test/run-pass/init-res-into-things.rs @@ -20,7 +20,7 @@ use std::cell::Cell; // as a move unless the stored thing is used afterwards. struct r<'a> { - i: &'a Cell, + i: &'a Cell, } struct BoxR<'a> { x: r<'a> } @@ -32,7 +32,7 @@ impl<'a> Drop for r<'a> { } } -fn r(i: &Cell) -> r { +fn r(i: &Cell) -> r { r { i: i } diff --git a/src/test/run-pass/instantiable.rs b/src/test/run-pass/instantiable.rs index e4a3f2c8d1d..28fba70eb24 100644 --- a/src/test/run-pass/instantiable.rs +++ b/src/test/run-pass/instantiable.rs @@ -16,7 +16,7 @@ use std::ptr; // even though it would be if the nxt field had type @foo: struct foo(X); -struct X { x: uint, nxt: *const foo } +struct X { x: usize, nxt: *const foo } pub fn main() { let _x = foo(X {x: 0, nxt: ptr::null()}); diff --git a/src/test/run-pass/int.rs b/src/test/run-pass/int.rs index 09d6501267d..9495552af40 100644 --- a/src/test/run-pass/int.rs +++ b/src/test/run-pass/int.rs @@ -13,4 +13,4 @@ // pretty-expanded FIXME #23616 -pub fn main() { let _x: int = 10; } +pub fn main() { let _x: isize = 10; } diff --git a/src/test/run-pass/integer-literal-suffix-inference.rs b/src/test/run-pass/integer-literal-suffix-inference.rs index 35da4b8a936..57f80bb14e2 100644 --- a/src/test/run-pass/integer-literal-suffix-inference.rs +++ b/src/test/run-pass/integer-literal-suffix-inference.rs @@ -16,7 +16,7 @@ pub fn main() { fn id_i32(n: i32) -> i32 { n } fn id_i64(n: i64) -> i64 { n } - fn id_uint(n: uint) -> uint { n } + fn id_uint(n: usize) -> usize { n } fn id_u8(n: u8) -> u8 { n } fn id_u16(n: u16) -> u16 { n } fn id_u32(n: u32) -> u32 { n } @@ -42,7 +42,7 @@ pub fn main() { id_i64(j); id_i64(-9_223_372_036_854_775_808); - let _i: uint = 1; + let _i: usize = 1; let j = 1; id_uint(j); id_uint(1); diff --git a/src/test/run-pass/into-iterator-type-inference-shift.rs b/src/test/run-pass/into-iterator-type-inference-shift.rs index 5bf8a4bc8f7..9ccf1c3bbb8 100644 --- a/src/test/run-pass/into-iterator-type-inference-shift.rs +++ b/src/test/run-pass/into-iterator-type-inference-shift.rs @@ -9,7 +9,7 @@ // except according to those terms. // Regression test for type inference failure around shifting. In this -// case, the iteration yields an int, but we hadn't run the full type +// case, the iteration yields an isize, but we hadn't run the full type // propagation yet, and so we just saw a type variable, yielding an // error. diff --git a/src/test/run-pass/intrinsic-alignment.rs b/src/test/run-pass/intrinsic-alignment.rs index c970b17d2a1..44dd191eb3e 100644 --- a/src/test/run-pass/intrinsic-alignment.rs +++ b/src/test/run-pass/intrinsic-alignment.rs @@ -14,8 +14,8 @@ mod rusti { extern "rust-intrinsic" { - pub fn pref_align_of() -> uint; - pub fn min_align_of() -> uint; + pub fn pref_align_of() -> usize; + pub fn min_align_of() -> usize; } } diff --git a/src/test/run-pass/intrinsic-move-val.rs b/src/test/run-pass/intrinsic-move-val.rs index 89aea93e7b3..c73aafa421e 100644 --- a/src/test/run-pass/intrinsic-move-val.rs +++ b/src/test/run-pass/intrinsic-move-val.rs @@ -27,7 +27,7 @@ pub fn main() { unsafe { let x: Box<_> = box 1; let mut y = rusti::init(); - let mut z: *const uint = transmute(&x); + let mut z: *const usize = transmute(&x); rusti::move_val_init(&mut y, x); assert_eq!(*y, 1); assert_eq!(*z, 0); // `x` is nulled out, not directly visible diff --git a/src/test/run-pass/intrinsic-return-address.rs b/src/test/run-pass/intrinsic-return-address.rs index ff6346943db..1ff910356eb 100644 --- a/src/test/run-pass/intrinsic-return-address.rs +++ b/src/test/run-pass/intrinsic-return-address.rs @@ -24,9 +24,9 @@ extern "rust-intrinsic" { fn return_address() -> *const u8; } -fn f(result: &mut uint) -> Point { +fn f(result: &mut usize) -> Point { unsafe { - *result = return_address() as uint; + *result = return_address() as usize; Point { x: 1.0, y: 2.0, @@ -39,6 +39,6 @@ fn f(result: &mut uint) -> Point { fn main() { let mut intrinsic_reported_address = 0; let pt = f(&mut intrinsic_reported_address); - let actual_address = &pt as *const Point as uint; + let actual_address = &pt as *const Point as usize; assert_eq!(intrinsic_reported_address, actual_address); } diff --git a/src/test/run-pass/intrinsic-uninit.rs b/src/test/run-pass/intrinsic-uninit.rs index 834455d560e..3d2c1ec5c19 100644 --- a/src/test/run-pass/intrinsic-uninit.rs +++ b/src/test/run-pass/intrinsic-uninit.rs @@ -18,5 +18,5 @@ mod rusti { } } pub fn main() { - let _a : int = unsafe {rusti::uninit()}; + let _a : isize = unsafe {rusti::uninit()}; } diff --git a/src/test/run-pass/intrinsic-unreachable.rs b/src/test/run-pass/intrinsic-unreachable.rs index c095ad1a070..86a370a0942 100644 --- a/src/test/run-pass/intrinsic-unreachable.rs +++ b/src/test/run-pass/intrinsic-unreachable.rs @@ -16,7 +16,7 @@ use std::intrinsics; // See also src/test/run-make/intrinsic-unreachable. -unsafe fn f(x: uint) -> uint { +unsafe fn f(x: usize) -> usize { match x { 17 => 23, _ => intrinsics::unreachable(), diff --git a/src/test/run-pass/issue-10392.rs b/src/test/run-pass/issue-10392.rs index 29c5a8208ba..2d695c75d30 100644 --- a/src/test/run-pass/issue-10392.rs +++ b/src/test/run-pass/issue-10392.rs @@ -10,8 +10,8 @@ // pretty-expanded FIXME #23616 -struct A { foo: int } -struct B { a: int, b: int, c: int } +struct A { foo: isize } +struct B { a: isize, b: isize, c: isize } fn mka() -> A { panic!() } fn mkb() -> B { panic!() } diff --git a/src/test/run-pass/issue-10682.rs b/src/test/run-pass/issue-10682.rs index ba003c0b1ba..c049bdfe83c 100644 --- a/src/test/run-pass/issue-10682.rs +++ b/src/test/run-pass/issue-10682.rs @@ -16,7 +16,7 @@ #![allow(unknown_features)] #![feature(box_syntax)] -fn work(_: Box) {} +fn work(_: Box) {} fn foo(_: F) {} pub fn main() { diff --git a/src/test/run-pass/issue-10734.rs b/src/test/run-pass/issue-10734.rs index 27773a42abb..49694f2755c 100644 --- a/src/test/run-pass/issue-10734.rs +++ b/src/test/run-pass/issue-10734.rs @@ -12,7 +12,7 @@ #![feature(unsafe_no_drop_flag)] -static mut drop_count: uint = 0; +static mut drop_count: usize = 0; #[unsafe_no_drop_flag] struct Foo { diff --git a/src/test/run-pass/issue-10806.rs b/src/test/run-pass/issue-10806.rs index 5b8828cf0b5..49883f15d31 100644 --- a/src/test/run-pass/issue-10806.rs +++ b/src/test/run-pass/issue-10806.rs @@ -11,30 +11,30 @@ // pretty-expanded FIXME #23616 -pub fn foo() -> int { +pub fn foo() -> isize { 3 } -pub fn bar() -> int { +pub fn bar() -> isize { 4 } pub mod baz { use {foo, bar}; - pub fn quux() -> int { + pub fn quux() -> isize { foo() + bar() } } pub mod grault { use {foo}; - pub fn garply() -> int { + pub fn garply() -> isize { foo() } } pub mod waldo { use {}; - pub fn plugh() -> int { + pub fn plugh() -> isize { 0 } } diff --git a/src/test/run-pass/issue-11085.rs b/src/test/run-pass/issue-11085.rs index 4009d2a7d31..c024c6297bf 100644 --- a/src/test/run-pass/issue-11085.rs +++ b/src/test/run-pass/issue-11085.rs @@ -15,12 +15,12 @@ struct Foo { #[cfg(fail)] bar: baz, - foo: int, + foo: isize, } struct Foo2 { #[cfg(foo)] - foo: int, + foo: isize, } enum Bar1 { @@ -37,8 +37,8 @@ enum Bar2 { enum Bar3 { Bar3_1 { #[cfg(fail)] - foo: int, - bar: int, + foo: isize, + bar: isize, } } diff --git a/src/test/run-pass/issue-1112.rs b/src/test/run-pass/issue-1112.rs index b3187d889a1..3d131b51033 100644 --- a/src/test/run-pass/issue-1112.rs +++ b/src/test/run-pass/issue-1112.rs @@ -24,7 +24,7 @@ struct X { } pub fn main() { - let x: X = X { + let x: X = X { a: 12345678, b: 9, c: true, diff --git a/src/test/run-pass/issue-11205.rs b/src/test/run-pass/issue-11205.rs index 70bec062d17..41b54727b66 100644 --- a/src/test/run-pass/issue-11205.rs +++ b/src/test/run-pass/issue-11205.rs @@ -15,7 +15,7 @@ // FIXME (#22405): Replace `Box::new` with `box` here when/if possible. trait Foo { fn dummy(&self) { } } -impl Foo for int {} +impl Foo for isize {} fn foo(_: [&Foo; 2]) {} fn foos(_: &[&Foo]) {} fn foog(_: &[T], _: &[T]) {} diff --git a/src/test/run-pass/issue-11267.rs b/src/test/run-pass/issue-11267.rs index 6fb2c532e0c..1a1227c7920 100644 --- a/src/test/run-pass/issue-11267.rs +++ b/src/test/run-pass/issue-11267.rs @@ -15,11 +15,11 @@ struct Empty; trait T { fn next(&mut self) -> Option; } -impl T for Empty { - fn next(&mut self) -> Option { None } +impl T for Empty { + fn next(&mut self) -> Option { None } } -fn do_something_with(a : &mut T) { +fn do_something_with(a : &mut T) { println!("{:?}", a.next()) } diff --git a/src/test/run-pass/issue-11552.rs b/src/test/run-pass/issue-11552.rs index bf5ad945b9f..1f91c6aaa4d 100644 --- a/src/test/run-pass/issue-11552.rs +++ b/src/test/run-pass/issue-11552.rs @@ -17,7 +17,7 @@ #[derive(Clone)] enum Noun { - Atom(int), + Atom(isize), Cell(Box, Box) } diff --git a/src/test/run-pass/issue-11577.rs b/src/test/run-pass/issue-11577.rs index 06d5b66b3e8..ecb7a3a3691 100644 --- a/src/test/run-pass/issue-11577.rs +++ b/src/test/run-pass/issue-11577.rs @@ -13,10 +13,10 @@ // Destructuring struct variants would ICE where regular structs wouldn't enum Foo { - VBar { num: int } + VBar { num: isize } } -struct SBar { num: int } +struct SBar { num: isize } pub fn main() { let vbar = Foo::VBar { num: 1 }; diff --git a/src/test/run-pass/issue-11677.rs b/src/test/run-pass/issue-11677.rs index 1edd1d137a9..a3eec42831f 100644 --- a/src/test/run-pass/issue-11677.rs +++ b/src/test/run-pass/issue-11677.rs @@ -24,7 +24,7 @@ struct S {f: Box+'static>, g: Box+'static>} struct F; -impl X for F { +impl X for F { } fn main() { diff --git a/src/test/run-pass/issue-11736.rs b/src/test/run-pass/issue-11736.rs index 72cc8d470d0..fde04efc8ba 100644 --- a/src/test/run-pass/issue-11736.rs +++ b/src/test/run-pass/issue-11736.rs @@ -21,7 +21,7 @@ fn main() { // Generate sieve of Eratosthenes for n up to 1e6 let n = 1000000; let mut sieve = BitVec::from_elem(n+1, true); - let limit: uint = (n as f32).sqrt() as uint; + let limit: usize = (n as f32).sqrt() as usize; for i in 2..limit+1 { if sieve[i] { let mut j = 0; diff --git a/src/test/run-pass/issue-11881.rs b/src/test/run-pass/issue-11881.rs index 4044468c3fe..811926826dd 100644 --- a/src/test/run-pass/issue-11881.rs +++ b/src/test/run-pass/issue-11881.rs @@ -32,7 +32,7 @@ struct Foo { #[derive(Encodable)] struct Bar { - froboz: uint, + froboz: usize, } enum WireProtocol { diff --git a/src/test/run-pass/issue-12860.rs b/src/test/run-pass/issue-12860.rs index 6b66c640b6b..ad03c7fddb4 100644 --- a/src/test/run-pass/issue-12860.rs +++ b/src/test/run-pass/issue-12860.rs @@ -18,9 +18,9 @@ use std::collections::HashSet; #[derive(Copy, PartialEq, Eq, Hash)] struct XYZ { - x: int, - y: int, - z: int + x: isize, + y: isize, + z: isize } fn main() { diff --git a/src/test/run-pass/issue-12909.rs b/src/test/run-pass/issue-12909.rs index dd541ff948c..e1532190730 100644 --- a/src/test/run-pass/issue-12909.rs +++ b/src/test/run-pass/issue-12909.rs @@ -23,6 +23,6 @@ fn main() { let v2: Vec<_> = arr.iter().map(copy).collect(); let m1: HashMap<_, _> = arr.iter().map(copy).collect(); - let m2: HashMap = arr.iter().map(copy).collect(); - let m3: HashMap<_, uint> = arr.iter().map(copy).collect(); + let m2: HashMap = arr.iter().map(copy).collect(); + let m3: HashMap<_, usize> = arr.iter().map(copy).collect(); } diff --git a/src/test/run-pass/issue-13027.rs b/src/test/run-pass/issue-13027.rs index 056c86b01f7..569de5033a0 100644 --- a/src/test/run-pass/issue-13027.rs +++ b/src/test/run-pass/issue-13027.rs @@ -13,9 +13,9 @@ // Tests that match expression handles overlapped literal and range // properly in the presence of guard function. -fn val() -> uint { 1 } +fn val() -> usize { 1 } -static CONST: uint = 1; +static CONST: usize = 1; pub fn main() { lit_shadow_range(); @@ -174,7 +174,7 @@ fn range_shadow_multi_pats() { fn misc() { enum Foo { - Bar(uint, bool) + Bar(usize, bool) } // This test basically mimics how trace_macros! macro is implemented, // which is a rare combination of vector patterns, multiple wild-card diff --git a/src/test/run-pass/issue-13167.rs b/src/test/run-pass/issue-13167.rs index 304d0297424..414f6768e0a 100644 --- a/src/test/run-pass/issue-13167.rs +++ b/src/test/run-pass/issue-13167.rs @@ -23,7 +23,7 @@ impl<'a, T> Iterator for PhfMapEntries<'a, T> { self.iter.by_ref().map(|&(key, ref value)| (key, value)).next() } - fn size_hint(&self) -> (uint, Option) { + fn size_hint(&self) -> (usize, Option) { self.iter.size_hint() } } diff --git a/src/test/run-pass/issue-13204.rs b/src/test/run-pass/issue-13204.rs index 904b8feb884..ec9d777974b 100644 --- a/src/test/run-pass/issue-13204.rs +++ b/src/test/run-pass/issue-13204.rs @@ -14,7 +14,7 @@ // pretty-expanded FIXME #23616 pub trait Foo { - fn bar<'a, I: Iterator>(&self, it: I) -> uint { + fn bar<'a, I: Iterator>(&self, it: I) -> usize { let mut xs = it.filter(|_| true); xs.count() } diff --git a/src/test/run-pass/issue-13264.rs b/src/test/run-pass/issue-13264.rs index 07da2b286c2..e82a7602ef5 100644 --- a/src/test/run-pass/issue-13264.rs +++ b/src/test/run-pass/issue-13264.rs @@ -62,10 +62,10 @@ impl JSRef { struct Node; impl Node { - fn RemoveChild(&self, _a: uint) { + fn RemoveChild(&self, _a: usize) { } - fn AddChild(&self, _a: uint) { + fn AddChild(&self, _a: usize) { } } diff --git a/src/test/run-pass/issue-13405.rs b/src/test/run-pass/issue-13405.rs index d1a24e4a450..c8b26dc4aed 100644 --- a/src/test/run-pass/issue-13405.rs +++ b/src/test/run-pass/issue-13405.rs @@ -12,11 +12,11 @@ struct Foo<'a> { i: &'a bool, - j: Option<&'a int>, + j: Option<&'a isize>, } impl<'a> Foo<'a> { - fn bar(&mut self, j: &int) { + fn bar(&mut self, j: &isize) { let child = Foo { i: self.i, j: Some(j) diff --git a/src/test/run-pass/issue-13494.rs b/src/test/run-pass/issue-13494.rs index 3fa9f66c9e3..6159edbfe1e 100644 --- a/src/test/run-pass/issue-13494.rs +++ b/src/test/run-pass/issue-13494.rs @@ -27,7 +27,7 @@ fn helper(rx: Receiver>) { fn main() { let (tx, rx) = channel(); let _t = Thread::spawn(move|| { helper(rx) }); - let (snd, rcv) = channel::(); + let (snd, rcv) = channel::(); for _ in 1..100000 { snd.send(1).unwrap(); let (tx2, rx2) = channel(); diff --git a/src/test/run-pass/issue-13703.rs b/src/test/run-pass/issue-13703.rs index fd482b37048..173b8dda057 100644 --- a/src/test/run-pass/issue-13703.rs +++ b/src/test/run-pass/issue-13703.rs @@ -10,6 +10,6 @@ // pretty-expanded FIXME #23616 -pub struct Foo<'a, 'b: 'a> { foo: &'a &'b int } +pub struct Foo<'a, 'b: 'a> { foo: &'a &'b isize } pub fn foo<'a, 'b>(x: Foo<'a, 'b>, _o: Option<& & ()>) { let _y = x.foo; } fn main() {} diff --git a/src/test/run-pass/issue-13763.rs b/src/test/run-pass/issue-13763.rs index c8bf74c5d9b..fb82cccc871 100644 --- a/src/test/run-pass/issue-13763.rs +++ b/src/test/run-pass/issue-13763.rs @@ -14,9 +14,9 @@ use std::u8; -const NUM: uint = u8::BITS as uint; +const NUM: usize = u8::BITS as usize; -struct MyStruct { nums: [uint; 8] } +struct MyStruct { nums: [usize; 8] } fn main() { diff --git a/src/test/run-pass/issue-13775.rs b/src/test/run-pass/issue-13775.rs index 38ecab67372..3b70bea719b 100644 --- a/src/test/run-pass/issue-13775.rs +++ b/src/test/run-pass/issue-13775.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 trait Foo { - fn bar(&self, int) {} + fn bar(&self, isize) {} } fn main() {} diff --git a/src/test/run-pass/issue-13837.rs b/src/test/run-pass/issue-13837.rs index cd6711df7f3..d90b9cffb6a 100644 --- a/src/test/run-pass/issue-13837.rs +++ b/src/test/run-pass/issue-13837.rs @@ -11,11 +11,11 @@ // pretty-expanded FIXME #23616 struct TestStruct { - x: *const [int; 2] + x: *const [isize; 2] } unsafe impl Sync for TestStruct {} -static TEST_VALUE : TestStruct = TestStruct{x: 0x1234 as *const [int; 2]}; +static TEST_VALUE : TestStruct = TestStruct{x: 0x1234 as *const [isize; 2]}; fn main() {} diff --git a/src/test/run-pass/issue-13867.rs b/src/test/run-pass/issue-13867.rs index 8a2e1585da6..a902e141bb6 100644 --- a/src/test/run-pass/issue-13867.rs +++ b/src/test/run-pass/issue-13867.rs @@ -14,7 +14,7 @@ // pretty-expanded FIXME #23616 enum Foo { - FooUint(uint), + FooUint(usize), FooNullary, } diff --git a/src/test/run-pass/issue-14254.rs b/src/test/run-pass/issue-14254.rs index 849d7e249a8..ed96eee6ddf 100644 --- a/src/test/run-pass/issue-14254.rs +++ b/src/test/run-pass/issue-14254.rs @@ -17,7 +17,7 @@ trait Foo { } struct BarTy { - x : int, + x : isize, y : f64, } @@ -68,34 +68,34 @@ impl Foo for Box { } // If these fail, it's necessary to update rustc_resolve and the cfail tests. -impl Foo for *const int { +impl Foo for *const isize { fn bar(&self) { self.baz(); - Foo::bah(None::<*const int>); + Foo::bah(None::<*const isize>); } } // If these fail, it's necessary to update rustc_resolve and the cfail tests. -impl<'a> Foo for &'a int { +impl<'a> Foo for &'a isize { fn bar(&self) { self.baz(); - Foo::bah(None::<&int>); + Foo::bah(None::<&isize>); } } // If these fail, it's necessary to update rustc_resolve and the cfail tests. -impl<'a> Foo for &'a mut int { +impl<'a> Foo for &'a mut isize { fn bar(&self) { self.baz(); - Foo::bah(None::<&mut int>); + Foo::bah(None::<&mut isize>); } } // If these fail, it's necessary to update rustc_resolve and the cfail tests. -impl Foo for Box { +impl Foo for Box { fn bar(&self) { self.baz(); - Foo::bah(None::>); + Foo::bah(None::>); } } diff --git a/src/test/run-pass/issue-14308.rs b/src/test/run-pass/issue-14308.rs index fd311a1e9b5..f67d0946e98 100644 --- a/src/test/run-pass/issue-14308.rs +++ b/src/test/run-pass/issue-14308.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -struct A(int); +struct A(isize); struct B; fn main() { diff --git a/src/test/run-pass/issue-14589.rs b/src/test/run-pass/issue-14589.rs index 7392c7a75d1..b0893e21af7 100644 --- a/src/test/run-pass/issue-14589.rs +++ b/src/test/run-pass/issue-14589.rs @@ -31,5 +31,5 @@ impl Test { } trait Foo { fn dummy(&self) { }} -struct Output(int); +struct Output(isize); impl Foo for Output {} diff --git a/src/test/run-pass/issue-14837.rs b/src/test/run-pass/issue-14837.rs index 92cb30068de..5589acdda37 100644 --- a/src/test/run-pass/issue-14837.rs +++ b/src/test/run-pass/issue-14837.rs @@ -13,7 +13,7 @@ #[deny(dead_code)] pub enum Foo { Bar { - baz: int + baz: isize } } diff --git a/src/test/run-pass/issue-14865.rs b/src/test/run-pass/issue-14865.rs index 5dca6e82ba2..e78736b77fd 100644 --- a/src/test/run-pass/issue-14865.rs +++ b/src/test/run-pass/issue-14865.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 enum X { - Foo(uint), + Foo(usize), Bar(bool) } diff --git a/src/test/run-pass/issue-14919.rs b/src/test/run-pass/issue-14919.rs index 9a85f83c03b..371e926ab18 100644 --- a/src/test/run-pass/issue-14919.rs +++ b/src/test/run-pass/issue-14919.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 trait Matcher { - fn next_match(&mut self) -> Option<(uint, uint)>; + fn next_match(&mut self) -> Option<(usize, usize)>; } struct CharPredMatcher<'a, 'b> { @@ -20,7 +20,7 @@ struct CharPredMatcher<'a, 'b> { } impl<'a, 'b> Matcher for CharPredMatcher<'a, 'b> { - fn next_match(&mut self) -> Option<(uint, uint)> { + fn next_match(&mut self) -> Option<(usize, usize)> { None } } @@ -44,9 +44,9 @@ struct MatchIndices { } impl Iterator for MatchIndices { - type Item = (uint, uint); + type Item = (usize, usize); - fn next(&mut self) -> Option<(uint, uint)> { + fn next(&mut self) -> Option<(usize, usize)> { self.matcher.next_match() } } @@ -59,5 +59,5 @@ fn match_indices<'a, M, T: IntoMatcher<'a, M>>(s: &'a str, from: T) -> MatchIndi fn main() { let s = "abcbdef"; match_indices(s, |c: char| c == 'b') - .collect::>(); + .collect::>(); } diff --git a/src/test/run-pass/issue-14933.rs b/src/test/run-pass/issue-14933.rs index 0e03f132418..f6815b76083 100644 --- a/src/test/run-pass/issue-14933.rs +++ b/src/test/run-pass/issue-14933.rs @@ -10,6 +10,6 @@ // pretty-expanded FIXME #23616 -pub type BigRat = T; +pub type BigRat = T; fn main() {} diff --git a/src/test/run-pass/issue-14936.rs b/src/test/run-pass/issue-14936.rs index 05e2fff8a44..2361c385b41 100644 --- a/src/test/run-pass/issue-14936.rs +++ b/src/test/run-pass/issue-14936.rs @@ -22,8 +22,8 @@ fn wrap(x:A, which: &'static str, history: &mut History) -> A { macro_rules! demo { ( $output_constraint:tt ) => { { - let mut x: int = 0; - let y: int = 1; + let mut x: isize = 0; + let y: isize = 1; let mut history: History = vec!(); unsafe { diff --git a/src/test/run-pass/issue-15043.rs b/src/test/run-pass/issue-15043.rs index fda7b901979..adf56388acd 100644 --- a/src/test/run-pass/issue-15043.rs +++ b/src/test/run-pass/issue-15043.rs @@ -14,10 +14,10 @@ struct S(T); -static s1: S>=S(S(0)); -static s2: S=S(0); +static s1: S>=S(S(0)); +static s2: S=S(0); fn main() { - let foo: S>=S(S(0)); - let foo: S=S(0); + let foo: S>=S(S(0)); + let foo: S=S(0); } diff --git a/src/test/run-pass/issue-15104.rs b/src/test/run-pass/issue-15104.rs index f56f3b63927..ce289bd4e98 100644 --- a/src/test/run-pass/issue-15104.rs +++ b/src/test/run-pass/issue-15104.rs @@ -14,7 +14,7 @@ fn main() { assert_eq!(count_members(&[1, 2, 3, 4]), 4); } -fn count_members(v: &[uint]) -> uint { +fn count_members(v: &[usize]) -> usize { match v { [] => 0, [_] => 1, diff --git a/src/test/run-pass/issue-15129.rs b/src/test/run-pass/issue-15129.rs index 9910c2e0d60..54705c6bf13 100644 --- a/src/test/run-pass/issue-15129.rs +++ b/src/test/run-pass/issue-15129.rs @@ -16,7 +16,7 @@ pub enum T { } pub enum V { - V1(int), + V1(isize), V2(bool) } diff --git a/src/test/run-pass/issue-15261.rs b/src/test/run-pass/issue-15261.rs index b1d74e471c1..239fef12326 100644 --- a/src/test/run-pass/issue-15261.rs +++ b/src/test/run-pass/issue-15261.rs @@ -10,8 +10,8 @@ // pretty-expanded FIXME #23616 -static mut n_mut: uint = 0; +static mut n_mut: usize = 0; -static n: &'static uint = unsafe{ &n_mut }; +static n: &'static usize = unsafe{ &n_mut }; fn main() {} diff --git a/src/test/run-pass/issue-15444.rs b/src/test/run-pass/issue-15444.rs index 6a11f15dc84..e9a9eabcd91 100644 --- a/src/test/run-pass/issue-15444.rs +++ b/src/test/run-pass/issue-15444.rs @@ -22,11 +22,11 @@ fn bar(t: &T) { t.foo() } -fn thing(a: int, b: int) -> int { +fn thing(a: isize, b: isize) -> isize { a + b } fn main() { - let thing: fn(int, int) -> int = thing; // coerce to fn type + let thing: fn(isize, isize) -> isize = thing; // coerce to fn type bar(&thing); } diff --git a/src/test/run-pass/issue-15689-1.rs b/src/test/run-pass/issue-15689-1.rs index ddfb57f345b..9fc1cce56b7 100644 --- a/src/test/run-pass/issue-15689-1.rs +++ b/src/test/run-pass/issue-15689-1.rs @@ -12,7 +12,7 @@ #[derive(PartialEq)] enum Test<'a> { - Slice(&'a int) + Slice(&'a isize) } fn main() { diff --git a/src/test/run-pass/issue-15689-2.rs b/src/test/run-pass/issue-15689-2.rs index 71306a63e90..922b18c01d9 100644 --- a/src/test/run-pass/issue-15689-2.rs +++ b/src/test/run-pass/issue-15689-2.rs @@ -12,7 +12,7 @@ #[derive(Clone)] enum Test<'a> { - Slice(&'a int) + Slice(&'a isize) } fn main() {} diff --git a/src/test/run-pass/issue-15734.rs b/src/test/run-pass/issue-15734.rs index 29e2a403ebc..d058cb73711 100644 --- a/src/test/run-pass/issue-15734.rs +++ b/src/test/run-pass/issue-15734.rs @@ -17,39 +17,39 @@ use std::ops::Index; -struct Mat { data: Vec, cols: uint, } +struct Mat { data: Vec, cols: usize, } impl Mat { - fn new(data: Vec, cols: uint) -> Mat { + fn new(data: Vec, cols: usize) -> Mat { Mat { data: data, cols: cols } } - fn row<'a>(&'a self, row: uint) -> Row<&'a Mat> { + fn row<'a>(&'a self, row: usize) -> Row<&'a Mat> { Row { mat: self, row: row, } } } -impl Index<(uint, uint)> for Mat { +impl Index<(usize, usize)> for Mat { type Output = T; - fn index<'a>(&'a self, (row, col): (uint, uint)) -> &'a T { + fn index<'a>(&'a self, (row, col): (usize, usize)) -> &'a T { &self.data[row * self.cols + col] } } -impl<'a, T> Index<(uint, uint)> for &'a Mat { +impl<'a, T> Index<(usize, usize)> for &'a Mat { type Output = T; - fn index<'b>(&'b self, index: (uint, uint)) -> &'b T { + fn index<'b>(&'b self, index: (usize, usize)) -> &'b T { (*self).index(index) } } -struct Row { mat: M, row: uint, } +struct Row { mat: M, row: usize, } -impl> Index for Row { +impl> Index for Row { type Output = T; - fn index<'a>(&'a self, col: uint) -> &'a T { + fn index<'a>(&'a self, col: usize) -> &'a T { &self.mat[(self.row, col)] } } @@ -66,6 +66,6 @@ fn main() { let e = r[2]; assert!(e == 6); - let e: uint = r[2]; + let e: usize = r[2]; assert!(e == 6); } diff --git a/src/test/run-pass/issue-15763.rs b/src/test/run-pass/issue-15763.rs index f30991a1963..b5251d63ff0 100644 --- a/src/test/run-pass/issue-15763.rs +++ b/src/test/run-pass/issue-15763.rs @@ -13,7 +13,7 @@ #[derive(PartialEq, Debug)] struct Bar { - x: int + x: isize } impl Drop for Bar { fn drop(&mut self) { @@ -24,17 +24,17 @@ impl Drop for Bar { #[derive(PartialEq, Debug)] struct Foo { x: Bar, - a: int + a: isize } -fn foo() -> Result { +fn foo() -> Result { return Ok(Foo { x: Bar { x: 22 }, a: return Err(32) }); } -fn baz() -> Result { +fn baz() -> Result { Ok(Foo { x: Bar { x: 22 }, a: return Err(32) @@ -42,41 +42,41 @@ fn baz() -> Result { } // explicit immediate return -fn aa() -> int { +fn aa() -> isize { return 3; } // implicit immediate return -fn bb() -> int { +fn bb() -> isize { 3 } // implicit outptr return -fn cc() -> Result { +fn cc() -> Result { Ok(3) } // explicit outptr return -fn dd() -> Result { +fn dd() -> Result { return Ok(3); } trait A { - fn aaa(&self) -> int { + fn aaa(&self) -> isize { 3 } - fn bbb(&self) -> int { + fn bbb(&self) -> isize { return 3; } - fn ccc(&self) -> Result { + fn ccc(&self) -> Result { Ok(3) } - fn ddd(&self) -> Result { + fn ddd(&self) -> Result { return Ok(3); } } -impl A for int {} +impl A for isize {} fn main() { assert_eq!(foo(), Err(32)); @@ -87,12 +87,12 @@ fn main() { assert_eq!(cc().unwrap(), 3); assert_eq!(dd().unwrap(), 3); - let i = box 32i as Box; + let i = box 32is as Box; assert_eq!(i.aaa(), 3); - let i = box 32i as Box; + let i = box 32is as Box; assert_eq!(i.bbb(), 3); - let i = box 32i as Box; + let i = box 32is as Box; assert_eq!(i.ccc().unwrap(), 3); - let i = box 32i as Box; + let i = box 32is as Box; assert_eq!(i.ddd().unwrap(), 3); } diff --git a/src/test/run-pass/issue-15793.rs b/src/test/run-pass/issue-15793.rs index b830234ded2..21baf47ee66 100644 --- a/src/test/run-pass/issue-15793.rs +++ b/src/test/run-pass/issue-15793.rs @@ -21,7 +21,7 @@ enum Enum { } #[inline(never)] -fn foo(x: Enum) -> int { +fn foo(x: Enum) -> isize { match x { Enum::Variant1(true) => 1, Enum::Variant1(false) => 2, diff --git a/src/test/run-pass/issue-16151.rs b/src/test/run-pass/issue-16151.rs index 0f55ca707bd..242bcb69be6 100644 --- a/src/test/run-pass/issue-16151.rs +++ b/src/test/run-pass/issue-16151.rs @@ -12,7 +12,7 @@ use std::mem; -static mut DROP_COUNT: uint = 0; +static mut DROP_COUNT: usize = 0; struct Fragment; diff --git a/src/test/run-pass/issue-16452.rs b/src/test/run-pass/issue-16452.rs index d9c87da5723..b6056d0ab8c 100644 --- a/src/test/run-pass/issue-16452.rs +++ b/src/test/run-pass/issue-16452.rs @@ -13,6 +13,6 @@ fn main() { if true { return } match () { - () => { static MAGIC: uint = 0; } + () => { static MAGIC: usize = 0; } } } diff --git a/src/test/run-pass/issue-16492.rs b/src/test/run-pass/issue-16492.rs index 67af19b8517..fcb04627662 100644 --- a/src/test/run-pass/issue-16492.rs +++ b/src/test/run-pass/issue-16492.rs @@ -16,12 +16,12 @@ use std::rc::Rc; use std::cell::Cell; struct Field { - number: uint, - state: Rc> + number: usize, + state: Rc> } impl Field { - fn new(number: uint, state: Rc>) -> Field { + fn new(number: usize, state: Rc>) -> Field { Field { number: number, state: state diff --git a/src/test/run-pass/issue-1660.rs b/src/test/run-pass/issue-1660.rs index cc64ffcab6f..2a59c3051d5 100644 --- a/src/test/run-pass/issue-1660.rs +++ b/src/test/run-pass/issue-1660.rs @@ -11,5 +11,5 @@ // pretty-expanded FIXME #23616 pub fn main() { - static _x: int = 1<<2; + static _x: isize = 1<<2; } diff --git a/src/test/run-pass/issue-16643.rs b/src/test/run-pass/issue-16643.rs index a0d9eeb9e0b..49dc02779c4 100644 --- a/src/test/run-pass/issue-16643.rs +++ b/src/test/run-pass/issue-16643.rs @@ -15,5 +15,5 @@ extern crate "issue-16643" as i; pub fn main() { - i::TreeBuilder { h: 3u }.process_token(); + i::TreeBuilder { h: 3 }.process_token(); } diff --git a/src/test/run-pass/issue-16648.rs b/src/test/run-pass/issue-16648.rs index 6b0d5d7c513..bc735650578 100644 --- a/src/test/run-pass/issue-16648.rs +++ b/src/test/run-pass/issue-16648.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 fn main() { - let x: (int, &[int]) = (2, &[1, 2]); + let x: (isize, &[isize]) = (2, &[1, 2]); assert_eq!(match x { (0, [_, _]) => 0, (1, _) => 1, diff --git a/src/test/run-pass/issue-16774.rs b/src/test/run-pass/issue-16774.rs index e7af88647c0..17d0969ce1c 100644 --- a/src/test/run-pass/issue-16774.rs +++ b/src/test/run-pass/issue-16774.rs @@ -17,7 +17,7 @@ use std::ops::{Deref, DerefMut}; -struct X(Box); +struct X(Box); static mut DESTRUCTOR_RAN: bool = false; @@ -31,16 +31,16 @@ impl Drop for X { } impl Deref for X { - type Target = int; + type Target = isize; - fn deref(&self) -> &int { + fn deref(&self) -> &isize { let &X(box ref x) = self; x } } impl DerefMut for X { - fn deref_mut(&mut self) -> &mut int { + fn deref_mut(&mut self) -> &mut isize { let &mut X(box ref mut x) = self; x } diff --git a/src/test/run-pass/issue-17068.rs b/src/test/run-pass/issue-17068.rs index 7db1b9b6f79..55a6d4cdbac 100644 --- a/src/test/run-pass/issue-17068.rs +++ b/src/test/run-pass/issue-17068.rs @@ -12,7 +12,7 @@ // binding of a for loop // pretty-expanded FIXME #23616 -fn foo<'a>(v: &'a [uint]) -> &'a uint { +fn foo<'a>(v: &'a [usize]) -> &'a usize { for &ref x in v { return x; } unreachable!() } diff --git a/src/test/run-pass/issue-17302.rs b/src/test/run-pass/issue-17302.rs index 0c9debec3e0..35bd07c896b 100644 --- a/src/test/run-pass/issue-17302.rs +++ b/src/test/run-pass/issue-17302.rs @@ -12,8 +12,8 @@ static mut DROPPED: [bool; 2] = [false, false]; -struct A(uint); -struct Foo { _a: A, _b: int } +struct A(usize); +struct Foo { _a: A, _b: isize } impl Drop for A { fn drop(&mut self) { diff --git a/src/test/run-pass/issue-17503.rs b/src/test/run-pass/issue-17503.rs index a071224999b..796277ce74d 100644 --- a/src/test/run-pass/issue-17503.rs +++ b/src/test/run-pass/issue-17503.rs @@ -9,9 +9,9 @@ // except according to those terms. fn main() { - let s: &[int] = &[0, 1, 2, 3, 4]; - let ss: &&[int] = &s; - let sss: &&&[int] = &ss; + let s: &[isize] = &[0, 1, 2, 3, 4]; + let ss: &&[isize] = &s; + let sss: &&&[isize] = &ss; println!("{:?}", &s[..3]); println!("{:?}", &ss[3..]); diff --git a/src/test/run-pass/issue-17662.rs b/src/test/run-pass/issue-17662.rs index ce1c077b23c..6d53e103d35 100644 --- a/src/test/run-pass/issue-17662.rs +++ b/src/test/run-pass/issue-17662.rs @@ -18,8 +18,8 @@ use std::marker; struct Bar<'a> { m: marker::PhantomData<&'a ()> } -impl<'a> i::Foo<'a, uint> for Bar<'a> { - fn foo(&self) -> uint { 5 } +impl<'a> i::Foo<'a, usize> for Bar<'a> { + fn foo(&self) -> usize { 5 } } pub fn main() { diff --git a/src/test/run-pass/issue-17718-parse-const.rs b/src/test/run-pass/issue-17718-parse-const.rs index 34699cf81b4..1fc8f3274d4 100644 --- a/src/test/run-pass/issue-17718-parse-const.rs +++ b/src/test/run-pass/issue-17718-parse-const.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -const FOO: uint = 3; +const FOO: usize = 3; fn main() { assert_eq!(FOO, 3); diff --git a/src/test/run-pass/issue-17718-static-unsafe-interior.rs b/src/test/run-pass/issue-17718-static-unsafe-interior.rs index 3f6bfb84fbf..29d72000d07 100644 --- a/src/test/run-pass/issue-17718-static-unsafe-interior.rs +++ b/src/test/run-pass/issue-17718-static-unsafe-interior.rs @@ -36,13 +36,13 @@ enum UnsafeEnum { unsafe impl Sync for UnsafeEnum {} -static STATIC1: UnsafeEnum = UnsafeEnum::VariantSafe; +static STATIC1: UnsafeEnum = UnsafeEnum::VariantSafe; -static STATIC2: MyUnsafePack = MyUnsafePack(UnsafeCell { value: 1 }); -const CONST: MyUnsafePack = MyUnsafePack(UnsafeCell { value: 1 }); -static STATIC3: MyUnsafe = MyUnsafe{value: CONST}; +static STATIC2: MyUnsafePack = MyUnsafePack(UnsafeCell { value: 1 }); +const CONST: MyUnsafePack = MyUnsafePack(UnsafeCell { value: 1 }); +static STATIC3: MyUnsafe = MyUnsafe{value: CONST}; -static STATIC4: &'static MyUnsafePack = &STATIC2; +static STATIC4: &'static MyUnsafePack = &STATIC2; struct Wrap { value: T @@ -50,8 +50,8 @@ struct Wrap { unsafe impl Sync for Wrap {} -static UNSAFE: MyUnsafePack = MyUnsafePack(UnsafeCell{value: 2}); -static WRAPPED_UNSAFE: Wrap<&'static MyUnsafePack> = Wrap { value: &UNSAFE }; +static UNSAFE: MyUnsafePack = MyUnsafePack(UnsafeCell{value: 2}); +static WRAPPED_UNSAFE: Wrap<&'static MyUnsafePack> = Wrap { value: &UNSAFE }; fn main() { let a = &STATIC1; diff --git a/src/test/run-pass/issue-17718.rs b/src/test/run-pass/issue-17718.rs index 2827ab92936..3453d2e6fce 100644 --- a/src/test/run-pass/issue-17718.rs +++ b/src/test/run-pass/issue-17718.rs @@ -18,23 +18,23 @@ extern crate "issue-17718" as other; use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering}; -const C1: uint = 1; +const C1: usize = 1; const C2: AtomicUsize = ATOMIC_USIZE_INIT; const C3: fn() = foo; -const C4: uint = C1 * C1 + C1 / C1; -const C5: &'static uint = &C4; -const C6: uint = { - const C: uint = 3; +const C4: usize = C1 * C1 + C1 / C1; +const C5: &'static usize = &C4; +const C6: usize = { + const C: usize = 3; C }; -static S1: uint = 3; +static S1: usize = 3; static S2: AtomicUsize = ATOMIC_USIZE_INIT; mod test { - static A: uint = 4; - static B: &'static uint = &A; - static C: &'static uint = &(A); + static A: usize = 4; + static B: &'static usize = &A; + static C: &'static usize = &(A); } fn foo() {} diff --git a/src/test/run-pass/issue-17897.rs b/src/test/run-pass/issue-17897.rs index adc33e3eed0..3fbdb92e906 100644 --- a/src/test/run-pass/issue-17897.rs +++ b/src/test/run-pass/issue-17897.rs @@ -12,7 +12,7 @@ use std::thunk::Thunk; -fn action(cb: Thunk) -> uint { +fn action(cb: Thunk) -> usize { cb.invoke(1) } diff --git a/src/test/run-pass/issue-18412.rs b/src/test/run-pass/issue-18412.rs index edf6f5e32c3..41dacd33203 100644 --- a/src/test/run-pass/issue-18412.rs +++ b/src/test/run-pass/issue-18412.rs @@ -14,17 +14,17 @@ // pretty-expanded FIXME #23616 trait Foo { - fn foo(&self) -> uint; + fn foo(&self) -> usize; } -struct A(uint); +struct A(usize); impl A { - fn bar(&self) -> uint { self.0 } + fn bar(&self) -> usize { self.0 } } impl Foo for A { - fn foo(&self) -> uint { self.bar() } + fn foo(&self) -> usize { self.bar() } } fn main() { diff --git a/src/test/run-pass/issue-18539.rs b/src/test/run-pass/issue-18539.rs index 897a3d082ba..8de2d1e4259 100644 --- a/src/test/run-pass/issue-18539.rs +++ b/src/test/run-pass/issue-18539.rs @@ -15,7 +15,7 @@ struct Foo; -fn uint_to_foo(_: uint) -> Foo { +fn uint_to_foo(_: usize) -> Foo { Foo } diff --git a/src/test/run-pass/issue-1866.rs b/src/test/run-pass/issue-1866.rs index a4e6e6181ee..2c346b93f5e 100644 --- a/src/test/run-pass/issue-1866.rs +++ b/src/test/run-pass/issue-1866.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 mod a { - pub type rust_task = uint; + pub type rust_task = usize; pub mod rustrt { use super::rust_task; extern { diff --git a/src/test/run-pass/issue-18738.rs b/src/test/run-pass/issue-18738.rs index 644a429750f..a92fcb01f5b 100644 --- a/src/test/run-pass/issue-18738.rs +++ b/src/test/run-pass/issue-18738.rs @@ -12,7 +12,7 @@ #[derive(Eq, PartialEq, PartialOrd, Ord)] enum Test<'a> { - Int(&'a int), + Int(&'a isize), Slice(&'a [u8]), } diff --git a/src/test/run-pass/issue-19358.rs b/src/test/run-pass/issue-19358.rs index 8b5269ab92f..c0c210b3e96 100644 --- a/src/test/run-pass/issue-19358.rs +++ b/src/test/run-pass/issue-19358.rs @@ -20,7 +20,7 @@ struct Bar where T: Trait { bar: T, } -impl Trait for int {} +impl Trait for isize {} fn main() { let a = Foo { foo: 12 }; diff --git a/src/test/run-pass/issue-19850.rs b/src/test/run-pass/issue-19850.rs index 4c1d30d9eed..15ca6a9d4c1 100644 --- a/src/test/run-pass/issue-19850.rs +++ b/src/test/run-pass/issue-19850.rs @@ -15,7 +15,7 @@ trait Int { fn one() -> Self; - fn leading_zeros(self) -> uint; + fn leading_zeros(self) -> usize; } trait Foo { diff --git a/src/test/run-pass/issue-20414.rs b/src/test/run-pass/issue-20414.rs index 80541171307..d2e2d9bd6ef 100644 --- a/src/test/run-pass/issue-20414.rs +++ b/src/test/run-pass/issue-20414.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 trait Trait { - fn method(self) -> int; + fn method(self) -> isize; } struct Wrapper { @@ -19,7 +19,7 @@ struct Wrapper { } impl<'a, T> Trait for &'a Wrapper where &'a T: Trait { - fn method(self) -> int { + fn method(self) -> isize { let r: &'a T = &self.field; Trait::method(r); // these should both work r.method() diff --git a/src/test/run-pass/issue-2074.rs b/src/test/run-pass/issue-2074.rs index f5d34c39ee5..bd844b7720c 100644 --- a/src/test/run-pass/issue-2074.rs +++ b/src/test/run-pass/issue-2074.rs @@ -15,11 +15,11 @@ pub fn main() { let one = || { enum r { a }; - r::a as uint + r::a as usize }; let two = || { enum r { a }; - r::a as uint + r::a as usize }; one(); two(); } diff --git a/src/test/run-pass/issue-21384.rs b/src/test/run-pass/issue-21384.rs index e9b9aeebdaf..41a9ca840b1 100644 --- a/src/test/run-pass/issue-21384.rs +++ b/src/test/run-pass/issue-21384.rs @@ -17,7 +17,7 @@ fn test(arg: T) -> T { } #[derive(PartialEq)] -struct Test(int); +struct Test(isize); fn main() { // Check that ranges implement clone diff --git a/src/test/run-pass/issue-2185.rs b/src/test/run-pass/issue-2185.rs index 3da0a67ea8e..fb0d2f0ad85 100644 --- a/src/test/run-pass/issue-2185.rs +++ b/src/test/run-pass/issue-2185.rs @@ -17,8 +17,8 @@ // // Running /usr/local/bin/rustc: // issue-2185.rs:24:0: 26:1 error: conflicting implementations for a trait -// issue-2185.rs:24 impl iterable for 'static ||uint|| { -// issue-2185.rs:25 fn iter(&self, blk: |v: uint|) { self( |i| blk(i) ) } +// issue-2185.rs:24 impl iterable for 'static ||usize|| { +// issue-2185.rs:25 fn iter(&self, blk: |v: usize|) { self( |i| blk(i) ) } // issue-2185.rs:26 } // issue-2185.rs:20:0: 22:1 note: note conflicting implementation here // issue-2185.rs:20 impl iterable for 'static ||A|| { @@ -26,7 +26,7 @@ // issue-2185.rs:22 } // // … so it looks like it's just not possible to implement both -// the generic iterable and iterable for the type iterable. +// the generic iterable and iterable for the type iterable. // Is it okay if I just remove this test? // // but Niko responded: @@ -50,8 +50,8 @@ impl iterable for 'static ||A|| { fn iter(&self, blk: |A|) { self(blk); } } -impl iterable for 'static ||uint|| { - fn iter(&self, blk: |v: uint|) { self( |i| blk(i) ) } +impl iterable for 'static ||usize|| { + fn iter(&self, blk: |v: usize|) { self( |i| blk(i) ) } } fn filter>(self: IA, prd: 'static |A| -> bool, blk: |A|) { @@ -68,7 +68,7 @@ fn foldl>(self: IA, b0: B, blk: |B, A| -> B) -> B { b } -fn range(lo: uint, hi: uint, it: |uint|) { +fn range(lo: usize, hi: usize, it: |usize|) { let mut i = lo; while i < hi { it(i); @@ -77,12 +77,12 @@ fn range(lo: uint, hi: uint, it: |uint|) { } pub fn main() { - let range: 'static ||uint|| = |a| range(0, 1000, a); - let filt: 'static ||v: uint|| = |a| filter( + let range: 'static ||usize|| = |a| range(0, 1000, a); + let filt: 'static ||v: usize|| = |a| filter( range, - |&&n: uint| n % 3 != 0 && n % 5 != 0, + |&&n: usize| n % 3 != 0 && n % 5 != 0, a); - let sum = foldl(filt, 0, |accum, &&n: uint| accum + n ); + let sum = foldl(filt, 0, |accum, &&n: usize| accum + n ); println!("{}", sum); } diff --git a/src/test/run-pass/issue-21891.rs b/src/test/run-pass/issue-21891.rs index 37acd34fbf0..0e35de7cdcb 100644 --- a/src/test/run-pass/issue-21891.rs +++ b/src/test/run-pass/issue-21891.rs @@ -10,9 +10,9 @@ // pretty-expanded FIXME #23616 -static foo: [uint; 3] = [1, 2, 3]; +static foo: [usize; 3] = [1, 2, 3]; -static slice_1: &'static [uint] = &foo; -static slice_2: &'static [uint] = &foo; +static slice_1: &'static [usize] = &foo; +static slice_2: &'static [usize] = &foo; fn main() {} diff --git a/src/test/run-pass/issue-2190-1.rs b/src/test/run-pass/issue-2190-1.rs index 41017134ba8..b2c21a274cb 100644 --- a/src/test/run-pass/issue-2190-1.rs +++ b/src/test/run-pass/issue-2190-1.rs @@ -15,13 +15,13 @@ use std::thread::Builder; use std::thunk::Thunk; -static generations: uint = 1024+256+128+49; +static generations: usize = 1024+256+128+49; fn spawn(f: Thunk<'static>) { Builder::new().stack_size(32 * 1024).spawn(move|| f.invoke(())); } -fn child_no(x: uint) -> Thunk<'static> { +fn child_no(x: usize) -> Thunk<'static> { Thunk::new(move|| { if x < generations { spawn(child_no(x+1)); diff --git a/src/test/run-pass/issue-2214.rs b/src/test/run-pass/issue-2214.rs index b5ea9c194a8..38895e1414c 100644 --- a/src/test/run-pass/issue-2214.rs +++ b/src/test/run-pass/issue-2214.rs @@ -17,13 +17,13 @@ extern crate libc; use std::mem; use libc::{c_double, c_int}; -fn to_c_int(v: &mut int) -> &mut c_int { +fn to_c_int(v: &mut isize) -> &mut c_int { unsafe { mem::transmute_copy(&v) } } -fn lgamma(n: c_double, value: &mut int) -> c_double { +fn lgamma(n: c_double, value: &mut isize) -> c_double { unsafe { return m::lgamma(n, to_c_int(value)); } @@ -44,7 +44,7 @@ mod m { } pub fn main() { - let mut y: int = 5; - let x: &mut int = &mut y; + let mut y: isize = 5; + let x: &mut isize = &mut y; assert_eq!(lgamma(1.0 as c_double, x), 0.0 as c_double); } diff --git a/src/test/run-pass/issue-2288.rs b/src/test/run-pass/issue-2288.rs index d4c882655b1..3364fae0d6f 100644 --- a/src/test/run-pass/issue-2288.rs +++ b/src/test/run-pass/issue-2288.rs @@ -40,6 +40,6 @@ fn f(x: Box>, a: A) { pub fn main() { let c = foo(42); - let d: Box> = box c as Box>; + let d: Box> = box c as Box>; f(d, c.x); } diff --git a/src/test/run-pass/issue-2312.rs b/src/test/run-pass/issue-2312.rs index 76bb216ed77..fa056191e67 100644 --- a/src/test/run-pass/issue-2312.rs +++ b/src/test/run-pass/issue-2312.rs @@ -14,7 +14,7 @@ trait clam { fn get(self) -> A; } -struct foo(int); +struct foo(isize); impl foo { pub fn bar>(&self, _c: C) -> B { panic!(); } diff --git a/src/test/run-pass/issue-2428.rs b/src/test/run-pass/issue-2428.rs index df604fd8e66..402eb0349ab 100644 --- a/src/test/run-pass/issue-2428.rs +++ b/src/test/run-pass/issue-2428.rs @@ -12,11 +12,11 @@ pub fn main() { let _foo = 100; - const quux: int = 5; + const quux: isize = 5; enum Stuff { Bar = quux } - assert_eq!(Stuff::Bar as int, quux); + assert_eq!(Stuff::Bar as isize, quux); } diff --git a/src/test/run-pass/issue-2445-b.rs b/src/test/run-pass/issue-2445-b.rs index 7c72b3aad92..c1d17d263d6 100644 --- a/src/test/run-pass/issue-2445-b.rs +++ b/src/test/run-pass/issue-2445-b.rs @@ -15,7 +15,7 @@ struct c1 { } impl c1 { - pub fn f1(&self, _x: int) { + pub fn f1(&self, _x: isize) { } } @@ -26,12 +26,12 @@ fn c1(x: T) -> c1 { } impl c1 { - pub fn f2(&self, _x: int) { + pub fn f2(&self, _x: isize) { } } pub fn main() { - c1::(3).f1(4); - c1::(3).f2(4); + c1::(3).f1(4); + c1::(3).f2(4); } diff --git a/src/test/run-pass/issue-2445.rs b/src/test/run-pass/issue-2445.rs index 3c72aa24f9b..0b6cf5890fd 100644 --- a/src/test/run-pass/issue-2445.rs +++ b/src/test/run-pass/issue-2445.rs @@ -30,6 +30,6 @@ impl c1 { pub fn main() { - c1::(3).f1(4); - c1::(3).f2(4); + c1::(3).f1(4); + c1::(3).f2(4); } diff --git a/src/test/run-pass/issue-2463.rs b/src/test/run-pass/issue-2463.rs index 2dc913a8f93..f0b0614535b 100644 --- a/src/test/run-pass/issue-2463.rs +++ b/src/test/run-pass/issue-2463.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -struct Pair { f: int, g: int } +struct Pair { f: isize, g: isize } pub fn main() { diff --git a/src/test/run-pass/issue-2487-a.rs b/src/test/run-pass/issue-2487-a.rs index 1c62d6a5f4a..76450b351f4 100644 --- a/src/test/run-pass/issue-2487-a.rs +++ b/src/test/run-pass/issue-2487-a.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 struct socket { - sock: int, + sock: isize, } @@ -33,6 +33,6 @@ fn socket() -> socket { fn closure(f: F) where F: FnOnce() { f() } -fn setsockopt_bytes(_sock: int) { } +fn setsockopt_bytes(_sock: isize) { } pub fn main() {} diff --git a/src/test/run-pass/issue-2550.rs b/src/test/run-pass/issue-2550.rs index d1e97e6cddf..87b0b198f9b 100644 --- a/src/test/run-pass/issue-2550.rs +++ b/src/test/run-pass/issue-2550.rs @@ -11,10 +11,10 @@ // pretty-expanded FIXME #23616 struct C { - x: uint, + x: usize, } -fn C(x: uint) -> C { +fn C(x: usize) -> C { C { x: x } diff --git a/src/test/run-pass/issue-2611-3.rs b/src/test/run-pass/issue-2611-3.rs index 17ace84b1e8..8cf80333e97 100644 --- a/src/test/run-pass/issue-2611-3.rs +++ b/src/test/run-pass/issue-2611-3.rs @@ -18,7 +18,7 @@ trait A { } struct E { - f: int + f: isize } impl A for E { diff --git a/src/test/run-pass/issue-2631-b.rs b/src/test/run-pass/issue-2631-b.rs index b6d180da849..7413ebd3504 100644 --- a/src/test/run-pass/issue-2631-b.rs +++ b/src/test/run-pass/issue-2631-b.rs @@ -24,5 +24,5 @@ pub fn main() { let v = vec!(Rc::new("hi".to_string())); let mut m: req::header_map = HashMap::new(); m.insert("METHOD".to_string(), Rc::new(RefCell::new(v))); - request::(&m); + request::(&m); } diff --git a/src/test/run-pass/issue-2633-2.rs b/src/test/run-pass/issue-2633-2.rs index 3812ead42f9..7b5a055d334 100644 --- a/src/test/run-pass/issue-2633-2.rs +++ b/src/test/run-pass/issue-2633-2.rs @@ -14,7 +14,7 @@ #![feature(box_syntax)] -fn a_val(x: Box, y: Box) -> int { +fn a_val(x: Box, y: Box) -> isize { *x + *y } diff --git a/src/test/run-pass/issue-2642.rs b/src/test/run-pass/issue-2642.rs index 113fe620d30..f0bc31fb391 100644 --- a/src/test/run-pass/issue-2642.rs +++ b/src/test/run-pass/issue-2642.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 fn f() { - let _x: uint = loop { loop { break; } }; + let _x: usize = loop { loop { break; } }; } pub fn main() { diff --git a/src/test/run-pass/issue-2708.rs b/src/test/run-pass/issue-2708.rs index 3f9dc46775a..d3916db3f75 100644 --- a/src/test/run-pass/issue-2708.rs +++ b/src/test/run-pass/issue-2708.rs @@ -14,9 +14,9 @@ #![feature(box_syntax)] struct Font { - fontbuf: uint, - cairo_font: uint, - font_dtor: uint, + fontbuf: usize, + cairo_font: usize, + font_dtor: usize, } diff --git a/src/test/run-pass/issue-2718.rs b/src/test/run-pass/issue-2718.rs index 7ca0ee01015..7842bcb7dd1 100644 --- a/src/test/run-pass/issue-2718.rs +++ b/src/test/run-pass/issue-2718.rs @@ -12,7 +12,7 @@ #![feature(unsafe_destructor, std_misc)] -pub type Task = int; +pub type Task = isize; // tjc: I don't know why pub mod pipes { @@ -31,7 +31,7 @@ pub mod pipes { } #[derive(PartialEq, Debug)] - #[repr(int)] + #[repr(isize)] pub enum state { empty, full, @@ -59,9 +59,9 @@ pub mod pipes { } mod rusti { - pub fn atomic_xchg(_dst: &mut int, _src: int) -> int { panic!(); } - pub fn atomic_xchg_acq(_dst: &mut int, _src: int) -> int { panic!(); } - pub fn atomic_xchg_rel(_dst: &mut int, _src: int) -> int { panic!(); } + pub fn atomic_xchg(_dst: &mut isize, _src: isize) -> isize { panic!(); } + pub fn atomic_xchg_acq(_dst: &mut isize, _src: isize) -> isize { panic!(); } + pub fn atomic_xchg_rel(_dst: &mut isize, _src: isize) -> isize { panic!(); } } // We should consider moving this to ::std::unsafe, although I @@ -72,13 +72,13 @@ pub mod pipes { pub fn swap_state_acq(dst: &mut state, src: state) -> state { unsafe { - transmute(rusti::atomic_xchg_acq(transmute(dst), src as int)) + transmute(rusti::atomic_xchg_acq(transmute(dst), src as isize)) } } pub fn swap_state_rel(dst: &mut state, src: state) -> state { unsafe { - transmute(rusti::atomic_xchg_rel(transmute(dst), src as int)) + transmute(rusti::atomic_xchg_rel(transmute(dst), src as isize)) } } diff --git a/src/test/run-pass/issue-2748-b.rs b/src/test/run-pass/issue-2748-b.rs index 5590f3432d5..8f30d262f41 100644 --- a/src/test/run-pass/issue-2748-b.rs +++ b/src/test/run-pass/issue-2748-b.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -fn thing<'r>(x: &'r [int]) -> &'r [int] { x } +fn thing<'r>(x: &'r [isize]) -> &'r [isize] { x } pub fn main() { let x = &[1,2,3]; diff --git a/src/test/run-pass/issue-2804-2.rs b/src/test/run-pass/issue-2804-2.rs index 4c09c39e4f9..6afb31619d1 100644 --- a/src/test/run-pass/issue-2804-2.rs +++ b/src/test/run-pass/issue-2804-2.rs @@ -17,7 +17,7 @@ extern crate collections; use std::collections::HashMap; -fn add_interfaces(managed_ip: String, device: HashMap) { +fn add_interfaces(managed_ip: String, device: HashMap) { println!("{}, {}", managed_ip, device["interfaces"]); } diff --git a/src/test/run-pass/issue-2804.rs b/src/test/run-pass/issue-2804.rs index dc1bee3a38c..a2b4e218a07 100644 --- a/src/test/run-pass/issue-2804.rs +++ b/src/test/run-pass/issue-2804.rs @@ -39,7 +39,7 @@ fn lookup(table: json::Object, key: String, default: String) -> String } } -fn add_interface(_store: int, managed_ip: String, data: json::Json) -> (String, object) +fn add_interface(_store: isize, managed_ip: String, data: json::Json) -> (String, object) { match &data { &Json::Object(ref interface) => { @@ -57,7 +57,7 @@ fn add_interface(_store: int, managed_ip: String, data: json::Json) -> (String, } } -fn add_interfaces(store: int, managed_ip: String, device: HashMap) +fn add_interfaces(store: isize, managed_ip: String, device: HashMap) -> Vec<(String, object)> { match device["interfaces"] { Json::Array(ref interfaces) => diff --git a/src/test/run-pass/issue-2895.rs b/src/test/run-pass/issue-2895.rs index af5cf97519e..3f4c630cc2b 100644 --- a/src/test/run-pass/issue-2895.rs +++ b/src/test/run-pass/issue-2895.rs @@ -13,11 +13,11 @@ use std::mem; struct Cat { - x: int + x: isize } struct Kitty { - x: int, + x: isize, } impl Drop for Kitty { @@ -26,12 +26,12 @@ impl Drop for Kitty { #[cfg(any(target_arch = "x86_64", target_arch="aarch64"))] pub fn main() { - assert_eq!(mem::size_of::(), 8 as uint); - assert_eq!(mem::size_of::(), 16 as uint); + assert_eq!(mem::size_of::(), 8 as usize); + assert_eq!(mem::size_of::(), 16 as usize); } #[cfg(any(target_arch = "x86", target_arch = "arm"))] pub fn main() { - assert_eq!(mem::size_of::(), 4 as uint); - assert_eq!(mem::size_of::(), 8 as uint); + assert_eq!(mem::size_of::(), 4 as usize); + assert_eq!(mem::size_of::(), 8 as usize); } diff --git a/src/test/run-pass/issue-2935.rs b/src/test/run-pass/issue-2935.rs index e653dda8de5..fd8e1e6b036 100644 --- a/src/test/run-pass/issue-2935.rs +++ b/src/test/run-pass/issue-2935.rs @@ -11,7 +11,7 @@ #![allow(unknown_features)] #![feature(box_syntax)] -//type t = { a: int }; +//type t = { a: isize }; // type t = { a: bool }; type t = bool; diff --git a/src/test/run-pass/issue-2936.rs b/src/test/run-pass/issue-2936.rs index fb72773f490..5c63230f5d0 100644 --- a/src/test/run-pass/issue-2936.rs +++ b/src/test/run-pass/issue-2936.rs @@ -19,22 +19,22 @@ fn foo>(b: U) -> T { } struct cbar { - x: int, + x: isize, } -impl bar for cbar { - fn get_bar(&self) -> int { +impl bar for cbar { + fn get_bar(&self) -> isize { self.x } } -fn cbar(x: int) -> cbar { +fn cbar(x: isize) -> cbar { cbar { x: x } } pub fn main() { - let x: int = foo::(cbar(5)); + let x: isize = foo::(cbar(5)); assert_eq!(x, 5); } diff --git a/src/test/run-pass/issue-3026.rs b/src/test/run-pass/issue-3026.rs index e7cd7926b2e..d8499992f94 100644 --- a/src/test/run-pass/issue-3026.rs +++ b/src/test/run-pass/issue-3026.rs @@ -19,7 +19,7 @@ use std::collections::HashMap; pub fn main() { let x: Box<_>; - let mut buggy_map: HashMap = HashMap::new(); + let mut buggy_map: HashMap = HashMap::new(); x = box 1; buggy_map.insert(42, &*x); } diff --git a/src/test/run-pass/issue-3220.rs b/src/test/run-pass/issue-3220.rs index ae4d05c76e3..0a37a013037 100644 --- a/src/test/run-pass/issue-3220.rs +++ b/src/test/run-pass/issue-3220.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -struct thing { x: int, } +struct thing { x: isize, } impl Drop for thing { fn drop(&mut self) {} diff --git a/src/test/run-pass/issue-3563-2.rs b/src/test/run-pass/issue-3563-2.rs index 6443ba243e2..65c21317cf2 100644 --- a/src/test/run-pass/issue-3563-2.rs +++ b/src/test/run-pass/issue-3563-2.rs @@ -11,8 +11,8 @@ // pretty-expanded FIXME #23616 trait Canvas { - fn add_point(&self, point: &int); - fn add_points(&self, shapes: &[int]) { + fn add_point(&self, point: &isize); + fn add_points(&self, shapes: &[isize]) { for pt in shapes { self.add_point(pt) } diff --git a/src/test/run-pass/issue-3563-3.rs b/src/test/run-pass/issue-3563-3.rs index 5dfe02cc9ec..07837625117 100644 --- a/src/test/run-pass/issue-3563-3.rs +++ b/src/test/run-pass/issue-3563-3.rs @@ -31,16 +31,16 @@ use std::slice; // Represents a position on a canvas. #[derive(Copy)] struct Point { - x: int, - y: int, + x: isize, + y: isize, } // Represents an offset on a canvas. (This has the same structure as a Point. // but different semantics). #[derive(Copy)] struct Size { - width: int, - height: int, + width: isize, + height: isize, } #[derive(Copy)] @@ -51,8 +51,8 @@ struct Rect { // Contains the information needed to do shape rendering via ASCII art. struct AsciiArt { - width: uint, - height: uint, + width: usize, + height: usize, fill: char, lines: Vec > , @@ -67,7 +67,7 @@ impl Drop for AsciiArt { // It's common to define a constructor sort of function to create struct instances. // If there is a canonical constructor it is typically named the same as the type. // Other constructor sort of functions are typically named from_foo, from_bar, etc. -fn AsciiArt(width: uint, height: uint, fill: char) -> AsciiArt { +fn AsciiArt(width: usize, height: usize, fill: char) -> AsciiArt { // Use an anonymous function to build a vector of vectors containing // blank characters for each position in our canvas. let mut lines = Vec::new(); @@ -82,12 +82,12 @@ fn AsciiArt(width: uint, height: uint, fill: char) -> AsciiArt { // Methods particular to the AsciiArt struct. impl AsciiArt { - fn add_pt(&mut self, x: int, y: int) { - if x >= 0 && x < self.width as int { - if y >= 0 && y < self.height as int { + fn add_pt(&mut self, x: isize, y: isize) { + if x >= 0 && x < self.width as isize { + if y >= 0 && y < self.height as isize { // Note that numeric types don't implicitly convert to each other. - let v = y as uint; - let h = x as uint; + let v = y as usize; + let h = x as usize; // Vector subscripting will normally copy the element, but &v[i] // will return a reference which is what we need because the diff --git a/src/test/run-pass/issue-3683.rs b/src/test/run-pass/issue-3683.rs index e6c816666e7..096eec803ff 100644 --- a/src/test/run-pass/issue-3683.rs +++ b/src/test/run-pass/issue-3683.rs @@ -12,14 +12,14 @@ trait Foo { - fn a(&self) -> int; - fn b(&self) -> int { + fn a(&self) -> isize; + fn b(&self) -> isize { self.a() + 2 } } -impl Foo for int { - fn a(&self) -> int { +impl Foo for isize { + fn a(&self) -> isize { 3 } } diff --git a/src/test/run-pass/issue-3794.rs b/src/test/run-pass/issue-3794.rs index 6ac252c07ef..3d5f38e38cc 100644 --- a/src/test/run-pass/issue-3794.rs +++ b/src/test/run-pass/issue-3794.rs @@ -17,7 +17,7 @@ trait T { #[derive(Debug)] struct S { - s: int, + s: isize, } impl T for S { diff --git a/src/test/run-pass/issue-3847.rs b/src/test/run-pass/issue-3847.rs index 9216c8aa1ae..bd3a726991b 100644 --- a/src/test/run-pass/issue-3847.rs +++ b/src/test/run-pass/issue-3847.rs @@ -9,12 +9,12 @@ // except according to those terms. mod buildings { - pub struct Tower { pub height: uint } + pub struct Tower { pub height: usize } } pub fn main() { let sears = buildings::Tower { height: 1451 }; - let h: uint = match sears { + let h: usize = match sears { buildings::Tower { height: h } => { h } }; diff --git a/src/test/run-pass/issue-3874.rs b/src/test/run-pass/issue-3874.rs index 0fe1e2af0c1..a29a2675865 100644 --- a/src/test/run-pass/issue-3874.rs +++ b/src/test/run-pass/issue-3874.rs @@ -10,9 +10,9 @@ // pretty-expanded FIXME #23616 -enum PureCounter { PureCounterVariant(uint) } +enum PureCounter { PureCounterVariant(usize) } -fn each(thing: PureCounter, blk: F) where F: FnOnce(&uint) { +fn each(thing: PureCounter, blk: F) where F: FnOnce(&usize) { let PureCounter::PureCounterVariant(ref x) = thing; blk(x); } diff --git a/src/test/run-pass/issue-3979-generics.rs b/src/test/run-pass/issue-3979-generics.rs index 14e1b635e94..61708acf7f3 100644 --- a/src/test/run-pass/issue-3979-generics.rs +++ b/src/test/run-pass/issue-3979-generics.rs @@ -24,18 +24,18 @@ trait Movable>: Positioned { } } -struct Point { x: int, y: int } +struct Point { x: isize, y: isize } -impl Positioned for Point { - fn SetX(&mut self, x: int) { +impl Positioned for Point { + fn SetX(&mut self, x: isize) { self.x = x; } - fn X(&self) -> int { + fn X(&self) -> isize { self.x } } -impl Movable for Point {} +impl Movable for Point {} pub fn main() { let mut p = Point{ x: 1, y: 2}; diff --git a/src/test/run-pass/issue-3979-xcrate.rs b/src/test/run-pass/issue-3979-xcrate.rs index ddd00522452..0784877849a 100644 --- a/src/test/run-pass/issue-3979-xcrate.rs +++ b/src/test/run-pass/issue-3979-xcrate.rs @@ -14,13 +14,13 @@ extern crate issue_3979_traits; use issue_3979_traits::{Positioned, Movable}; -struct Point { x: int, y: int } +struct Point { x: isize, y: isize } impl Positioned for Point { - fn SetX(&mut self, x: int) { + fn SetX(&mut self, x: isize) { self.x = x; } - fn X(&self) -> int { + fn X(&self) -> isize { self.x } } diff --git a/src/test/run-pass/issue-3979.rs b/src/test/run-pass/issue-3979.rs index 06d1cfa0e0d..341866e4982 100644 --- a/src/test/run-pass/issue-3979.rs +++ b/src/test/run-pass/issue-3979.rs @@ -11,24 +11,24 @@ // pretty-expanded FIXME #23616 trait Positioned { - fn SetX(&mut self, int); - fn X(&self) -> int; + fn SetX(&mut self, isize); + fn X(&self) -> isize; } trait Movable: Positioned { - fn translate(&mut self, dx: int) { + fn translate(&mut self, dx: isize) { let x = self.X(); self.SetX(x + dx); } } -struct Point { x: int, y: int } +struct Point { x: isize, y: isize } impl Positioned for Point { - fn SetX(&mut self, x: int) { + fn SetX(&mut self, x: isize) { self.x = x; } - fn X(&self) -> int { + fn X(&self) -> isize { self.x } } diff --git a/src/test/run-pass/issue-3991.rs b/src/test/run-pass/issue-3991.rs index 77fb488488c..d89cf8c2e10 100644 --- a/src/test/run-pass/issue-3991.rs +++ b/src/test/run-pass/issue-3991.rs @@ -12,7 +12,7 @@ // pretty-expanded FIXME #23616 struct HasNested { - nest: Vec > , + nest: Vec > , } impl HasNested { diff --git a/src/test/run-pass/issue-4036.rs b/src/test/run-pass/issue-4036.rs index b4aaf4cc7e9..ae7bb8a6842 100644 --- a/src/test/run-pass/issue-4036.rs +++ b/src/test/run-pass/issue-4036.rs @@ -23,5 +23,5 @@ use serialize::{json, Decodable}; pub fn main() { let json = json::from_str("[1]").unwrap(); let mut decoder = json::Decoder::new(json); - let _x: Vec = Decodable::decode(&mut decoder).unwrap(); + let _x: Vec = Decodable::decode(&mut decoder).unwrap(); } diff --git a/src/test/run-pass/issue-4107.rs b/src/test/run-pass/issue-4107.rs index 0be76dd1b22..18025c315c9 100644 --- a/src/test/run-pass/issue-4107.rs +++ b/src/test/run-pass/issue-4107.rs @@ -15,16 +15,16 @@ pub fn main() { } pub trait Index { fn get(&self, Index) -> Result { panic!() } } -pub trait Dimensional: Index { } +pub trait Dimensional: Index { } pub struct Mat2 { x: T } pub struct Vec2 { x: T } impl Dimensional> for Mat2 { } -impl Index> for Mat2 { } +impl Index> for Mat2 { } impl Dimensional for Vec2 { } -impl Index for Vec2 { } +impl Index for Vec2 { } pub trait Matrix: Dimensional { fn identity(t:T) -> Self; diff --git a/src/test/run-pass/issue-4241.rs b/src/test/run-pass/issue-4241.rs index 89cf2f69b34..c650fc25ee1 100644 --- a/src/test/run-pass/issue-4241.rs +++ b/src/test/run-pass/issue-4241.rs @@ -15,23 +15,23 @@ extern crate extra; use extra::net::tcp::TcpSocketBuf; use std::io; -use std::int; +use std::isize; use std::io::{ReaderUtil,WriterUtil}; enum Result { Nil, - Int(int), + Int(isize), Data(~[u8]), List(~[Result]), Error(String), Status(String) } -priv fn parse_data(len: uint, io: @io::Reader) -> Result { +priv fn parse_data(len: usize, io: @io::Reader) -> Result { let res = if (len > 0) { - let bytes = io.read_bytes(len as uint); + let bytes = io.read_bytes(len as usize); assert_eq!(bytes.len(), len); Data(bytes) } else { @@ -42,7 +42,7 @@ priv fn parse_data(len: uint, io: @io::Reader) -> Result { return res; } -priv fn parse_list(len: uint, io: @io::Reader) -> Result { +priv fn parse_list(len: usize, io: @io::Reader) -> Result { let mut list: ~[Result] = ~[]; for _ in 0..len { let v = match io.read_char() { @@ -60,26 +60,26 @@ priv fn chop(s: String) -> String { } priv fn parse_bulk(io: @io::Reader) -> Result { - match from_str::(chop(io.read_line())) { + match from_str::(chop(io.read_line())) { None => panic!(), Some(-1) => Nil, - Some(len) if len >= 0 => parse_data(len as uint, io), + Some(len) if len >= 0 => parse_data(len as usize, io), Some(_) => panic!() } } priv fn parse_multi(io: @io::Reader) -> Result { - match from_str::(chop(io.read_line())) { + match from_str::(chop(io.read_line())) { None => panic!(), Some(-1) => Nil, Some(0) => List(~[]), - Some(len) if len >= 0 => parse_list(len as uint, io), + Some(len) if len >= 0 => parse_list(len as usize, io), Some(_) => panic!() } } priv fn parse_int(io: @io::Reader) -> Result { - match from_str::(chop(io.read_line())) { + match from_str::(chop(io.read_line())) { None => panic!(), Some(i) => Int(i) } diff --git a/src/test/run-pass/issue-4252.rs b/src/test/run-pass/issue-4252.rs index 08ee955cabb..73ef35f0457 100644 --- a/src/test/run-pass/issue-4252.rs +++ b/src/test/run-pass/issue-4252.rs @@ -18,7 +18,7 @@ trait X { } #[derive(Debug)] -struct Y(int); +struct Y(isize); #[derive(Debug)] struct Z { diff --git a/src/test/run-pass/issue-4464.rs b/src/test/run-pass/issue-4464.rs index 753500cec99..675ca2c3b7e 100644 --- a/src/test/run-pass/issue-4464.rs +++ b/src/test/run-pass/issue-4464.rs @@ -10,6 +10,6 @@ // pretty-expanded FIXME #23616 -fn broken(v: &[u8], i: uint, j: uint) -> &[u8] { &v[i..j] } +fn broken(v: &[u8], i: usize, j: usize) -> &[u8] { &v[i..j] } pub fn main() {} diff --git a/src/test/run-pass/issue-4545.rs b/src/test/run-pass/issue-4545.rs index a9d04167a41..cf7ab5d860b 100644 --- a/src/test/run-pass/issue-4545.rs +++ b/src/test/run-pass/issue-4545.rs @@ -13,4 +13,4 @@ // pretty-expanded FIXME #23616 extern crate "issue-4545" as somelib; -pub fn main() { somelib::mk::(); } +pub fn main() { somelib::mk::(); } diff --git a/src/test/run-pass/issue-4734.rs b/src/test/run-pass/issue-4734.rs index 30c8cb1bfa4..82925852a6a 100644 --- a/src/test/run-pass/issue-4734.rs +++ b/src/test/run-pass/issue-4734.rs @@ -15,10 +15,10 @@ #![allow(path_statement)] -struct A { n: int } +struct A { n: isize } struct B; -static mut NUM_DROPS: uint = 0; +static mut NUM_DROPS: usize = 0; impl Drop for A { fn drop(&mut self) { diff --git a/src/test/run-pass/issue-4735.rs b/src/test/run-pass/issue-4735.rs index 45db84ca93a..56e69a9f36e 100644 --- a/src/test/run-pass/issue-4735.rs +++ b/src/test/run-pass/issue-4735.rs @@ -24,12 +24,12 @@ struct NonCopyable(*const c_void); impl Drop for NonCopyable { fn drop(&mut self) { let NonCopyable(p) = *self; - let _v = unsafe { transmute::<*const c_void, Box>(p) }; + let _v = unsafe { transmute::<*const c_void, Box>(p) }; } } pub fn main() { let t = box 0; - let p = unsafe { transmute::, *const c_void>(t) }; + let p = unsafe { transmute::, *const c_void>(t) }; let _z = NonCopyable(p); } diff --git a/src/test/run-pass/issue-4759.rs b/src/test/run-pass/issue-4759.rs index c2fc559ae81..a26d6b05d7e 100644 --- a/src/test/run-pass/issue-4759.rs +++ b/src/test/run-pass/issue-4759.rs @@ -13,13 +13,13 @@ #![allow(unknown_features)] #![feature(box_syntax)] -struct T { a: Box } +struct T { a: Box } trait U { fn f(self); } -impl U for Box { +impl U for Box { fn f(self) { } } diff --git a/src/test/run-pass/issue-4830.rs b/src/test/run-pass/issue-4830.rs index 15d870b12a7..f615767c215 100644 --- a/src/test/run-pass/issue-4830.rs +++ b/src/test/run-pass/issue-4830.rs @@ -13,7 +13,7 @@ pub struct Scheduler { /// The event loop used to drive the scheduler and perform I/O - event_loop: Box + event_loop: Box } pub fn main() { } diff --git a/src/test/run-pass/issue-5192.rs b/src/test/run-pass/issue-5192.rs index 2a871522b44..d8f7f25508d 100644 --- a/src/test/run-pass/issue-5192.rs +++ b/src/test/run-pass/issue-5192.rs @@ -18,7 +18,7 @@ pub trait EventLoop { } pub struct UvEventLoop { - uvio: int + uvio: isize } impl UvEventLoop { diff --git a/src/test/run-pass/issue-5239-2.rs b/src/test/run-pass/issue-5239-2.rs index 6720bb3f0f9..d8491070bd8 100644 --- a/src/test/run-pass/issue-5239-2.rs +++ b/src/test/run-pass/issue-5239-2.rs @@ -13,7 +13,7 @@ // pretty-expanded FIXME #23616 pub fn main() { - let _f = |ref x: int| { *x }; + let _f = |ref x: isize| { *x }; let foo = 10; assert!(_f(foo) == 10); } diff --git a/src/test/run-pass/issue-5243.rs b/src/test/run-pass/issue-5243.rs index 31dc8208725..eda0eea7071 100644 --- a/src/test/run-pass/issue-5243.rs +++ b/src/test/run-pass/issue-5243.rs @@ -15,7 +15,7 @@ // pretty-expanded FIXME #23616 struct S<'a> { - v: &'a int + v: &'a isize } fn f<'lt>(_s: &'lt S<'lt>) {} diff --git a/src/test/run-pass/issue-5321-immediates-with-bare-self.rs b/src/test/run-pass/issue-5321-immediates-with-bare-self.rs index 2ab41f77838..d0bc396c368 100644 --- a/src/test/run-pass/issue-5321-immediates-with-bare-self.rs +++ b/src/test/run-pass/issue-5321-immediates-with-bare-self.rs @@ -14,7 +14,7 @@ trait Fooable { fn yes(self); } -impl Fooable for uint { +impl Fooable for usize { fn yes(self) { for _ in 0..self { println!("yes"); } } diff --git a/src/test/run-pass/issue-5530.rs b/src/test/run-pass/issue-5530.rs index 7b3d226fe12..50b9ca6e797 100644 --- a/src/test/run-pass/issue-5530.rs +++ b/src/test/run-pass/issue-5530.rs @@ -11,11 +11,11 @@ // pretty-expanded FIXME #23616 enum Enum { - Foo { foo: uint }, - Bar { bar: uint } + Foo { foo: usize }, + Bar { bar: usize } } -fn fun1(e1: &Enum, e2: &Enum) -> uint { +fn fun1(e1: &Enum, e2: &Enum) -> usize { match (e1, e2) { (&Enum::Foo { foo: _ }, &Enum::Foo { foo: _ }) => 0, (&Enum::Foo { foo: _ }, &Enum::Bar { bar: _ }) => 1, @@ -24,7 +24,7 @@ fn fun1(e1: &Enum, e2: &Enum) -> uint { } } -fn fun2(e1: &Enum, e2: &Enum) -> uint { +fn fun2(e1: &Enum, e2: &Enum) -> usize { match (e1, e2) { (&Enum::Foo { foo: _ }, &Enum::Foo { foo: _ }) => 0, (&Enum::Foo { foo: _ }, _ ) => 1, diff --git a/src/test/run-pass/issue-5554.rs b/src/test/run-pass/issue-5554.rs index 63dcae41d83..e8190a7245a 100644 --- a/src/test/run-pass/issue-5554.rs +++ b/src/test/run-pass/issue-5554.rs @@ -28,7 +28,7 @@ impl Default for X { macro_rules! constants { () => { - let _ : X = Default::default(); + let _ : X = Default::default(); } } diff --git a/src/test/run-pass/issue-5688.rs b/src/test/run-pass/issue-5688.rs index 9612c4bf181..3c25c6dc8ed 100644 --- a/src/test/run-pass/issue-5688.rs +++ b/src/test/run-pass/issue-5688.rs @@ -13,12 +13,12 @@ ...should print &[1, 2, 3] but instead prints something like &[4492532864, 24]. It is pretty evident that the compiler messed up -with the representation of [int; n] and [int] somehow, or at least +with the representation of [isize; n] and [isize] somehow, or at least failed to typecheck correctly. */ #[derive(Copy)] -struct X { vec: &'static [int] } +struct X { vec: &'static [isize] } static V: &'static [X] = &[X { vec: &[1, 2, 3] }]; diff --git a/src/test/run-pass/issue-5708.rs b/src/test/run-pass/issue-5708.rs index 54773d71cbe..dfb560db100 100644 --- a/src/test/run-pass/issue-5708.rs +++ b/src/test/run-pass/issue-5708.rs @@ -24,7 +24,7 @@ trait Inner { fn print(&self); } -impl Inner for int { +impl Inner for isize { fn print(&self) { print!("Inner: {}\n", *self); } } @@ -41,7 +41,7 @@ impl<'a> Outer<'a> { } pub fn main() { - let inner: int = 5; + let inner: isize = 5; let outer = Outer::new(&inner as &Inner); outer.inner.print(); } diff --git a/src/test/run-pass/issue-5718.rs b/src/test/run-pass/issue-5718.rs index 8eea99cf562..964809631d9 100644 --- a/src/test/run-pass/issue-5718.rs +++ b/src/test/run-pass/issue-5718.rs @@ -20,13 +20,13 @@ macro_rules! foo { if $tag == $string { let element: Box<_> = box Element; unsafe { - return std::mem::transmute::<_, uint>(element); + return std::mem::transmute::<_, usize>(element); } } } } -fn bar() -> uint { +fn bar() -> usize { foo!("a", "b"); 0 } diff --git a/src/test/run-pass/issue-5884.rs b/src/test/run-pass/issue-5884.rs index d798560a232..2096bebd2b2 100644 --- a/src/test/run-pass/issue-5884.rs +++ b/src/test/run-pass/issue-5884.rs @@ -14,11 +14,11 @@ #![feature(box_syntax)] pub struct Foo { - a: int, + a: isize, } struct Bar<'a> { - a: Box>, + a: Box>, b: &'a Foo, } diff --git a/src/test/run-pass/issue-5900.rs b/src/test/run-pass/issue-5900.rs index 65ece1f6711..d3a43b51dcf 100644 --- a/src/test/run-pass/issue-5900.rs +++ b/src/test/run-pass/issue-5900.rs @@ -17,7 +17,7 @@ pub mod foo { } pub enum Bar { - Bar0 = 0 as int + Bar0 = 0 as isize } pub fn main() {} diff --git a/src/test/run-pass/issue-5917.rs b/src/test/run-pass/issue-5917.rs index 56122700683..7f741182f42 100644 --- a/src/test/run-pass/issue-5917.rs +++ b/src/test/run-pass/issue-5917.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -struct T (&'static [int]); +struct T (&'static [isize]); static t : T = T (&[5, 4, 3]); pub fn main () { let T(ref v) = t; diff --git a/src/test/run-pass/issue-5997.rs b/src/test/run-pass/issue-5997.rs index dd311c812e5..48923bc82b4 100644 --- a/src/test/run-pass/issue-5997.rs +++ b/src/test/run-pass/issue-5997.rs @@ -19,6 +19,6 @@ fn f() -> bool { } fn main() { - let b = f::(); + let b = f::(); assert!(b); } diff --git a/src/test/run-pass/issue-6128.rs b/src/test/run-pass/issue-6128.rs index 84baff9aae1..baf829bc269 100644 --- a/src/test/run-pass/issue-6128.rs +++ b/src/test/run-pass/issue-6128.rs @@ -23,16 +23,16 @@ trait Graph { } -impl Graph for HashMap { +impl Graph for HashMap { fn f(&self, _e: E) { panic!(); } - fn g(&self, _e: int) { + fn g(&self, _e: isize) { panic!(); } } pub fn main() { - let g : Box> = box HashMap::new(); - let _g2 : Box> = g as Box>; + let g : Box> = box HashMap::new(); + let _g2 : Box> = g as Box>; } diff --git a/src/test/run-pass/issue-6130.rs b/src/test/run-pass/issue-6130.rs index 1f204ab896b..6f158339169 100644 --- a/src/test/run-pass/issue-6130.rs +++ b/src/test/run-pass/issue-6130.rs @@ -13,10 +13,10 @@ #![deny(type_limits)] pub fn main() { - let i: uint = 0; + let i: usize = 0; assert!(i <= 0xFFFF_FFFF); - let i: int = 0; + let i: isize = 0; assert!(i >= -0x8000_0000); assert!(i <= 0x7FFF_FFFF); } diff --git a/src/test/run-pass/issue-6153.rs b/src/test/run-pass/issue-6153.rs index 5df3478c84c..c280ea31ebc 100644 --- a/src/test/run-pass/issue-6153.rs +++ b/src/test/run-pass/issue-6153.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 -fn swap(f: F) -> Vec where F: FnOnce(Vec) -> Vec { +fn swap(f: F) -> Vec where F: FnOnce(Vec) -> Vec { let x = vec!(1, 2, 3); f(x) } diff --git a/src/test/run-pass/issue-6157.rs b/src/test/run-pass/issue-6157.rs index 756aaece681..c7832ae41e3 100644 --- a/src/test/run-pass/issue-6157.rs +++ b/src/test/run-pass/issue-6157.rs @@ -10,17 +10,17 @@ // pretty-expanded FIXME #23616 -pub trait OpInt { fn call(&mut self, int, int) -> int; } +pub trait OpInt { fn call(&mut self, isize, isize) -> isize; } -impl OpInt for F where F: FnMut(int, int) -> int { - fn call(&mut self, a:int, b:int) -> int { +impl OpInt for F where F: FnMut(isize, isize) -> isize { + fn call(&mut self, a:isize, b:isize) -> isize { (*self)(a, b) } } -fn squarei<'a>(x: int, op: &'a mut OpInt) -> int { op.call(x, x) } +fn squarei<'a>(x: isize, op: &'a mut OpInt) -> isize { op.call(x, x) } -fn muli(x:int, y:int) -> int { x * y } +fn muli(x:isize, y:isize) -> isize { x * y } pub fn main() { let mut f = |x, y| muli(x, y); diff --git a/src/test/run-pass/issue-6334.rs b/src/test/run-pass/issue-6334.rs index fa546a80bfb..2f2dca8fe22 100644 --- a/src/test/run-pass/issue-6334.rs +++ b/src/test/run-pass/issue-6334.rs @@ -14,37 +14,37 @@ // pretty-expanded FIXME #23616 trait A { - fn a(&self) -> uint; + fn a(&self) -> usize; } trait B { - fn b(&self) -> uint; + fn b(&self) -> usize; } trait C { - fn combine(&self, t: &T) -> uint; + fn combine(&self, t: &T) -> usize; } struct Foo; impl A for Foo { - fn a(&self) -> uint { 1 } + fn a(&self) -> usize { 1 } } impl B for Foo { - fn b(&self) -> uint { 2 } + fn b(&self) -> usize { 2 } } struct Bar; impl C for Bar { // Note below: bounds in impl decl are in reverse order. - fn combine(&self, t: &T) -> uint { + fn combine(&self, t: &T) -> usize { (t.a() * 100) + t.b() } } -fn use_c(s: &S, t: &T) -> uint { +fn use_c(s: &S, t: &T) -> usize { s.combine(t) } diff --git a/src/test/run-pass/issue-6341.rs b/src/test/run-pass/issue-6341.rs index 8ca921f5a05..41abaa2c8b8 100644 --- a/src/test/run-pass/issue-6341.rs +++ b/src/test/run-pass/issue-6341.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 #[derive(PartialEq)] -struct A { x: uint } +struct A { x: usize } impl Drop for A { fn drop(&mut self) {} diff --git a/src/test/run-pass/issue-6344-let.rs b/src/test/run-pass/issue-6344-let.rs index 65ee062a039..8449d9f572b 100644 --- a/src/test/run-pass/issue-6344-let.rs +++ b/src/test/run-pass/issue-6344-let.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -struct A { x: uint } +struct A { x: usize } impl Drop for A { fn drop(&mut self) {} diff --git a/src/test/run-pass/issue-6344-match.rs b/src/test/run-pass/issue-6344-match.rs index ee99ec957b5..4bb23295c85 100644 --- a/src/test/run-pass/issue-6344-match.rs +++ b/src/test/run-pass/issue-6344-match.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -struct A { x: uint } +struct A { x: usize } impl Drop for A { fn drop(&mut self) {} diff --git a/src/test/run-pass/issue-6449.rs b/src/test/run-pass/issue-6449.rs index 6d2b3ffc75b..3b33a0ac86f 100644 --- a/src/test/run-pass/issue-6449.rs +++ b/src/test/run-pass/issue-6449.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 enum Foo { - Bar(int), + Bar(isize), Baz, } diff --git a/src/test/run-pass/issue-6470.rs b/src/test/run-pass/issue-6470.rs index 05a5dcbc3f8..9b5f78a1450 100644 --- a/src/test/run-pass/issue-6470.rs +++ b/src/test/run-pass/issue-6470.rs @@ -12,7 +12,7 @@ pub mod Bar { pub struct Foo { - v: int, + v: isize, } extern { diff --git a/src/test/run-pass/issue-6557.rs b/src/test/run-pass/issue-6557.rs index a618b3d2e7c..eba87f418e4 100644 --- a/src/test/run-pass/issue-6557.rs +++ b/src/test/run-pass/issue-6557.rs @@ -14,6 +14,6 @@ #![feature(box_patterns)] #![feature(box_syntax)] -fn foo(box (_x, _y): Box<(int, int)>) {} +fn foo(box (_x, _y): Box<(isize, isize)>) {} pub fn main() {} diff --git a/src/test/run-pass/issue-6892.rs b/src/test/run-pass/issue-6892.rs index 43da077ab1f..4469dcc0ced 100644 --- a/src/test/run-pass/issue-6892.rs +++ b/src/test/run-pass/issue-6892.rs @@ -14,11 +14,11 @@ // pretty-expanded FIXME #23616 struct Foo; -struct Bar { x: int } -struct Baz(int); -enum FooBar { _Foo(Foo), _Bar(uint) } +struct Bar { x: isize } +struct Baz(isize); +enum FooBar { _Foo(Foo), _Bar(usize) } -static mut NUM_DROPS: uint = 0; +static mut NUM_DROPS: usize = 0; impl Drop for Foo { fn drop(&mut self) { diff --git a/src/test/run-pass/issue-6898.rs b/src/test/run-pass/issue-6898.rs index 19e59ea2d73..3138aad2c8c 100644 --- a/src/test/run-pass/issue-6898.rs +++ b/src/test/run-pass/issue-6898.rs @@ -15,28 +15,28 @@ use std::intrinsics; /// Returns the size of a type -pub fn size_of() -> uint { +pub fn size_of() -> usize { TypeInfo::size_of(None::) } /// Returns the size of the type that `val` points to -pub fn size_of_val(val: &T) -> uint { +pub fn size_of_val(val: &T) -> usize { val.size_of_val() } pub trait TypeInfo { - fn size_of(_lame_type_hint: Option) -> uint; - fn size_of_val(&self) -> uint; + fn size_of(_lame_type_hint: Option) -> usize; + fn size_of_val(&self) -> usize; } impl TypeInfo for T { /// The size of the type in bytes. - fn size_of(_lame_type_hint: Option) -> uint { + fn size_of(_lame_type_hint: Option) -> usize { unsafe { intrinsics::size_of::() } } /// Returns the size of the type of `self` in bytes. - fn size_of_val(&self) -> uint { + fn size_of_val(&self) -> usize { TypeInfo::size_of(None::) } } diff --git a/src/test/run-pass/issue-7563.rs b/src/test/run-pass/issue-7563.rs index eda2057f6d6..6d2a602fc8d 100644 --- a/src/test/run-pass/issue-7563.rs +++ b/src/test/run-pass/issue-7563.rs @@ -13,9 +13,9 @@ trait IDummy { } #[derive(Debug)] -struct A { a: int } +struct A { a: isize } #[derive(Debug)] -struct B<'a> { b: int, pa: &'a A } +struct B<'a> { b: isize, pa: &'a A } impl IDummy for A { fn do_nothing(&self) { diff --git a/src/test/run-pass/issue-7575.rs b/src/test/run-pass/issue-7575.rs index 471caa55149..727ed91eadc 100644 --- a/src/test/run-pass/issue-7575.rs +++ b/src/test/run-pass/issue-7575.rs @@ -19,8 +19,8 @@ trait Bar { fn new(&self) -> bool { true } } -impl Bar for int {} -impl Foo for int {} +impl Bar for isize {} +impl Foo for isize {} fn main() { assert!(1.new()); diff --git a/src/test/run-pass/issue-7660.rs b/src/test/run-pass/issue-7660.rs index f044c4d3e50..b0ebc6c9cc8 100644 --- a/src/test/run-pass/issue-7660.rs +++ b/src/test/run-pass/issue-7660.rs @@ -19,10 +19,10 @@ extern crate collections; use std::collections::HashMap; -struct A(int, int); +struct A(isize, isize); pub fn main() { - let mut m: HashMap = HashMap::new(); + let mut m: HashMap = HashMap::new(); m.insert(1, A(0, 0)); let A(ref _a, ref _b) = m[&1]; diff --git a/src/test/run-pass/issue-7663.rs b/src/test/run-pass/issue-7663.rs index 3b954ff1948..007127aeae1 100644 --- a/src/test/run-pass/issue-7663.rs +++ b/src/test/run-pass/issue-7663.rs @@ -14,8 +14,8 @@ mod test1 { - mod foo { pub fn p() -> int { 1 } } - mod bar { pub fn p() -> int { 2 } } + mod foo { pub fn p() -> isize { 1 } } + mod bar { pub fn p() -> isize { 2 } } pub mod baz { use test1::bar::p; @@ -26,8 +26,8 @@ mod test1 { mod test2 { - mod foo { pub fn p() -> int { 1 } } - mod bar { pub fn p() -> int { 2 } } + mod foo { pub fn p() -> isize { 1 } } + mod bar { pub fn p() -> isize { 2 } } pub mod baz { use test2::bar::p; diff --git a/src/test/run-pass/issue-8044.rs b/src/test/run-pass/issue-8044.rs index 284b0ff0348..386d3558553 100644 --- a/src/test/run-pass/issue-8044.rs +++ b/src/test/run-pass/issue-8044.rs @@ -16,5 +16,5 @@ extern crate "issue-8044" as minimal; use minimal::{BTree, leaf}; pub fn main() { - BTree:: { node: leaf(1) }; + BTree:: { node: leaf(1) }; } diff --git a/src/test/run-pass/issue-8351-1.rs b/src/test/run-pass/issue-8351-1.rs index 4e42f943d35..a11e14fb333 100644 --- a/src/test/run-pass/issue-8351-1.rs +++ b/src/test/run-pass/issue-8351-1.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 enum E { - Foo{f: int}, + Foo{f: isize}, Bar, } diff --git a/src/test/run-pass/issue-8351-2.rs b/src/test/run-pass/issue-8351-2.rs index 10dd803d050..7cf221926a6 100644 --- a/src/test/run-pass/issue-8351-2.rs +++ b/src/test/run-pass/issue-8351-2.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 enum E { - Foo{f: int, b: bool}, + Foo{f: isize, b: bool}, Bar, } diff --git a/src/test/run-pass/issue-8709.rs b/src/test/run-pass/issue-8709.rs index a75696fbe29..64672629298 100644 --- a/src/test/run-pass/issue-8709.rs +++ b/src/test/run-pass/issue-8709.rs @@ -19,6 +19,6 @@ macro_rules! spath { } fn main() { - assert_eq!(sty!(int), "int"); + assert_eq!(sty!(isize), "isize"); assert_eq!(spath!(std::option), "std::option"); } diff --git a/src/test/run-pass/issue-8783.rs b/src/test/run-pass/issue-8783.rs index 8097df4927a..485a76ff7ec 100644 --- a/src/test/run-pass/issue-8783.rs +++ b/src/test/run-pass/issue-8783.rs @@ -12,7 +12,7 @@ use std::default::Default; -struct X { pub x: uint } +struct X { pub x: usize } impl Default for X { fn default() -> X { X { x: 42 } diff --git a/src/test/run-pass/issue-8827.rs b/src/test/run-pass/issue-8827.rs index b2aa93d280c..4e1ff84291e 100644 --- a/src/test/run-pass/issue-8827.rs +++ b/src/test/run-pass/issue-8827.rs @@ -13,7 +13,7 @@ use std::thread::Thread; use std::sync::mpsc::{channel, Receiver}; -fn periodical(n: int) -> Receiver { +fn periodical(n: isize) -> Receiver { let (chan, port) = channel(); Thread::spawn(move|| { loop { @@ -32,7 +32,7 @@ fn periodical(n: int) -> Receiver { return port; } -fn integers() -> Receiver { +fn integers() -> Receiver { let (chan, port) = channel(); Thread::spawn(move|| { let mut i = 1; diff --git a/src/test/run-pass/issue-8851.rs b/src/test/run-pass/issue-8851.rs index 48cb2a64bb7..2a0c02b23e8 100644 --- a/src/test/run-pass/issue-8851.rs +++ b/src/test/run-pass/issue-8851.rs @@ -16,13 +16,13 @@ // pretty-expanded FIXME #23616 enum T { - A(int), - B(uint) + A(isize), + B(usize) } macro_rules! test { ($id:ident, $e:expr) => ( - fn foo(t: T) -> int { + fn foo(t: T) -> isize { match t { T::A($id) => $e, T::B($id) => $e @@ -31,7 +31,7 @@ macro_rules! test { ) } -test!(y, 10 + (y as int)); +test!(y, 10 + (y as isize)); pub fn main() { foo(T::A(20)); diff --git a/src/test/run-pass/issue-8860.rs b/src/test/run-pass/issue-8860.rs index 968f621037f..8024eaeda83 100644 --- a/src/test/run-pass/issue-8860.rs +++ b/src/test/run-pass/issue-8860.rs @@ -10,9 +10,9 @@ // pretty-expanded FIXME #23616 -static mut DROP: int = 0; -static mut DROP_S: int = 0; -static mut DROP_T: int = 0; +static mut DROP: isize = 0; +static mut DROP_S: isize = 0; +static mut DROP_T: isize = 0; struct S; impl Drop for S { @@ -25,7 +25,7 @@ impl Drop for S { } fn f(ref _s: S) {} -struct T { i: int } +struct T { i: isize } impl Drop for T { fn drop(&mut self) { unsafe { diff --git a/src/test/run-pass/issue-9047.rs b/src/test/run-pass/issue-9047.rs index 99413819852..aa3e601c3a2 100644 --- a/src/test/run-pass/issue-9047.rs +++ b/src/test/run-pass/issue-9047.rs @@ -10,7 +10,7 @@ fn decode() -> String { 'outer: loop { - let mut ch_start: uint; + let mut ch_start: usize; break 'outer; } "".to_string() diff --git a/src/test/run-pass/issue-9129.rs b/src/test/run-pass/issue-9129.rs index 6c843993040..99db47c172e 100644 --- a/src/test/run-pass/issue-9129.rs +++ b/src/test/run-pass/issue-9129.rs @@ -17,7 +17,7 @@ pub trait bomb { fn boom(&self, Ident); } pub struct S; impl bomb for S { fn boom(&self, _: Ident) { } } -pub struct Ident { name: uint } +pub struct Ident { name: usize } // macro_rules! int3 { () => ( unsafe { asm!( "int3" ); } ) } macro_rules! int3 { () => ( { } ) } diff --git a/src/test/run-pass/issue-9188.rs b/src/test/run-pass/issue-9188.rs index 1600ce22dd4..0bd8a8e0d9d 100644 --- a/src/test/run-pass/issue-9188.rs +++ b/src/test/run-pass/issue-9188.rs @@ -16,6 +16,6 @@ extern crate issue_9188; pub fn main() { let a = issue_9188::bar(); - let b = issue_9188::foo::(); + let b = issue_9188::foo::(); assert_eq!(*a, *b); } diff --git a/src/test/run-pass/issue-9382.rs b/src/test/run-pass/issue-9382.rs index f9cc8cb293f..2c84e202b26 100644 --- a/src/test/run-pass/issue-9382.rs +++ b/src/test/run-pass/issue-9382.rs @@ -21,12 +21,12 @@ struct Thing1<'a> { - baz: &'a [Box], + baz: &'a [Box], bar: Box, } struct Thing2<'a> { - baz: &'a [Box], + baz: &'a [Box], bar: u64, } diff --git a/src/test/run-pass/issue-9719.rs b/src/test/run-pass/issue-9719.rs index 6e88379f9a4..108f1a0d73d 100644 --- a/src/test/run-pass/issue-9719.rs +++ b/src/test/run-pass/issue-9719.rs @@ -18,32 +18,32 @@ mod a { pub trait X { fn dummy(&self) { } } - impl X for int {} + impl X for isize {} pub struct Z<'a>(Enum<&'a (X+'a)>); - fn foo() { let x: int = 42; let z = Z(Enum::A(&x as &X)); let _ = z; } + fn foo() { let x: isize = 42; let z = Z(Enum::A(&x as &X)); let _ = z; } } mod b { trait X { fn dummy(&self) { } } - impl X for int {} + impl X for isize {} struct Y<'a>{ x:Option<&'a (X+'a)>, } fn bar() { - let x: int = 42; + let x: isize = 42; let _y = Y { x: Some(&x as &X) }; } } mod c { pub trait X { fn f(&self); } - impl X for int { fn f(&self) {} } + impl X for isize { fn f(&self) {} } pub struct Z<'a>(Option<&'a (X+'a)>); - fn main() { let x: int = 42; let z = Z(Some(&x as &X)); let _ = z; } + fn main() { let x: isize = 42; let z = Z(Some(&x as &X)); let _ = z; } } pub fn main() {} diff --git a/src/test/run-pass/issue-979.rs b/src/test/run-pass/issue-979.rs index 81edac3cef2..3283dc44f30 100644 --- a/src/test/run-pass/issue-979.rs +++ b/src/test/run-pass/issue-979.rs @@ -15,7 +15,7 @@ use std::cell::Cell; struct r<'a> { - b: &'a Cell, + b: &'a Cell, } #[unsafe_destructor] @@ -25,7 +25,7 @@ impl<'a> Drop for r<'a> { } } -fn r(b: &Cell) -> r { +fn r(b: &Cell) -> r { r { b: b } diff --git a/src/test/run-pass/issue-9942.rs b/src/test/run-pass/issue-9942.rs index 1c554250a11..222eb0c6518 100644 --- a/src/test/run-pass/issue-9942.rs +++ b/src/test/run-pass/issue-9942.rs @@ -11,5 +11,5 @@ // pretty-expanded FIXME #23616 pub fn main() { - const S: uint = 23 as uint; [0; S]; () + const S: usize = 23 as usize; [0; S]; () } diff --git a/src/test/run-pass/item-attributes.rs b/src/test/run-pass/item-attributes.rs index e1b980d7132..c2ed68fc5d4 100644 --- a/src/test/run-pass/item-attributes.rs +++ b/src/test/run-pass/item-attributes.rs @@ -30,7 +30,7 @@ mod test_first_item_in_file_mod {} mod test_single_attr_outer { #[attr = "val"] - pub static x: int = 10; + pub static x: isize = 10; #[attr = "val"] pub fn f() { } @@ -47,7 +47,7 @@ mod test_single_attr_outer { mod test_multi_attr_outer { #[attr1 = "val"] #[attr2 = "val"] - pub static x: int = 10; + pub static x: isize = 10; #[attr1 = "val"] #[attr2 = "val"] @@ -65,13 +65,13 @@ mod test_multi_attr_outer { #[attr1 = "val"] #[attr2 = "val"] - struct t {x: int} + struct t {x: isize} } mod test_stmt_single_attr_outer { pub fn f() { #[attr = "val"] - static x: int = 10; + static x: isize = 10; #[attr = "val"] fn f() { } @@ -93,7 +93,7 @@ mod test_stmt_multi_attr_outer { #[attr1 = "val"] #[attr2 = "val"] - static x: int = 10; + static x: isize = 10; #[attr1 = "val"] #[attr2 = "val"] @@ -176,8 +176,8 @@ mod test_foreign_items { /*mod test_literals { #![str = "s"] #![char = 'c'] - #![int = 100] - #![uint = 100_usize] + #![isize = 100] + #![usize = 100_usize] #![mach_int = 100u32] #![float = 1.0] #![mach_float = 1.0f32] diff --git a/src/test/run-pass/iter-range.rs b/src/test/run-pass/iter-range.rs index 29ac563878b..a6130841b5c 100644 --- a/src/test/run-pass/iter-range.rs +++ b/src/test/run-pass/iter-range.rs @@ -10,14 +10,14 @@ -fn range_(a: int, b: int, mut it: F) where F: FnMut(int) { +fn range_(a: isize, b: isize, mut it: F) where F: FnMut(isize) { assert!((a < b)); - let mut i: int = a; + let mut i: isize = a; while i < b { it(i); i += 1; } } pub fn main() { - let mut sum: int = 0; + let mut sum: isize = 0; range_(0, 100, |x| sum += x ); println!("{}", sum); } diff --git a/src/test/run-pass/ivec-pass-by-value.rs b/src/test/run-pass/ivec-pass-by-value.rs index 246ba19a59b..62aa3005783 100644 --- a/src/test/run-pass/ivec-pass-by-value.rs +++ b/src/test/run-pass/ivec-pass-by-value.rs @@ -11,5 +11,5 @@ // pretty-expanded FIXME #23616 -fn f(_a: Vec ) { } +fn f(_a: Vec ) { } pub fn main() { f(vec!(1, 2, 3, 4, 5)); } diff --git a/src/test/run-pass/keyword-changes-2012-07-31.rs b/src/test/run-pass/keyword-changes-2012-07-31.rs index 97025f209a2..9838fe62394 100644 --- a/src/test/run-pass/keyword-changes-2012-07-31.rs +++ b/src/test/run-pass/keyword-changes-2012-07-31.rs @@ -20,7 +20,7 @@ pub fn main() { mod foo { } -fn bar() -> int { +fn bar() -> isize { match 0 { _ => { 0 } } diff --git a/src/test/run-pass/kindck-implicit-close-over-mut-var.rs b/src/test/run-pass/kindck-implicit-close-over-mut-var.rs index ca405f54415..4645e8ff392 100644 --- a/src/test/run-pass/kindck-implicit-close-over-mut-var.rs +++ b/src/test/run-pass/kindck-implicit-close-over-mut-var.rs @@ -12,7 +12,7 @@ use std::thread::Thread; -fn user(_i: int) {} +fn user(_i: isize) {} fn foo() { // Here, i is *copied* into the proc (heap closure). diff --git a/src/test/run-pass/kinds-in-metadata.rs b/src/test/run-pass/kinds-in-metadata.rs index 05c6cb7f5ac..84c5da1ad6c 100644 --- a/src/test/run-pass/kinds-in-metadata.rs +++ b/src/test/run-pass/kinds-in-metadata.rs @@ -22,5 +22,5 @@ extern crate kinds_in_metadata; use kinds_in_metadata::f; pub fn main() { - f::(); + f::(); } diff --git a/src/test/run-pass/lambda-infer-unresolved.rs b/src/test/run-pass/lambda-infer-unresolved.rs index 3c2a3f355b4..fca700f6e4a 100644 --- a/src/test/run-pass/lambda-infer-unresolved.rs +++ b/src/test/run-pass/lambda-infer-unresolved.rs @@ -12,11 +12,11 @@ // resolved when we finish typechecking the ||. -struct Refs { refs: Vec , n: int } +struct Refs { refs: Vec , n: isize } pub fn main() { let mut e = Refs{refs: vec!(), n: 0}; let _f = || println!("{}", e.n); - let x: &[int] = &e.refs; + let x: &[isize] = &e.refs; assert_eq!(x.len(), 0); } diff --git a/src/test/run-pass/lambda-var-hygiene.rs b/src/test/run-pass/lambda-var-hygiene.rs index a6060bebbc5..e5bdca1a067 100644 --- a/src/test/run-pass/lambda-var-hygiene.rs +++ b/src/test/run-pass/lambda-var-hygiene.rs @@ -15,7 +15,7 @@ macro_rules! bad_macro { ($ex:expr) => ({(|_x| { $ex }) (9) }) } -fn takes_x(_x : int) { +fn takes_x(_x : isize) { assert_eq!(bad_macro!(_x),8); } fn main() { diff --git a/src/test/run-pass/lang-item-public.rs b/src/test/run-pass/lang-item-public.rs index 6f5ded6c475..966ab4d260f 100644 --- a/src/test/run-pass/lang-item-public.rs +++ b/src/test/run-pass/lang-item-public.rs @@ -45,6 +45,6 @@ extern {} extern {} #[start] -fn main(_: int, _: *const *const u8) -> int { +fn main(_: isize, _: *const *const u8) -> isize { 1 % 1 } diff --git a/src/test/run-pass/large-records.rs b/src/test/run-pass/large-records.rs index 6824d9a1cce..e9c66093fb0 100644 --- a/src/test/run-pass/large-records.rs +++ b/src/test/run-pass/large-records.rs @@ -14,18 +14,18 @@ // pretty-expanded FIXME #23616 -struct Large {a: int, - b: int, - c: int, - d: int, - e: int, - f: int, - g: int, - h: int, - i: int, - j: int, - k: int, - l: int} +struct Large {a: isize, + b: isize, + c: isize, + d: isize, + e: isize, + f: isize, + g: isize, + h: isize, + i: isize, + j: isize, + k: isize, + l: isize} fn f() { let _foo: Large = Large {a: 0, diff --git a/src/test/run-pass/last-use-is-capture.rs b/src/test/run-pass/last-use-is-capture.rs index 7b11aae168c..35a17150787 100644 --- a/src/test/run-pass/last-use-is-capture.rs +++ b/src/test/run-pass/last-use-is-capture.rs @@ -13,7 +13,7 @@ #![allow(unknown_features)] #![feature(box_syntax)] -struct A { a: Box } +struct A { a: Box } pub fn main() { fn invoke(f: F) where F: FnOnce() { f(); } diff --git a/src/test/run-pass/lazy-and-or.rs b/src/test/run-pass/lazy-and-or.rs index 559c9e78945..500de64ae83 100644 --- a/src/test/run-pass/lazy-and-or.rs +++ b/src/test/run-pass/lazy-and-or.rs @@ -8,12 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn incr(x: &mut int) -> bool { *x += 1; assert!((false)); return false; } +fn incr(x: &mut isize) -> bool { *x += 1; assert!((false)); return false; } pub fn main() { let x = 1 == 2 || 3 == 3; assert!((x)); - let mut y: int = 10; + let mut y: isize = 10; println!("{}", x || incr(&mut y)); assert_eq!(y, 10); if true && x { assert!((true)); } else { assert!((false)); } diff --git a/src/test/run-pass/lazy-init.rs b/src/test/run-pass/lazy-init.rs index 60f7689ecfa..d71d7e751a0 100644 --- a/src/test/run-pass/lazy-init.rs +++ b/src/test/run-pass/lazy-init.rs @@ -10,6 +10,6 @@ -fn foo(x: int) { println!("{}", x); } +fn foo(x: isize) { println!("{}", x); } -pub fn main() { let mut x: int; if 1 > 2 { x = 12; } else { x = 10; } foo(x); } +pub fn main() { let mut x: isize; if 1 > 2 { x = 12; } else { x = 10; } foo(x); } diff --git a/src/test/run-pass/leak-unique-as-tydesc.rs b/src/test/run-pass/leak-unique-as-tydesc.rs index fe89d52bcb3..30838b3121a 100644 --- a/src/test/run-pass/leak-unique-as-tydesc.rs +++ b/src/test/run-pass/leak-unique-as-tydesc.rs @@ -15,4 +15,4 @@ fn leaky(_t: T) { } -pub fn main() { let x = box 10; leaky::>(x); } +pub fn main() { let x = box 10; leaky::>(x); } diff --git a/src/test/run-pass/let-assignability.rs b/src/test/run-pass/let-assignability.rs index 1500edce779..c53bc83ef6b 100644 --- a/src/test/run-pass/let-assignability.rs +++ b/src/test/run-pass/let-assignability.rs @@ -13,7 +13,7 @@ fn f() { let a: Box<_> = box 1; - let b: &int = &*a; + let b: &isize = &*a; println!("{}", b); } diff --git a/src/test/run-pass/linear-for-loop.rs b/src/test/run-pass/linear-for-loop.rs index 22a29279a67..80bd15578d1 100644 --- a/src/test/run-pass/linear-for-loop.rs +++ b/src/test/run-pass/linear-for-loop.rs @@ -17,7 +17,7 @@ pub fn main() { println!("{}", y); assert_eq!(y, 6); let s = "hello there".to_string(); - let mut i: int = 0; + let mut i: isize = 0; for c in s.bytes() { if i == 0 { assert!((c == 'h' as u8)); } if i == 1 { assert!((c == 'e' as u8)); } diff --git a/src/test/run-pass/link-section.rs b/src/test/run-pass/link-section.rs index 38b5a858aff..3336ce7e723 100644 --- a/src/test/run-pass/link-section.rs +++ b/src/test/run-pass/link-section.rs @@ -16,11 +16,11 @@ fn i_live_in_more_text() -> &'static str { #[cfg(not(target_os = "macos"))] #[link_section=".imm"] -static magic: uint = 42; +static magic: usize = 42; #[cfg(not(target_os = "macos"))] #[link_section=".mut"] -static mut frobulator: uint = 0xdeadbeef; +static mut frobulator: usize = 0xdeadbeef; #[cfg(target_os = "macos")] #[link_section="__TEXT,__moretext"] @@ -30,11 +30,11 @@ fn i_live_in_more_text() -> &'static str { #[cfg(target_os = "macos")] #[link_section="__RODATA,__imm"] -static magic: uint = 42; +static magic: usize = 42; #[cfg(target_os = "macos")] #[link_section="__DATA,__mut"] -static mut frobulator: uint = 0xdeadbeef; +static mut frobulator: usize = 0xdeadbeef; pub fn main() { unsafe { diff --git a/src/test/run-pass/linkage-visibility.rs b/src/test/run-pass/linkage-visibility.rs index 3c238d3fe78..509ff77655e 100644 --- a/src/test/run-pass/linkage-visibility.rs +++ b/src/test/run-pass/linkage-visibility.rs @@ -18,6 +18,6 @@ extern crate "linkage-visibility" as foo; pub fn main() { foo::test(); - foo::foo2::(); + foo::foo2::(); foo::foo(); } diff --git a/src/test/run-pass/linkage1.rs b/src/test/run-pass/linkage1.rs index 5cd741350d5..5e765bb4c3c 100644 --- a/src/test/run-pass/linkage1.rs +++ b/src/test/run-pass/linkage1.rs @@ -18,9 +18,9 @@ extern crate "linkage1" as other; extern { #[linkage = "extern_weak"] - static foo: *const int; + static foo: *const isize; #[linkage = "extern_weak"] - static something_that_should_never_exist: *mut int; + static something_that_should_never_exist: *mut isize; } fn main() { diff --git a/src/test/run-pass/lint-non-camel-case-types-non-uppercase-statics-unicode.rs b/src/test/run-pass/lint-non-camel-case-types-non-uppercase-statics-unicode.rs index 061f7025527..6ddaee9c8bd 100644 --- a/src/test/run-pass/lint-non-camel-case-types-non-uppercase-statics-unicode.rs +++ b/src/test/run-pass/lint-non-camel-case-types-non-uppercase-statics-unicode.rs @@ -20,6 +20,6 @@ struct ヒ; -static ラ: uint = 0; +static ラ: usize = 0; pub fn main() {} diff --git a/src/test/run-pass/lint-non-camel-case-with-trailing-underscores.rs b/src/test/run-pass/lint-non-camel-case-with-trailing-underscores.rs index 37de5745bb4..3b4bd001e8d 100644 --- a/src/test/run-pass/lint-non-camel-case-with-trailing-underscores.rs +++ b/src/test/run-pass/lint-non-camel-case-with-trailing-underscores.rs @@ -13,6 +13,6 @@ // pretty-expanded FIXME #23616 #[forbid(non_camel_case_types)] -type Foo_ = int; +type Foo_ = isize; pub fn main() { } diff --git a/src/test/run-pass/lint-non-uppercase-statics-lowercase-mut-statics.rs b/src/test/run-pass/lint-non-uppercase-statics-lowercase-mut-statics.rs index b530a3facaf..aa5b3834c01 100644 --- a/src/test/run-pass/lint-non-uppercase-statics-lowercase-mut-statics.rs +++ b/src/test/run-pass/lint-non-uppercase-statics-lowercase-mut-statics.rs @@ -14,6 +14,6 @@ #![forbid(non_camel_case_types)] #![forbid(non_upper_case_globals)] -static mut bar: int = 2; +static mut bar: isize = 2; pub fn main() {} diff --git a/src/test/run-pass/list.rs b/src/test/run-pass/list.rs index dfd2d191d49..8f0cbf96b60 100644 --- a/src/test/run-pass/list.rs +++ b/src/test/run-pass/list.rs @@ -13,6 +13,6 @@ #![allow(unknown_features)] #![feature(box_syntax)] -enum list { cons(int, Box), nil, } +enum list { cons(isize, Box), nil, } pub fn main() { list::cons(10, box list::cons(11, box list::cons(12, box list::nil))); } diff --git a/src/test/run-pass/liveness-assign-imm-local-after-loop.rs b/src/test/run-pass/liveness-assign-imm-local-after-loop.rs index ce6f77633db..df89809ef1f 100644 --- a/src/test/run-pass/liveness-assign-imm-local-after-loop.rs +++ b/src/test/run-pass/liveness-assign-imm-local-after-loop.rs @@ -15,7 +15,7 @@ #![allow(unused_variable)] fn test(_cond: bool) { - let v: int; + let v: isize; v = 1; loop { } // loop never terminates, so no error is reported v = 2; diff --git a/src/test/run-pass/liveness-assign-imm-local-after-ret.rs b/src/test/run-pass/liveness-assign-imm-local-after-ret.rs index f10d851a463..6fc15478f7a 100644 --- a/src/test/run-pass/liveness-assign-imm-local-after-ret.rs +++ b/src/test/run-pass/liveness-assign-imm-local-after-ret.rs @@ -13,7 +13,7 @@ #![allow(unreachable_code)] fn test() { - let _v: int; + let _v: isize; _v = 1; return; _v = 2; //~ WARNING: unreachable statement diff --git a/src/test/run-pass/liveness-move-in-loop.rs b/src/test/run-pass/liveness-move-in-loop.rs index 4f1b6f3b925..f9bb45ee400 100644 --- a/src/test/run-pass/liveness-move-in-loop.rs +++ b/src/test/run-pass/liveness-move-in-loop.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 -fn take(x: int) -> int {x} +fn take(x: isize) -> isize {x} fn the_loop() { let mut list = Vec::new(); diff --git a/src/test/run-pass/log-knows-the-names-of-variants-in-std.rs b/src/test/run-pass/log-knows-the-names-of-variants-in-std.rs index c4b45ae0f0e..1991e2b178d 100644 --- a/src/test/run-pass/log-knows-the-names-of-variants-in-std.rs +++ b/src/test/run-pass/log-knows-the-names-of-variants-in-std.rs @@ -10,7 +10,7 @@ #[derive(Clone, Debug)] enum foo { - a(uint), + a(usize), b(String), } diff --git a/src/test/run-pass/logging-only-prints-once.rs b/src/test/run-pass/logging-only-prints-once.rs index b03c4b5ff47..575f087d833 100644 --- a/src/test/run-pass/logging-only-prints-once.rs +++ b/src/test/run-pass/logging-only-prints-once.rs @@ -15,7 +15,7 @@ use std::cell::Cell; use std::fmt; use std::thread; -struct Foo(Cell); +struct Foo(Cell); impl fmt::Debug for Foo { fn fmt(&self, _fmt: &mut fmt::Formatter) -> fmt::Result { diff --git a/src/test/run-pass/logging-right-crate.rs b/src/test/run-pass/logging-right-crate.rs index 63993182a42..7caeeb40124 100644 --- a/src/test/run-pass/logging-right-crate.rs +++ b/src/test/run-pass/logging-right-crate.rs @@ -27,5 +27,5 @@ extern crate logging_right_crate; pub fn main() { // this function panicks if logging is turned on - logging_right_crate::foo::(); + logging_right_crate::foo::(); } diff --git a/src/test/run-pass/long-while.rs b/src/test/run-pass/long-while.rs index 2c2c2be39a4..6e0f1bb87a5 100644 --- a/src/test/run-pass/long-while.rs +++ b/src/test/run-pass/long-while.rs @@ -13,7 +13,7 @@ #![allow(unused_variable)] pub fn main() { - let mut i: int = 0; + let mut i: isize = 0; while i < 1000000 { i += 1; let x = 3; diff --git a/src/test/run-pass/macro-2.rs b/src/test/run-pass/macro-2.rs index 80b2f408c19..d582fc3b721 100644 --- a/src/test/run-pass/macro-2.rs +++ b/src/test/run-pass/macro-2.rs @@ -14,7 +14,7 @@ pub fn main() { macro_rules! mylambda_tt { ($x:ident, $body:expr) => ({ - fn f($x: int) -> int { return $body; }; + fn f($x: isize) -> isize { return $body; }; f }) } diff --git a/src/test/run-pass/macro-crate-use.rs b/src/test/run-pass/macro-crate-use.rs index 38f646b79a5..557f982713a 100644 --- a/src/test/run-pass/macro-crate-use.rs +++ b/src/test/run-pass/macro-crate-use.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -pub fn increment(x: uint) -> uint { +pub fn increment(x: usize) -> usize { x + 1 } diff --git a/src/test/run-pass/macro-interpolation.rs b/src/test/run-pass/macro-interpolation.rs index 9782ee146fc..e6b5d50b36e 100644 --- a/src/test/run-pass/macro-interpolation.rs +++ b/src/test/run-pass/macro-interpolation.rs @@ -25,7 +25,7 @@ macro_rules! overly_complicated { } pub fn main() { - assert!(overly_complicated!(f, x, Option, { return Some(x); }, + assert!(overly_complicated!(f, x, Option, { return Some(x); }, Some(8), Some(y), y) == 8) } diff --git a/src/test/run-pass/macro-method-issue-4621.rs b/src/test/run-pass/macro-method-issue-4621.rs index d20777aadc4..cb154045977 100644 --- a/src/test/run-pass/macro-method-issue-4621.rs +++ b/src/test/run-pass/macro-method-issue-4621.rs @@ -12,7 +12,7 @@ struct A; -macro_rules! make_thirteen_method {() => (fn thirteen(&self)->int {13})} +macro_rules! make_thirteen_method {() => (fn thirteen(&self)->isize {13})} impl A { make_thirteen_method!(); } fn main() { diff --git a/src/test/run-pass/macro-pat.rs b/src/test/run-pass/macro-pat.rs index 15387f908b4..659113d4e0c 100644 --- a/src/test/run-pass/macro-pat.rs +++ b/src/test/run-pass/macro-pat.rs @@ -40,7 +40,7 @@ macro_rules! ident_pat { ) } -fn f(c: Option) -> uint { +fn f(c: Option) -> usize { match c { Some('x') => 1, mypat!() => 2, diff --git a/src/test/run-pass/macro-path.rs b/src/test/run-pass/macro-path.rs index 072bc84fb63..2e880622977 100644 --- a/src/test/run-pass/macro-path.rs +++ b/src/test/run-pass/macro-path.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 mod m { - pub type t = int; + pub type t = isize; } macro_rules! foo { diff --git a/src/test/run-pass/macro-stmt.rs b/src/test/run-pass/macro-stmt.rs index 3aa02987098..0d8b86012d6 100644 --- a/src/test/run-pass/macro-stmt.rs +++ b/src/test/run-pass/macro-stmt.rs @@ -12,7 +12,7 @@ macro_rules! myfn { ( $f:ident, ( $( $x:ident ),* ), $body:block ) => ( - fn $f( $( $x : int),* ) -> int $body + fn $f( $( $x : isize),* ) -> isize $body ) } diff --git a/src/test/run-pass/match-arm-statics.rs b/src/test/run-pass/match-arm-statics.rs index b9b78012c3d..e21f89aee43 100644 --- a/src/test/run-pass/match-arm-statics.rs +++ b/src/test/run-pass/match-arm-statics.rs @@ -39,7 +39,7 @@ const VARIANT2_NORTH: EnumWithStructVariants = EnumWithStructVariants::Variant2 pub mod glfw { #[derive(Copy)] - pub struct InputState(uint); + pub struct InputState(usize); pub const RELEASE : InputState = InputState(0); pub const PRESS : InputState = InputState(1); @@ -101,7 +101,7 @@ fn issue_13731() { fn issue_15393() { #![allow(dead_code)] struct Flags { - bits: uint + bits: usize } const FOO: Flags = Flags { bits: 0x01 }; diff --git a/src/test/run-pass/match-bot-2.rs b/src/test/run-pass/match-bot-2.rs index 00804634ea8..4fa951b3479 100644 --- a/src/test/run-pass/match-bot-2.rs +++ b/src/test/run-pass/match-bot-2.rs @@ -11,5 +11,5 @@ // n.b. This was only ever failing with optimization disabled. // pretty-expanded FIXME #23616 -fn a() -> int { match return 1 { 2 => 3, _ => panic!() } } +fn a() -> isize { match return 1 { 2 => 3, _ => panic!() } } pub fn main() { a(); } diff --git a/src/test/run-pass/match-bot.rs b/src/test/run-pass/match-bot.rs index 74cf3faea46..7745410fa43 100644 --- a/src/test/run-pass/match-bot.rs +++ b/src/test/run-pass/match-bot.rs @@ -10,7 +10,7 @@ pub fn main() { - let i: int = - match Some::(3) { None:: => { panic!() } Some::(_) => { 5 } }; + let i: isize = + match Some::(3) { None:: => { panic!() } Some::(_) => { 5 } }; println!("{}", i); } diff --git a/src/test/run-pass/match-enum-struct-0.rs b/src/test/run-pass/match-enum-struct-0.rs index 5bd8db7b17b..06d19cec185 100644 --- a/src/test/run-pass/match-enum-struct-0.rs +++ b/src/test/run-pass/match-enum-struct-0.rs @@ -13,7 +13,7 @@ // pretty-expanded FIXME #23616 enum E { - Foo{f : int}, + Foo{f : isize}, Bar } diff --git a/src/test/run-pass/match-enum-struct-1.rs b/src/test/run-pass/match-enum-struct-1.rs index 1224a5dd314..e4766f32a57 100644 --- a/src/test/run-pass/match-enum-struct-1.rs +++ b/src/test/run-pass/match-enum-struct-1.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 enum E { - Foo{f : int}, + Foo{f : isize}, Bar } diff --git a/src/test/run-pass/match-implicit-copy-unique.rs b/src/test/run-pass/match-implicit-copy-unique.rs index a49f7bcebcf..d481c02eb41 100644 --- a/src/test/run-pass/match-implicit-copy-unique.rs +++ b/src/test/run-pass/match-implicit-copy-unique.rs @@ -13,7 +13,7 @@ #![allow(unknown_features)] #![feature(box_syntax)] -struct Pair { a: Box, b: Box } +struct Pair { a: Box, b: Box } pub fn main() { let mut x: Box<_> = box Pair {a: box 10, b: box 20}; diff --git a/src/test/run-pass/match-in-macro.rs b/src/test/run-pass/match-in-macro.rs index 374b1b54e0b..27bbbc936ae 100644 --- a/src/test/run-pass/match-in-macro.rs +++ b/src/test/run-pass/match-in-macro.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 enum Foo { - B { b1: int, bb1: int}, + B { b1: isize, bb1: isize}, } macro_rules! match_inside_expansion { diff --git a/src/test/run-pass/match-join.rs b/src/test/run-pass/match-join.rs index a9039885296..b47732b325a 100644 --- a/src/test/run-pass/match-join.rs +++ b/src/test/run-pass/match-join.rs @@ -9,8 +9,8 @@ // except according to those terms. fn foo(y: Option) { - let mut x: int; - let mut rs: Vec = Vec::new(); + let mut x: isize; + let mut rs: Vec = Vec::new(); /* tests that x doesn't get put in the precondition for the entire if expression */ @@ -25,4 +25,4 @@ fn foo(y: Option) { return; } -pub fn main() { println!("hello"); foo::(Some::(5)); } +pub fn main() { println!("hello"); foo::(Some::(5)); } diff --git a/src/test/run-pass/match-naked-record-expr.rs b/src/test/run-pass/match-naked-record-expr.rs index 0e6bb1e62a5..e558e88e03d 100644 --- a/src/test/run-pass/match-naked-record-expr.rs +++ b/src/test/run-pass/match-naked-record-expr.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -struct X { x: int } +struct X { x: isize } pub fn main() { let _x = match 0 { diff --git a/src/test/run-pass/match-naked-record.rs b/src/test/run-pass/match-naked-record.rs index d8422ba6917..a2b35e6558c 100644 --- a/src/test/run-pass/match-naked-record.rs +++ b/src/test/run-pass/match-naked-record.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -struct X { x: int } +struct X { x: isize } pub fn main() { let _x = match 0 { diff --git a/src/test/run-pass/match-pattern-lit.rs b/src/test/run-pass/match-pattern-lit.rs index 4265d0a5406..33c77f33c44 100644 --- a/src/test/run-pass/match-pattern-lit.rs +++ b/src/test/run-pass/match-pattern-lit.rs @@ -10,7 +10,7 @@ -fn altlit(f: int) -> int { +fn altlit(f: isize) -> isize { match f { 10 => { println!("case 10"); return 20; } 11 => { println!("case 11"); return 22; } diff --git a/src/test/run-pass/match-pattern-no-type-params.rs b/src/test/run-pass/match-pattern-no-type-params.rs index d76c8faa5b6..ccf23b87ea3 100644 --- a/src/test/run-pass/match-pattern-no-type-params.rs +++ b/src/test/run-pass/match-pattern-no-type-params.rs @@ -10,7 +10,7 @@ enum maybe { nothing, just(T), } -fn foo(x: maybe) { +fn foo(x: maybe) { match x { maybe::nothing => { println!("A"); } maybe::just(_a) => { println!("B"); } diff --git a/src/test/run-pass/match-pattern-simple.rs b/src/test/run-pass/match-pattern-simple.rs index f8a6e475a3b..8e729e2eab3 100644 --- a/src/test/run-pass/match-pattern-simple.rs +++ b/src/test/run-pass/match-pattern-simple.rs @@ -12,6 +12,6 @@ // pretty-expanded FIXME #23616 -fn altsimple(f: int) { match f { _x => () } } +fn altsimple(f: isize) { match f { _x => () } } pub fn main() { } diff --git a/src/test/run-pass/match-phi.rs b/src/test/run-pass/match-phi.rs index 5e15c642b67..ac070cb1f25 100644 --- a/src/test/run-pass/match-phi.rs +++ b/src/test/run-pass/match-phi.rs @@ -15,7 +15,7 @@ enum thing { a, b, c, } -fn foo(it: F) where F: FnOnce(int) { it(10); } +fn foo(it: F) where F: FnOnce(isize) { it(10); } pub fn main() { let mut x = true; diff --git a/src/test/run-pass/match-range-static.rs b/src/test/run-pass/match-range-static.rs index 56e6f4dce59..9aafcda1b02 100644 --- a/src/test/run-pass/match-range-static.rs +++ b/src/test/run-pass/match-range-static.rs @@ -10,8 +10,8 @@ // pretty-expanded FIXME #23616 -const s: int = 1; -const e: int = 42; +const s: isize = 1; +const e: isize = 42; pub fn main() { match 7 { diff --git a/src/test/run-pass/match-ref-binding-mut.rs b/src/test/run-pass/match-ref-binding-mut.rs index 9dfe079c8a8..26c91e1703c 100644 --- a/src/test/run-pass/match-ref-binding-mut.rs +++ b/src/test/run-pass/match-ref-binding-mut.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 struct Rec { - f: int + f: isize } fn destructure(x: &mut Rec) { diff --git a/src/test/run-pass/match-ref-binding.rs b/src/test/run-pass/match-ref-binding.rs index 03d5c6817e4..826edb30b36 100644 --- a/src/test/run-pass/match-ref-binding.rs +++ b/src/test/run-pass/match-ref-binding.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -fn destructure(x: Option) -> int { +fn destructure(x: Option) -> isize { match x { None => 0, Some(ref v) => *v diff --git a/src/test/run-pass/match-static-const-rename.rs b/src/test/run-pass/match-static-const-rename.rs index 433ef8a6319..21b806f80de 100644 --- a/src/test/run-pass/match-static-const-rename.rs +++ b/src/test/run-pass/match-static-const-rename.rs @@ -20,7 +20,7 @@ #![deny(non_upper_case_globals)] -pub const A : int = 97; +pub const A : isize = 97; fn f() { let r = match (0,0) { @@ -37,7 +37,7 @@ fn f() { mod m { #[allow(non_upper_case_globals)] - pub const aha : int = 7; + pub const aha : isize = 7; } fn g() { diff --git a/src/test/run-pass/match-struct-0.rs b/src/test/run-pass/match-struct-0.rs index e550b354d40..450b310b8f4 100644 --- a/src/test/run-pass/match-struct-0.rs +++ b/src/test/run-pass/match-struct-0.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 struct Foo{ - f : int, + f : isize, } pub fn main() { diff --git a/src/test/run-pass/match-tag.rs b/src/test/run-pass/match-tag.rs index 4a04fd55df5..82d29f9050b 100644 --- a/src/test/run-pass/match-tag.rs +++ b/src/test/run-pass/match-tag.rs @@ -14,13 +14,13 @@ // pretty-expanded FIXME #23616 enum color { - rgb(int, int, int), - rgba(int, int, int, int), - hsl(int, int, int), + rgb(isize, isize, isize), + rgba(isize, isize, isize, isize), + hsl(isize, isize, isize), } -fn process(c: color) -> int { - let mut x: int; +fn process(c: color) -> isize { + let mut x: isize; match c { color::rgb(r, _, _) => { x = r; } color::rgba(_, _, _, a) => { x = a; } diff --git a/src/test/run-pass/match-value-binding-in-guard-3291.rs b/src/test/run-pass/match-value-binding-in-guard-3291.rs index e008874e6d7..d4f4f3bb27e 100644 --- a/src/test/run-pass/match-value-binding-in-guard-3291.rs +++ b/src/test/run-pass/match-value-binding-in-guard-3291.rs @@ -13,7 +13,7 @@ #![allow(unknown_features)] #![feature(box_syntax)] -fn foo(x: Option>, b: bool) -> int { +fn foo(x: Option>, b: bool) -> isize { match x { None => { 1 } Some(ref x) if b => { *x.clone() } diff --git a/src/test/run-pass/match-vec-alternatives.rs b/src/test/run-pass/match-vec-alternatives.rs index 520c2e8108d..c11eedd3971 100644 --- a/src/test/run-pass/match-vec-alternatives.rs +++ b/src/test/run-pass/match-vec-alternatives.rs @@ -59,22 +59,22 @@ fn match_nested_vecs_snoc<'a, T>(l1: Option<&'a [T]>, l2: Result<&'a [T], ()>) - fn main() { assert_eq!(match_vecs(&[1, 2], &[2, 3]), "both non-empty"); assert_eq!(match_vecs(&[], &[1, 2, 3, 4]), "one empty"); - assert_eq!(match_vecs::(&[], &[]), "both empty"); + assert_eq!(match_vecs::(&[], &[]), "both empty"); assert_eq!(match_vecs(&[1, 2, 3], &[]), "one empty"); assert_eq!(match_vecs_cons(&[1, 2], &[2, 3]), "both non-empty"); assert_eq!(match_vecs_cons(&[], &[1, 2, 3, 4]), "one empty"); - assert_eq!(match_vecs_cons::(&[], &[]), "both empty"); + assert_eq!(match_vecs_cons::(&[], &[]), "both empty"); assert_eq!(match_vecs_cons(&[1, 2, 3], &[]), "one empty"); assert_eq!(match_vecs_snoc(&[1, 2], &[2, 3]), "both non-empty"); assert_eq!(match_vecs_snoc(&[], &[1, 2, 3, 4]), "one empty"); - assert_eq!(match_vecs_snoc::(&[], &[]), "both empty"); + assert_eq!(match_vecs_snoc::(&[], &[]), "both empty"); assert_eq!(match_vecs_snoc(&[1, 2, 3], &[]), "one empty"); assert_eq!(match_nested_vecs_cons(None, Ok::<&[_], ()>(&[4_usize, 2_usize])), "None, Ok(at least two elements)"); - assert_eq!(match_nested_vecs_cons::(None, Err(())), "None, Ok(less than one element)"); + assert_eq!(match_nested_vecs_cons::(None, Err(())), "None, Ok(less than one element)"); assert_eq!(match_nested_vecs_cons::(Some::<&[_]>(&[]), Ok::<&[_], ()>(&[])), "Some(empty), Ok(empty)"); assert_eq!(match_nested_vecs_cons(Some::<&[_]>(&[1]), Err(())), "Some(non-empty), any"); @@ -83,7 +83,7 @@ fn main() { assert_eq!(match_nested_vecs_snoc(None, Ok::<&[_], ()>(&[4_usize, 2_usize])), "None, Ok(at least two elements)"); - assert_eq!(match_nested_vecs_snoc::(None, Err(())), "None, Ok(less than one element)"); + assert_eq!(match_nested_vecs_snoc::(None, Err(())), "None, Ok(less than one element)"); assert_eq!(match_nested_vecs_snoc::(Some::<&[_]>(&[]), Ok::<&[_], ()>(&[])), "Some(empty), Ok(empty)"); assert_eq!(match_nested_vecs_snoc(Some::<&[_]>(&[1]), Err(())), "Some(non-empty), any"); diff --git a/src/test/run-pass/max-min-classes.rs b/src/test/run-pass/max-min-classes.rs index e3c375f8b0f..f0844b8e1eb 100644 --- a/src/test/run-pass/max-min-classes.rs +++ b/src/test/run-pass/max-min-classes.rs @@ -9,27 +9,27 @@ // except according to those terms. trait Product { - fn product(&self) -> int; + fn product(&self) -> isize; } struct Foo { - x: int, - y: int, + x: isize, + y: isize, } impl Foo { - pub fn sum(&self) -> int { + pub fn sum(&self) -> isize { self.x + self.y } } impl Product for Foo { - fn product(&self) -> int { + fn product(&self) -> isize { self.x * self.y } } -fn Foo(x: int, y: int) -> Foo { +fn Foo(x: isize, y: isize) -> Foo { Foo { x: x, y: y } } diff --git a/src/test/run-pass/method-attributes.rs b/src/test/run-pass/method-attributes.rs index ccf5efddebe..400ecda411e 100644 --- a/src/test/run-pass/method-attributes.rs +++ b/src/test/run-pass/method-attributes.rs @@ -23,7 +23,7 @@ trait frobable { } #[int_frobable] -impl frobable for int { +impl frobable for isize { #[frob_attr1] fn frob(&self) { #![frob_attr2] diff --git a/src/test/run-pass/method-normalize-bounds-issue-20604.rs b/src/test/run-pass/method-normalize-bounds-issue-20604.rs index 926a0c371e9..3a1ce74a64c 100644 --- a/src/test/run-pass/method-normalize-bounds-issue-20604.rs +++ b/src/test/run-pass/method-normalize-bounds-issue-20604.rs @@ -38,7 +38,7 @@ impl Hasher for SipHasher { fn finish(&self) -> u64 { 4 } } -impl Hash for int { +impl Hash for isize { fn hash(&self, h: &mut SipHasher) {} } diff --git a/src/test/run-pass/method-projection.rs b/src/test/run-pass/method-projection.rs index 496625213f7..3db72682070 100644 --- a/src/test/run-pass/method-projection.rs +++ b/src/test/run-pass/method-projection.rs @@ -19,13 +19,13 @@ trait MakeString { fn make_string(&self) -> String; } -impl MakeString for int { +impl MakeString for isize { fn make_string(&self) -> String { format!("{}", *self) } } -impl MakeString for uint { +impl MakeString for usize { fn make_string(&self) -> String { format!("{}", *self) } @@ -46,13 +46,13 @@ fn foo(f: &F) -> String { /////////////////////////////////////////////////////////////////////////// struct SomeStruct { - field: int, + field: isize, } impl Foo for SomeStruct { - type F = int; + type F = isize; - fn get(&self) -> &int { + fn get(&self) -> &isize { &self.field } } @@ -60,13 +60,13 @@ impl Foo for SomeStruct { /////////////////////////////////////////////////////////////////////////// struct SomeOtherStruct { - field: uint, + field: usize, } impl Foo for SomeOtherStruct { - type F = uint; + type F = usize; - fn get(&self) -> &uint { + fn get(&self) -> &usize { &self.field } } diff --git a/src/test/run-pass/method-self-arg.rs b/src/test/run-pass/method-self-arg.rs index 9784149c440..98ab67b05af 100644 --- a/src/test/run-pass/method-self-arg.rs +++ b/src/test/run-pass/method-self-arg.rs @@ -15,7 +15,7 @@ #![allow(unknown_features)] #![feature(box_syntax)] -static mut COUNT: uint = 1; +static mut COUNT: usize = 1; #[derive(Copy)] struct Foo; diff --git a/src/test/run-pass/method-two-trait-defer-resolution-2.rs b/src/test/run-pass/method-two-trait-defer-resolution-2.rs index 36f16f36cc0..d87ed03e94e 100644 --- a/src/test/run-pass/method-two-trait-defer-resolution-2.rs +++ b/src/test/run-pass/method-two-trait-defer-resolution-2.rs @@ -22,25 +22,25 @@ #![feature(box_syntax)] trait Foo { - fn foo(&self) -> int; + fn foo(&self) -> isize; } impl Foo for Vec { - fn foo(&self) -> int {1} + fn foo(&self) -> isize {1} } impl Foo for Vec> { - fn foo(&self) -> int {2} + fn foo(&self) -> isize {2} } -fn call_foo_copy() -> int { +fn call_foo_copy() -> isize { let mut x = Vec::new(); let y = x.foo(); x.push(0_usize); y } -fn call_foo_other() -> int { +fn call_foo_other() -> isize { let mut x: Vec> = Vec::new(); let y = x.foo(); x.push(box 0); diff --git a/src/test/run-pass/method-two-traits-distinguished-via-where-clause.rs b/src/test/run-pass/method-two-traits-distinguished-via-where-clause.rs index de8d116255b..329b77776b6 100644 --- a/src/test/run-pass/method-two-traits-distinguished-via-where-clause.rs +++ b/src/test/run-pass/method-two-traits-distinguished-via-where-clause.rs @@ -32,7 +32,7 @@ impl B for *const [T] { } fn main() { - let x: [int; 4] = [1,2,3,4]; - let xptr = x.as_slice() as *const [int]; + let x: [isize; 4] = [1,2,3,4]; + let xptr = x.as_slice() as *const [isize]; xptr.foo(); } diff --git a/src/test/run-pass/mid-path-type-params.rs b/src/test/run-pass/mid-path-type-params.rs index 602ab95b048..3055f90ee25 100644 --- a/src/test/run-pass/mid-path-type-params.rs +++ b/src/test/run-pass/mid-path-type-params.rs @@ -27,11 +27,11 @@ trait Trait { } struct S2 { - contents: int, + contents: isize, } -impl Trait for S2 { - fn new(x: int, _: U) -> S2 { +impl Trait for S2 { + fn new(x: isize, _: U) -> S2 { S2 { contents: x, } @@ -39,6 +39,6 @@ impl Trait for S2 { } pub fn main() { - let _ = S::::new::(1, 1.0); - let _: S2 = Trait::::new::(1, 1.0); + let _ = S::::new::(1, 1.0); + let _: S2 = Trait::::new::(1, 1.0); } diff --git a/src/test/run-pass/mod-inside-fn.rs b/src/test/run-pass/mod-inside-fn.rs index 60e9a2b8acb..836f2960d71 100644 --- a/src/test/run-pass/mod-inside-fn.rs +++ b/src/test/run-pass/mod-inside-fn.rs @@ -10,9 +10,9 @@ // pretty-expanded FIXME #23616 -fn f() -> int { +fn f() -> isize { mod m { - pub fn g() -> int { 720 } + pub fn g() -> isize { 720 } } m::g() diff --git a/src/test/run-pass/mod-view-items.rs b/src/test/run-pass/mod-view-items.rs index 40069c32cd9..ba23197b83c 100644 --- a/src/test/run-pass/mod-view-items.rs +++ b/src/test/run-pass/mod-view-items.rs @@ -17,7 +17,7 @@ // pretty-expanded FIXME #23616 mod m { - pub fn f() -> Vec { Vec::new() } + pub fn f() -> Vec { Vec::new() } } pub fn main() { let _x = m::f(); } diff --git a/src/test/run-pass/mod_dir_implicit_aux/mod.rs b/src/test/run-pass/mod_dir_implicit_aux/mod.rs index a3c1628725a..58c1beee3be 100644 --- a/src/test/run-pass/mod_dir_implicit_aux/mod.rs +++ b/src/test/run-pass/mod_dir_implicit_aux/mod.rs @@ -8,4 +8,4 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub fn foo() -> int { 10 } +pub fn foo() -> isize { 10 } diff --git a/src/test/run-pass/mod_dir_simple/test.rs b/src/test/run-pass/mod_dir_simple/test.rs index a3c1628725a..58c1beee3be 100644 --- a/src/test/run-pass/mod_dir_simple/test.rs +++ b/src/test/run-pass/mod_dir_simple/test.rs @@ -8,4 +8,4 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub fn foo() -> int { 10 } +pub fn foo() -> isize { 10 } diff --git a/src/test/run-pass/mod_file_aux.rs b/src/test/run-pass/mod_file_aux.rs index 4d18decdc13..b7470811f60 100644 --- a/src/test/run-pass/mod_file_aux.rs +++ b/src/test/run-pass/mod_file_aux.rs @@ -10,4 +10,4 @@ // ignore-test Not a test. Used by other tests -pub fn foo() -> int { 10 } +pub fn foo() -> isize { 10 } diff --git a/src/test/run-pass/module-qualified-struct-destructure.rs b/src/test/run-pass/module-qualified-struct-destructure.rs index 1b725d6ae21..d6844f0f4ab 100644 --- a/src/test/run-pass/module-qualified-struct-destructure.rs +++ b/src/test/run-pass/module-qualified-struct-destructure.rs @@ -12,8 +12,8 @@ mod m { pub struct S { - pub x: int, - pub y: int + pub x: isize, + pub y: isize } } diff --git a/src/test/run-pass/monad.rs b/src/test/run-pass/monad.rs index c9994e9b515..9ccb8f2e6fd 100644 --- a/src/test/run-pass/monad.rs +++ b/src/test/run-pass/monad.rs @@ -39,7 +39,7 @@ impl option_monad for Option { } } -fn transform(x: Option) -> Option { +fn transform(x: Option) -> Option { x.bind(|n| Some(*n + 1) ).bind(|n| Some(n.to_string()) ) } diff --git a/src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs b/src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs index b45805902df..12162ba9022 100644 --- a/src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs +++ b/src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs @@ -21,7 +21,7 @@ trait Serializable { fn serialize(&self, s: S); } -impl Serializable for int { +impl Serializable for isize { fn serialize(&self, _s: S) { } } @@ -33,7 +33,7 @@ impl Serializable for F { } } -impl Serializer for int { +impl Serializer for isize { } pub fn main() { diff --git a/src/test/run-pass/move-1-unique.rs b/src/test/run-pass/move-1-unique.rs index 74f474b8752..ab9770b13d4 100644 --- a/src/test/run-pass/move-1-unique.rs +++ b/src/test/run-pass/move-1-unique.rs @@ -15,12 +15,12 @@ #[derive(Clone)] struct Triple { - x: int, - y: int, - z: int, + x: isize, + y: isize, + z: isize, } -fn test(x: bool, foo: Box) -> int { +fn test(x: bool, foo: Box) -> isize { let bar = foo; let mut y: Box; if x { y = bar; } else { y = box Triple{x: 4, y: 5, z: 6}; } diff --git a/src/test/run-pass/move-2-unique.rs b/src/test/run-pass/move-2-unique.rs index 175c369e628..c65e58a7b65 100644 --- a/src/test/run-pass/move-2-unique.rs +++ b/src/test/run-pass/move-2-unique.rs @@ -13,7 +13,7 @@ #![allow(unknown_features)] #![feature(box_syntax)] -struct X { x: int, y: int, z: int } +struct X { x: isize, y: isize, z: isize } pub fn main() { let x: Box<_> = box X{x: 1, y: 2, z: 3}; diff --git a/src/test/run-pass/move-2.rs b/src/test/run-pass/move-2.rs index faf45f8ae09..054b57b2f43 100644 --- a/src/test/run-pass/move-2.rs +++ b/src/test/run-pass/move-2.rs @@ -13,6 +13,6 @@ #![allow(unknown_features)] #![feature(box_syntax)] -struct X { x: int, y: int, z: int } +struct X { x: isize, y: isize, z: isize } pub fn main() { let x: Box<_> = box X {x: 1, y: 2, z: 3}; let y = x; assert!((y.y == 2)); } diff --git a/src/test/run-pass/move-3-unique.rs b/src/test/run-pass/move-3-unique.rs index 171c455e807..6036fa26ccf 100644 --- a/src/test/run-pass/move-3-unique.rs +++ b/src/test/run-pass/move-3-unique.rs @@ -15,12 +15,12 @@ #[derive(Clone)] struct Triple { - x: int, - y: int, - z: int, + x: isize, + y: isize, + z: isize, } -fn test(x: bool, foo: Box) -> int { +fn test(x: bool, foo: Box) -> isize { let bar = foo; let mut y: Box; if x { y = bar; } else { y = box Triple {x: 4, y: 5, z: 6}; } diff --git a/src/test/run-pass/move-4-unique.rs b/src/test/run-pass/move-4-unique.rs index 94fa3dbca0e..79a1b294da9 100644 --- a/src/test/run-pass/move-4-unique.rs +++ b/src/test/run-pass/move-4-unique.rs @@ -13,7 +13,7 @@ #![allow(unknown_features)] #![feature(box_syntax)] -struct Triple {a: int, b: int, c: int} +struct Triple {a: isize, b: isize, c: isize} fn test(foo: Box) -> Box { let foo = foo; diff --git a/src/test/run-pass/move-4.rs b/src/test/run-pass/move-4.rs index 5c80e683ba4..16ef9502354 100644 --- a/src/test/run-pass/move-4.rs +++ b/src/test/run-pass/move-4.rs @@ -13,7 +13,7 @@ #![allow(unknown_features)] #![feature(box_syntax)] -struct Triple { a: int, b: int, c: int } +struct Triple { a: isize, b: isize, c: isize } fn test(foo: Box) -> Box { let foo = foo; diff --git a/src/test/run-pass/move-arg-2-unique.rs b/src/test/run-pass/move-arg-2-unique.rs index fd13db560e0..7aec948c8d4 100644 --- a/src/test/run-pass/move-arg-2-unique.rs +++ b/src/test/run-pass/move-arg-2-unique.rs @@ -13,7 +13,7 @@ #![allow(unknown_features)] #![feature(box_syntax)] -fn test(foo: Box> ) { assert!(((*foo)[0] == 10)); } +fn test(foo: Box> ) { assert!(((*foo)[0] == 10)); } pub fn main() { let x = box vec!(10); diff --git a/src/test/run-pass/move-arg-2.rs b/src/test/run-pass/move-arg-2.rs index fd8eddd0c1c..69b66d81e43 100644 --- a/src/test/run-pass/move-arg-2.rs +++ b/src/test/run-pass/move-arg-2.rs @@ -13,7 +13,7 @@ #![allow(unknown_features)] #![feature(box_syntax)] -fn test(foo: Box>) { assert!(((*foo)[0] == 10)); } +fn test(foo: Box>) { assert!(((*foo)[0] == 10)); } pub fn main() { let x = box vec!(10); diff --git a/src/test/run-pass/move-arg.rs b/src/test/run-pass/move-arg.rs index 197f044ea78..3d9eba8c09f 100644 --- a/src/test/run-pass/move-arg.rs +++ b/src/test/run-pass/move-arg.rs @@ -10,6 +10,6 @@ // pretty-expanded FIXME #23616 -fn test(foo: int) { assert!((foo == 10)); } +fn test(foo: isize) { assert!((foo == 10)); } pub fn main() { let x = 10; test(x); } diff --git a/src/test/run-pass/move-scalar.rs b/src/test/run-pass/move-scalar.rs index a0ca9a43a5d..a5b0a8b9bf4 100644 --- a/src/test/run-pass/move-scalar.rs +++ b/src/test/run-pass/move-scalar.rs @@ -12,8 +12,8 @@ pub fn main() { - let y: int = 42; - let mut x: int; + let y: isize = 42; + let mut x: isize; x = y; assert_eq!(x, 42); } diff --git a/src/test/run-pass/multidispatch1.rs b/src/test/run-pass/multidispatch1.rs index 4243b28614c..0233a7ff485 100644 --- a/src/test/run-pass/multidispatch1.rs +++ b/src/test/run-pass/multidispatch1.rs @@ -18,11 +18,11 @@ trait MyTrait { #[derive(Copy)] struct MyType { - dummy: uint + dummy: usize } -impl MyTrait for MyType { - fn get(&self) -> uint { self.dummy } +impl MyTrait for MyType { + fn get(&self) -> usize { self.dummy } } impl MyTrait for MyType { @@ -38,6 +38,6 @@ where T : Eq + Debug, pub fn main() { let value = MyType { dummy: 256 + 22 }; - test_eq::(value, value.dummy); + test_eq::(value, value.dummy); test_eq::(value, value.dummy as u8); } diff --git a/src/test/run-pass/multidispatch2.rs b/src/test/run-pass/multidispatch2.rs index 0655552c85b..161913f6f5d 100644 --- a/src/test/run-pass/multidispatch2.rs +++ b/src/test/run-pass/multidispatch2.rs @@ -27,11 +27,11 @@ impl MyTrait for T #[derive(Copy)] struct MyType { - dummy: uint + dummy: usize } -impl MyTrait for MyType { - fn get(&self) -> uint { self.dummy } +impl MyTrait for MyType { + fn get(&self) -> usize { self.dummy } } fn test_eq(m: M, v: T) diff --git a/src/test/run-pass/mut-function-arguments.rs b/src/test/run-pass/mut-function-arguments.rs index 311eaf27da9..644e4557552 100644 --- a/src/test/run-pass/mut-function-arguments.rs +++ b/src/test/run-pass/mut-function-arguments.rs @@ -13,13 +13,13 @@ #![allow(unknown_features)] #![feature(box_syntax)] -fn f(mut y: Box) { +fn f(mut y: Box) { *y = 5; assert_eq!(*y, 5); } fn g() { - let frob = |mut q: Box| { *q = 2; assert!(*q == 2); }; + let frob = |mut q: Box| { *q = 2; assert!(*q == 2); }; let w = box 37; frob(w); diff --git a/src/test/run-pass/mut-in-ident-patterns.rs b/src/test/run-pass/mut-in-ident-patterns.rs index f97dc9a5dd7..2a8f6f1fc31 100644 --- a/src/test/run-pass/mut-in-ident-patterns.rs +++ b/src/test/run-pass/mut-in-ident-patterns.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 trait Foo { - fn foo(&self, mut x: int) -> int { + fn foo(&self, mut x: isize) -> isize { let val = x; x = 37 * x; val + x @@ -32,7 +32,7 @@ pub fn main() { assert_eq!(X.foo(2), 76); enum Bar { - Foo(int), + Foo(isize), Baz(f32, u8) } @@ -63,14 +63,14 @@ pub fn main() { } } - fn foo1((x, mut y): (f64, int), mut z: int) -> int { + fn foo1((x, mut y): (f64, isize), mut z: isize) -> isize { y = 2 * 6; - z = y + (x as int); + z = y + (x as isize); y - z } struct A { - x: int + x: isize } let A { x: mut x } = A { x: 10 }; assert_eq!(x, 10); diff --git a/src/test/run-pass/mut-vstore-expr.rs b/src/test/run-pass/mut-vstore-expr.rs index bc90a8cf0d7..503f3ce5f9b 100644 --- a/src/test/run-pass/mut-vstore-expr.rs +++ b/src/test/run-pass/mut-vstore-expr.rs @@ -11,5 +11,5 @@ // pretty-expanded FIXME #23616 pub fn main() { - let _x: &mut [int] = &mut [ 1, 2, 3 ]; + let _x: &mut [isize] = &mut [ 1, 2, 3 ]; } diff --git a/src/test/run-pass/mutable-alias-vec.rs b/src/test/run-pass/mutable-alias-vec.rs index 28dd89edd62..3f90cedca9b 100644 --- a/src/test/run-pass/mutable-alias-vec.rs +++ b/src/test/run-pass/mutable-alias-vec.rs @@ -8,16 +8,16 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn grow(v: &mut Vec ) { +fn grow(v: &mut Vec ) { v.push(1); } pub fn main() { - let mut v: Vec = Vec::new(); + let mut v: Vec = Vec::new(); grow(&mut v); grow(&mut v); grow(&mut v); let len = v.len(); println!("{}", len); - assert_eq!(len, 3 as uint); + assert_eq!(len, 3 as usize); } diff --git a/src/test/run-pass/mutual-recursion-group.rs b/src/test/run-pass/mutual-recursion-group.rs index cb2361dd569..72a8847094b 100644 --- a/src/test/run-pass/mutual-recursion-group.rs +++ b/src/test/run-pass/mutual-recursion-group.rs @@ -17,6 +17,6 @@ enum tree { children(Box), leaf(colour), } enum list { cons(Box, Box), nil, } -enum small_list { kons(int, Box), neel, } +enum small_list { kons(isize, Box), neel, } pub fn main() { } diff --git a/src/test/run-pass/namespaced-enum-emulate-flat.rs b/src/test/run-pass/namespaced-enum-emulate-flat.rs index c557d624586..0f85c20d315 100644 --- a/src/test/run-pass/namespaced-enum-emulate-flat.rs +++ b/src/test/run-pass/namespaced-enum-emulate-flat.rs @@ -15,8 +15,8 @@ use nest::{Bar, D, E, F}; pub enum Foo { A, - B(int), - C { a: int }, + B(isize), + C { a: isize }, } impl Foo { @@ -34,8 +34,8 @@ mod nest { pub enum Bar { D, - E(int), - F { a: int }, + E(isize), + F { a: isize }, } impl Bar { diff --git a/src/test/run-pass/namespaced-enum-glob-import.rs b/src/test/run-pass/namespaced-enum-glob-import.rs index 8d58cd950a8..f506ea11f84 100644 --- a/src/test/run-pass/namespaced-enum-glob-import.rs +++ b/src/test/run-pass/namespaced-enum-glob-import.rs @@ -13,8 +13,8 @@ mod m2 { pub enum Foo { A, - B(int), - C { a: int }, + B(isize), + C { a: isize }, } impl Foo { diff --git a/src/test/run-pass/namespaced-enums.rs b/src/test/run-pass/namespaced-enums.rs index a0b8109b93b..3e72f73bc48 100644 --- a/src/test/run-pass/namespaced-enums.rs +++ b/src/test/run-pass/namespaced-enums.rs @@ -12,8 +12,8 @@ enum Foo { A, - B(int), - C { a: int }, + B(isize), + C { a: isize }, } fn _foo (f: Foo) { diff --git a/src/test/run-pass/native-print-no-runtime.rs b/src/test/run-pass/native-print-no-runtime.rs index b151eddb94e..deb0b503061 100644 --- a/src/test/run-pass/native-print-no-runtime.rs +++ b/src/test/run-pass/native-print-no-runtime.rs @@ -11,7 +11,7 @@ #![feature(start)] #[start] -pub fn main(_: int, _: *const *const u8) -> int { +pub fn main(_: isize, _: *const *const u8) -> isize { println!("hello"); 0 } diff --git a/src/test/run-pass/nested-class.rs b/src/test/run-pass/nested-class.rs index 8b156ae364d..86197d44a68 100644 --- a/src/test/run-pass/nested-class.rs +++ b/src/test/run-pass/nested-class.rs @@ -12,20 +12,20 @@ pub fn main() { struct b { - i: int, + i: isize, } impl b { - fn do_stuff(&self) -> int { return 37; } + fn do_stuff(&self) -> isize { return 37; } } - fn b(i:int) -> b { + fn b(i:isize) -> b { b { i: i } } - // fn b(x:int) -> int { panic!(); } + // fn b(x:isize) -> isize { panic!(); } let z = b(42); assert_eq!(z.i, 42); diff --git a/src/test/run-pass/nested-exhaustive-match.rs b/src/test/run-pass/nested-exhaustive-match.rs index 0b30cc2cde3..e0a3b1adfe4 100644 --- a/src/test/run-pass/nested-exhaustive-match.rs +++ b/src/test/run-pass/nested-exhaustive-match.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -struct Foo { foo: bool, bar: Option, baz: int } +struct Foo { foo: bool, bar: Option, baz: isize } pub fn main() { match (Foo{foo: true, bar: Some(10), baz: 20}) { diff --git a/src/test/run-pass/nested-function-names-issue-8587.rs b/src/test/run-pass/nested-function-names-issue-8587.rs index 488a722f674..28f3438f986 100644 --- a/src/test/run-pass/nested-function-names-issue-8587.rs +++ b/src/test/run-pass/nested-function-names-issue-8587.rs @@ -18,25 +18,25 @@ pub struct X; impl X { - fn f(&self) -> int { + fn f(&self) -> isize { #[inline(never)] - fn inner() -> int { + fn inner() -> isize { 0 } inner() } - fn g(&self) -> int { + fn g(&self) -> isize { #[inline(never)] - fn inner_2() -> int { + fn inner_2() -> isize { 1 } inner_2() } - fn h(&self) -> int { + fn h(&self) -> isize { #[inline(never)] - fn inner() -> int { + fn inner() -> isize { 2 } inner() diff --git a/src/test/run-pass/nested-matchs.rs b/src/test/run-pass/nested-matchs.rs index b0ac9fb597a..46d30b68f78 100644 --- a/src/test/run-pass/nested-matchs.rs +++ b/src/test/run-pass/nested-matchs.rs @@ -11,13 +11,13 @@ fn baz() -> ! { panic!(); } fn foo() { - match Some::(5) { - Some::(_x) => { + match Some::(5) { + Some::(_x) => { let mut bar; - match None:: { None:: => { bar = 5; } _ => { baz(); } } + match None:: { None:: => { bar = 5; } _ => { baz(); } } println!("{}", bar); } - None:: => { println!("hello"); } + None:: => { println!("hello"); } } } diff --git a/src/test/run-pass/nested-pattern.rs b/src/test/run-pass/nested-pattern.rs index 14a84484f64..f9abdd56fa4 100644 --- a/src/test/run-pass/nested-pattern.rs +++ b/src/test/run-pass/nested-pattern.rs @@ -12,13 +12,13 @@ // a bug was causing this to complain about leaked memory on exit -enum t { foo(int, uint), bar(int, Option), } +enum t { foo(isize, usize), bar(isize, Option), } fn nested(o: t) { match o { - t::bar(_i, Some::(_)) => { println!("wrong pattern matched"); panic!(); } + t::bar(_i, Some::(_)) => { println!("wrong pattern matched"); panic!(); } _ => { println!("succeeded"); } } } -pub fn main() { nested(t::bar(1, None::)); } +pub fn main() { nested(t::bar(1, None::)); } diff --git a/src/test/run-pass/nested_item_main.rs b/src/test/run-pass/nested_item_main.rs index 3c0123f7519..f7adfe36695 100644 --- a/src/test/run-pass/nested_item_main.rs +++ b/src/test/run-pass/nested_item_main.rs @@ -16,5 +16,5 @@ extern crate nested_item; pub fn main() { assert_eq!(2, nested_item::foo::<()>()); - assert_eq!(2, nested_item::foo::()); + assert_eq!(2, nested_item::foo::()); } diff --git a/src/test/run-pass/new-box-syntax.rs b/src/test/run-pass/new-box-syntax.rs index 8482dd84d87..95168b1bff7 100644 --- a/src/test/run-pass/new-box-syntax.rs +++ b/src/test/run-pass/new-box-syntax.rs @@ -21,13 +21,13 @@ use std::boxed::{Box, HEAP}; struct Structure { - x: int, - y: int, + x: isize, + y: isize, } pub fn main() { - let x: Box = box(HEAP) 2; - let y: Box = box 2; - let b: Box = box()(1 + 2); + let x: Box = box(HEAP) 2; + let y: Box = box 2; + let b: Box = box()(1 + 2); let c = box()(3 + 4); } diff --git a/src/test/run-pass/new-box.rs b/src/test/run-pass/new-box.rs index 3e4665bb231..17f71c3de43 100644 --- a/src/test/run-pass/new-box.rs +++ b/src/test/run-pass/new-box.rs @@ -11,8 +11,8 @@ #![allow(unknown_features)] #![feature(box_syntax)] -fn f(x: Box) { - let y: &int = &*x; +fn f(x: Box) { + let y: &isize = &*x; println!("{}", *x); println!("{}", *y); } diff --git a/src/test/run-pass/new-impl-syntax.rs b/src/test/run-pass/new-impl-syntax.rs index bd0a53b620c..554fab53e4b 100644 --- a/src/test/run-pass/new-impl-syntax.rs +++ b/src/test/run-pass/new-impl-syntax.rs @@ -11,8 +11,8 @@ use std::fmt; struct Thingy { - x: int, - y: int + x: isize, + y: isize } impl fmt::Debug for Thingy { diff --git a/src/test/run-pass/new-style-constants.rs b/src/test/run-pass/new-style-constants.rs index fa681c81398..36d66d1e12b 100644 --- a/src/test/run-pass/new-style-constants.rs +++ b/src/test/run-pass/new-style-constants.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -static FOO: int = 3; +static FOO: isize = 3; pub fn main() { println!("{}", FOO); diff --git a/src/test/run-pass/new-style-fixed-length-vec.rs b/src/test/run-pass/new-style-fixed-length-vec.rs index e06461daed0..4d9f0394eb4 100644 --- a/src/test/run-pass/new-style-fixed-length-vec.rs +++ b/src/test/run-pass/new-style-fixed-length-vec.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -static FOO: [int; 3] = [1, 2, 3]; +static FOO: [isize; 3] = [1, 2, 3]; pub fn main() { println!("{} {} {}", FOO[0], FOO[1], FOO[2]); diff --git a/src/test/run-pass/new-unsafe-pointers.rs b/src/test/run-pass/new-unsafe-pointers.rs index db387224c38..a0d631046a6 100644 --- a/src/test/run-pass/new-unsafe-pointers.rs +++ b/src/test/run-pass/new-unsafe-pointers.rs @@ -11,6 +11,6 @@ // pretty-expanded FIXME #23616 fn main() { - let _a: *const int = 3 as *const int; - let _a: *mut int = 3 as *mut int; + let _a: *const isize = 3 as *const isize; + let _a: *mut isize = 3 as *mut isize; } diff --git a/src/test/run-pass/newlambdas.rs b/src/test/run-pass/newlambdas.rs index 0fe1227523f..c6fa7cc35fd 100644 --- a/src/test/run-pass/newlambdas.rs +++ b/src/test/run-pass/newlambdas.rs @@ -12,7 +12,7 @@ // pretty-expanded FIXME #23616 -fn f(i: int, f: F) -> int where F: FnOnce(int) -> int { f(i) } +fn f(i: isize, f: F) -> isize where F: FnOnce(isize) -> isize { f(i) } fn g(_g: G) where G: FnOnce() { } diff --git a/src/test/run-pass/newtype-struct-drop-run.rs b/src/test/run-pass/newtype-struct-drop-run.rs index ad878fe4b31..2d162ba7e33 100644 --- a/src/test/run-pass/newtype-struct-drop-run.rs +++ b/src/test/run-pass/newtype-struct-drop-run.rs @@ -16,7 +16,7 @@ use std::cell::Cell; -struct Foo<'a>(&'a Cell); +struct Foo<'a>(&'a Cell); #[unsafe_destructor] impl<'a> Drop for Foo<'a> { diff --git a/src/test/run-pass/newtype-temporary.rs b/src/test/run-pass/newtype-temporary.rs index 5952258e46c..19790a488b5 100644 --- a/src/test/run-pass/newtype-temporary.rs +++ b/src/test/run-pass/newtype-temporary.rs @@ -9,7 +9,7 @@ // except according to those terms. #[derive(PartialEq, Debug)] -struct Foo(uint); +struct Foo(usize); fn foo() -> Foo { Foo(42) diff --git a/src/test/run-pass/newtype.rs b/src/test/run-pass/newtype.rs index 869ae4a37d2..fb43f041e04 100644 --- a/src/test/run-pass/newtype.rs +++ b/src/test/run-pass/newtype.rs @@ -13,11 +13,11 @@ struct mytype(Mytype); #[derive(Copy)] struct Mytype { - compute: fn(mytype) -> int, - val: int, + compute: fn(mytype) -> isize, + val: isize, } -fn compute(i: mytype) -> int { +fn compute(i: mytype) -> isize { let mytype(m) = i; return m.val + 20; } diff --git a/src/test/run-pass/no-std-xcrate2.rs b/src/test/run-pass/no-std-xcrate2.rs index f5f34607aff..43f6b27d64f 100644 --- a/src/test/run-pass/no-std-xcrate2.rs +++ b/src/test/run-pass/no-std-xcrate2.rs @@ -30,7 +30,7 @@ pub mod linkhack { } #[start] -pub fn main(_: int, _: **u8, _: *u8) -> int { +pub fn main(_: isize, _: **u8, _: *u8) -> isize { no_std_crate::foo(); 0 } diff --git a/src/test/run-pass/non-legacy-modes.rs b/src/test/run-pass/non-legacy-modes.rs index 1eeea662383..5f1c69bb4b6 100644 --- a/src/test/run-pass/non-legacy-modes.rs +++ b/src/test/run-pass/non-legacy-modes.rs @@ -11,14 +11,14 @@ // pretty-expanded FIXME #23616 struct X { - repr: int + repr: isize } fn apply(x: T, f: F) where F: FnOnce(T) { f(x); } -fn check_int(x: int) { +fn check_int(x: isize) { assert_eq!(x, 22); } diff --git a/src/test/run-pass/nullable-pointer-ffi-compat.rs b/src/test/run-pass/nullable-pointer-ffi-compat.rs index 42cef21f884..22aa09c718a 100644 --- a/src/test/run-pass/nullable-pointer-ffi-compat.rs +++ b/src/test/run-pass/nullable-pointer-ffi-compat.rs @@ -25,13 +25,13 @@ use std::mem; #[inline(never)] -extern "C" fn foo<'a>(x: &'a int) -> Option<&'a int> { Some(x) } +extern "C" fn foo<'a>(x: &'a isize) -> Option<&'a isize> { Some(x) } -static FOO: int = 0xDEADBEE; +static FOO: isize = 0xDEADBEE; pub fn main() { unsafe { - let f: for<'a> extern "C" fn(&'a int) -> &'a int = mem::transmute(foo); + let f: for<'a> extern "C" fn(&'a isize) -> &'a isize = mem::transmute(foo); assert_eq!(*f(&FOO), FOO); } } diff --git a/src/test/run-pass/nullable-pointer-iotareduction.rs b/src/test/run-pass/nullable-pointer-iotareduction.rs index b92ae3f23ec..ad2716e00de 100644 --- a/src/test/run-pass/nullable-pointer-iotareduction.rs +++ b/src/test/run-pass/nullable-pointer-iotareduction.rs @@ -23,7 +23,7 @@ use std::{option, mem}; // trying to get assert failure messages that at least identify which case // failed. -enum E { Thing(int, T), Nothing((), ((), ()), [i8; 0]) } +enum E { Thing(isize, T), Nothing((), ((), ()), [i8; 0]) } impl E { fn is_none(&self) -> bool { match *self { @@ -31,7 +31,7 @@ impl E { E::Nothing(..) => true } } - fn get_ref(&self) -> (int, &T) { + fn get_ref(&self) -> (isize, &T) { match *self { E::Nothing(..) => panic!("E::get_ref(Nothing::<{}>)", stringify!(T)), E::Thing(x, ref y) => (x, y) @@ -76,11 +76,11 @@ macro_rules! check_type { } pub fn main() { - check_type!(&17, &int); - check_type!(box 18, Box); + check_type!(&17, &isize); + check_type!(box 18, Box); check_type!("foo".to_string(), String); - check_type!(vec!(20, 22), Vec ); - let mint: uint = unsafe { mem::transmute(main) }; + check_type!(vec!(20, 22), Vec ); + let mint: usize = unsafe { mem::transmute(main) }; check_type!(main, fn(), |pthing| { assert!(mint == unsafe { mem::transmute(*pthing) }) }); diff --git a/src/test/run-pass/nullable-pointer-size.rs b/src/test/run-pass/nullable-pointer-size.rs index 2b908a6c5b7..6e3f438575e 100644 --- a/src/test/run-pass/nullable-pointer-size.rs +++ b/src/test/run-pass/nullable-pointer-size.rs @@ -12,8 +12,8 @@ use std::mem; -enum E { Thing(int, T), Nothing((), ((), ()), [i8; 0]) } -struct S(int, T); +enum E { Thing(isize, T), Nothing((), ((), ()), [i8; 0]) } +struct S(isize, T); // These are macros so we get useful assert messages. @@ -37,7 +37,7 @@ macro_rules! check_type { } pub fn main() { - check_type!(&'static int); - check_type!(Box); + check_type!(&'static isize); + check_type!(Box); check_type!(extern fn()); } diff --git a/src/test/run-pass/nullary-or-pattern.rs b/src/test/run-pass/nullary-or-pattern.rs index 4369e4095fb..f4cfc808274 100644 --- a/src/test/run-pass/nullary-or-pattern.rs +++ b/src/test/run-pass/nullary-or-pattern.rs @@ -12,7 +12,7 @@ enum blah { a, b, } -fn or_alt(q: blah) -> int { +fn or_alt(q: blah) -> isize { match q { blah::a | blah::b => { 42 } } } diff --git a/src/test/run-pass/object-one-type-two-traits.rs b/src/test/run-pass/object-one-type-two-traits.rs index baf8c6e4c97..b1cf330c756 100644 --- a/src/test/run-pass/object-one-type-two-traits.rs +++ b/src/test/run-pass/object-one-type-two-traits.rs @@ -17,15 +17,15 @@ use std::any::Any; trait Wrap { - fn get(&self) -> int; + fn get(&self) -> isize; fn wrap(self: Box) -> Box; } -impl Wrap for int { - fn get(&self) -> int { +impl Wrap for isize { + fn get(&self) -> isize { *self } - fn wrap(self: Box) -> Box { + fn wrap(self: Box) -> Box { self as Box } } diff --git a/src/test/run-pass/objects-coerce-freeze-borrored.rs b/src/test/run-pass/objects-coerce-freeze-borrored.rs index 368842ed1b0..686924a3140 100644 --- a/src/test/run-pass/objects-coerce-freeze-borrored.rs +++ b/src/test/run-pass/objects-coerce-freeze-borrored.rs @@ -13,16 +13,16 @@ // pretty-expanded FIXME #23616 trait Foo { - fn foo(&self) -> uint; - fn bar(&mut self) -> uint; + fn foo(&self) -> usize; + fn bar(&mut self) -> usize; } -impl Foo for uint { - fn foo(&self) -> uint { +impl Foo for usize { + fn foo(&self) -> usize { *self } - fn bar(&mut self) -> uint { + fn bar(&mut self) -> usize { *self += 1; *self } @@ -36,13 +36,13 @@ fn do_it_mut(obj: &mut Foo) { do_it_imm(obj, y); } -fn do_it_imm(obj: &Foo, v: uint) { +fn do_it_imm(obj: &Foo, v: usize) { let y = obj.foo(); assert_eq!(v, y); } pub fn main() { - let mut x: uint = 22; + let mut x: usize = 22; let obj = &mut x as &mut Foo; do_it_mut(obj); do_it_imm(obj, 23); diff --git a/src/test/run-pass/objects-owned-object-borrowed-method-headerless.rs b/src/test/run-pass/objects-owned-object-borrowed-method-headerless.rs index 15ed94e62ba..9a1cdd2922f 100644 --- a/src/test/run-pass/objects-owned-object-borrowed-method-headerless.rs +++ b/src/test/run-pass/objects-owned-object-borrowed-method-headerless.rs @@ -19,15 +19,15 @@ trait FooTrait { - fn foo(&self) -> uint; + fn foo(&self) -> usize; } struct BarStruct { - x: uint + x: usize } impl FooTrait for BarStruct { - fn foo(&self) -> uint { + fn foo(&self) -> usize { self.x } } diff --git a/src/test/run-pass/objects-owned-object-owned-method.rs b/src/test/run-pass/objects-owned-object-owned-method.rs index e7206588532..4357adbf65b 100644 --- a/src/test/run-pass/objects-owned-object-owned-method.rs +++ b/src/test/run-pass/objects-owned-object-owned-method.rs @@ -18,15 +18,15 @@ #![feature(box_syntax)] trait FooTrait { - fn foo(self: Box) -> uint; + fn foo(self: Box) -> usize; } struct BarStruct { - x: uint + x: usize } impl FooTrait for BarStruct { - fn foo(self: Box) -> uint { + fn foo(self: Box) -> usize { self.x } } diff --git a/src/test/run-pass/opeq.rs b/src/test/run-pass/opeq.rs index 3f00cf7d184..f5f0928ff14 100644 --- a/src/test/run-pass/opeq.rs +++ b/src/test/run-pass/opeq.rs @@ -12,7 +12,7 @@ pub fn main() { - let mut x: int = 1; + let mut x: isize = 1; x *= 2; println!("{}", x); assert_eq!(x, 2); diff --git a/src/test/run-pass/operator-multidispatch.rs b/src/test/run-pass/operator-multidispatch.rs index 4ce6fcee8c7..af7deef11b6 100644 --- a/src/test/run-pass/operator-multidispatch.rs +++ b/src/test/run-pass/operator-multidispatch.rs @@ -15,8 +15,8 @@ use std::ops; #[derive(Debug,PartialEq,Eq)] struct Point { - x: int, - y: int + x: isize, + y: isize } impl ops::Add for Point { @@ -27,10 +27,10 @@ impl ops::Add for Point { } } -impl ops::Add for Point { +impl ops::Add for Point { type Output = Point; - fn add(self, other: int) -> Point { + fn add(self, other: isize) -> Point { Point {x: self.x + other, y: self.y + other} } diff --git a/src/test/run-pass/operator-overloading.rs b/src/test/run-pass/operator-overloading.rs index 69542042c4f..fc089839683 100644 --- a/src/test/run-pass/operator-overloading.rs +++ b/src/test/run-pass/operator-overloading.rs @@ -15,8 +15,8 @@ use std::ops; #[derive(Copy, Debug)] struct Point { - x: int, - y: int + x: isize, + y: isize } impl ops::Add for Point { @@ -52,9 +52,9 @@ impl ops::Not for Point { } impl ops::Index for Point { - type Output = int; + type Output = isize; - fn index(&self, x: bool) -> &int { + fn index(&self, x: bool) -> &isize { if x { &self.x } else { @@ -87,4 +87,4 @@ pub fn main() { result(p[true]); } -fn result(i: int) { } +fn result(i: isize) { } diff --git a/src/test/run-pass/option-unwrap.rs b/src/test/run-pass/option-unwrap.rs index b0f5d8e53bd..4902038667c 100644 --- a/src/test/run-pass/option-unwrap.rs +++ b/src/test/run-pass/option-unwrap.rs @@ -15,7 +15,7 @@ use std::cell::Cell; struct dtor<'a> { - x: &'a Cell, + x: &'a Cell, } #[unsafe_destructor] diff --git a/src/test/run-pass/or-pattern.rs b/src/test/run-pass/or-pattern.rs index 1aaef7b8174..3ab78e8d053 100644 --- a/src/test/run-pass/or-pattern.rs +++ b/src/test/run-pass/or-pattern.rs @@ -10,9 +10,9 @@ // pretty-expanded FIXME #23616 -enum blah { a(int, int, uint), b(int, int), c, } +enum blah { a(isize, isize, usize), b(isize, isize), c, } -fn or_alt(q: blah) -> int { +fn or_alt(q: blah) -> isize { match q { blah::a(x, y, _) | blah::b(x, y) => { return x + y; } blah::c => { return 0; } } } diff --git a/src/test/run-pass/order-drop-with-match.rs b/src/test/run-pass/order-drop-with-match.rs index a42720d3cb4..c8a2ba0af47 100644 --- a/src/test/run-pass/order-drop-with-match.rs +++ b/src/test/run-pass/order-drop-with-match.rs @@ -16,8 +16,8 @@ // pretty-expanded FIXME #23616 -static mut ORDER: [uint; 3] = [0, 0, 0]; -static mut INDEX: uint = 0; +static mut ORDER: [usize; 3] = [0, 0, 0]; +static mut INDEX: usize = 0; struct A; impl Drop for A { diff --git a/src/test/run-pass/out-pointer-aliasing.rs b/src/test/run-pass/out-pointer-aliasing.rs index 1a6c60426af..eb0a6c95134 100644 --- a/src/test/run-pass/out-pointer-aliasing.rs +++ b/src/test/run-pass/out-pointer-aliasing.rs @@ -12,8 +12,8 @@ #[derive(Copy)] pub struct Foo { - f1: int, - _f2: int, + f1: isize, + _f2: isize, } #[inline(never)] diff --git a/src/test/run-pass/output-slot-variants.rs b/src/test/run-pass/output-slot-variants.rs index f80fbdeb1e3..33489688d4a 100644 --- a/src/test/run-pass/output-slot-variants.rs +++ b/src/test/run-pass/output-slot-variants.rs @@ -15,12 +15,12 @@ #![allow(unknown_features)] #![feature(box_syntax)] -struct A { a: int, b: int } -struct Abox { a: Box, b: Box } +struct A { a: isize, b: isize } +struct Abox { a: Box, b: Box } -fn ret_int_i() -> int { 10 } +fn ret_int_i() -> isize { 10 } -fn ret_ext_i() -> Box { box 10 } +fn ret_ext_i() -> Box { box 10 } fn ret_int_rec() -> A { A {a: 10, b: 10} } @@ -31,8 +31,8 @@ fn ret_ext_mem() -> Abox { Abox {a: box 10, b: box 10} } fn ret_ext_ext_mem() -> Box { box Abox{a: box 10, b: box 10} } pub fn main() { - let mut int_i: int; - let mut ext_i: Box; + let mut int_i: isize; + let mut ext_i: Box; let mut int_rec: A; let mut ext_rec: Box; let mut ext_mem: Abox; diff --git a/src/test/run-pass/over-constrained-vregs.rs b/src/test/run-pass/over-constrained-vregs.rs index c2b42ac1c81..e4e07941470 100644 --- a/src/test/run-pass/over-constrained-vregs.rs +++ b/src/test/run-pass/over-constrained-vregs.rs @@ -10,7 +10,7 @@ // Regression test for issue #152. pub fn main() { - let mut b: uint = 1_usize; + let mut b: usize = 1_usize; while b < std::mem::size_of::() { 0_usize << b; b <<= 1_usize; diff --git a/src/test/run-pass/overloaded-autoderef-count.rs b/src/test/run-pass/overloaded-autoderef-count.rs index cc36b625c35..14a9cc4c248 100644 --- a/src/test/run-pass/overloaded-autoderef-count.rs +++ b/src/test/run-pass/overloaded-autoderef-count.rs @@ -13,8 +13,8 @@ use std::ops::{Deref, DerefMut}; #[derive(PartialEq)] struct DerefCounter { - count_imm: Cell, - count_mut: uint, + count_imm: Cell, + count_mut: usize, value: T } @@ -27,7 +27,7 @@ impl DerefCounter { } } - fn counts(&self) -> (uint, uint) { + fn counts(&self) -> (usize, usize) { (self.count_imm.get(), self.count_mut) } } @@ -50,12 +50,12 @@ impl DerefMut for DerefCounter { #[derive(PartialEq, Debug)] struct Point { - x: int, - y: int + x: isize, + y: isize } impl Point { - fn get(&self) -> (int, int) { + fn get(&self) -> (isize, isize) { (self.x, self.y) } } diff --git a/src/test/run-pass/overloaded-autoderef-vtable.rs b/src/test/run-pass/overloaded-autoderef-vtable.rs index f949f6e4ef4..38bf68b7469 100644 --- a/src/test/run-pass/overloaded-autoderef-vtable.rs +++ b/src/test/run-pass/overloaded-autoderef-vtable.rs @@ -35,10 +35,10 @@ impl> Deref for DerefWithHelper { } } -struct Foo {x: int} +struct Foo {x: isize} impl Foo { - fn foo(&self) -> int {self.x} + fn foo(&self) -> isize {self.x} } pub fn main() { diff --git a/src/test/run-pass/overloaded-autoderef.rs b/src/test/run-pass/overloaded-autoderef.rs index 7b956dc772f..ddd6ae4d0a0 100644 --- a/src/test/run-pass/overloaded-autoderef.rs +++ b/src/test/run-pass/overloaded-autoderef.rs @@ -17,8 +17,8 @@ use std::num::ToPrimitive; #[derive(PartialEq, Debug)] struct Point { - x: int, - y: int + x: isize, + y: isize } pub fn main() { diff --git a/src/test/run-pass/overloaded-calls-object-one-arg.rs b/src/test/run-pass/overloaded-calls-object-one-arg.rs index 7cb57a91253..291d2c6498f 100644 --- a/src/test/run-pass/overloaded-calls-object-one-arg.rs +++ b/src/test/run-pass/overloaded-calls-object-one-arg.rs @@ -13,7 +13,7 @@ // pretty-expanded FIXME #23616 -fn foo(f: &mut FnMut(int) -> int) -> int { +fn foo(f: &mut FnMut(isize) -> isize) -> isize { f(22) } diff --git a/src/test/run-pass/overloaded-calls-object-two-args.rs b/src/test/run-pass/overloaded-calls-object-two-args.rs index 65a63a33d1b..42c71572a3a 100644 --- a/src/test/run-pass/overloaded-calls-object-two-args.rs +++ b/src/test/run-pass/overloaded-calls-object-two-args.rs @@ -13,7 +13,7 @@ // pretty-expanded FIXME #23616 -fn foo(f: &mut FnMut(int, int) -> int) -> int { +fn foo(f: &mut FnMut(isize, isize) -> isize) -> isize { f(1, 2) } diff --git a/src/test/run-pass/overloaded-calls-object-zero-args.rs b/src/test/run-pass/overloaded-calls-object-zero-args.rs index 46fa0619082..9bc6c9f0428 100644 --- a/src/test/run-pass/overloaded-calls-object-zero-args.rs +++ b/src/test/run-pass/overloaded-calls-object-zero-args.rs @@ -13,7 +13,7 @@ // pretty-expanded FIXME #23616 -fn foo(f: &mut FnMut() -> int) -> int { +fn foo(f: &mut FnMut() -> isize) -> isize { f() } diff --git a/src/test/run-pass/overloaded-deref-count.rs b/src/test/run-pass/overloaded-deref-count.rs index 187b032b0f1..5f6eb87ae1b 100644 --- a/src/test/run-pass/overloaded-deref-count.rs +++ b/src/test/run-pass/overloaded-deref-count.rs @@ -15,8 +15,8 @@ use std::ops::{Deref, DerefMut}; use std::vec::Vec; struct DerefCounter { - count_imm: Cell, - count_mut: uint, + count_imm: Cell, + count_mut: usize, value: T } @@ -29,7 +29,7 @@ impl DerefCounter { } } - fn counts(&self) -> (uint, uint) { + fn counts(&self) -> (usize, usize) { (self.count_imm.get(), self.count_mut) } } diff --git a/src/test/run-pass/overloaded-deref.rs b/src/test/run-pass/overloaded-deref.rs index 20e55de2f05..6d8bb30c837 100644 --- a/src/test/run-pass/overloaded-deref.rs +++ b/src/test/run-pass/overloaded-deref.rs @@ -16,8 +16,8 @@ use std::string::String; #[derive(PartialEq, Debug)] struct Point { - x: int, - y: int + x: isize, + y: isize } pub fn main() { diff --git a/src/test/run-pass/overloaded-index-autoderef.rs b/src/test/run-pass/overloaded-index-autoderef.rs index 37de83aef33..56d71edd56c 100644 --- a/src/test/run-pass/overloaded-index-autoderef.rs +++ b/src/test/run-pass/overloaded-index-autoderef.rs @@ -18,14 +18,14 @@ use std::ops::{Index, IndexMut}; struct Foo { - x: int, - y: int, + x: isize, + y: isize, } -impl Index for Foo { - type Output = int; +impl Index for Foo { + type Output = isize; - fn index(&self, z: int) -> &int { + fn index(&self, z: isize) -> &isize { if z == 0 { &self.x } else { @@ -34,8 +34,8 @@ impl Index for Foo { } } -impl IndexMut for Foo { - fn index_mut(&mut self, z: int) -> &mut int { +impl IndexMut for Foo { + fn index_mut(&mut self, z: isize) -> &mut isize { if z == 0 { &mut self.x } else { @@ -45,14 +45,14 @@ impl IndexMut for Foo { } trait Int { - fn get(self) -> int; - fn get_from_ref(&self) -> int; + fn get(self) -> isize; + fn get_from_ref(&self) -> isize; fn inc(&mut self); } -impl Int for int { - fn get(self) -> int { self } - fn get_from_ref(&self) -> int { *self } +impl Int for isize { + fn get(self) -> isize { self } + fn get_from_ref(&self) -> isize { *self } fn inc(&mut self) { *self += 1; } } diff --git a/src/test/run-pass/overloaded-index-in-field.rs b/src/test/run-pass/overloaded-index-in-field.rs index 2370c6a2856..bc53836aca3 100644 --- a/src/test/run-pass/overloaded-index-in-field.rs +++ b/src/test/run-pass/overloaded-index-in-field.rs @@ -18,18 +18,18 @@ use std::ops::Index; struct Foo { - x: int, - y: int, + x: isize, + y: isize, } struct Bar { foo: Foo } -impl Index for Foo { - type Output = int; +impl Index for Foo { + type Output = isize; - fn index(&self, z: int) -> &int { + fn index(&self, z: isize) -> &isize { if z == 0 { &self.x } else { @@ -39,14 +39,14 @@ impl Index for Foo { } trait Int { - fn get(self) -> int; - fn get_from_ref(&self) -> int; + fn get(self) -> isize; + fn get_from_ref(&self) -> isize; fn inc(&mut self); } -impl Int for int { - fn get(self) -> int { self } - fn get_from_ref(&self) -> int { *self } +impl Int for isize { + fn get(self) -> isize { self } + fn get_from_ref(&self) -> isize { *self } fn inc(&mut self) { *self += 1; } } diff --git a/src/test/run-pass/overloaded-index.rs b/src/test/run-pass/overloaded-index.rs index 79c2b14aa93..4f8cf0e9e38 100644 --- a/src/test/run-pass/overloaded-index.rs +++ b/src/test/run-pass/overloaded-index.rs @@ -15,14 +15,14 @@ use std::ops::{Index, IndexMut}; struct Foo { - x: int, - y: int, + x: isize, + y: isize, } -impl Index for Foo { - type Output = int; +impl Index for Foo { + type Output = isize; - fn index(&self, z: int) -> &int { + fn index(&self, z: isize) -> &isize { if z == 0 { &self.x } else { @@ -31,8 +31,8 @@ impl Index for Foo { } } -impl IndexMut for Foo { - fn index_mut(&mut self, z: int) -> &mut int { +impl IndexMut for Foo { + fn index_mut(&mut self, z: isize) -> &mut isize { if z == 0 { &mut self.x } else { @@ -42,14 +42,14 @@ impl IndexMut for Foo { } trait Int { - fn get(self) -> int; - fn get_from_ref(&self) -> int; + fn get(self) -> isize; + fn get_from_ref(&self) -> isize; fn inc(&mut self); } -impl Int for int { - fn get(self) -> int { self } - fn get_from_ref(&self) -> int { *self } +impl Int for isize { + fn get(self) -> isize { self } + fn get_from_ref(&self) -> isize { *self } fn inc(&mut self) { *self += 1; } } diff --git a/src/test/run-pass/packed-struct-borrow-element.rs b/src/test/run-pass/packed-struct-borrow-element.rs index e7a662c5260..8819b201361 100644 --- a/src/test/run-pass/packed-struct-borrow-element.rs +++ b/src/test/run-pass/packed-struct-borrow-element.rs @@ -13,7 +13,7 @@ #[repr(packed)] struct Foo { bar: u8, - baz: uint + baz: usize } pub fn main() { diff --git a/src/test/run-pass/packed-struct-match.rs b/src/test/run-pass/packed-struct-match.rs index 6df761d1b21..3c3d632222e 100644 --- a/src/test/run-pass/packed-struct-match.rs +++ b/src/test/run-pass/packed-struct-match.rs @@ -13,7 +13,7 @@ #[repr(packed)] struct Foo { bar: u8, - baz: uint + baz: usize } pub fn main() { diff --git a/src/test/run-pass/panic-in-dtor-drops-fields.rs b/src/test/run-pass/panic-in-dtor-drops-fields.rs index c1ebd2a5304..4226fba9d3e 100644 --- a/src/test/run-pass/panic-in-dtor-drops-fields.rs +++ b/src/test/run-pass/panic-in-dtor-drops-fields.rs @@ -19,7 +19,7 @@ struct A { } struct B { - foo: int, + foo: isize, } impl Drop for A { diff --git a/src/test/run-pass/parameterized-trait-with-bounds.rs b/src/test/run-pass/parameterized-trait-with-bounds.rs index eb483009662..3e74341d819 100644 --- a/src/test/run-pass/parameterized-trait-with-bounds.rs +++ b/src/test/run-pass/parameterized-trait-with-bounds.rs @@ -23,7 +23,7 @@ mod foo { fn foo1(_: &(A + Send)) {} fn foo2(_: Box + Send + Sync>) {} -fn foo3(_: Box + 'static>) {} +fn foo3(_: Box + 'static>) {} fn foo4<'a, T>(_: Box + 'static + Send>) {} fn foo5<'a, T>(_: Box + 'static + Send>) {} diff --git a/src/test/run-pass/path.rs b/src/test/run-pass/path.rs index b1a761d09fd..fddc2744eb1 100644 --- a/src/test/run-pass/path.rs +++ b/src/test/run-pass/path.rs @@ -13,7 +13,7 @@ // pretty-expanded FIXME #23616 mod foo { - pub fn bar(_offset: uint) { } + pub fn bar(_offset: usize) { } } pub fn main() { foo::bar(0); } diff --git a/src/test/run-pass/pattern-bound-var-in-for-each.rs b/src/test/run-pass/pattern-bound-var-in-for-each.rs index ad12775a31d..1ab578b9332 100644 --- a/src/test/run-pass/pattern-bound-var-in-for-each.rs +++ b/src/test/run-pass/pattern-bound-var-in-for-each.rs @@ -14,7 +14,7 @@ // pretty-expanded FIXME #23616 -fn foo(src: uint) { +fn foo(src: usize) { match Some(src) { Some(src_id) => { diff --git a/src/test/run-pass/pattern-in-closure.rs b/src/test/run-pass/pattern-in-closure.rs index e4f1df2d637..909ed985d7f 100644 --- a/src/test/run-pass/pattern-in-closure.rs +++ b/src/test/run-pass/pattern-in-closure.rs @@ -9,12 +9,12 @@ // except according to those terms. struct Foo { - x: int, - y: int + x: isize, + y: isize } pub fn main() { - let f = |(x, _): (int, int)| println!("{}", x + 1); + let f = |(x, _): (isize, isize)| println!("{}", x + 1); let g = |Foo { x: x, y: _y }: Foo| println!("{}", x + 1); f((2, 3)); g(Foo { x: 1, y: 2 }); diff --git a/src/test/run-pass/pred-not-bool.rs b/src/test/run-pass/pred-not-bool.rs index d761f1610d4..f0f3d3d7bd8 100644 --- a/src/test/run-pass/pred-not-bool.rs +++ b/src/test/run-pass/pred-not-bool.rs @@ -13,6 +13,6 @@ // pretty-expanded FIXME #23616 -fn bad(_a: int) -> int { return 37; } //~ ERROR Non-boolean return type +fn bad(_a: isize) -> isize { return 37; } //~ ERROR Non-boolean return type pub fn main() { } diff --git a/src/test/run-pass/preempt.rs b/src/test/run-pass/preempt.rs index bcfc39ee7e4..7e5e41820e9 100644 --- a/src/test/run-pass/preempt.rs +++ b/src/test/run-pass/preempt.rs @@ -14,11 +14,11 @@ // note: halfway done porting to modern rust use std::comm; -fn starve_main(alive: Receiver) { +fn starve_main(alive: Receiver) { println!("signalling main"); alive.recv(); println!("starving main"); - let mut i: int = 0; + let mut i: isize = 0; loop { i += 1; } } @@ -29,7 +29,7 @@ pub fn main() { spawn(move|| { starve_main(port); }); - let mut i: int = 0; + let mut i: isize = 0; println!("main waiting for alive signal"); chan.send(i); println!("main got alive signal"); diff --git a/src/test/run-pass/private-class-field.rs b/src/test/run-pass/private-class-field.rs index 27b8d5965e9..d32ac4b9082 100644 --- a/src/test/run-pass/private-class-field.rs +++ b/src/test/run-pass/private-class-field.rs @@ -11,16 +11,16 @@ // pretty-expanded FIXME #23616 struct cat { - meows : uint, + meows : usize, - how_hungry : int, + how_hungry : isize, } impl cat { - pub fn meow_count(&mut self) -> uint { self.meows } + pub fn meow_count(&mut self) -> usize { self.meows } } -fn cat(in_x : uint, in_y : int) -> cat { +fn cat(in_x : usize, in_y : isize) -> cat { cat { meows: in_x, how_hungry: in_y diff --git a/src/test/run-pass/private-method.rs b/src/test/run-pass/private-method.rs index a15c7b58ce1..0d6e6010c56 100644 --- a/src/test/run-pass/private-method.rs +++ b/src/test/run-pass/private-method.rs @@ -11,9 +11,9 @@ // pretty-expanded FIXME #23616 struct cat { - meows : uint, + meows : usize, - how_hungry : int, + how_hungry : isize, } impl cat { @@ -27,7 +27,7 @@ impl cat { fn nap(&mut self) { for _ in 1_usize..10_usize { } } } -fn cat(in_x : uint, in_y : int) -> cat { +fn cat(in_x : usize, in_y : isize) -> cat { cat { meows: in_x, how_hungry: in_y diff --git a/src/test/run-pass/ptr-coercion.rs b/src/test/run-pass/ptr-coercion.rs index 85897f171b6..ac1b6aebec5 100644 --- a/src/test/run-pass/ptr-coercion.rs +++ b/src/test/run-pass/ptr-coercion.rs @@ -14,24 +14,24 @@ pub fn main() { // &mut -> & - let x: &mut int = &mut 42; - let x: &int = x; + let x: &mut isize = &mut 42; + let x: &isize = x; - let x: &int = &mut 42; + let x: &isize = &mut 42; // & -> *const - let x: &int = &42; - let x: *const int = x; + let x: &isize = &42; + let x: *const isize = x; - let x: *const int = &42; + let x: *const isize = &42; // &mut -> *const - let x: &mut int = &mut 42; - let x: *const int = x; + let x: &mut isize = &mut 42; + let x: *const isize = x; - let x: *const int = &mut 42; + let x: *const isize = &mut 42; // *mut -> *const - let x: *mut int = &mut 42; - let x: *const int = x; + let x: *mut isize = &mut 42; + let x: *const isize = x; } diff --git a/src/test/run-pass/pure-sum.rs b/src/test/run-pass/pure-sum.rs index 2612a21bc01..c27b95e1f13 100644 --- a/src/test/run-pass/pure-sum.rs +++ b/src/test/run-pass/pure-sum.rs @@ -15,7 +15,7 @@ #![allow(unknown_features)] #![feature(box_syntax)] -fn sums_to(v: Vec , sum: int) -> bool { +fn sums_to(v: Vec , sum: isize) -> bool { let mut i = 0; let mut sum0 = 0; while i < v.len() { @@ -25,7 +25,7 @@ fn sums_to(v: Vec , sum: int) -> bool { return sum0 == sum; } -fn sums_to_using_uniq(v: Vec , sum: int) -> bool { +fn sums_to_using_uniq(v: Vec , sum: isize) -> bool { let mut i = 0; let mut sum0: Box<_> = box 0; while i < v.len() { @@ -35,7 +35,7 @@ fn sums_to_using_uniq(v: Vec , sum: int) -> bool { return *sum0 == sum; } -fn sums_to_using_rec(v: Vec , sum: int) -> bool { +fn sums_to_using_rec(v: Vec , sum: isize) -> bool { let mut i = 0; let mut sum0 = F {f: 0}; while i < v.len() { @@ -47,7 +47,7 @@ fn sums_to_using_rec(v: Vec , sum: int) -> bool { struct F { f: T } -fn sums_to_using_uniq_rec(v: Vec , sum: int) -> bool { +fn sums_to_using_uniq_rec(v: Vec , sum: isize) -> bool { let mut i = 0; let mut sum0 = F::> {f: box 0}; while i < v.len() { diff --git a/src/test/run-pass/range.rs b/src/test/run-pass/range.rs index f2aa17d4069..4633f73b9a0 100644 --- a/src/test/run-pass/range.rs +++ b/src/test/run-pass/range.rs @@ -12,7 +12,7 @@ // pretty-expanded FIXME #23616 -fn foo() -> int { 42 } +fn foo() -> isize { 42 } // Test that range syntax works in return statements fn return_range_to() -> ::std::ops::RangeTo { return ..1; } diff --git a/src/test/run-pass/ranges-precedence.rs b/src/test/run-pass/ranges-precedence.rs index bad3621cbf0..870d7a0bc08 100644 --- a/src/test/run-pass/ranges-precedence.rs +++ b/src/test/run-pass/ranges-precedence.rs @@ -14,11 +14,11 @@ // pretty-expanded FIXME #23616 struct Foo { - foo: uint, + foo: usize, } impl Foo { - fn bar(&self) -> uint { 5 } + fn bar(&self) -> usize { 5 } } fn main() { diff --git a/src/test/run-pass/rcvr-borrowed-to-region.rs b/src/test/run-pass/rcvr-borrowed-to-region.rs index 7bc761d2f60..6e9769ea2b9 100644 --- a/src/test/run-pass/rcvr-borrowed-to-region.rs +++ b/src/test/run-pass/rcvr-borrowed-to-region.rs @@ -12,14 +12,14 @@ #![feature(box_syntax)] trait get { - fn get(self) -> int; + fn get(self) -> isize; } // Note: impl on a slice; we're checking that the pointers below -// correctly get borrowed to `&`. (similar to impling for `int`, with +// correctly get borrowed to `&`. (similar to impling for `isize`, with // `&self` instead of `self`.) -impl<'a> get for &'a int { - fn get(self) -> int { +impl<'a> get for &'a isize { + fn get(self) -> isize { return *self; } } diff --git a/src/test/run-pass/rcvr-borrowed-to-slice.rs b/src/test/run-pass/rcvr-borrowed-to-slice.rs index 6a5da014994..1ec16747181 100644 --- a/src/test/run-pass/rcvr-borrowed-to-slice.rs +++ b/src/test/run-pass/rcvr-borrowed-to-slice.rs @@ -10,17 +10,17 @@ trait sum { - fn sum_(self) -> int; + fn sum_(self) -> isize; } // Note: impl on a slice -impl<'a> sum for &'a [int] { - fn sum_(self) -> int { +impl<'a> sum for &'a [isize] { + fn sum_(self) -> isize { self.iter().fold(0, |a, &b| a + b) } } -fn call_sum(x: &[int]) -> int { x.sum_() } +fn call_sum(x: &[isize]) -> isize { x.sum_() } pub fn main() { let x = vec!(1, 2, 3); diff --git a/src/test/run-pass/readalias.rs b/src/test/run-pass/readalias.rs index ff00dc0ab53..d3b9e56f7d0 100644 --- a/src/test/run-pass/readalias.rs +++ b/src/test/run-pass/readalias.rs @@ -13,7 +13,7 @@ // pretty-expanded FIXME #23616 -struct Point {x: int, y: int, z: int} +struct Point {x: isize, y: isize, z: isize} fn f(p: Point) { assert!((p.z == 12)); } diff --git a/src/test/run-pass/realloc-16687.rs b/src/test/run-pass/realloc-16687.rs index 0b714578c66..cd9cc090120 100644 --- a/src/test/run-pass/realloc-16687.rs +++ b/src/test/run-pass/realloc-16687.rs @@ -28,10 +28,10 @@ fn main() { } unsafe fn test_triangle() -> bool { - static COUNT : uint = 16; + static COUNT : usize = 16; let mut ascend = repeat(ptr::null_mut()).take(COUNT).collect::>(); let ascend = &mut *ascend; - static ALIGN : uint = 1; + static ALIGN : usize = 1; // Checks that `ascend` forms triangle of ascending size formed // from pairs of rows (where each pair of rows is equally sized), @@ -40,37 +40,37 @@ unsafe fn test_triangle() -> bool { for i in 0..COUNT / 2 { let (p0, p1, size) = (ascend[2*i], ascend[2*i+1], idx_to_size(i)); for j in 0..size { - assert_eq!(*p0.offset(j as int), i as u8); - assert_eq!(*p1.offset(j as int), i as u8); + assert_eq!(*p0.offset(j as isize), i as u8); + assert_eq!(*p1.offset(j as isize), i as u8); } } } static PRINT : bool = false; - unsafe fn allocate(size: uint, align: uint) -> *mut u8 { + unsafe fn allocate(size: usize, align: usize) -> *mut u8 { if PRINT { println!("allocate(size={} align={})", size, align); } let ret = heap::allocate(size, align); if ret.is_null() { alloc::oom() } if PRINT { println!("allocate(size={} align={}) ret: 0x{:010x}", - size, align, ret as uint); + size, align, ret as usize); } ret } - unsafe fn deallocate(ptr: *mut u8, size: uint, align: uint) { + unsafe fn deallocate(ptr: *mut u8, size: usize, align: usize) { if PRINT { println!("deallocate(ptr=0x{:010x} size={} align={})", - ptr as uint, size, align); + ptr as usize, size, align); } heap::deallocate(ptr, size, align); } - unsafe fn reallocate(ptr: *mut u8, old_size: uint, size: uint, align: uint) -> *mut u8 { + unsafe fn reallocate(ptr: *mut u8, old_size: usize, size: usize, align: usize) -> *mut u8 { if PRINT { println!("reallocate(ptr=0x{:010x} old_size={} size={} align={})", - ptr as uint, old_size, size, align); + ptr as usize, old_size, size, align); } let ret = heap::reallocate(ptr, old_size, size, align); @@ -79,12 +79,12 @@ unsafe fn test_triangle() -> bool { if PRINT { println!("reallocate(ptr=0x{:010x} old_size={} size={} align={}) \ ret: 0x{:010x}", - ptr as uint, old_size, size, align, ret as uint); + ptr as usize, old_size, size, align, ret as usize); } ret } - fn idx_to_size(i: uint) -> uint { (i+1) * 10 } + fn idx_to_size(i: usize) -> usize { (i+1) * 10 } // Allocate pairs of rows that form a triangle shape. (Hope is // that at least two rows will be allocated near each other, so @@ -100,8 +100,8 @@ unsafe fn test_triangle() -> bool { for i in 0..COUNT / 2 { let (p0, p1, size) = (ascend[2*i], ascend[2*i+1], idx_to_size(i)); for j in 0..size { - *p0.offset(j as int) = i as u8; - *p1.offset(j as int) = i as u8; + *p0.offset(j as isize) = i as u8; + *p1.offset(j as isize) = i as u8; } } diff --git a/src/test/run-pass/rec-align-u32.rs b/src/test/run-pass/rec-align-u32.rs index 94fe3f1d9ea..e5d76c3e67a 100644 --- a/src/test/run-pass/rec-align-u32.rs +++ b/src/test/run-pass/rec-align-u32.rs @@ -16,8 +16,8 @@ use std::mem; mod rusti { extern "rust-intrinsic" { - pub fn pref_align_of() -> uint; - pub fn min_align_of() -> uint; + pub fn pref_align_of() -> usize; + pub fn min_align_of() -> usize; } } @@ -38,14 +38,14 @@ struct Outer { #[cfg(any(target_arch = "x86", target_arch = "arm", target_arch = "aarch64"))] mod m { - pub fn align() -> uint { 4 } - pub fn size() -> uint { 8 } + pub fn align() -> usize { 4 } + pub fn size() -> usize { 8 } } #[cfg(target_arch = "x86_64")] mod m { - pub fn align() -> uint { 4 } - pub fn size() -> uint { 8 } + pub fn align() -> usize { 4 } + pub fn size() -> usize { 8 } } pub fn main() { diff --git a/src/test/run-pass/rec-align-u64.rs b/src/test/run-pass/rec-align-u64.rs index 8b7434ed063..bae95bcb50f 100644 --- a/src/test/run-pass/rec-align-u64.rs +++ b/src/test/run-pass/rec-align-u64.rs @@ -16,8 +16,8 @@ use std::mem; mod rusti { extern "rust-intrinsic" { - pub fn pref_align_of() -> uint; - pub fn min_align_of() -> uint; + pub fn pref_align_of() -> usize; + pub fn min_align_of() -> usize; } } @@ -44,14 +44,14 @@ struct Outer { mod m { #[cfg(target_arch = "x86")] pub mod m { - pub fn align() -> uint { 4 } - pub fn size() -> uint { 12 } + pub fn align() -> usize { 4 } + pub fn size() -> usize { 12 } } #[cfg(any(target_arch = "x86_64", target_arch = "arm", target_arch = "aarch64"))] pub mod m { - pub fn align() -> uint { 8 } - pub fn size() -> uint { 16 } + pub fn align() -> usize { 8 } + pub fn size() -> usize { 16 } } } @@ -59,8 +59,8 @@ mod m { mod m { #[cfg(target_arch = "x86_64")] pub mod m { - pub fn align() -> uint { 8 } - pub fn size() -> uint { 16 } + pub fn align() -> usize { 8 } + pub fn size() -> usize { 16 } } } @@ -68,14 +68,14 @@ mod m { mod m { #[cfg(target_arch = "x86")] pub mod m { - pub fn align() -> uint { 8 } - pub fn size() -> uint { 16 } + pub fn align() -> usize { 8 } + pub fn size() -> usize { 16 } } #[cfg(target_arch = "x86_64")] pub mod m { - pub fn align() -> uint { 8 } - pub fn size() -> uint { 16 } + pub fn align() -> usize { 8 } + pub fn size() -> usize { 16 } } } @@ -83,8 +83,8 @@ mod m { mod m { #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] pub mod m { - pub fn align() -> uint { 8 } - pub fn size() -> uint { 16 } + pub fn align() -> usize { 8 } + pub fn size() -> usize { 16 } } } diff --git a/src/test/run-pass/rec-extend.rs b/src/test/run-pass/rec-extend.rs index f511db8db5a..1071df84cd2 100644 --- a/src/test/run-pass/rec-extend.rs +++ b/src/test/run-pass/rec-extend.rs @@ -13,7 +13,7 @@ // pretty-expanded FIXME #23616 -struct Point {x: int, y: int} +struct Point {x: isize, y: isize} pub fn main() { let origin: Point = Point {x: 0, y: 0}; diff --git a/src/test/run-pass/rec-tup.rs b/src/test/run-pass/rec-tup.rs index eb3fe430c4b..c61c387c781 100644 --- a/src/test/run-pass/rec-tup.rs +++ b/src/test/run-pass/rec-tup.rs @@ -11,14 +11,14 @@ // pretty-expanded FIXME #23616 #[derive(Copy)] -struct Point {x: int, y: int} +struct Point {x: isize, y: isize} type rect = (Point, Point); fn fst(r: rect) -> Point { let (fst, _) = r; return fst; } fn snd(r: rect) -> Point { let (_, snd) = r; return snd; } -fn f(r: rect, x1: int, y1: int, x2: int, y2: int) { +fn f(r: rect, x1: isize, y1: isize, x2: isize, y2: isize) { assert_eq!(fst(r).x, x1); assert_eq!(fst(r).y, y1); assert_eq!(snd(r).x, x2); @@ -32,7 +32,7 @@ pub fn main() { assert_eq!(snd(r).x, 11); assert_eq!(snd(r).y, 22); let r2 = r; - let x: int = fst(r2).x; + let x: isize = fst(r2).x; assert_eq!(x, 10); f(r, 10, 20, 11, 22); f(r2, 10, 20, 11, 22); diff --git a/src/test/run-pass/rec.rs b/src/test/run-pass/rec.rs index 9be1884267d..96b6b50237d 100644 --- a/src/test/run-pass/rec.rs +++ b/src/test/run-pass/rec.rs @@ -11,9 +11,9 @@ // pretty-expanded FIXME #23616 #[derive(Copy)] -struct Rect {x: int, y: int, w: int, h: int} +struct Rect {x: isize, y: isize, w: isize, h: isize} -fn f(r: Rect, x: int, y: int, w: int, h: int) { +fn f(r: Rect, x: isize, y: isize, w: isize, h: isize) { assert_eq!(r.x, x); assert_eq!(r.y, y); assert_eq!(r.w, w); @@ -27,7 +27,7 @@ pub fn main() { assert_eq!(r.w, 100); assert_eq!(r.h, 200); let r2: Rect = r; - let x: int = r2.x; + let x: isize = r2.x; assert_eq!(x, 10); f(r, 10, 20, 100, 200); f(r2, 10, 20, 100, 200); diff --git a/src/test/run-pass/record-pat.rs b/src/test/run-pass/record-pat.rs index 79cc4e47f5e..6b39cc196f1 100644 --- a/src/test/run-pass/record-pat.rs +++ b/src/test/run-pass/record-pat.rs @@ -10,14 +10,14 @@ // pretty-expanded FIXME #23616 -enum t1 { a(int), b(uint), } -struct T2 {x: t1, y: int} -enum t3 { c(T2, uint), } +enum t1 { a(isize), b(usize), } +struct T2 {x: t1, y: isize} +enum t3 { c(T2, usize), } -fn m(input: t3) -> int { +fn m(input: t3) -> isize { match input { t3::c(T2 {x: t1::a(m), ..}, _) => { return m; } - t3::c(T2 {x: t1::b(m), y: y}, z) => { return ((m + z) as int) + y; } + t3::c(T2 {x: t1::b(m), y: y}, z) => { return ((m + z) as isize) + y; } } } diff --git a/src/test/run-pass/regions-addr-of-interior-of-unique-box.rs b/src/test/run-pass/regions-addr-of-interior-of-unique-box.rs index c211d8d704d..4839067e53d 100644 --- a/src/test/run-pass/regions-addr-of-interior-of-unique-box.rs +++ b/src/test/run-pass/regions-addr-of-interior-of-unique-box.rs @@ -12,15 +12,15 @@ // pretty-expanded FIXME #23616 struct Point { - x: int, - y: int + x: isize, + y: isize } struct Character { pos: Box, } -fn get_x(x: &Character) -> &int { +fn get_x(x: &Character) -> &isize { // interesting case because the scope of this // borrow of the unique pointer is in fact // larger than the fn itself diff --git a/src/test/run-pass/regions-addr-of-ret.rs b/src/test/run-pass/regions-addr-of-ret.rs index a046ba456a6..3baf2fa2de5 100644 --- a/src/test/run-pass/regions-addr-of-ret.rs +++ b/src/test/run-pass/regions-addr-of-ret.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn f(x: &int) -> &int { +fn f(x: &isize) -> &isize { return &*x; } diff --git a/src/test/run-pass/regions-borrow-at.rs b/src/test/run-pass/regions-borrow-at.rs index 56dd386ead1..83a82041af9 100644 --- a/src/test/run-pass/regions-borrow-at.rs +++ b/src/test/run-pass/regions-borrow-at.rs @@ -11,7 +11,7 @@ #![allow(unknown_features)] #![feature(box_syntax)] -fn foo(x: &uint) -> uint { +fn foo(x: &usize) -> usize { *x } diff --git a/src/test/run-pass/regions-borrow-evec-fixed.rs b/src/test/run-pass/regions-borrow-evec-fixed.rs index 1258dfe3306..7f3db867830 100644 --- a/src/test/run-pass/regions-borrow-evec-fixed.rs +++ b/src/test/run-pass/regions-borrow-evec-fixed.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -fn foo(x: &[int]) -> int { +fn foo(x: &[isize]) -> isize { x[0] } diff --git a/src/test/run-pass/regions-borrow-evec-uniq.rs b/src/test/run-pass/regions-borrow-evec-uniq.rs index dd42eb2717a..adf88037d28 100644 --- a/src/test/run-pass/regions-borrow-evec-uniq.rs +++ b/src/test/run-pass/regions-borrow-evec-uniq.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 -fn foo(x: &[int]) -> int { +fn foo(x: &[isize]) -> isize { x[0] } diff --git a/src/test/run-pass/regions-borrow-uniq.rs b/src/test/run-pass/regions-borrow-uniq.rs index c0c985fa0d1..01a4e9c20ca 100644 --- a/src/test/run-pass/regions-borrow-uniq.rs +++ b/src/test/run-pass/regions-borrow-uniq.rs @@ -13,7 +13,7 @@ #![allow(unknown_features)] #![feature(box_syntax)] -fn foo(x: &uint) -> uint { +fn foo(x: &usize) -> usize { *x } diff --git a/src/test/run-pass/regions-bot.rs b/src/test/run-pass/regions-bot.rs index 43cf6bd42ff..269e30741f4 100644 --- a/src/test/run-pass/regions-bot.rs +++ b/src/test/run-pass/regions-bot.rs @@ -14,7 +14,7 @@ fn produce_static() -> &'static T { panic!(); } -fn foo(_x: &T) -> &uint { produce_static() } +fn foo(_x: &T) -> &usize { produce_static() } pub fn main() { } diff --git a/src/test/run-pass/regions-close-over-type-parameter-successfully.rs b/src/test/run-pass/regions-close-over-type-parameter-successfully.rs index d0157788cc9..cc417219ee3 100644 --- a/src/test/run-pass/regions-close-over-type-parameter-successfully.rs +++ b/src/test/run-pass/regions-close-over-type-parameter-successfully.rs @@ -16,10 +16,10 @@ #![allow(unknown_features)] #![feature(box_syntax)] -trait SomeTrait { fn get(&self) -> int; } +trait SomeTrait { fn get(&self) -> isize; } -impl<'a> SomeTrait for &'a int { - fn get(&self) -> int { +impl<'a> SomeTrait for &'a isize { + fn get(&self) -> isize { **self } } @@ -29,7 +29,7 @@ fn make_object<'a,A:SomeTrait+'a>(v: A) -> Box { } fn main() { - let i: int = 22; + let i: isize = 22; let obj = make_object(&i); assert_eq!(22, obj.get()); } diff --git a/src/test/run-pass/regions-creating-enums2.rs b/src/test/run-pass/regions-creating-enums2.rs index 8bd3bd4c0dd..66d28f5afa1 100644 --- a/src/test/run-pass/regions-creating-enums2.rs +++ b/src/test/run-pass/regions-creating-enums2.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 enum ast<'a> { - num(uint), + num(usize), add(&'a ast<'a>, &'a ast<'a>) } diff --git a/src/test/run-pass/regions-creating-enums5.rs b/src/test/run-pass/regions-creating-enums5.rs index 032ed068d5a..4bd12863e2a 100644 --- a/src/test/run-pass/regions-creating-enums5.rs +++ b/src/test/run-pass/regions-creating-enums5.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 enum ast<'a> { - num(uint), + num(usize), add(&'a ast<'a>, &'a ast<'a>) } diff --git a/src/test/run-pass/regions-dependent-addr-of.rs b/src/test/run-pass/regions-dependent-addr-of.rs index 0439cb81c47..0cb70735dba 100644 --- a/src/test/run-pass/regions-dependent-addr-of.rs +++ b/src/test/run-pass/regions-dependent-addr-of.rs @@ -22,9 +22,9 @@ struct A { } struct B { - v1: int, - v2: [int; 3], - v3: Vec , + v1: isize, + v2: [isize; 3], + v3: Vec , v4: C, v5: Box, v6: Option @@ -32,57 +32,57 @@ struct B { #[derive(Copy)] struct C { - f: int + f: isize } -fn get_v1(a: &A) -> &int { +fn get_v1(a: &A) -> &isize { // Region inferencer must deduce that &v < L2 < L1 let foo = &a.value; // L1 &foo.v1 // L2 } -fn get_v2(a: &A, i: uint) -> &int { +fn get_v2(a: &A, i: usize) -> &isize { let foo = &a.value; &foo.v2[i] } -fn get_v3(a: &A, i: uint) -> &int { +fn get_v3(a: &A, i: usize) -> &isize { let foo = &a.value; &foo.v3[i] } -fn get_v4(a: &A, _i: uint) -> &int { +fn get_v4(a: &A, _i: usize) -> &isize { let foo = &a.value; &foo.v4.f } -fn get_v5(a: &A, _i: uint) -> &int { +fn get_v5(a: &A, _i: usize) -> &isize { let foo = &a.value; &foo.v5.f } -fn get_v6_a(a: &A, _i: uint) -> &int { +fn get_v6_a(a: &A, _i: usize) -> &isize { match a.value.v6 { Some(ref v) => &v.f, None => panic!() } } -fn get_v6_b(a: &A, _i: uint) -> &int { +fn get_v6_b(a: &A, _i: usize) -> &isize { match *a { A { value: B { v6: Some(ref v), .. } } => &v.f, _ => panic!() } } -fn get_v6_c(a: &A, _i: uint) -> &int { +fn get_v6_c(a: &A, _i: usize) -> &isize { match a { &A { value: B { v6: Some(ref v), .. } } => &v.f, _ => panic!() } } -fn get_v5_ref(a: &A, _i: uint) -> &int { +fn get_v5_ref(a: &A, _i: usize) -> &isize { match &a.value { &B {v5: box C {f: ref v}, ..} => v } diff --git a/src/test/run-pass/regions-dependent-autoslice.rs b/src/test/run-pass/regions-dependent-autoslice.rs index 4652fed8a9d..fd0d8121f5f 100644 --- a/src/test/run-pass/regions-dependent-autoslice.rs +++ b/src/test/run-pass/regions-dependent-autoslice.rs @@ -14,9 +14,9 @@ // pretty-expanded FIXME #23616 -fn subslice1<'r>(v: &'r [uint]) -> &'r [uint] { v } +fn subslice1<'r>(v: &'r [usize]) -> &'r [usize] { v } -fn both<'r>(v: &'r [uint]) -> &'r [uint] { +fn both<'r>(v: &'r [usize]) -> &'r [usize] { subslice1(subslice1(v)) } diff --git a/src/test/run-pass/regions-dependent-let-ref.rs b/src/test/run-pass/regions-dependent-let-ref.rs index 4d3fed5031f..1b869e462b0 100644 --- a/src/test/run-pass/regions-dependent-let-ref.rs +++ b/src/test/run-pass/regions-dependent-let-ref.rs @@ -13,7 +13,7 @@ // pretty-expanded FIXME #23616 -struct Foo(int); +struct Foo(isize); pub fn main() { // Here the lifetime of the `&` should be at least the // block, since a ref binding is created to the interior. diff --git a/src/test/run-pass/regions-early-bound-lifetime-in-assoc-fn.rs b/src/test/run-pass/regions-early-bound-lifetime-in-assoc-fn.rs index 2dc40718307..9aed9155124 100644 --- a/src/test/run-pass/regions-early-bound-lifetime-in-assoc-fn.rs +++ b/src/test/run-pass/regions-early-bound-lifetime-in-assoc-fn.rs @@ -28,7 +28,7 @@ pub trait Decoder<'v> { } pub trait Decodable<'v, D: Decoder<'v>> - : marker::PhantomFn<(), &'v int> + : marker::PhantomFn<(), &'v isize> { fn decode(d: &mut D) -> Self; } diff --git a/src/test/run-pass/regions-early-bound-trait-param.rs b/src/test/run-pass/regions-early-bound-trait-param.rs index c87c79ca24e..738f5dbb7b9 100644 --- a/src/test/run-pass/regions-early-bound-trait-param.rs +++ b/src/test/run-pass/regions-early-bound-trait-param.rs @@ -17,17 +17,17 @@ #![feature(box_syntax)] trait Trait<'a> { - fn long(&'a self) -> int; - fn short<'b>(&'b self) -> int; + fn long(&'a self) -> isize; + fn short<'b>(&'b self) -> isize; } -fn poly_invoke<'c, T: Trait<'c>>(x: &'c T) -> (int, int) { +fn poly_invoke<'c, T: Trait<'c>>(x: &'c T) -> (isize, isize) { let l = x.long(); let s = x.short(); (l,s) } -fn object_invoke1<'d>(x: &'d Trait<'d>) -> (int, int) { +fn object_invoke1<'d>(x: &'d Trait<'d>) -> (isize, isize) { let l = x.long(); let s = x.short(); (l,s) @@ -37,7 +37,7 @@ struct Struct1<'e> { f: &'e (Trait<'e>+'e) } -fn field_invoke1<'f, 'g>(x: &'g Struct1<'f>) -> (int,int) { +fn field_invoke1<'f, 'g>(x: &'g Struct1<'f>) -> (isize,isize) { let l = x.f.long(); let s = x.f.short(); (l,s) @@ -47,11 +47,11 @@ struct Struct2<'h, 'i> { f: &'h (Trait<'i>+'h) } -fn object_invoke2<'j, 'k>(x: &'k Trait<'j>) -> int { +fn object_invoke2<'j, 'k>(x: &'k Trait<'j>) -> isize { x.short() } -fn field_invoke2<'l, 'm, 'n>(x: &'n Struct2<'l,'m>) -> int { +fn field_invoke2<'l, 'm, 'n>(x: &'n Struct2<'l,'m>) -> isize { x.f.short() } @@ -71,12 +71,12 @@ fn make_ref<'r, T:RefMakerTrait<'r>>(t:T) -> &'r T { RefMakerTrait::mk(t) } -impl<'s> Trait<'s> for (int,int) { - fn long(&'s self) -> int { +impl<'s> Trait<'s> for (isize,isize) { + fn long(&'s self) -> isize { let &(x,_) = self; x } - fn short<'b>(&'b self) -> int { + fn short<'b>(&'b self) -> isize { let &(_,y) = self; y } @@ -84,18 +84,18 @@ impl<'s> Trait<'s> for (int,int) { impl<'t> MakerTrait for Box+'static> { fn mk() -> Box+'static> { - let tup: Box<(int, int)> = box() (4,5); + let tup: Box<(isize, isize)> = box() (4,5); tup as Box } } enum List<'l> { - Cons(int, &'l List<'l>), + Cons(isize, &'l List<'l>), Null } impl<'l> List<'l> { - fn car<'m>(&'m self) -> int { + fn car<'m>(&'m self) -> isize { match self { &List::Cons(car, _) => car, &List::Null => panic!(), diff --git a/src/test/run-pass/regions-early-bound-used-in-bound-method.rs b/src/test/run-pass/regions-early-bound-used-in-bound-method.rs index 360457cf3f1..b1f9ff4de0f 100644 --- a/src/test/run-pass/regions-early-bound-used-in-bound-method.rs +++ b/src/test/run-pass/regions-early-bound-used-in-bound-method.rs @@ -14,22 +14,22 @@ // pretty-expanded FIXME #23616 trait GetRef<'a> { - fn get(&self) -> &'a int; + fn get(&self) -> &'a isize; } #[derive(Copy)] struct Box<'a> { - t: &'a int + t: &'a isize } impl<'a> GetRef<'a> for Box<'a> { - fn get(&self) -> &'a int { + fn get(&self) -> &'a isize { self.t } } impl<'a> Box<'a> { - fn add<'b,G:GetRef<'b>>(&self, g2: G) -> int { + fn add<'b,G:GetRef<'b>>(&self, g2: G) -> isize { *self.t + *g2.get() } } diff --git a/src/test/run-pass/regions-early-bound-used-in-bound.rs b/src/test/run-pass/regions-early-bound-used-in-bound.rs index 924f9b8f70b..9c2d2726a73 100644 --- a/src/test/run-pass/regions-early-bound-used-in-bound.rs +++ b/src/test/run-pass/regions-early-bound-used-in-bound.rs @@ -29,7 +29,7 @@ impl<'a,T:Clone> GetRef<'a,T> for Box<'a,T> { } } -fn add<'a,G:GetRef<'a, int>>(g1: G, g2: G) -> int { +fn add<'a,G:GetRef<'a, isize>>(g1: G, g2: G) -> isize { *g1.get() + *g2.get() } diff --git a/src/test/run-pass/regions-early-bound-used-in-type-param.rs b/src/test/run-pass/regions-early-bound-used-in-type-param.rs index c31d4d45fb9..830fb7127b9 100644 --- a/src/test/run-pass/regions-early-bound-used-in-type-param.rs +++ b/src/test/run-pass/regions-early-bound-used-in-type-param.rs @@ -28,7 +28,7 @@ impl Get for Box { } } -fn add<'a,G:Get<&'a int>>(g1: G, g2: G) -> int { +fn add<'a,G:Get<&'a isize>>(g1: G, g2: G) -> isize { *g1.get() + *g2.get() } diff --git a/src/test/run-pass/regions-escape-into-other-fn.rs b/src/test/run-pass/regions-escape-into-other-fn.rs index cd32c426527..3e2fec717f9 100644 --- a/src/test/run-pass/regions-escape-into-other-fn.rs +++ b/src/test/run-pass/regions-escape-into-other-fn.rs @@ -13,8 +13,8 @@ #![allow(unknown_features)] #![feature(box_syntax)] -fn foo(x: &uint) -> &uint { x } -fn bar(x: &uint) -> uint { *x } +fn foo(x: &usize) -> &usize { x } +fn bar(x: &usize) -> usize { *x } pub fn main() { let p: Box<_> = box 3; diff --git a/src/test/run-pass/regions-expl-self.rs b/src/test/run-pass/regions-expl-self.rs index ee4bbcebb78..7ad3c3f4e17 100644 --- a/src/test/run-pass/regions-expl-self.rs +++ b/src/test/run-pass/regions-expl-self.rs @@ -13,7 +13,7 @@ // pretty-expanded FIXME #23616 struct Foo { - f: uint + f: usize } impl Foo { diff --git a/src/test/run-pass/regions-fn-subtyping-2.rs b/src/test/run-pass/regions-fn-subtyping-2.rs index b8b5f6fb05f..7f2fc11cb8e 100644 --- a/src/test/run-pass/regions-fn-subtyping-2.rs +++ b/src/test/run-pass/regions-fn-subtyping-2.rs @@ -15,13 +15,13 @@ // that `x` is in. // pretty-expanded FIXME #23616 -fn has_same_region(f: Box FnMut(&'a int, Box)>) { +fn has_same_region(f: Box FnMut(&'a isize, Box)>) { // `f` should be the type that `wants_same_region` wants, but // right now the compiler complains that it isn't. wants_same_region(f); } -fn wants_same_region(_f: Box FnMut(&'b int, Box)>) { +fn wants_same_region(_f: Box FnMut(&'b isize, Box)>) { } pub fn main() { diff --git a/src/test/run-pass/regions-fn-subtyping.rs b/src/test/run-pass/regions-fn-subtyping.rs index d9079dfe3f5..e5b652c306f 100644 --- a/src/test/run-pass/regions-fn-subtyping.rs +++ b/src/test/run-pass/regions-fn-subtyping.rs @@ -19,21 +19,21 @@ // FIXME (#22405): Replace `Box::new` with `box` here when/if possible. // Should pass region checking. -fn ok(f: Box) { - // Here, g is a function that can accept a uint pointer with - // lifetime r, and f is a function that can accept a uint pointer +fn ok(f: Box) { + // Here, g is a function that can accept a usize pointer with + // lifetime r, and f is a function that can accept a usize pointer // with any lifetime. The assignment g = f should be OK (i.e., // f's type should be a subtype of g's type), because f can be // used in any context that expects g's type. But this currently // fails. - let mut g: Box FnMut(&'r uint)> = Box::new(|x| { }); + let mut g: Box FnMut(&'r usize)> = Box::new(|x| { }); g = f; } // This version is the same as above, except that here, g's type is // inferred. -fn ok_inferred(f: Box) { - let mut g: Box FnMut(&'r uint)> = Box::new(|_| {}); +fn ok_inferred(f: Box) { + let mut g: Box FnMut(&'r usize)> = Box::new(|_| {}); g = f; } diff --git a/src/test/run-pass/regions-infer-borrow-scope.rs b/src/test/run-pass/regions-infer-borrow-scope.rs index acbe091a6a4..3289da3cfd8 100644 --- a/src/test/run-pass/regions-infer-borrow-scope.rs +++ b/src/test/run-pass/regions-infer-borrow-scope.rs @@ -13,9 +13,9 @@ #![allow(unknown_features)] #![feature(box_syntax)] -struct Point {x: int, y: int} +struct Point {x: isize, y: isize} -fn x_coord(p: &Point) -> &int { +fn x_coord(p: &Point) -> &isize { return &p.x; } diff --git a/src/test/run-pass/regions-infer-call-2.rs b/src/test/run-pass/regions-infer-call-2.rs index cc1bf05db5f..7e6767b0de4 100644 --- a/src/test/run-pass/regions-infer-call-2.rs +++ b/src/test/run-pass/regions-infer-call-2.rs @@ -10,13 +10,13 @@ // pretty-expanded FIXME #23616 -fn takes_two(x: &int, y: &int) -> int { *x + *y } +fn takes_two(x: &isize, y: &isize) -> isize { *x + *y } -fn with(f: F) -> T where F: FnOnce(&int) -> T { +fn with(f: F) -> T where F: FnOnce(&isize) -> T { f(&20) } -fn has_one<'a>(x: &'a int) -> int { +fn has_one<'a>(x: &'a isize) -> isize { with(|y| takes_two(x, y)) } diff --git a/src/test/run-pass/regions-infer-call.rs b/src/test/run-pass/regions-infer-call.rs index c1044b59af2..bc752a1d504 100644 --- a/src/test/run-pass/regions-infer-call.rs +++ b/src/test/run-pass/regions-infer-call.rs @@ -10,9 +10,9 @@ // pretty-expanded FIXME #23616 -fn takes_two(x: &int, y: &int) -> int { *x + *y } +fn takes_two(x: &isize, y: &isize) -> isize { *x + *y } -fn has_two<'a,'b>(x: &'a int, y: &'b int) -> int { +fn has_two<'a,'b>(x: &'a isize, y: &'b isize) -> isize { takes_two(x, y) } diff --git a/src/test/run-pass/regions-infer-contravariance-due-to-ret.rs b/src/test/run-pass/regions-infer-contravariance-due-to-ret.rs index 11c3ab111cf..73cfbcddd9a 100644 --- a/src/test/run-pass/regions-infer-contravariance-due-to-ret.rs +++ b/src/test/run-pass/regions-infer-contravariance-due-to-ret.rs @@ -11,14 +11,14 @@ // pretty-expanded FIXME #23616 struct boxed_int<'a> { - f: &'a int, + f: &'a isize, } -fn max<'r>(bi: &'r boxed_int, f: &'r int) -> int { +fn max<'r>(bi: &'r boxed_int, f: &'r isize) -> isize { if *bi.f > *f {*bi.f} else {*f} } -fn with(bi: &boxed_int) -> int { +fn with(bi: &boxed_int) -> isize { let i = 22; max(bi, &i) } diff --git a/src/test/run-pass/regions-infer-reborrow-ref-mut-recurse.rs b/src/test/run-pass/regions-infer-reborrow-ref-mut-recurse.rs index 6b143908f05..2349b6c3bc1 100644 --- a/src/test/run-pass/regions-infer-reborrow-ref-mut-recurse.rs +++ b/src/test/run-pass/regions-infer-reborrow-ref-mut-recurse.rs @@ -13,10 +13,10 @@ // pretty-expanded FIXME #23616 -fn foo<'a,'b>(x: &'a &'b mut int) -> &'a int { - let y = &*x; // should be inferred to have type &'a &'b mut int... +fn foo<'a,'b>(x: &'a &'b mut isize) -> &'a isize { + let y = &*x; // should be inferred to have type &'a &'b mut isize... - // ...because if we inferred, say, &'x &'b mut int where 'x <= 'a, + // ...because if we inferred, say, &'x &'b mut isize where 'x <= 'a, // this reborrow would be illegal: &**y } diff --git a/src/test/run-pass/regions-infer-region-in-fn-but-not-type.rs b/src/test/run-pass/regions-infer-region-in-fn-but-not-type.rs index 586c9ab3a72..a8418f967fd 100644 --- a/src/test/run-pass/regions-infer-region-in-fn-but-not-type.rs +++ b/src/test/run-pass/regions-infer-region-in-fn-but-not-type.rs @@ -9,11 +9,11 @@ // except according to those terms. -// check that the &int here does not cause us to think that `foo` +// check that the &isize here does not cause us to think that `foo` // contains region pointers // pretty-expanded FIXME #23616 -struct foo(Box); +struct foo(Box); fn take_foo(x: T) {} diff --git a/src/test/run-pass/regions-infer-static-from-proc.rs b/src/test/run-pass/regions-infer-static-from-proc.rs index 391501014b3..403dfbf655f 100644 --- a/src/test/run-pass/regions-infer-static-from-proc.rs +++ b/src/test/run-pass/regions-infer-static-from-proc.rs @@ -14,9 +14,9 @@ // pretty-expanded FIXME #23616 -static i: uint = 3; +static i: usize = 3; fn foo(_: F) {} -fn read(_: uint) { } +fn read(_: usize) { } pub fn main() { let x = &i; foo(move|| { diff --git a/src/test/run-pass/regions-lifetime-nonfree-late-bound.rs b/src/test/run-pass/regions-lifetime-nonfree-late-bound.rs index 99a4f5647bb..a2c07d27288 100644 --- a/src/test/run-pass/regions-lifetime-nonfree-late-bound.rs +++ b/src/test/run-pass/regions-lifetime-nonfree-late-bound.rs @@ -29,15 +29,15 @@ pub fn main() { fn explicit() { - fn test(_x: Option>) where F: FnMut(Box FnMut(&'a int)>) {} - test(Some(box |_f: Box FnMut(&'a int)>| {})); + fn test(_x: Option>) where F: FnMut(Box FnMut(&'a isize)>) {} + test(Some(box |_f: Box FnMut(&'a isize)>| {})); } // The code below is shorthand for the code above (and more likely // to represent what one encounters in practice). fn implicit() { - fn test(_x: Option>) where F: FnMut(Box< FnMut(& int)>) {} - test(Some(box |_f: Box< FnMut(& int)>| {})); + fn test(_x: Option>) where F: FnMut(Box< FnMut(& isize)>) {} + test(Some(box |_f: Box< FnMut(& isize)>| {})); } explicit(); diff --git a/src/test/run-pass/regions-lifetime-static-items-enclosing-scopes.rs b/src/test/run-pass/regions-lifetime-static-items-enclosing-scopes.rs index 077d4f5a25e..451c745358a 100644 --- a/src/test/run-pass/regions-lifetime-static-items-enclosing-scopes.rs +++ b/src/test/run-pass/regions-lifetime-static-items-enclosing-scopes.rs @@ -25,5 +25,5 @@ pub fn main() { static C: E = E::V; } - f::(&mut None); + f::(&mut None); } diff --git a/src/test/run-pass/regions-link-fn-args.rs b/src/test/run-pass/regions-link-fn-args.rs index 0b5ab35f7fe..9e8ce616048 100644 --- a/src/test/run-pass/regions-link-fn-args.rs +++ b/src/test/run-pass/regions-link-fn-args.rs @@ -15,7 +15,7 @@ #![allow(dead_code)] -fn with<'a, F>(_: F) where F: FnOnce(&'a Vec) -> &'a Vec { } +fn with<'a, F>(_: F) where F: FnOnce(&'a Vec) -> &'a Vec { } fn foo() { with(|&ref ints| ints); diff --git a/src/test/run-pass/regions-mock-tcx.rs b/src/test/run-pass/regions-mock-tcx.rs index f2e0837c6ea..c6bacac63e0 100644 --- a/src/test/run-pass/regions-mock-tcx.rs +++ b/src/test/run-pass/regions-mock-tcx.rs @@ -56,7 +56,7 @@ struct TypeContext<'tcx, 'ast> { type_table: HashMap>, ast_arena: &'ast AstArena<'ast>, - ast_counter: uint, + ast_counter: usize, } impl<'tcx,'ast> TypeContext<'tcx, 'ast> { @@ -96,7 +96,7 @@ impl<'tcx,'ast> TypeContext<'tcx, 'ast> { #[derive(Copy, PartialEq, Eq, Hash)] struct NodeId { - id: uint + id: usize } type Ast<'ast> = &'ast AstStructure<'ast>; @@ -110,7 +110,7 @@ struct AstStructure<'ast> { #[derive(Copy)] enum AstKind<'ast> { ExprInt, - ExprVar(uint), + ExprVar(usize), ExprLambda(Ast<'ast>), } diff --git a/src/test/run-pass/regions-mock-trans.rs b/src/test/run-pass/regions-mock-trans.rs index b6ba7d979ac..b67612c94b0 100644 --- a/src/test/run-pass/regions-mock-trans.rs +++ b/src/test/run-pass/regions-mock-trans.rs @@ -27,7 +27,7 @@ struct Fcx<'a> { } struct Ccx { - x: int + x: isize } fn alloc<'a>(_bcx : &'a arena) -> &'a Bcx<'a> { diff --git a/src/test/run-pass/regions-nullary-variant.rs b/src/test/run-pass/regions-nullary-variant.rs index c2a8f7e66c6..ae55b97dc93 100644 --- a/src/test/run-pass/regions-nullary-variant.rs +++ b/src/test/run-pass/regions-nullary-variant.rs @@ -11,10 +11,10 @@ // pretty-expanded FIXME #23616 enum roption<'a> { - a, b(&'a uint) + a, b(&'a usize) } -fn mk(cond: bool, ptr: &uint) -> roption { +fn mk(cond: bool, ptr: &usize) -> roption { if cond {roption::a} else {roption::b(ptr)} } diff --git a/src/test/run-pass/regions-params.rs b/src/test/run-pass/regions-params.rs index c7ee3213f37..5002fcce96b 100644 --- a/src/test/run-pass/regions-params.rs +++ b/src/test/run-pass/regions-params.rs @@ -11,11 +11,11 @@ // pretty-expanded FIXME #23616 -fn region_identity(x: &uint) -> &uint { x } +fn region_identity(x: &usize) -> &usize { x } fn apply(t: T, f: F) -> T where F: FnOnce(T) -> T { f(t) } -fn parameterized(x: &uint) -> uint { +fn parameterized(x: &usize) -> usize { let z = apply(x, ({|y| region_identity(y) })); diff --git a/src/test/run-pass/regions-reassign-let-bound-pointer.rs b/src/test/run-pass/regions-reassign-let-bound-pointer.rs index 89a9d3f1290..b29cc8f9036 100644 --- a/src/test/run-pass/regions-reassign-let-bound-pointer.rs +++ b/src/test/run-pass/regions-reassign-let-bound-pointer.rs @@ -14,7 +14,7 @@ // pretty-expanded FIXME #23616 -fn foo(x: &int) { +fn foo(x: &isize) { let a = 1; let mut z = x; z = &a; diff --git a/src/test/run-pass/regions-reassign-match-bound-pointer.rs b/src/test/run-pass/regions-reassign-match-bound-pointer.rs index 02c59dde1d6..58d4f556a79 100644 --- a/src/test/run-pass/regions-reassign-match-bound-pointer.rs +++ b/src/test/run-pass/regions-reassign-match-bound-pointer.rs @@ -14,7 +14,7 @@ // pretty-expanded FIXME #23616 -fn foo(x: &int) { +fn foo(x: &isize) { let a = 1; match x { mut z => { diff --git a/src/test/run-pass/regions-relate-bound-regions-on-closures-to-inference-variables.rs b/src/test/run-pass/regions-relate-bound-regions-on-closures-to-inference-variables.rs index 310902d4d0a..a36c1b30ead 100644 --- a/src/test/run-pass/regions-relate-bound-regions-on-closures-to-inference-variables.rs +++ b/src/test/run-pass/regions-relate-bound-regions-on-closures-to-inference-variables.rs @@ -23,7 +23,7 @@ #![feature(box_syntax)] struct Ctxt<'tcx> { - x: &'tcx Vec + x: &'tcx Vec } struct Foo<'a,'tcx:'a> { @@ -31,7 +31,7 @@ struct Foo<'a,'tcx:'a> { } impl<'a,'tcx> Foo<'a,'tcx> { - fn bother(&mut self) -> int { + fn bother(&mut self) -> isize { // FIXME (#22405): Replace `Box::new` with `box` here when/if possible. self.elaborate_bounds(Box::new(|this| { // (*) Here: type of `this` is `&'f0 Foo<&'f1, '_2>`, @@ -50,14 +50,14 @@ impl<'a,'tcx> Foo<'a,'tcx> { })) } - fn foo(&mut self) -> int { + fn foo(&mut self) -> isize { 22 } fn elaborate_bounds( &mut self, - mut mk_cand: Box FnMut(&mut Foo<'b, 'tcx>) -> int>) - -> int + mut mk_cand: Box FnMut(&mut Foo<'b, 'tcx>) -> isize>) + -> isize { mk_cand(self) } diff --git a/src/test/run-pass/regions-self-impls.rs b/src/test/run-pass/regions-self-impls.rs index b30b3cfa476..26e3fbfab9e 100644 --- a/src/test/run-pass/regions-self-impls.rs +++ b/src/test/run-pass/regions-self-impls.rs @@ -9,15 +9,15 @@ // except according to those terms. struct Clam<'a> { - chowder: &'a int + chowder: &'a isize } trait get_chowder<'a> { - fn get_chowder(&self) -> &'a int; + fn get_chowder(&self) -> &'a isize; } impl<'a> get_chowder<'a> for Clam<'a> { - fn get_chowder(&self) -> &'a int { return self.chowder; } + fn get_chowder(&self) -> &'a isize { return self.chowder; } } pub fn main() { diff --git a/src/test/run-pass/regions-self-in-enums.rs b/src/test/run-pass/regions-self-in-enums.rs index ab0b4acc769..9ff20e93a0d 100644 --- a/src/test/run-pass/regions-self-in-enums.rs +++ b/src/test/run-pass/regions-self-in-enums.rs @@ -9,13 +9,13 @@ // except according to those terms. enum int_wrapper<'a> { - int_wrapper_ctor(&'a int) + int_wrapper_ctor(&'a isize) } pub fn main() { let x = 3; let y = int_wrapper::int_wrapper_ctor(&x); - let mut z : ∫ + let mut z : &isize; match y { int_wrapper::int_wrapper_ctor(zz) => { z = zz; } } diff --git a/src/test/run-pass/regions-simple.rs b/src/test/run-pass/regions-simple.rs index d540605180a..f4fe73131fe 100644 --- a/src/test/run-pass/regions-simple.rs +++ b/src/test/run-pass/regions-simple.rs @@ -9,8 +9,8 @@ // except according to those terms. pub fn main() { - let mut x: int = 3; - let y: &mut int = &mut x; + let mut x: isize = 3; + let y: &mut isize = &mut x; *y = 5; println!("{}", *y); } diff --git a/src/test/run-pass/regions-variance-contravariant-use-contravariant.rs b/src/test/run-pass/regions-variance-contravariant-use-contravariant.rs index 1b174580b0e..5e5be1c2587 100644 --- a/src/test/run-pass/regions-variance-contravariant-use-contravariant.rs +++ b/src/test/run-pass/regions-variance-contravariant-use-contravariant.rs @@ -17,7 +17,7 @@ // pretty-expanded FIXME #23616 struct Contravariant<'a> { - f: &'a int + f: &'a isize } fn use_<'a>(c: Contravariant<'a>) { @@ -28,7 +28,7 @@ fn use_<'a>(c: Contravariant<'a>) { // if 'call <= 'a, which is true, so no error. collapse(&x, c); - fn collapse<'b>(x: &'b int, c: Contravariant<'b>) { } + fn collapse<'b>(x: &'b isize, c: Contravariant<'b>) { } } pub fn main() {} diff --git a/src/test/run-pass/regions-variance-covariant-use-covariant.rs b/src/test/run-pass/regions-variance-covariant-use-covariant.rs index 40210482327..02562781373 100644 --- a/src/test/run-pass/regions-variance-covariant-use-covariant.rs +++ b/src/test/run-pass/regions-variance-covariant-use-covariant.rs @@ -20,7 +20,7 @@ // pretty-expanded FIXME #23616 struct Covariant<'a> { - f: extern "Rust" fn(&'a int) + f: extern "Rust" fn(&'a isize) } fn use_<'a>(c: Covariant<'a>) { diff --git a/src/test/run-pass/repeat-expr-in-static.rs b/src/test/run-pass/repeat-expr-in-static.rs index 12cf0c0de45..5a4475ae947 100644 --- a/src/test/run-pass/repeat-expr-in-static.rs +++ b/src/test/run-pass/repeat-expr-in-static.rs @@ -10,8 +10,8 @@ // pretty-expanded FIXME #23616 -static FOO: [int; 4] = [32; 4]; -static BAR: [int; 4] = [32, 32, 32, 32]; +static FOO: [isize; 4] = [32; 4]; +static BAR: [isize; 4] = [32, 32, 32, 32]; pub fn main() { assert!(FOO == BAR); diff --git a/src/test/run-pass/resolve-issue-2428.rs b/src/test/run-pass/resolve-issue-2428.rs index 39b89bb3e4e..bad5b83b548 100644 --- a/src/test/run-pass/resolve-issue-2428.rs +++ b/src/test/run-pass/resolve-issue-2428.rs @@ -10,6 +10,6 @@ // pretty-expanded FIXME #23616 -const foo: int = 4 >> 1; +const foo: isize = 4 >> 1; enum bs { thing = foo } -pub fn main() { assert!((bs::thing as int == foo)); } +pub fn main() { assert!((bs::thing as isize == foo)); } diff --git a/src/test/run-pass/resource-assign-is-not-copy.rs b/src/test/run-pass/resource-assign-is-not-copy.rs index abc33e9f2e6..ba63c2db7cf 100644 --- a/src/test/run-pass/resource-assign-is-not-copy.rs +++ b/src/test/run-pass/resource-assign-is-not-copy.rs @@ -14,7 +14,7 @@ use std::cell::Cell; #[derive(Debug)] struct r<'a> { - i: &'a Cell, + i: &'a Cell, } #[unsafe_destructor] @@ -24,7 +24,7 @@ impl<'a> Drop for r<'a> { } } -fn r(i: &Cell) -> r { +fn r(i: &Cell) -> r { r { i: i } diff --git a/src/test/run-pass/resource-destruct.rs b/src/test/run-pass/resource-destruct.rs index 71bf6cc6261..229ceba08b0 100644 --- a/src/test/run-pass/resource-destruct.rs +++ b/src/test/run-pass/resource-destruct.rs @@ -13,7 +13,7 @@ use std::cell::Cell; struct shrinky_pointer<'a> { - i: &'a Cell, + i: &'a Cell, } #[unsafe_destructor] @@ -24,10 +24,10 @@ impl<'a> Drop for shrinky_pointer<'a> { } impl<'a> shrinky_pointer<'a> { - pub fn look_at(&self) -> int { return self.i.get(); } + pub fn look_at(&self) -> isize { return self.i.get(); } } -fn shrinky_pointer(i: &Cell) -> shrinky_pointer { +fn shrinky_pointer(i: &Cell) -> shrinky_pointer { shrinky_pointer { i: i } diff --git a/src/test/run-pass/ret-bang.rs b/src/test/run-pass/ret-bang.rs index 14b398b3d9a..7d4d0218112 100644 --- a/src/test/run-pass/ret-bang.rs +++ b/src/test/run-pass/ret-bang.rs @@ -13,7 +13,7 @@ fn my_err(s: String) -> ! { println!("{}", s); panic!(); } -fn okay(i: uint) -> int { +fn okay(i: usize) -> isize { if i == 3 { my_err("I don't like three".to_string()); } else { diff --git a/src/test/run-pass/ret-none.rs b/src/test/run-pass/ret-none.rs index ea0de67572d..032a4b662cb 100644 --- a/src/test/run-pass/ret-none.rs +++ b/src/test/run-pass/ret-none.rs @@ -16,4 +16,4 @@ enum option { none, some(T), } fn f() -> option { return option::none; } -pub fn main() { f::(); } +pub fn main() { f::(); } diff --git a/src/test/run-pass/return-from-closure.rs b/src/test/run-pass/return-from-closure.rs index 0a87e76ef4e..4395f6fcb4b 100644 --- a/src/test/run-pass/return-from-closure.rs +++ b/src/test/run-pass/return-from-closure.rs @@ -12,10 +12,10 @@ // not the surrounding function. // pretty-expanded FIXME #23616 -static mut calls: uint = 0; +static mut calls: usize = 0; fn surrounding() { - let return_works = |n: int| { + let return_works = |n: isize| { unsafe { calls += 1 } if n >= 0 { return; } @@ -25,7 +25,7 @@ fn surrounding() { return_works(10); return_works(20); - let return_works_proc = |n: int| { + let return_works_proc = |n: isize| { unsafe { calls += 1 } if n >= 0 { return; } diff --git a/src/test/run-pass/running-with-no-runtime.rs b/src/test/run-pass/running-with-no-runtime.rs index 75f66d5bf26..c5b59e6c6e0 100644 --- a/src/test/run-pass/running-with-no-runtime.rs +++ b/src/test/run-pass/running-with-no-runtime.rs @@ -20,7 +20,7 @@ use std::thread::Thread; use std::thunk::Thunk; #[start] -fn start(argc: int, argv: *const *const u8) -> int { +fn start(argc: isize, argv: *const *const u8) -> isize { if argc > 1 { unsafe { match **argv.offset(1) { @@ -36,8 +36,8 @@ fn start(argc: int, argv: *const *const u8) -> int { } let args = unsafe { - (0..argc as uint).map(|i| { - let ptr = *argv.offset(i as int) as *const _; + (0..argc as usize).map(|i| { + let ptr = *argv.offset(i as isize) as *const _; ffi::c_str_to_bytes(&ptr).to_vec() }).collect::>() }; diff --git a/src/test/run-pass/segfault-no-out-of-stack.rs b/src/test/run-pass/segfault-no-out-of-stack.rs index 1b3020b8dbe..6eb9600cf8b 100644 --- a/src/test/run-pass/segfault-no-out-of-stack.rs +++ b/src/test/run-pass/segfault-no-out-of-stack.rs @@ -18,7 +18,7 @@ use std::env; fn main() { let args: Vec = env::args().collect(); if args.len() > 1 && args[1] == "segfault" { - unsafe { *(0 as *mut int) = 1 }; // trigger a segfault + unsafe { *(0 as *mut isize) = 1 }; // trigger a segfault } else { let segfault = Command::new(&args[0]).arg("segfault").output().unwrap(); assert!(!segfault.status.success()); diff --git a/src/test/run-pass/self-impl.rs b/src/test/run-pass/self-impl.rs index 75a68677e52..c32773aa88c 100644 --- a/src/test/run-pass/self-impl.rs +++ b/src/test/run-pass/self-impl.rs @@ -34,7 +34,7 @@ trait Bar { fn dummy(&self, x: X) { } } -impl Bar for Box> { +impl Bar for Box> { fn bar(_x: Self, _y: &Self, _z: Box) -> Self { box Baz { f: 42 } } @@ -42,7 +42,7 @@ impl Bar for Box> { fn main() { let _: Foo = Foo::foo(Foo, &Foo, box Foo); - let _: Box> = Bar::bar(box Baz { f: 42 }, + let _: Box> = Bar::bar(box Baz { f: 42 }, &box Baz { f: 42 }, box box Baz { f: 42 }); } diff --git a/src/test/run-pass/self-in-mut-slot-default-method.rs b/src/test/run-pass/self-in-mut-slot-default-method.rs index 64d49215f22..f8502137be1 100644 --- a/src/test/run-pass/self-in-mut-slot-default-method.rs +++ b/src/test/run-pass/self-in-mut-slot-default-method.rs @@ -14,7 +14,7 @@ #![feature(box_syntax)] struct X { - a: int + a: isize } trait Changer : Sized { @@ -28,11 +28,11 @@ trait Changer : Sized { self } - fn set_to(&mut self, a: int); + fn set_to(&mut self, a: isize); } impl Changer for X { - fn set_to(&mut self, a: int) { + fn set_to(&mut self, a: isize) { self.a = a; } } diff --git a/src/test/run-pass/self-in-mut-slot-immediate-value.rs b/src/test/run-pass/self-in-mut-slot-immediate-value.rs index 69cad7ab3dd..fa7b21a26c5 100644 --- a/src/test/run-pass/self-in-mut-slot-immediate-value.rs +++ b/src/test/run-pass/self-in-mut-slot-immediate-value.rs @@ -15,7 +15,7 @@ #[derive(Copy)] struct Value { - n: int + n: isize } impl Value { diff --git a/src/test/run-pass/self-shadowing-import.rs b/src/test/run-pass/self-shadowing-import.rs index 6621de0d8be..5de1686ef9d 100644 --- a/src/test/run-pass/self-shadowing-import.rs +++ b/src/test/run-pass/self-shadowing-import.rs @@ -13,7 +13,7 @@ mod a { pub mod b { pub mod a { - pub fn foo() -> int { return 1; } + pub fn foo() -> isize { return 1; } } } } diff --git a/src/test/run-pass/self-type-param.rs b/src/test/run-pass/self-type-param.rs index ea2bec8c861..ac810606a93 100644 --- a/src/test/run-pass/self-type-param.rs +++ b/src/test/run-pass/self-type-param.rs @@ -15,7 +15,7 @@ trait MyTrait { } struct S { - x: int + x: isize } impl MyTrait for S { diff --git a/src/test/run-pass/send-resource.rs b/src/test/run-pass/send-resource.rs index 47c3766797a..2c897c48a33 100644 --- a/src/test/run-pass/send-resource.rs +++ b/src/test/run-pass/send-resource.rs @@ -16,14 +16,14 @@ use std::thread::Thread; use std::sync::mpsc::channel; struct test { - f: int, + f: isize, } impl Drop for test { fn drop(&mut self) {} } -fn test(f: int) -> test { +fn test(f: isize) -> test { test { f: f } diff --git a/src/test/run-pass/send_str_hashmap.rs b/src/test/run-pass/send_str_hashmap.rs index d109f7abde4..16a695f08fe 100644 --- a/src/test/run-pass/send_str_hashmap.rs +++ b/src/test/run-pass/send_str_hashmap.rs @@ -20,7 +20,7 @@ use std::borrow::{Cow, IntoCow}; type SendStr = Cow<'static, str>; pub fn main() { - let mut map: HashMap = HashMap::new(); + let mut map: HashMap = HashMap::new(); assert!(map.insert("foo".into_cow(), 42).is_none()); assert!(map.insert("foo".to_string().into_cow(), 42).is_some()); assert!(map.insert("foo".into_cow(), 42).is_some()); diff --git a/src/test/run-pass/send_str_treemap.rs b/src/test/run-pass/send_str_treemap.rs index 07dd5443348..d56657ee4d5 100644 --- a/src/test/run-pass/send_str_treemap.rs +++ b/src/test/run-pass/send_str_treemap.rs @@ -20,7 +20,7 @@ use std::borrow::{Cow, IntoCow}; type SendStr = Cow<'static, str>; pub fn main() { - let mut map: BTreeMap = BTreeMap::new(); + let mut map: BTreeMap = BTreeMap::new(); assert!(map.insert("foo".into_cow(), 42).is_none()); assert!(map.insert("foo".to_string().into_cow(), 42).is_some()); assert!(map.insert("foo".into_cow(), 42).is_some()); diff --git a/src/test/run-pass/sendable-class.rs b/src/test/run-pass/sendable-class.rs index 993ae2a43fb..4fb1c32952f 100644 --- a/src/test/run-pass/sendable-class.rs +++ b/src/test/run-pass/sendable-class.rs @@ -15,11 +15,11 @@ use std::sync::mpsc::channel; struct foo { - i: int, + i: isize, j: char, } -fn foo(i:int, j: char) -> foo { +fn foo(i:isize, j: char) -> foo { foo { i: i, j: j diff --git a/src/test/run-pass/sendfn-is-a-block.rs b/src/test/run-pass/sendfn-is-a-block.rs index 5f23b72edb7..59b92ec6a48 100644 --- a/src/test/run-pass/sendfn-is-a-block.rs +++ b/src/test/run-pass/sendfn-is-a-block.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 -fn test(f: F) -> uint where F: FnOnce(uint) -> uint { +fn test(f: F) -> usize where F: FnOnce(usize) -> usize { return f(22); } diff --git a/src/test/run-pass/sendfn-spawn-with-fn-arg.rs b/src/test/run-pass/sendfn-spawn-with-fn-arg.rs index 264ee5f55b9..63ffa552405 100644 --- a/src/test/run-pass/sendfn-spawn-with-fn-arg.rs +++ b/src/test/run-pass/sendfn-spawn-with-fn-arg.rs @@ -15,13 +15,13 @@ use std::thread; pub fn main() { test05(); } -fn test05_start(f: F) { +fn test05_start(f: F) { f(22); } fn test05() { let three: Box<_> = box 3; - let fn_to_send = move|n:int| { + let fn_to_send = move|n:isize| { println!("{}", *three + n); // will copy x into the closure assert_eq!(*three, 3); }; diff --git a/src/test/run-pass/sepcomp-cci.rs b/src/test/run-pass/sepcomp-cci.rs index 07393d83e67..6a92f32c0b3 100644 --- a/src/test/run-pass/sepcomp-cci.rs +++ b/src/test/run-pass/sepcomp-cci.rs @@ -18,20 +18,20 @@ extern crate sepcomp_cci_lib; use sepcomp_cci_lib::{cci_fn, CCI_STATIC}; -fn call1() -> uint { +fn call1() -> usize { cci_fn() + CCI_STATIC } mod a { use sepcomp_cci_lib::{cci_fn, CCI_STATIC}; - pub fn call2() -> uint { + pub fn call2() -> usize { cci_fn() + CCI_STATIC } } mod b { use sepcomp_cci_lib::{cci_fn, CCI_STATIC}; - pub fn call3() -> uint { + pub fn call3() -> usize { cci_fn() + CCI_STATIC } } diff --git a/src/test/run-pass/sepcomp-extern.rs b/src/test/run-pass/sepcomp-extern.rs index fc85fc223a4..87470e90047 100644 --- a/src/test/run-pass/sepcomp-extern.rs +++ b/src/test/run-pass/sepcomp-extern.rs @@ -18,21 +18,21 @@ #[link(name = "sepcomp-extern-lib")] extern { #[allow(ctypes)] - fn foo() -> uint; + fn foo() -> usize; } -fn call1() -> uint { +fn call1() -> usize { unsafe { foo() } } mod a { - pub fn call2() -> uint { + pub fn call2() -> usize { unsafe { ::foo() } } } mod b { - pub fn call3() -> uint { + pub fn call3() -> usize { unsafe { ::foo() } } } diff --git a/src/test/run-pass/sepcomp-fns-backwards.rs b/src/test/run-pass/sepcomp-fns-backwards.rs index 79988413229..2e510082e27 100644 --- a/src/test/run-pass/sepcomp-fns-backwards.rs +++ b/src/test/run-pass/sepcomp-fns-backwards.rs @@ -17,21 +17,21 @@ // compilation unit as the top-level module. // pretty-expanded FIXME #23616 -fn pad() -> uint { 0 } +fn pad() -> usize { 0 } mod b { - pub fn three() -> uint { + pub fn three() -> usize { ::one() + ::a::two() } } mod a { - pub fn two() -> uint { + pub fn two() -> usize { ::one() + ::one() } } -fn one() -> uint { +fn one() -> usize { 1 } diff --git a/src/test/run-pass/sepcomp-fns.rs b/src/test/run-pass/sepcomp-fns.rs index f3673dfdbf2..f4fa0ed5698 100644 --- a/src/test/run-pass/sepcomp-fns.rs +++ b/src/test/run-pass/sepcomp-fns.rs @@ -19,16 +19,16 @@ // compilation unit as the top-level module. // pretty-expanded FIXME #23616 -fn one() -> uint { 1 } +fn one() -> usize { 1 } mod a { - pub fn two() -> uint { + pub fn two() -> usize { ::one() + ::one() } } mod b { - pub fn three() -> uint { + pub fn three() -> usize { ::one() + ::a::two() } } diff --git a/src/test/run-pass/sepcomp-statics.rs b/src/test/run-pass/sepcomp-statics.rs index 43d03e2bb6b..e926114e219 100644 --- a/src/test/run-pass/sepcomp-statics.rs +++ b/src/test/run-pass/sepcomp-statics.rs @@ -14,23 +14,23 @@ // pretty-expanded FIXME #23616 -fn pad() -> uint { 0 } +fn pad() -> usize { 0 } -const ONE: uint = 1; +const ONE: usize = 1; mod b { // Separate compilation always switches to the LLVM module with the fewest // instructions. Make sure we have some instructions in this module so // that `a` and `b` don't go into the same compilation unit. - fn pad() -> uint { 0 } + fn pad() -> usize { 0 } - pub static THREE: uint = ::ONE + ::a::TWO; + pub static THREE: usize = ::ONE + ::a::TWO; } mod a { - fn pad() -> uint { 0 } + fn pad() -> usize { 0 } - pub const TWO: uint = ::ONE + ::ONE; + pub const TWO: usize = ::ONE + ::ONE; } fn main() { diff --git a/src/test/run-pass/sepcomp-unwind.rs b/src/test/run-pass/sepcomp-unwind.rs index 6b39510c8c2..71d3d91e84f 100644 --- a/src/test/run-pass/sepcomp-unwind.rs +++ b/src/test/run-pass/sepcomp-unwind.rs @@ -23,7 +23,7 @@ use std::thread; -fn pad() -> uint { 0 } +fn pad() -> usize { 0 } mod a { pub fn f() { diff --git a/src/test/run-pass/shadow.rs b/src/test/run-pass/shadow.rs index 6e03c1e4a80..3b719d1806e 100644 --- a/src/test/run-pass/shadow.rs +++ b/src/test/run-pass/shadow.rs @@ -8,13 +8,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn foo(c: Vec ) { - let a: int = 5; - let mut b: Vec = Vec::new(); +fn foo(c: Vec ) { + let a: isize = 5; + let mut b: Vec = Vec::new(); - match t::none:: { - t::some::(_) => { + match t::none:: { + t::some::(_) => { for _i in &c { println!("{}", a); let a = 17; diff --git a/src/test/run-pass/shift.rs b/src/test/run-pass/shift.rs index 138a681ce2a..f1637fe1e09 100644 --- a/src/test/run-pass/shift.rs +++ b/src/test/run-pass/shift.rs @@ -24,60 +24,60 @@ fn test_misc() { } fn test_expr() { - let v10 = 10 as uint; + let v10 = 10 as usize; let v4 = 4 as u8; let v2 = 2 as u8; - assert_eq!(v10 >> v2 as uint, v2 as uint); - assert_eq!(v10 << v4 as uint, 160 as uint); + assert_eq!(v10 >> v2 as usize, v2 as usize); + assert_eq!(v10 << v4 as usize, 160 as usize); let v10 = 10 as u8; - let v4 = 4 as uint; - let v2 = 2 as uint; - assert_eq!(v10 >> v2 as uint, v2 as u8); - assert_eq!(v10 << v4 as uint, 160 as u8); + let v4 = 4 as usize; + let v2 = 2 as usize; + assert_eq!(v10 >> v2 as usize, v2 as u8); + assert_eq!(v10 << v4 as usize, 160 as u8); - let v10 = 10 as int; + let v10 = 10 as isize; let v4 = 4 as i8; let v2 = 2 as i8; - assert_eq!(v10 >> v2 as uint, v2 as int); - assert_eq!(v10 << v4 as uint, 160 as int); + assert_eq!(v10 >> v2 as usize, v2 as isize); + assert_eq!(v10 << v4 as usize, 160 as isize); let v10 = 10 as i8; - let v4 = 4 as int; - let v2 = 2 as int; - assert_eq!(v10 >> v2 as uint, v2 as i8); - assert_eq!(v10 << v4 as uint, 160 as i8); + let v4 = 4 as isize; + let v2 = 2 as isize; + assert_eq!(v10 >> v2 as usize, v2 as i8); + assert_eq!(v10 << v4 as usize, 160 as i8); - let v10 = 10 as uint; - let v4 = 4 as int; - let v2 = 2 as int; - assert_eq!(v10 >> v2 as uint, v2 as uint); - assert_eq!(v10 << v4 as uint, 160 as uint); + let v10 = 10 as usize; + let v4 = 4 as isize; + let v2 = 2 as isize; + assert_eq!(v10 >> v2 as usize, v2 as usize); + assert_eq!(v10 << v4 as usize, 160 as usize); } fn test_const() { - static r1_1: uint = 10_usize >> 2_usize; - static r2_1: uint = 10_usize << 4_usize; - assert_eq!(r1_1, 2 as uint); - assert_eq!(r2_1, 160 as uint); + static r1_1: usize = 10_usize >> 2_usize; + static r2_1: usize = 10_usize << 4_usize; + assert_eq!(r1_1, 2 as usize); + assert_eq!(r2_1, 160 as usize); static r1_2: u8 = 10u8 >> 2_usize; static r2_2: u8 = 10u8 << 4_usize; assert_eq!(r1_2, 2 as u8); assert_eq!(r2_2, 160 as u8); - static r1_3: int = 10 >> 2_usize; - static r2_3: int = 10 << 4_usize; - assert_eq!(r1_3, 2 as int); - assert_eq!(r2_3, 160 as int); + static r1_3: isize = 10 >> 2_usize; + static r2_3: isize = 10 << 4_usize; + assert_eq!(r1_3, 2 as isize); + assert_eq!(r2_3, 160 as isize); static r1_4: i8 = 10i8 >> 2_usize; static r2_4: i8 = 10i8 << 4_usize; assert_eq!(r1_4, 2 as i8); assert_eq!(r2_4, 160 as i8); - static r1_5: uint = 10_usize >> 2_usize; - static r2_5: uint = 10_usize << 4_usize; - assert_eq!(r1_5, 2 as uint); - assert_eq!(r2_5, 160 as uint); + static r1_5: usize = 10_usize >> 2_usize; + static r2_5: usize = 10_usize << 4_usize; + assert_eq!(r1_5, 2 as usize); + assert_eq!(r2_5, 160 as usize); } diff --git a/src/test/run-pass/signal-exit-status.rs b/src/test/run-pass/signal-exit-status.rs index 90bb36f25f7..bfc4aee7757 100644 --- a/src/test/run-pass/signal-exit-status.rs +++ b/src/test/run-pass/signal-exit-status.rs @@ -20,7 +20,7 @@ pub fn main() { let args: Vec = env::args().collect(); if args.len() >= 2 && args[1] == "signal" { // Raise a segfault. - unsafe { *(0 as *mut int) = 0; } + unsafe { *(0 as *mut isize) = 0; } } else { let status = Command::new(&args[0]).arg("signal").status().unwrap(); // Windows does not have signal, so we get exit status 0xC0000028 (STATUS_BAD_STACK). diff --git a/src/test/run-pass/signed-shift-const-eval.rs b/src/test/run-pass/signed-shift-const-eval.rs index eab4a0dfb7f..71672364380 100644 --- a/src/test/run-pass/signed-shift-const-eval.rs +++ b/src/test/run-pass/signed-shift-const-eval.rs @@ -12,5 +12,5 @@ enum test { thing = -5 >> 1_usize } pub fn main() { - assert_eq!(test::thing as int, -3); + assert_eq!(test::thing as isize, -3); } diff --git a/src/test/run-pass/simple-generic-match.rs b/src/test/run-pass/simple-generic-match.rs index 3273b73b4e2..02fc2a61d01 100644 --- a/src/test/run-pass/simple-generic-match.rs +++ b/src/test/run-pass/simple-generic-match.rs @@ -14,4 +14,4 @@ enum clam { a(T), } -pub fn main() { let c = clam::a(2); match c { clam::a::(_) => { } } } +pub fn main() { let c = clam::a(2); match c { clam::a::(_) => { } } } diff --git a/src/test/run-pass/simple-match-generic-tag.rs b/src/test/run-pass/simple-match-generic-tag.rs index 2217dddbd21..52989b36669 100644 --- a/src/test/run-pass/simple-match-generic-tag.rs +++ b/src/test/run-pass/simple-match-generic-tag.rs @@ -11,9 +11,9 @@ enum opt { none, some(T) } pub fn main() { - let x = opt::none::; + let x = opt::none::; match x { - opt::none:: => { println!("hello world"); } + opt::none:: => { println!("hello world"); } opt::some(_) => { } } } diff --git a/src/test/run-pass/size-and-align.rs b/src/test/run-pass/size-and-align.rs index 4b587ae70a1..007ce52d7c4 100644 --- a/src/test/run-pass/size-and-align.rs +++ b/src/test/run-pass/size-and-align.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -enum clam { a(T, int), b, } +enum clam { a(T, isize), b, } fn uhoh(v: Vec> ) { match v[1] { @@ -22,6 +22,6 @@ fn uhoh(v: Vec> ) { } pub fn main() { - let v: Vec> = vec!(clam::b::, clam::b::, clam::a::(42, 17)); - uhoh::(v); + let v: Vec> = vec!(clam::b::, clam::b::, clam::a::(42, 17)); + uhoh::(v); } diff --git a/src/test/run-pass/slice-2.rs b/src/test/run-pass/slice-2.rs index 1d0d28d5f95..7f34b94ad04 100644 --- a/src/test/run-pass/slice-2.rs +++ b/src/test/run-pass/slice-2.rs @@ -13,59 +13,59 @@ // pretty-expanded FIXME #23616 fn main() { - let x: &[int] = &[1, 2, 3, 4, 5]; - let cmp: &[int] = &[1, 2, 3, 4, 5]; + let x: &[isize] = &[1, 2, 3, 4, 5]; + let cmp: &[isize] = &[1, 2, 3, 4, 5]; assert!(&x[..] == cmp); - let cmp: &[int] = &[3, 4, 5]; + let cmp: &[isize] = &[3, 4, 5]; assert!(&x[2..] == cmp); - let cmp: &[int] = &[1, 2, 3]; + let cmp: &[isize] = &[1, 2, 3]; assert!(&x[..3] == cmp); - let cmp: &[int] = &[2, 3, 4]; + let cmp: &[isize] = &[2, 3, 4]; assert!(&x[1..4] == cmp); - let x: Vec = vec![1, 2, 3, 4, 5]; - let cmp: &[int] = &[1, 2, 3, 4, 5]; + let x: Vec = vec![1, 2, 3, 4, 5]; + let cmp: &[isize] = &[1, 2, 3, 4, 5]; assert!(&x[..] == cmp); - let cmp: &[int] = &[3, 4, 5]; + let cmp: &[isize] = &[3, 4, 5]; assert!(&x[2..] == cmp); - let cmp: &[int] = &[1, 2, 3]; + let cmp: &[isize] = &[1, 2, 3]; assert!(&x[..3] == cmp); - let cmp: &[int] = &[2, 3, 4]; + let cmp: &[isize] = &[2, 3, 4]; assert!(&x[1..4] == cmp); - let x: &mut [int] = &mut [1, 2, 3, 4, 5]; + let x: &mut [isize] = &mut [1, 2, 3, 4, 5]; { - let cmp: &mut [int] = &mut [1, 2, 3, 4, 5]; + let cmp: &mut [isize] = &mut [1, 2, 3, 4, 5]; assert!(&mut x[..] == cmp); } { - let cmp: &mut [int] = &mut [3, 4, 5]; + let cmp: &mut [isize] = &mut [3, 4, 5]; assert!(&mut x[2..] == cmp); } { - let cmp: &mut [int] = &mut [1, 2, 3]; + let cmp: &mut [isize] = &mut [1, 2, 3]; assert!(&mut x[..3] == cmp); } { - let cmp: &mut [int] = &mut [2, 3, 4]; + let cmp: &mut [isize] = &mut [2, 3, 4]; assert!(&mut x[1..4] == cmp); } - let mut x: Vec = vec![1, 2, 3, 4, 5]; + let mut x: Vec = vec![1, 2, 3, 4, 5]; { - let cmp: &mut [int] = &mut [1, 2, 3, 4, 5]; + let cmp: &mut [isize] = &mut [1, 2, 3, 4, 5]; assert!(&mut x[..] == cmp); } { - let cmp: &mut [int] = &mut [3, 4, 5]; + let cmp: &mut [isize] = &mut [3, 4, 5]; assert!(&mut x[2..] == cmp); } { - let cmp: &mut [int] = &mut [1, 2, 3]; + let cmp: &mut [isize] = &mut [1, 2, 3]; assert!(&mut x[..3] == cmp); } { - let cmp: &mut [int] = &mut [2, 3, 4]; + let cmp: &mut [isize] = &mut [2, 3, 4]; assert!(&mut x[1..4] == cmp); } } diff --git a/src/test/run-pass/slice-panic-1.rs b/src/test/run-pass/slice-panic-1.rs index bb8db83ccdc..a4f737f7461 100644 --- a/src/test/run-pass/slice-panic-1.rs +++ b/src/test/run-pass/slice-panic-1.rs @@ -16,7 +16,7 @@ use std::thread; struct Foo; -static mut DTOR_COUNT: int = 0; +static mut DTOR_COUNT: isize = 0; impl Drop for Foo { fn drop(&mut self) { unsafe { DTOR_COUNT += 1; } } diff --git a/src/test/run-pass/slice-panic-2.rs b/src/test/run-pass/slice-panic-2.rs index 94ea026d87d..f02a84b9070 100644 --- a/src/test/run-pass/slice-panic-2.rs +++ b/src/test/run-pass/slice-panic-2.rs @@ -16,13 +16,13 @@ use std::thread; struct Foo; -static mut DTOR_COUNT: int = 0; +static mut DTOR_COUNT: isize = 0; impl Drop for Foo { fn drop(&mut self) { unsafe { DTOR_COUNT += 1; } } } -fn bar() -> uint { +fn bar() -> usize { panic!(); } diff --git a/src/test/run-pass/slice.rs b/src/test/run-pass/slice.rs index ec6cdf44830..edc5f6b1846 100644 --- a/src/test/run-pass/slice.rs +++ b/src/test/run-pass/slice.rs @@ -17,7 +17,7 @@ extern crate core; use core::ops::{Index, IndexMut, Range, RangeTo, RangeFrom, RangeFull}; -static mut COUNT: uint = 0; +static mut COUNT: usize = 0; struct Foo; diff --git a/src/test/run-pass/smallest-hello-world.rs b/src/test/run-pass/smallest-hello-world.rs index d7926ec8b29..5e84ce19de1 100644 --- a/src/test/run-pass/smallest-hello-world.rs +++ b/src/test/run-pass/smallest-hello-world.rs @@ -26,9 +26,9 @@ extern "rust-intrinsic" { fn transmute(t: T) -> U; } #[start] #[no_stack_check] -fn main(_: int, _: *const *const u8) -> int { +fn main(_: isize, _: *const *const u8) -> isize { unsafe { - let (ptr, _): (*const u8, uint) = transmute("Hello!\0"); + let (ptr, _): (*const u8, usize) = transmute("Hello!\0"); puts(ptr); } return 0; diff --git a/src/test/run-pass/spawn-fn.rs b/src/test/run-pass/spawn-fn.rs index 4f8ba7f655e..aee0a459c31 100644 --- a/src/test/run-pass/spawn-fn.rs +++ b/src/test/run-pass/spawn-fn.rs @@ -12,7 +12,7 @@ use std::thread::Thread; -fn x(s: String, n: int) { +fn x(s: String, n: isize) { println!("{}", s); println!("{}", n); } @@ -21,7 +21,7 @@ pub fn main() { let _t = Thread::spawn(|| x("hello from first spawned fn".to_string(), 65) ); let _t = Thread::spawn(|| x("hello from second spawned fn".to_string(), 66) ); let _t = Thread::spawn(|| x("hello from third spawned fn".to_string(), 67) ); - let mut i: int = 30; + let mut i: isize = 30; while i > 0 { i = i - 1; println!("parent sleeping"); diff --git a/src/test/run-pass/spawn-types.rs b/src/test/run-pass/spawn-types.rs index baf7bb6308f..aab292a940a 100644 --- a/src/test/run-pass/spawn-types.rs +++ b/src/test/run-pass/spawn-types.rs @@ -19,14 +19,14 @@ use std::thread; use std::sync::mpsc::{channel, Sender}; -type ctx = Sender; +type ctx = Sender; fn iotask(_tx: &ctx, ip: String) { assert_eq!(ip, "localhost".to_string()); } pub fn main() { - let (tx, _rx) = channel::(); + let (tx, _rx) = channel::(); let t = thread::spawn(move|| iotask(&tx, "localhost".to_string()) ); t.join().ok().unwrap(); } diff --git a/src/test/run-pass/spawn.rs b/src/test/run-pass/spawn.rs index 90b47f4986b..1c34634c73d 100644 --- a/src/test/run-pass/spawn.rs +++ b/src/test/run-pass/spawn.rs @@ -14,4 +14,4 @@ pub fn main() { thread::spawn(move|| child(10)).join().ok().unwrap(); } -fn child(i: int) { println!("{}", i); assert!((i == 10)); } +fn child(i: isize) { println!("{}", i); assert!((i == 10)); } diff --git a/src/test/run-pass/spawn2.rs b/src/test/run-pass/spawn2.rs index b808ea472a2..93dc3faaa20 100644 --- a/src/test/run-pass/spawn2.rs +++ b/src/test/run-pass/spawn2.rs @@ -15,7 +15,7 @@ pub fn main() { t.join().ok().unwrap(); // forget Err value, since it doesn't implement Debug } -fn child(args: (int, int, int, int, int, int, int, int, int)) { +fn child(args: (isize, isize, isize, isize, isize, isize, isize, isize, isize)) { let (i1, i2, i3, i4, i5, i6, i7, i8, i9) = args; println!("{}", i1); println!("{}", i2); diff --git a/src/test/run-pass/stable-addr-of.rs b/src/test/run-pass/stable-addr-of.rs index 920cd9e03ab..f93600195dc 100644 --- a/src/test/run-pass/stable-addr-of.rs +++ b/src/test/run-pass/stable-addr-of.rs @@ -13,6 +13,6 @@ // pretty-expanded FIXME #23616 pub fn main() { - let foo: int = 1; - assert_eq!(&foo as *const int, &foo as *const int); + let foo: isize = 1; + assert_eq!(&foo as *const isize, &foo as *const isize); } diff --git a/src/test/run-pass/static-function-pointer-xc.rs b/src/test/run-pass/static-function-pointer-xc.rs index f4d6e89d170..ecabfcaf20c 100644 --- a/src/test/run-pass/static-function-pointer-xc.rs +++ b/src/test/run-pass/static-function-pointer-xc.rs @@ -13,7 +13,7 @@ extern crate "static-function-pointer-aux" as aux; -fn f(x: int) -> int { x } +fn f(x: isize) -> isize { x } pub fn main() { assert_eq!(aux::F(42), -42); diff --git a/src/test/run-pass/static-function-pointer.rs b/src/test/run-pass/static-function-pointer.rs index a2b1572db63..67cc033f7cf 100644 --- a/src/test/run-pass/static-function-pointer.rs +++ b/src/test/run-pass/static-function-pointer.rs @@ -10,11 +10,11 @@ // pretty-expanded FIXME #23616 -fn f(x: int) -> int { x } -fn g(x: int) -> int { 2 * x } +fn f(x: isize) -> isize { x } +fn g(x: isize) -> isize { 2 * x } -static F: fn(int) -> int = f; -static mut G: fn(int) -> int = f; +static F: fn(isize) -> isize = f; +static mut G: fn(isize) -> isize = f; pub fn main() { assert_eq!(F(42), 42); diff --git a/src/test/run-pass/static-impl.rs b/src/test/run-pass/static-impl.rs index 6af348b0e3e..aff2797c1ac 100644 --- a/src/test/run-pass/static-impl.rs +++ b/src/test/run-pass/static-impl.rs @@ -13,42 +13,42 @@ // pretty-expanded FIXME #23616 pub trait plus { - fn plus(&self) -> int; + fn plus(&self) -> isize; } mod a { use plus; - impl plus for uint { fn plus(&self) -> int { *self as int + 20 } } + impl plus for usize { fn plus(&self) -> isize { *self as isize + 20 } } } mod b { use plus; - impl plus for String { fn plus(&self) -> int { 200 } } + impl plus for String { fn plus(&self) -> isize { 200 } } } trait uint_utils { fn str(&self) -> String; - fn multi(&self, f: F) where F: FnMut(uint); + fn multi(&self, f: F) where F: FnMut(usize); } -impl uint_utils for uint { +impl uint_utils for usize { fn str(&self) -> String { self.to_string() } - fn multi(&self, mut f: F) where F: FnMut(uint) { + fn multi(&self, mut f: F) where F: FnMut(usize) { let mut c = 0_usize; while c < *self { f(c); c += 1_usize; } } } trait vec_utils { - fn length_(&self, ) -> uint; + fn length_(&self, ) -> usize; fn iter_(&self, f: F) where F: FnMut(&T); fn map_(&self, f: F) -> Vec where F: FnMut(&T) -> U; } impl vec_utils for Vec { - fn length_(&self) -> uint { self.len() } + fn length_(&self) -> usize { self.len() } fn iter_(&self, mut f: F) where F: FnMut(&T) { for x in self { f(x); } } fn map_(&self, mut f: F) -> Vec where F: FnMut(&T) -> U { let mut r = Vec::new(); @@ -66,7 +66,7 @@ pub fn main() { assert_eq!((vec!(1)).length_().str(), "1".to_string()); let vect = vec!(3, 4).map_(|a| *a + 4); assert_eq!(vect[0], 7); - let vect = (vec!(3, 4)).map_::(|a| *a as uint + 4_usize); + let vect = (vec!(3, 4)).map_::(|a| *a as usize + 4_usize); assert_eq!(vect[0], 7_usize); let mut x = 0_usize; 10_usize.multi(|_n| x += 2_usize ); diff --git a/src/test/run-pass/static-method-in-trait-with-tps-intracrate.rs b/src/test/run-pass/static-method-in-trait-with-tps-intracrate.rs index 1eb20370f68..4ccb044bbd2 100644 --- a/src/test/run-pass/static-method-in-trait-with-tps-intracrate.rs +++ b/src/test/run-pass/static-method-in-trait-with-tps-intracrate.rs @@ -11,15 +11,15 @@ // pretty-expanded FIXME #23616 trait Deserializer { - fn read_int(&self) -> int; + fn read_int(&self) -> isize; } trait Deserializable { fn deserialize(d: &D) -> Self; } -impl Deserializable for int { - fn deserialize(d: &D) -> int { +impl Deserializable for isize { + fn deserialize(d: &D) -> isize { return d.read_int(); } } @@ -27,11 +27,11 @@ impl Deserializable for int { struct FromThinAir { dummy: () } impl Deserializer for FromThinAir { - fn read_int(&self) -> int { 22 } + fn read_int(&self) -> isize { 22 } } pub fn main() { let d = FromThinAir { dummy: () }; - let i: int = Deserializable::deserialize(&d); + let i: isize = Deserializable::deserialize(&d); assert_eq!(i, 22); } diff --git a/src/test/run-pass/static-method-xcrate.rs b/src/test/run-pass/static-method-xcrate.rs index ed9160e1d58..d0b69b430a6 100644 --- a/src/test/run-pass/static-method-xcrate.rs +++ b/src/test/run-pass/static-method-xcrate.rs @@ -17,7 +17,7 @@ extern crate static_methods_crate; use static_methods_crate::read; pub fn main() { - let result: int = read("5".to_string()); + let result: isize = read("5".to_string()); assert_eq!(result, 5); assert_eq!(read::readMaybe("false".to_string()), Some(false)); assert_eq!(read::readMaybe("foo".to_string()), None::); diff --git a/src/test/run-pass/static-methods-in-traits.rs b/src/test/run-pass/static-methods-in-traits.rs index 33c1ce4d2c3..cb23feb05a5 100644 --- a/src/test/run-pass/static-methods-in-traits.rs +++ b/src/test/run-pass/static-methods-in-traits.rs @@ -15,22 +15,22 @@ mod a { fn foo() -> Self; } - impl Foo for int { - fn foo() -> int { + impl Foo for isize { + fn foo() -> isize { 3 } } - impl Foo for uint { - fn foo() -> uint { + impl Foo for usize { + fn foo() -> usize { 5 } } } pub fn main() { - let x: int = a::Foo::foo(); - let y: uint = a::Foo::foo(); + let x: isize = a::Foo::foo(); + let y: usize = a::Foo::foo(); assert_eq!(x, 3); assert_eq!(y, 5); } diff --git a/src/test/run-pass/static-mut-xc.rs b/src/test/run-pass/static-mut-xc.rs index a32bf7a7af2..0456d17bdc4 100644 --- a/src/test/run-pass/static-mut-xc.rs +++ b/src/test/run-pass/static-mut-xc.rs @@ -18,9 +18,9 @@ extern crate static_mut_xc; -unsafe fn static_bound(_: &'static int) {} +unsafe fn static_bound(_: &'static isize) {} -fn static_bound_set(a: &'static mut int) { +fn static_bound_set(a: &'static mut isize) { *a = 3; } @@ -43,5 +43,5 @@ pub fn main() { } pub mod inner { - pub static mut a: int = 4; + pub static mut a: isize = 4; } diff --git a/src/test/run-pass/struct-aliases.rs b/src/test/run-pass/struct-aliases.rs index c27e6e4576c..79e7960cfb2 100644 --- a/src/test/run-pass/struct-aliases.rs +++ b/src/test/run-pass/struct-aliases.rs @@ -11,8 +11,8 @@ // pretty-expanded FIXME #23616 struct S { - x: int, - y: int, + x: isize, + y: isize, } type S2 = S; diff --git a/src/test/run-pass/struct-like-variant-construct.rs b/src/test/run-pass/struct-like-variant-construct.rs index 8ff17bf08f8..a55e5143a0b 100644 --- a/src/test/run-pass/struct-like-variant-construct.rs +++ b/src/test/run-pass/struct-like-variant-construct.rs @@ -12,8 +12,8 @@ enum Foo { Bar { - a: int, - b: int + a: isize, + b: isize }, Baz { c: f64, diff --git a/src/test/run-pass/struct-like-variant-match.rs b/src/test/run-pass/struct-like-variant-match.rs index 36b9a6d9e8d..f072d315d72 100644 --- a/src/test/run-pass/struct-like-variant-match.rs +++ b/src/test/run-pass/struct-like-variant-match.rs @@ -12,8 +12,8 @@ enum Foo { Bar { - x: int, - y: int + x: isize, + y: isize }, Baz { x: f64, diff --git a/src/test/run-pass/struct-new-as-field-name.rs b/src/test/run-pass/struct-new-as-field-name.rs index 22a57cbf043..73f27448f81 100644 --- a/src/test/run-pass/struct-new-as-field-name.rs +++ b/src/test/run-pass/struct-new-as-field-name.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 struct Foo { - new: int, + new: isize, } pub fn main() { diff --git a/src/test/run-pass/struct-order-of-eval-1.rs b/src/test/run-pass/struct-order-of-eval-1.rs index 1c7101402ab..49ec695a122 100644 --- a/src/test/run-pass/struct-order-of-eval-1.rs +++ b/src/test/run-pass/struct-order-of-eval-1.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -struct S { f0: String, f1: int } +struct S { f0: String, f1: isize } pub fn main() { let s = "Hello, world!".to_string(); diff --git a/src/test/run-pass/struct-partial-move-1.rs b/src/test/run-pass/struct-partial-move-1.rs index 8f75b763d96..3b04bfc1acc 100644 --- a/src/test/run-pass/struct-partial-move-1.rs +++ b/src/test/run-pass/struct-partial-move-1.rs @@ -12,8 +12,8 @@ pub struct Partial { x: T, y: T } #[derive(PartialEq, Debug)] -struct S { val: int } -impl S { fn new(v: int) -> S { S { val: v } } } +struct S { val: isize } +impl S { fn new(v: isize) -> S { S { val: v } } } impl Drop for S { fn drop(&mut self) { } } pub fn f((b1, b2): (T, T), mut f: F) -> Partial where F: FnMut(T) -> T { diff --git a/src/test/run-pass/struct-partial-move-2.rs b/src/test/run-pass/struct-partial-move-2.rs index 377e9e6b89a..b9c697c71ea 100644 --- a/src/test/run-pass/struct-partial-move-2.rs +++ b/src/test/run-pass/struct-partial-move-2.rs @@ -12,8 +12,8 @@ pub struct Partial { x: T, y: T } #[derive(PartialEq, Debug)] -struct S { val: int } -impl S { fn new(v: int) -> S { S { val: v } } } +struct S { val: isize } +impl S { fn new(v: isize) -> S { S { val: v } } } impl Drop for S { fn drop(&mut self) { } } pub type Two = (Partial, Partial); diff --git a/src/test/run-pass/struct-pattern-matching.rs b/src/test/run-pass/struct-pattern-matching.rs index 6033554d0cb..9c3ce54f369 100644 --- a/src/test/run-pass/struct-pattern-matching.rs +++ b/src/test/run-pass/struct-pattern-matching.rs @@ -9,8 +9,8 @@ // except according to those terms. struct Foo { - x: int, - y: int, + x: isize, + y: isize, } pub fn main() { diff --git a/src/test/run-pass/struct-return.rs b/src/test/run-pass/struct-return.rs index d67c6322c61..9e372913e05 100644 --- a/src/test/run-pass/struct-return.rs +++ b/src/test/run-pass/struct-return.rs @@ -33,10 +33,10 @@ fn test1() { c: 0xcccc_cccc_cccc_cccc, d: 0xdddd_dddd_dddd_dddd }; let qq = rustrt::rust_dbg_abi_1(q); - println!("a: {:x}", qq.a as uint); - println!("b: {:x}", qq.b as uint); - println!("c: {:x}", qq.c as uint); - println!("d: {:x}", qq.d as uint); + println!("a: {:x}", qq.a as usize); + println!("b: {:x}", qq.b as usize); + println!("c: {:x}", qq.c as usize); + println!("d: {:x}", qq.d as usize); assert_eq!(qq.a, q.c + 1); assert_eq!(qq.b, q.d - 1); assert_eq!(qq.c, q.a + 1); @@ -52,7 +52,7 @@ fn test2() { c: 1.0987654321e-15_f64 }; let ff = rustrt::rust_dbg_abi_2(f); println!("a: {}", ff.a as f64); - println!("b: {}", ff.b as uint); + println!("b: {}", ff.b as usize); println!("c: {}", ff.c as f64); assert_eq!(ff.a, f.c + 1.0f64); assert_eq!(ff.b, 0xff); diff --git a/src/test/run-pass/struct-variant-field-visibility.rs b/src/test/run-pass/struct-variant-field-visibility.rs index 383292fe097..b6e7846e96d 100644 --- a/src/test/run-pass/struct-variant-field-visibility.rs +++ b/src/test/run-pass/struct-variant-field-visibility.rs @@ -12,7 +12,7 @@ mod foo { pub enum Foo { - Bar { a: int } + Bar { a: isize } } } diff --git a/src/test/run-pass/structured-compare.rs b/src/test/run-pass/structured-compare.rs index 12d8fe8f4c8..4df802849e2 100644 --- a/src/test/run-pass/structured-compare.rs +++ b/src/test/run-pass/structured-compare.rs @@ -15,7 +15,7 @@ enum foo { large, small, } impl PartialEq for foo { fn eq(&self, other: &foo) -> bool { - ((*self) as uint) == ((*other) as uint) + ((*self) as usize) == ((*other) as usize) } fn ne(&self, other: &foo) -> bool { !(*self).eq(other) } } diff --git a/src/test/run-pass/super-fast-paren-parsing.rs b/src/test/run-pass/super-fast-paren-parsing.rs index f00ba36a004..69ec0a2222d 100644 --- a/src/test/run-pass/super-fast-paren-parsing.rs +++ b/src/test/run-pass/super-fast-paren-parsing.rs @@ -14,7 +14,7 @@ // // Big stack is needed for pretty printing, a little sad... -static a: int = +static a: isize = ((((((((((((((((((((((((((((((((((((((((((((((((((( ((((((((((((((((((((((((((((((((((((((((((((((((((( ((((((((((((((((((((((((((((((((((((((((((((((((((( diff --git a/src/test/run-pass/supported-cast.rs b/src/test/run-pass/supported-cast.rs index 7f705146aaa..811b9dce4bc 100644 --- a/src/test/run-pass/supported-cast.rs +++ b/src/test/run-pass/supported-cast.rs @@ -14,8 +14,8 @@ extern crate libc; pub fn main() { let f = 1_usize as *const libc::FILE; - println!("{:?}", f as int); - println!("{:?}", f as uint); + println!("{:?}", f as isize); + println!("{:?}", f as usize); println!("{:?}", f as i8); println!("{:?}", f as i16); println!("{:?}", f as i32); @@ -25,8 +25,8 @@ pub fn main() { println!("{:?}", f as u32); println!("{:?}", f as u64); - println!("{:?}", 1 as int); - println!("{:?}", 1 as uint); + println!("{:?}", 1 as isize); + println!("{:?}", 1 as usize); println!("{:?}", 1 as *const libc::FILE); println!("{:?}", 1 as i8); println!("{:?}", 1 as i16); @@ -39,8 +39,8 @@ pub fn main() { println!("{:?}", 1 as f32); println!("{:?}", 1 as f64); - println!("{:?}", 1_usize as int); - println!("{:?}", 1_usize as uint); + println!("{:?}", 1_usize as isize); + println!("{:?}", 1_usize as usize); println!("{:?}", 1_usize as *const libc::FILE); println!("{:?}", 1_usize as i8); println!("{:?}", 1_usize as i16); @@ -53,8 +53,8 @@ pub fn main() { println!("{:?}", 1_usize as f32); println!("{:?}", 1_usize as f64); - println!("{:?}", 1i8 as int); - println!("{:?}", 1i8 as uint); + println!("{:?}", 1i8 as isize); + println!("{:?}", 1i8 as usize); println!("{:?}", 1i8 as *const libc::FILE); println!("{:?}", 1i8 as i8); println!("{:?}", 1i8 as i16); @@ -67,8 +67,8 @@ pub fn main() { println!("{:?}", 1i8 as f32); println!("{:?}", 1i8 as f64); - println!("{:?}", 1u8 as int); - println!("{:?}", 1u8 as uint); + println!("{:?}", 1u8 as isize); + println!("{:?}", 1u8 as usize); println!("{:?}", 1u8 as *const libc::FILE); println!("{:?}", 1u8 as i8); println!("{:?}", 1u8 as i16); @@ -81,8 +81,8 @@ pub fn main() { println!("{:?}", 1u8 as f32); println!("{:?}", 1u8 as f64); - println!("{:?}", 1i16 as int); - println!("{:?}", 1i16 as uint); + println!("{:?}", 1i16 as isize); + println!("{:?}", 1i16 as usize); println!("{:?}", 1i16 as *const libc::FILE); println!("{:?}", 1i16 as i8); println!("{:?}", 1i16 as i16); @@ -95,8 +95,8 @@ pub fn main() { println!("{:?}", 1i16 as f32); println!("{:?}", 1i16 as f64); - println!("{:?}", 1u16 as int); - println!("{:?}", 1u16 as uint); + println!("{:?}", 1u16 as isize); + println!("{:?}", 1u16 as usize); println!("{:?}", 1u16 as *const libc::FILE); println!("{:?}", 1u16 as i8); println!("{:?}", 1u16 as i16); @@ -109,8 +109,8 @@ pub fn main() { println!("{:?}", 1u16 as f32); println!("{:?}", 1u16 as f64); - println!("{:?}", 1i32 as int); - println!("{:?}", 1i32 as uint); + println!("{:?}", 1i32 as isize); + println!("{:?}", 1i32 as usize); println!("{:?}", 1i32 as *const libc::FILE); println!("{:?}", 1i32 as i8); println!("{:?}", 1i32 as i16); @@ -123,8 +123,8 @@ pub fn main() { println!("{:?}", 1i32 as f32); println!("{:?}", 1i32 as f64); - println!("{:?}", 1u32 as int); - println!("{:?}", 1u32 as uint); + println!("{:?}", 1u32 as isize); + println!("{:?}", 1u32 as usize); println!("{:?}", 1u32 as *const libc::FILE); println!("{:?}", 1u32 as i8); println!("{:?}", 1u32 as i16); @@ -137,8 +137,8 @@ pub fn main() { println!("{:?}", 1u32 as f32); println!("{:?}", 1u32 as f64); - println!("{:?}", 1i64 as int); - println!("{:?}", 1i64 as uint); + println!("{:?}", 1i64 as isize); + println!("{:?}", 1i64 as usize); println!("{:?}", 1i64 as *const libc::FILE); println!("{:?}", 1i64 as i8); println!("{:?}", 1i64 as i16); @@ -151,8 +151,8 @@ pub fn main() { println!("{:?}", 1i64 as f32); println!("{:?}", 1i64 as f64); - println!("{:?}", 1u64 as int); - println!("{:?}", 1u64 as uint); + println!("{:?}", 1u64 as isize); + println!("{:?}", 1u64 as usize); println!("{:?}", 1u64 as *const libc::FILE); println!("{:?}", 1u64 as i8); println!("{:?}", 1u64 as i16); @@ -165,8 +165,8 @@ pub fn main() { println!("{:?}", 1u64 as f32); println!("{:?}", 1u64 as f64); - println!("{:?}", 1u64 as int); - println!("{:?}", 1u64 as uint); + println!("{:?}", 1u64 as isize); + println!("{:?}", 1u64 as usize); println!("{:?}", 1u64 as *const libc::FILE); println!("{:?}", 1u64 as i8); println!("{:?}", 1u64 as i16); @@ -179,8 +179,8 @@ pub fn main() { println!("{:?}", 1u64 as f32); println!("{:?}", 1u64 as f64); - println!("{:?}", true as int); - println!("{:?}", true as uint); + println!("{:?}", true as isize); + println!("{:?}", true as usize); println!("{:?}", true as *const libc::FILE); println!("{:?}", true as i8); println!("{:?}", true as i16); @@ -193,8 +193,8 @@ pub fn main() { println!("{:?}", true as f32); println!("{:?}", true as f64); - println!("{:?}", 1f32 as int); - println!("{:?}", 1f32 as uint); + println!("{:?}", 1f32 as isize); + println!("{:?}", 1f32 as usize); println!("{:?}", 1f32 as i8); println!("{:?}", 1f32 as i16); println!("{:?}", 1f32 as i32); @@ -206,8 +206,8 @@ pub fn main() { println!("{:?}", 1f32 as f32); println!("{:?}", 1f32 as f64); - println!("{:?}", 1f64 as int); - println!("{:?}", 1f64 as uint); + println!("{:?}", 1f64 as isize); + println!("{:?}", 1f64 as usize); println!("{:?}", 1f64 as i8); println!("{:?}", 1f64 as i16); println!("{:?}", 1f64 as i32); diff --git a/src/test/run-pass/swap-2.rs b/src/test/run-pass/swap-2.rs index 45bcba61b15..3891376e463 100644 --- a/src/test/run-pass/swap-2.rs +++ b/src/test/run-pass/swap-2.rs @@ -13,7 +13,7 @@ use std::mem::swap; pub fn main() { - let mut a: Vec = vec!(0, 1, 2, 3, 4, 5, 6); + let mut a: Vec = vec!(0, 1, 2, 3, 4, 5, 6); a.swap(2, 4); assert_eq!(a[2], 4); assert_eq!(a[4], 2); diff --git a/src/test/run-pass/swap-overlapping.rs b/src/test/run-pass/swap-overlapping.rs index 96cab66ab66..2e5386d6866 100644 --- a/src/test/run-pass/swap-overlapping.rs +++ b/src/test/run-pass/swap-overlapping.rs @@ -36,8 +36,8 @@ pub enum TestName { } pub enum TestFn { - DynTestFn(int), - DynBenchFn(int), + DynTestFn(isize), + DynBenchFn(isize), } pub struct TestDesc { diff --git a/src/test/run-pass/tag-align-dyn-u64.rs b/src/test/run-pass/tag-align-dyn-u64.rs index b0d4b4c4404..a9f5875023f 100644 --- a/src/test/run-pass/tag-align-dyn-u64.rs +++ b/src/test/run-pass/tag-align-dyn-u64.rs @@ -26,7 +26,7 @@ fn mk_rec() -> Rec { } fn is_u64_aligned(u: &Tag) -> bool { - let p: uint = unsafe { mem::transmute(u) }; + let p: usize = unsafe { mem::transmute(u) }; let u64_align = std::mem::min_align_of::(); return (p & (u64_align - 1)) == 0; } diff --git a/src/test/run-pass/tag-align-dyn-variants.rs b/src/test/run-pass/tag-align-dyn-variants.rs index 672a63824aa..90b583e2e50 100644 --- a/src/test/run-pass/tag-align-dyn-variants.rs +++ b/src/test/run-pass/tag-align-dyn-variants.rs @@ -28,12 +28,12 @@ fn mk_rec(a: A, b: B) -> Rec { Rec { chA:0, tA:Tag::VarA(a), chB:1, tB:Tag::VarB(b) } } -fn is_aligned(amnt: uint, u: &A) -> bool { - let p: uint = unsafe { mem::transmute(u) }; +fn is_aligned(amnt: usize, u: &A) -> bool { + let p: usize = unsafe { mem::transmute(u) }; return (p & (amnt-1)) == 0; } -fn variant_data_is_aligned(amnt: uint, u: &Tag) -> bool { +fn variant_data_is_aligned(amnt: usize, u: &Tag) -> bool { match u { &Tag::VarA(ref a) => is_aligned(amnt, a), &Tag::VarB(ref b) => is_aligned(amnt, b) diff --git a/src/test/run-pass/tag-align-u64.rs b/src/test/run-pass/tag-align-u64.rs index ca0e3ee95f8..e922ac3b466 100644 --- a/src/test/run-pass/tag-align-u64.rs +++ b/src/test/run-pass/tag-align-u64.rs @@ -26,7 +26,7 @@ fn mk_rec() -> Rec { } fn is_u64_aligned(u: &Tag) -> bool { - let p: uint = unsafe { mem::transmute(u) }; + let p: usize = unsafe { mem::transmute(u) }; let u64_align = std::mem::min_align_of::(); return (p & (u64_align - 1)) == 0; } diff --git a/src/test/run-pass/tag-variant-disr-val.rs b/src/test/run-pass/tag-variant-disr-val.rs index 95bfb786899..affabff9164 100644 --- a/src/test/run-pass/tag-variant-disr-val.rs +++ b/src/test/run-pass/tag-variant-disr-val.rs @@ -25,7 +25,7 @@ enum color { impl PartialEq for color { fn eq(&self, other: &color) -> bool { - ((*self) as uint) == ((*other) as uint) + ((*self) as usize) == ((*other) as usize) } fn ne(&self, other: &color) -> bool { !(*self).eq(other) } } @@ -41,9 +41,9 @@ pub fn main() { test_color(orange, 4, "orange".to_string()); } -fn test_color(color: color, val: int, name: String) { +fn test_color(color: color, val: isize, name: String) { //assert!(unsafe::transmute(color) == val); - assert_eq!(color as int, val); + assert_eq!(color as isize, val); assert!(get_color_alt(color) == name); assert!(get_color_if(color) == name); } diff --git a/src/test/run-pass/tag.rs b/src/test/run-pass/tag.rs index d6d4cd2de78..dbd65ee6bd4 100644 --- a/src/test/run-pass/tag.rs +++ b/src/test/run-pass/tag.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 -enum colour { red(int, int), green, } +enum colour { red(isize, isize), green, } impl PartialEq for colour { fn eq(&self, other: &colour) -> bool { diff --git a/src/test/run-pass/tail-cps.rs b/src/test/run-pass/tail-cps.rs index 6f03f385a83..b6313905923 100644 --- a/src/test/run-pass/tail-cps.rs +++ b/src/test/run-pass/tail-cps.rs @@ -12,13 +12,13 @@ fn checktrue(rs: bool) -> bool { assert!((rs)); return true; } pub fn main() { let k = checktrue; evenk(42, k); oddk(45, k); } -fn evenk(n: int, k: fn(bool) -> bool) -> bool { +fn evenk(n: isize, k: fn(bool) -> bool) -> bool { println!("evenk"); println!("{}", n); if n == 0 { return k(true); } else { return oddk(n - 1, k); } } -fn oddk(n: int, k: fn(bool) -> bool) -> bool { +fn oddk(n: isize, k: fn(bool) -> bool) -> bool { println!("oddk"); println!("{}", n); if n == 0 { return k(false); } else { return evenk(n - 1, k); } diff --git a/src/test/run-pass/tail-direct.rs b/src/test/run-pass/tail-direct.rs index 640da0697ac..01fc18af343 100644 --- a/src/test/run-pass/tail-direct.rs +++ b/src/test/run-pass/tail-direct.rs @@ -15,6 +15,6 @@ pub fn main() { assert!((even(42))); assert!((odd(45))); } -fn even(n: int) -> bool { if n == 0 { return true; } else { return odd(n - 1); } } +fn even(n: isize) -> bool { if n == 0 { return true; } else { return odd(n - 1); } } -fn odd(n: int) -> bool { if n == 0 { return false; } else { return even(n - 1); } } +fn odd(n: isize) -> bool { if n == 0 { return false; } else { return even(n - 1); } } diff --git a/src/test/run-pass/task-comm-0.rs b/src/test/run-pass/task-comm-0.rs index a24d61c8cea..05197cd6a3d 100644 --- a/src/test/run-pass/task-comm-0.rs +++ b/src/test/run-pass/task-comm-0.rs @@ -15,7 +15,7 @@ use std::sync::mpsc::{channel, Sender}; pub fn main() { test05(); } -fn test05_start(tx : &Sender) { +fn test05_start(tx : &Sender) { tx.send(10).unwrap(); println!("sent 10"); tx.send(20).unwrap(); @@ -27,7 +27,7 @@ fn test05_start(tx : &Sender) { fn test05() { let (tx, rx) = channel(); let _t = Thread::spawn(move|| { test05_start(&tx) }); - let mut value: int = rx.recv().unwrap(); + let mut value: isize = rx.recv().unwrap(); println!("{}", value); value = rx.recv().unwrap(); println!("{}", value); diff --git a/src/test/run-pass/task-comm-11.rs b/src/test/run-pass/task-comm-11.rs index 952adf1cd78..9ef5afab2e0 100644 --- a/src/test/run-pass/task-comm-11.rs +++ b/src/test/run-pass/task-comm-11.rs @@ -15,7 +15,7 @@ use std::sync::mpsc::{channel, Sender}; use std::thread::Thread; -fn start(tx: &Sender>) { +fn start(tx: &Sender>) { let (tx2, _rx) = channel(); tx.send(tx2).unwrap(); } diff --git a/src/test/run-pass/task-comm-12.rs b/src/test/run-pass/task-comm-12.rs index ff6d959327d..8921529c6be 100644 --- a/src/test/run-pass/task-comm-12.rs +++ b/src/test/run-pass/task-comm-12.rs @@ -14,10 +14,10 @@ use std::thread::Thread; pub fn main() { test00(); } -fn start(_task_number: int) { println!("Started / Finished task."); } +fn start(_task_number: isize) { println!("Started / Finished task."); } fn test00() { - let i: int = 0; + let i: isize = 0; let mut result = Thread::scoped(move|| { start(i) }); diff --git a/src/test/run-pass/task-comm-13.rs b/src/test/run-pass/task-comm-13.rs index 1f7da10252b..3a0757548e8 100644 --- a/src/test/run-pass/task-comm-13.rs +++ b/src/test/run-pass/task-comm-13.rs @@ -13,8 +13,8 @@ use std::sync::mpsc::{channel, Sender}; use std::thread::Thread; -fn start(tx: &Sender, start: int, number_of_messages: int) { - let mut i: int = 0; +fn start(tx: &Sender, start: isize, number_of_messages: isize) { + let mut i: isize = 0; while i< number_of_messages { tx.send(start + i).unwrap(); i += 1; } } diff --git a/src/test/run-pass/task-comm-14.rs b/src/test/run-pass/task-comm-14.rs index 785df73317a..2ef09cdcf87 100644 --- a/src/test/run-pass/task-comm-14.rs +++ b/src/test/run-pass/task-comm-14.rs @@ -16,7 +16,7 @@ use std::thread::Thread; pub fn main() { let (tx, rx) = channel(); - // Spawn 10 tasks each sending us back one int. + // Spawn 10 tasks each sending us back one isize. let mut i = 10; while (i > 0) { println!("{}", i); @@ -38,7 +38,7 @@ pub fn main() { println!("main thread exiting"); } -fn child(x: int, tx: &Sender) { +fn child(x: isize, tx: &Sender) { println!("{}", x); tx.send(x).unwrap(); } diff --git a/src/test/run-pass/task-comm-15.rs b/src/test/run-pass/task-comm-15.rs index 4db4333c964..605900495b5 100644 --- a/src/test/run-pass/task-comm-15.rs +++ b/src/test/run-pass/task-comm-15.rs @@ -15,7 +15,7 @@ use std::sync::mpsc::{channel, Sender}; use std::thread::Thread; -fn start(tx: &Sender, i0: int) { +fn start(tx: &Sender, i0: isize) { let mut i = i0; while i > 0 { tx.send(0).unwrap(); diff --git a/src/test/run-pass/task-comm-16.rs b/src/test/run-pass/task-comm-16.rs index ca009677ee9..c6d8f3c0d9b 100644 --- a/src/test/run-pass/task-comm-16.rs +++ b/src/test/run-pass/task-comm-16.rs @@ -13,7 +13,7 @@ use std::cmp; // Tests of ports and channels on various types fn test_rec() { - struct R {val0: int, val1: u8, val2: char} + struct R {val0: isize, val1: u8, val2: char} let (tx, rx) = channel(); let r0: R = R {val0: 0, val1: 1, val2: '2'}; @@ -27,7 +27,7 @@ fn test_rec() { fn test_vec() { let (tx, rx) = channel(); - let v0: Vec = vec!(0, 1, 2); + let v0: Vec = vec!(0, 1, 2); tx.send(v0).unwrap(); let v1 = rx.recv().unwrap(); assert_eq!(v1[0], 0); @@ -49,8 +49,8 @@ fn test_str() { #[derive(Debug)] enum t { tag1, - tag2(int), - tag3(int, u8, char) + tag2(isize), + tag3(isize, u8, char) } impl cmp::PartialEq for t { @@ -102,7 +102,7 @@ fn test_chan() { // Does the transmitted channel still work? tx2.send(10).unwrap(); - let mut i: int; + let mut i: isize; i = rx2.recv().unwrap(); assert_eq!(i, 10); } diff --git a/src/test/run-pass/task-comm-3.rs b/src/test/run-pass/task-comm-3.rs index bb0749eb8c0..d742b7bb11a 100644 --- a/src/test/run-pass/task-comm-3.rs +++ b/src/test/run-pass/task-comm-3.rs @@ -17,9 +17,9 @@ use std::sync::mpsc::{channel, Sender}; pub fn main() { println!("===== WITHOUT THREADS ====="); test00(); } -fn test00_start(ch: &Sender, message: int, count: int) { +fn test00_start(ch: &Sender, message: isize, count: isize) { println!("Starting test00_start"); - let mut i: int = 0; + let mut i: isize = 0; while i < count { println!("Sending Message"); ch.send(message + 0).unwrap(); @@ -29,14 +29,14 @@ fn test00_start(ch: &Sender, message: int, count: int) { } fn test00() { - let number_of_tasks: int = 16; - let number_of_messages: int = 4; + let number_of_tasks: isize = 16; + let number_of_messages: isize = 4; println!("Creating tasks"); let (tx, rx) = channel(); - let mut i: int = 0; + let mut i: isize = 0; // Create and spawn tasks... let mut results = Vec::new(); diff --git a/src/test/run-pass/task-comm-4.rs b/src/test/run-pass/task-comm-4.rs index 1f1b750aa57..e70a00591d6 100644 --- a/src/test/run-pass/task-comm-4.rs +++ b/src/test/run-pass/task-comm-4.rs @@ -15,8 +15,8 @@ use std::sync::mpsc::channel; pub fn main() { test00(); } fn test00() { - let mut r: int = 0; - let mut sum: int = 0; + let mut r: isize = 0; + let mut sum: isize = 0; let (tx, rx) = channel(); tx.send(1).unwrap(); tx.send(2).unwrap(); diff --git a/src/test/run-pass/task-comm-5.rs b/src/test/run-pass/task-comm-5.rs index 9bae0ad069c..cd3d97b88ba 100644 --- a/src/test/run-pass/task-comm-5.rs +++ b/src/test/run-pass/task-comm-5.rs @@ -15,11 +15,11 @@ use std::sync::mpsc::channel; pub fn main() { test00(); } fn test00() { - let _r: int = 0; - let mut sum: int = 0; + let _r: isize = 0; + let mut sum: isize = 0; let (tx, rx) = channel(); - let number_of_messages: int = 1000; - let mut i: int = 0; + let number_of_messages: isize = 1000; + let mut i: isize = 0; while i < number_of_messages { tx.send(i + 0).unwrap(); i += 1; } i = 0; while i < number_of_messages { sum += rx.recv().unwrap(); i += 1; } diff --git a/src/test/run-pass/task-comm-6.rs b/src/test/run-pass/task-comm-6.rs index 2657951ca48..80e777d242c 100644 --- a/src/test/run-pass/task-comm-6.rs +++ b/src/test/run-pass/task-comm-6.rs @@ -17,15 +17,15 @@ use std::sync::mpsc::channel; pub fn main() { test00(); } fn test00() { - let mut r: int = 0; - let mut sum: int = 0; + let mut r: isize = 0; + let mut sum: isize = 0; let (tx, rx) = channel(); let mut tx0 = tx.clone(); let mut tx1 = tx.clone(); let mut tx2 = tx.clone(); let mut tx3 = tx.clone(); - let number_of_messages: int = 1000; - let mut i: int = 0; + let number_of_messages: isize = 1000; + let mut i: isize = 0; while i < number_of_messages { tx0.send(i + 0).unwrap(); tx1.send(i + 0).unwrap(); diff --git a/src/test/run-pass/task-comm-7.rs b/src/test/run-pass/task-comm-7.rs index 44e3bab20ef..82e8fe0af41 100644 --- a/src/test/run-pass/task-comm-7.rs +++ b/src/test/run-pass/task-comm-7.rs @@ -18,17 +18,17 @@ use std::thread::Thread; pub fn main() { test00(); } -fn test00_start(c: &Sender, start: int, - number_of_messages: int) { - let mut i: int = 0; +fn test00_start(c: &Sender, start: isize, + number_of_messages: isize) { + let mut i: isize = 0; while i < number_of_messages { c.send(start + i).unwrap(); i += 1; } } fn test00() { - let mut r: int = 0; - let mut sum: int = 0; + let mut r: isize = 0; + let mut sum: isize = 0; let (tx, rx) = channel(); - let number_of_messages: int = 10; + let number_of_messages: isize = 10; let tx2 = tx.clone(); let _t = Thread::spawn(move|| { @@ -47,7 +47,7 @@ fn test00() { test00_start(&tx2, number_of_messages * 3, number_of_messages); }); - let mut i: int = 0; + let mut i: isize = 0; while i < number_of_messages { r = rx.recv().unwrap(); sum += r; diff --git a/src/test/run-pass/task-comm-9.rs b/src/test/run-pass/task-comm-9.rs index 81d9148955a..3e4a75b8e22 100644 --- a/src/test/run-pass/task-comm-9.rs +++ b/src/test/run-pass/task-comm-9.rs @@ -15,22 +15,22 @@ use std::sync::mpsc::{channel, Sender}; pub fn main() { test00(); } -fn test00_start(c: &Sender, number_of_messages: int) { - let mut i: int = 0; +fn test00_start(c: &Sender, number_of_messages: isize) { + let mut i: isize = 0; while i < number_of_messages { c.send(i + 0).unwrap(); i += 1; } } fn test00() { - let r: int = 0; - let mut sum: int = 0; + let r: isize = 0; + let mut sum: isize = 0; let (tx, rx) = channel(); - let number_of_messages: int = 10; + let number_of_messages: isize = 10; let result = Thread::scoped(move|| { test00_start(&tx, number_of_messages); }); - let mut i: int = 0; + let mut i: isize = 0; while i < number_of_messages { sum += rx.recv().unwrap(); println!("{}", r); diff --git a/src/test/run-pass/task-spawn-move-and-copy.rs b/src/test/run-pass/task-spawn-move-and-copy.rs index 5c0d0fe9a63..637f564f726 100644 --- a/src/test/run-pass/task-spawn-move-and-copy.rs +++ b/src/test/run-pass/task-spawn-move-and-copy.rs @@ -17,13 +17,13 @@ use std::thread::Thread; use std::sync::mpsc::channel; pub fn main() { - let (tx, rx) = channel::(); + let (tx, rx) = channel::(); - let x: Box = box 1; - let x_in_parent = &(*x) as *const int as uint; + let x: Box = box 1; + let x_in_parent = &(*x) as *const isize as usize; let _t = Thread::spawn(move || { - let x_in_child = &(*x) as *const int as uint; + let x_in_child = &(*x) as *const isize as usize; tx.send(x_in_child).unwrap(); }); diff --git a/src/test/run-pass/tcp-accept-stress.rs b/src/test/run-pass/tcp-accept-stress.rs index 5633ef2ecfc..99d36a179aa 100644 --- a/src/test/run-pass/tcp-accept-stress.rs +++ b/src/test/run-pass/tcp-accept-stress.rs @@ -21,8 +21,8 @@ use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::mpsc::channel; use std::thread::Thread; -static N: uint = 8; -static M: uint = 20; +static N: usize = 8; +static M: usize = 20; fn main() { test(); diff --git a/src/test/run-pass/terminate-in-initializer.rs b/src/test/run-pass/terminate-in-initializer.rs index b59d11d8674..ec9e7de40dc 100644 --- a/src/test/run-pass/terminate-in-initializer.rs +++ b/src/test/run-pass/terminate-in-initializer.rs @@ -16,20 +16,20 @@ use std::thread; -fn test_break() { loop { let _x: Box = break; } } +fn test_break() { loop { let _x: Box = break; } } -fn test_cont() { let mut i = 0; while i < 1 { i += 1; let _x: Box = continue; } } +fn test_cont() { let mut i = 0; while i < 1 { i += 1; let _x: Box = continue; } } -fn test_ret() { let _x: Box = return; } +fn test_ret() { let _x: Box = return; } fn test_panic() { - fn f() { let _x: Box = panic!(); } + fn f() { let _x: Box = panic!(); } thread::spawn(move|| f() ).join().err().unwrap(); } fn test_panic_indirect() { fn f() -> ! { panic!(); } - fn g() { let _x: Box = f(); } + fn g() { let _x: Box = f(); } thread::spawn(move|| g() ).join().err().unwrap(); } diff --git a/src/test/run-pass/threads.rs b/src/test/run-pass/threads.rs index 436fb1fe9b5..4fc09952904 100644 --- a/src/test/run-pass/threads.rs +++ b/src/test/run-pass/threads.rs @@ -21,4 +21,4 @@ pub fn main() { println!("main thread exiting"); } -fn child(x: int) { println!("{}", x); } +fn child(x: isize) { println!("{}", x); } diff --git a/src/test/run-pass/trailing-comma.rs b/src/test/run-pass/trailing-comma.rs index 79e0df0133b..a97b06caa6b 100644 --- a/src/test/run-pass/trailing-comma.rs +++ b/src/test/run-pass/trailing-comma.rs @@ -19,24 +19,24 @@ struct Foo(T); struct Bar; impl Bar { - fn f(_: int,) {} - fn g(self, _: int,) {} + fn f(_: isize,) {} + fn g(self, _: isize,) {} fn h(self,) {} } enum Baz { - Qux(int,), + Qux(isize,), } #[allow(unused,)] pub fn main() { - f::(0,); + f::(0,); let (_, _,) = (1, 1,); let [_, _,] = [1, 1,]; let [_, _, .., _,] = [1, 1, 1, 1,]; let [_, _, _.., _,] = [1, 1, 1, 1,]; - let x: Foo = Foo::(1); + let x: Foo = Foo::(1); Bar::f(0,); Bar.g(0,); diff --git a/src/test/run-pass/trait-bounds-impl-comparison-duplicates.rs b/src/test/run-pass/trait-bounds-impl-comparison-duplicates.rs index 7357c387511..33bfbc39603 100644 --- a/src/test/run-pass/trait-bounds-impl-comparison-duplicates.rs +++ b/src/test/run-pass/trait-bounds-impl-comparison-duplicates.rs @@ -18,7 +18,7 @@ trait A { fn foo(&self); } -impl A for int { +impl A for isize { fn foo(&self) {} // Ord implies Eq, so this is ok. } diff --git a/src/test/run-pass/trait-bounds-in-arc.rs b/src/test/run-pass/trait-bounds-in-arc.rs index d2782976463..2d97633771e 100644 --- a/src/test/run-pass/trait-bounds-in-arc.rs +++ b/src/test/run-pass/trait-bounds-in-arc.rs @@ -23,41 +23,41 @@ use std::thread::Thread; trait Pet { fn name(&self, blk: Box); - fn num_legs(&self) -> uint; + fn num_legs(&self) -> usize; fn of_good_pedigree(&self) -> bool; } struct Catte { - num_whiskers: uint, + num_whiskers: usize, name: String, } struct Dogge { - bark_decibels: uint, - tricks_known: uint, + bark_decibels: usize, + tricks_known: usize, name: String, } struct Goldfyshe { - swim_speed: uint, + swim_speed: usize, name: String, } impl Pet for Catte { fn name(&self, mut blk: Box) { blk(&self.name) } - fn num_legs(&self) -> uint { 4 } + fn num_legs(&self) -> usize { 4 } fn of_good_pedigree(&self) -> bool { self.num_whiskers >= 4 } } impl Pet for Dogge { fn name(&self, mut blk: Box) { blk(&self.name) } - fn num_legs(&self) -> uint { 4 } + fn num_legs(&self) -> usize { 4 } fn of_good_pedigree(&self) -> bool { self.bark_decibels < 70 || self.tricks_known > 20 } } impl Pet for Goldfyshe { fn name(&self, mut blk: Box) { blk(&self.name) } - fn num_legs(&self) -> uint { 0 } + fn num_legs(&self) -> usize { 0 } fn of_good_pedigree(&self) -> bool { self.swim_speed >= 500 } } diff --git a/src/test/run-pass/trait-bounds.rs b/src/test/run-pass/trait-bounds.rs index 0db77ec2f79..642119df15c 100644 --- a/src/test/run-pass/trait-bounds.rs +++ b/src/test/run-pass/trait-bounds.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 trait connection { - fn read(&self) -> int; + fn read(&self) -> isize; } trait connection_factory { @@ -22,7 +22,7 @@ type my_connection = (); type my_connection_factory = (); impl connection for () { - fn read(&self) -> int { 43 } + fn read(&self) -> isize { 43 } } impl connection_factory for my_connection_factory { diff --git a/src/test/run-pass/trait-coercion-generic.rs b/src/test/run-pass/trait-coercion-generic.rs index 96203ba4779..2f33621e36c 100644 --- a/src/test/run-pass/trait-coercion-generic.rs +++ b/src/test/run-pass/trait-coercion-generic.rs @@ -14,8 +14,8 @@ trait Trait { #[derive(Copy)] struct Struct { - x: int, - y: int, + x: isize, + y: isize, } impl Trait<&'static str> for Struct { diff --git a/src/test/run-pass/trait-coercion.rs b/src/test/run-pass/trait-coercion.rs index 6f2fc8ba79a..de0a2e9e4d4 100644 --- a/src/test/run-pass/trait-coercion.rs +++ b/src/test/run-pass/trait-coercion.rs @@ -19,8 +19,8 @@ trait Trait { #[derive(Copy)] struct Struct { - x: int, - y: int, + x: isize, + y: isize, } impl Trait for Struct { diff --git a/src/test/run-pass/trait-default-method-bound-subst2.rs b/src/test/run-pass/trait-default-method-bound-subst2.rs index 49ac66167cd..4fedbba81f4 100644 --- a/src/test/run-pass/trait-default-method-bound-subst2.rs +++ b/src/test/run-pass/trait-default-method-bound-subst2.rs @@ -15,7 +15,7 @@ trait A { fn g(&self, x: T) -> T { x } } -impl A for int { } +impl A for isize { } fn f>(i: V, j: T) -> T { i.g(j) diff --git a/src/test/run-pass/trait-default-method-bound-subst3.rs b/src/test/run-pass/trait-default-method-bound-subst3.rs index abf135a6685..4f749cbd3fd 100644 --- a/src/test/run-pass/trait-default-method-bound-subst3.rs +++ b/src/test/run-pass/trait-default-method-bound-subst3.rs @@ -15,7 +15,7 @@ trait A { fn g(&self, x: T, y: T) -> (T, T) { (x, y) } } -impl A for int { } +impl A for isize { } fn f(i: V, j: T, k: T) -> (T, T) { i.g(j, k) diff --git a/src/test/run-pass/trait-default-method-bound-subst4.rs b/src/test/run-pass/trait-default-method-bound-subst4.rs index ba94fc4cd36..6774569cd25 100644 --- a/src/test/run-pass/trait-default-method-bound-subst4.rs +++ b/src/test/run-pass/trait-default-method-bound-subst4.rs @@ -12,17 +12,17 @@ // pretty-expanded FIXME #23616 trait A { - fn g(&self, x: uint) -> uint { x } + fn g(&self, x: usize) -> usize { x } fn h(&self, x: T) { } } -impl A for int { } +impl A for isize { } -fn f>(i: V, j: uint) -> uint { +fn f>(i: V, j: usize) -> usize { i.g(j) } pub fn main () { - assert_eq!(f::(0, 2), 2); - assert_eq!(f::(0, 2), 2); + assert_eq!(f::(0, 2), 2); + assert_eq!(f::(0, 2), 2); } diff --git a/src/test/run-pass/trait-default-method-bound.rs b/src/test/run-pass/trait-default-method-bound.rs index 4f1127c0b09..4107540a471 100644 --- a/src/test/run-pass/trait-default-method-bound.rs +++ b/src/test/run-pass/trait-default-method-bound.rs @@ -12,10 +12,10 @@ // pretty-expanded FIXME #23616 trait A { - fn g(&self) -> int { 10 } + fn g(&self) -> isize { 10 } } -impl A for int { } +impl A for isize { } fn f(i: T) { assert_eq!(i.g(), 10); diff --git a/src/test/run-pass/trait-default-method-xc.rs b/src/test/run-pass/trait-default-method-xc.rs index eb2a75f62fb..9ac799216dd 100644 --- a/src/test/run-pass/trait-default-method-xc.rs +++ b/src/test/run-pass/trait-default-method-xc.rs @@ -20,16 +20,16 @@ fn f(i: T) { assert_eq!(i.g(), 10); } -fn welp(i: int, _x: &T) -> int { +fn welp(i: isize, _x: &T) -> isize { i.g() } mod stuff { - pub struct thing { pub x: int } + pub struct thing { pub x: isize } } impl A for stuff::thing { - fn f(&self) -> int { 10 } + fn f(&self) -> isize { 10 } } fn g>(i: V, j: T, k: U) -> (T, U) { @@ -69,7 +69,7 @@ pub fn main() { assert_eq!(0.thing(3.14f64, 1), (3.14f64, 1)); assert_eq!(B::staticthing(&0, 3.14f64, 1), (3.14f64, 1)); - assert_eq!(B::::staticthing::(&0, 3.14, 1), (3.14, 1)); + assert_eq!(B::::staticthing::(&0, 3.14, 1), (3.14, 1)); assert_eq!(g(0, 3.14f64, 1), (3.14f64, 1)); assert_eq!(g(false, 3.14f64, 1), (3.14, 1)); diff --git a/src/test/run-pass/trait-generic.rs b/src/test/run-pass/trait-generic.rs index 2a5f9b80e9d..6ef0dacee74 100644 --- a/src/test/run-pass/trait-generic.rs +++ b/src/test/run-pass/trait-generic.rs @@ -15,7 +15,7 @@ trait to_str { fn to_string_(&self) -> String; } -impl to_str for int { +impl to_str for isize { fn to_string_(&self) -> String { self.to_string() } } impl to_str for String { @@ -47,7 +47,7 @@ fn bar>(x: T) -> Vec { pub fn main() { assert_eq!(foo(vec!(1)), ["hi".to_string()]); - assert_eq!(bar:: >(vec!(4, 5)), ["4".to_string(), "5".to_string()]); + assert_eq!(bar:: >(vec!(4, 5)), ["4".to_string(), "5".to_string()]); assert_eq!(bar:: >(vec!("x".to_string(), "y".to_string())), ["x".to_string(), "y".to_string()]); assert_eq!(bar::<(), Vec<()>>(vec!(())), ["()".to_string()]); diff --git a/src/test/run-pass/trait-impl.rs b/src/test/run-pass/trait-impl.rs index 0caa4c2d2d2..95fd7bda474 100644 --- a/src/test/run-pass/trait-impl.rs +++ b/src/test/run-pass/trait-impl.rs @@ -16,7 +16,7 @@ extern crate traitimpl; use traitimpl::Bar; -static mut COUNT: uint = 1; +static mut COUNT: usize = 1; trait T { fn t(&self) {} @@ -31,7 +31,7 @@ impl<'a> T+'a { } } -impl T for int {} +impl T for isize {} struct Foo; impl<'a> Bar<'a> for Foo {} diff --git a/src/test/run-pass/trait-inheritance-auto-xc.rs b/src/test/run-pass/trait-inheritance-auto-xc.rs index b58839931b0..401c93c78c8 100644 --- a/src/test/run-pass/trait-inheritance-auto-xc.rs +++ b/src/test/run-pass/trait-inheritance-auto-xc.rs @@ -16,11 +16,11 @@ extern crate "trait_inheritance_auto_xc_aux" as aux; use aux::{Foo, Bar, Baz, Quux}; -struct A { x: int } +struct A { x: isize } -impl Foo for A { fn f(&self) -> int { 10 } } -impl Bar for A { fn g(&self) -> int { 20 } } -impl Baz for A { fn h(&self) -> int { 30 } } +impl Foo for A { fn f(&self) -> isize { 10 } } +impl Bar for A { fn g(&self) -> isize { 20 } } +impl Baz for A { fn h(&self) -> isize { 30 } } fn f(a: &T) { assert_eq!(a.f(), 10); diff --git a/src/test/run-pass/trait-inheritance-auto.rs b/src/test/run-pass/trait-inheritance-auto.rs index dfd541c6932..1b72736cde4 100644 --- a/src/test/run-pass/trait-inheritance-auto.rs +++ b/src/test/run-pass/trait-inheritance-auto.rs @@ -14,17 +14,17 @@ impl Quux for T { } -trait Foo { fn f(&self) -> int; } -trait Bar { fn g(&self) -> int; } -trait Baz { fn h(&self) -> int; } +trait Foo { fn f(&self) -> isize; } +trait Bar { fn g(&self) -> isize; } +trait Baz { fn h(&self) -> isize; } trait Quux: Foo + Bar + Baz { } -struct A { x: int } +struct A { x: isize } -impl Foo for A { fn f(&self) -> int { 10 } } -impl Bar for A { fn g(&self) -> int { 20 } } -impl Baz for A { fn h(&self) -> int { 30 } } +impl Foo for A { fn f(&self) -> isize { 10 } } +impl Bar for A { fn g(&self) -> isize { 20 } } +impl Baz for A { fn h(&self) -> isize { 30 } } fn f(a: &T) { assert_eq!(a.f(), 10); diff --git a/src/test/run-pass/trait-inheritance-call-bound-inherited.rs b/src/test/run-pass/trait-inheritance-call-bound-inherited.rs index c62941a5174..c8df12392fa 100644 --- a/src/test/run-pass/trait-inheritance-call-bound-inherited.rs +++ b/src/test/run-pass/trait-inheritance-call-bound-inherited.rs @@ -10,16 +10,16 @@ // pretty-expanded FIXME #23616 -trait Foo { fn f(&self) -> int; } -trait Bar : Foo { fn g(&self) -> int; } +trait Foo { fn f(&self) -> isize; } +trait Bar : Foo { fn g(&self) -> isize; } -struct A { x: int } +struct A { x: isize } -impl Foo for A { fn f(&self) -> int { 10 } } -impl Bar for A { fn g(&self) -> int { 20 } } +impl Foo for A { fn f(&self) -> isize { 10 } } +impl Bar for A { fn g(&self) -> isize { 20 } } // Call a function on Foo, given a T: Bar -fn gg(a: &T) -> int { +fn gg(a: &T) -> isize { a.f() } diff --git a/src/test/run-pass/trait-inheritance-call-bound-inherited2.rs b/src/test/run-pass/trait-inheritance-call-bound-inherited2.rs index 2ee3a2ec124..fcd6143579c 100644 --- a/src/test/run-pass/trait-inheritance-call-bound-inherited2.rs +++ b/src/test/run-pass/trait-inheritance-call-bound-inherited2.rs @@ -10,19 +10,19 @@ // pretty-expanded FIXME #23616 -trait Foo { fn f(&self) -> int; } -trait Bar : Foo { fn g(&self) -> int; } -trait Baz : Bar { fn h(&self) -> int; } +trait Foo { fn f(&self) -> isize; } +trait Bar : Foo { fn g(&self) -> isize; } +trait Baz : Bar { fn h(&self) -> isize; } -struct A { x: int } +struct A { x: isize } -impl Foo for A { fn f(&self) -> int { 10 } } -impl Bar for A { fn g(&self) -> int { 20 } } -impl Baz for A { fn h(&self) -> int { 30 } } +impl Foo for A { fn f(&self) -> isize { 10 } } +impl Bar for A { fn g(&self) -> isize { 20 } } +impl Baz for A { fn h(&self) -> isize { 30 } } // Call a function on Foo, given a T: Baz, // which is inherited via Bar -fn gg(a: &T) -> int { +fn gg(a: &T) -> isize { a.f() } diff --git a/src/test/run-pass/trait-inheritance-cast-without-call-to-supertrait.rs b/src/test/run-pass/trait-inheritance-cast-without-call-to-supertrait.rs index 5afdc60b0e8..3996ae850e8 100644 --- a/src/test/run-pass/trait-inheritance-cast-without-call-to-supertrait.rs +++ b/src/test/run-pass/trait-inheritance-cast-without-call-to-supertrait.rs @@ -14,23 +14,23 @@ // pretty-expanded FIXME #23616 trait Foo { - fn f(&self) -> int; + fn f(&self) -> isize; } trait Bar : Foo { - fn g(&self) -> int; + fn g(&self) -> isize; } struct A { - x: int + x: isize } impl Foo for A { - fn f(&self) -> int { 10 } + fn f(&self) -> isize { 10 } } impl Bar for A { - fn g(&self) -> int { 20 } + fn g(&self) -> isize { 20 } } pub fn main() { diff --git a/src/test/run-pass/trait-inheritance-cast.rs b/src/test/run-pass/trait-inheritance-cast.rs index 84ffb395588..7784ed2f26a 100644 --- a/src/test/run-pass/trait-inheritance-cast.rs +++ b/src/test/run-pass/trait-inheritance-cast.rs @@ -13,23 +13,23 @@ // pretty-expanded FIXME #23616 trait Foo { - fn f(&self) -> int; + fn f(&self) -> isize; } trait Bar : Foo { - fn g(&self) -> int; + fn g(&self) -> isize; } struct A { - x: int + x: isize } impl Foo for A { - fn f(&self) -> int { 10 } + fn f(&self) -> isize { 10 } } impl Bar for A { - fn g(&self) -> int { 20 } + fn g(&self) -> isize { 20 } } pub fn main() { diff --git a/src/test/run-pass/trait-inheritance-cross-trait-call-xc.rs b/src/test/run-pass/trait-inheritance-cross-trait-call-xc.rs index 8de867eff90..990c4b9b418 100644 --- a/src/test/run-pass/trait-inheritance-cross-trait-call-xc.rs +++ b/src/test/run-pass/trait-inheritance-cross-trait-call-xc.rs @@ -17,11 +17,11 @@ extern crate "trait_inheritance_cross_trait_call_xc_aux" as aux; use aux::Foo; trait Bar : Foo { - fn g(&self) -> int; + fn g(&self) -> isize; } impl Bar for aux::A { - fn g(&self) -> int { self.f() } + fn g(&self) -> isize { self.f() } } pub fn main() { diff --git a/src/test/run-pass/trait-inheritance-cross-trait-call.rs b/src/test/run-pass/trait-inheritance-cross-trait-call.rs index 88645a36b6e..418986f961e 100644 --- a/src/test/run-pass/trait-inheritance-cross-trait-call.rs +++ b/src/test/run-pass/trait-inheritance-cross-trait-call.rs @@ -10,16 +10,16 @@ // pretty-expanded FIXME #23616 -trait Foo { fn f(&self) -> int; } -trait Bar : Foo { fn g(&self) -> int; } +trait Foo { fn f(&self) -> isize; } +trait Bar : Foo { fn g(&self) -> isize; } -struct A { x: int } +struct A { x: isize } -impl Foo for A { fn f(&self) -> int { 10 } } +impl Foo for A { fn f(&self) -> isize { 10 } } impl Bar for A { // Testing that this impl can call the impl of Foo - fn g(&self) -> int { self.f() } + fn g(&self) -> isize { self.f() } } pub fn main() { diff --git a/src/test/run-pass/trait-inheritance-diamond.rs b/src/test/run-pass/trait-inheritance-diamond.rs index 69f97d8d652..07b1a79110f 100644 --- a/src/test/run-pass/trait-inheritance-diamond.rs +++ b/src/test/run-pass/trait-inheritance-diamond.rs @@ -12,17 +12,17 @@ // pretty-expanded FIXME #23616 -trait A { fn a(&self) -> int; } -trait B: A { fn b(&self) -> int; } -trait C: A { fn c(&self) -> int; } -trait D: B + C { fn d(&self) -> int; } +trait A { fn a(&self) -> isize; } +trait B: A { fn b(&self) -> isize; } +trait C: A { fn c(&self) -> isize; } +trait D: B + C { fn d(&self) -> isize; } struct S { bogus: () } -impl A for S { fn a(&self) -> int { 10 } } -impl B for S { fn b(&self) -> int { 20 } } -impl C for S { fn c(&self) -> int { 30 } } -impl D for S { fn d(&self) -> int { 40 } } +impl A for S { fn a(&self) -> isize { 10 } } +impl B for S { fn b(&self) -> isize { 20 } } +impl C for S { fn c(&self) -> isize { 30 } } +impl D for S { fn d(&self) -> isize { 40 } } fn f(x: &T) { assert_eq!(x.a(), 10); diff --git a/src/test/run-pass/trait-inheritance-multiple-inheritors.rs b/src/test/run-pass/trait-inheritance-multiple-inheritors.rs index 47c8726c3e7..b8924626954 100644 --- a/src/test/run-pass/trait-inheritance-multiple-inheritors.rs +++ b/src/test/run-pass/trait-inheritance-multiple-inheritors.rs @@ -10,15 +10,15 @@ // pretty-expanded FIXME #23616 -trait A { fn a(&self) -> int; } -trait B: A { fn b(&self) -> int; } -trait C: A { fn c(&self) -> int; } +trait A { fn a(&self) -> isize; } +trait B: A { fn b(&self) -> isize; } +trait C: A { fn c(&self) -> isize; } struct S { bogus: () } -impl A for S { fn a(&self) -> int { 10 } } -impl B for S { fn b(&self) -> int { 20 } } -impl C for S { fn c(&self) -> int { 30 } } +impl A for S { fn a(&self) -> isize { 10 } } +impl B for S { fn b(&self) -> isize { 20 } } +impl C for S { fn c(&self) -> isize { 30 } } // Both B and C inherit from A fn f(x: &T) { diff --git a/src/test/run-pass/trait-inheritance-multiple-params.rs b/src/test/run-pass/trait-inheritance-multiple-params.rs index da57d9a4e97..37803edb752 100644 --- a/src/test/run-pass/trait-inheritance-multiple-params.rs +++ b/src/test/run-pass/trait-inheritance-multiple-params.rs @@ -10,15 +10,15 @@ // pretty-expanded FIXME #23616 -trait A { fn a(&self) -> int; } -trait B: A { fn b(&self) -> int; } -trait C: A { fn c(&self) -> int; } +trait A { fn a(&self) -> isize; } +trait B: A { fn b(&self) -> isize; } +trait C: A { fn c(&self) -> isize; } struct S { bogus: () } -impl A for S { fn a(&self) -> int { 10 } } -impl B for S { fn b(&self) -> int { 20 } } -impl C for S { fn c(&self) -> int { 30 } } +impl A for S { fn a(&self) -> isize { 10 } } +impl B for S { fn b(&self) -> isize { 20 } } +impl C for S { fn c(&self) -> isize { 30 } } // Multiple type params, multiple levels of inheritance fn f(x: &X, y: &Y, z: &Z) { diff --git a/src/test/run-pass/trait-inheritance-num0.rs b/src/test/run-pass/trait-inheritance-num0.rs index a4b0d5b88ca..b7f95349356 100644 --- a/src/test/run-pass/trait-inheritance-num0.rs +++ b/src/test/run-pass/trait-inheritance-num0.rs @@ -18,7 +18,7 @@ use std::cmp::PartialOrd; use std::num::NumCast; pub trait Num { - fn from_int(i: int) -> Self; + fn from_int(i: isize) -> Self; fn gt(&self, other: &Self) -> bool; } diff --git a/src/test/run-pass/trait-inheritance-num2.rs b/src/test/run-pass/trait-inheritance-num2.rs index df751a6d004..773fc387a2a 100644 --- a/src/test/run-pass/trait-inheritance-num2.rs +++ b/src/test/run-pass/trait-inheritance-num2.rs @@ -21,13 +21,13 @@ impl TypeExt for u8 {} impl TypeExt for u16 {} impl TypeExt for u32 {} impl TypeExt for u64 {} -impl TypeExt for uint {} +impl TypeExt for usize {} impl TypeExt for i8 {} impl TypeExt for i16 {} impl TypeExt for i32 {} impl TypeExt for i64 {} -impl TypeExt for int {} +impl TypeExt for isize {} impl TypeExt for f32 {} impl TypeExt for f64 {} @@ -39,13 +39,13 @@ impl NumExt for u8 {} impl NumExt for u16 {} impl NumExt for u32 {} impl NumExt for u64 {} -impl NumExt for uint {} +impl NumExt for usize {} impl NumExt for i8 {} impl NumExt for i16 {} impl NumExt for i32 {} impl NumExt for i64 {} -impl NumExt for int {} +impl NumExt for isize {} impl NumExt for f32 {} impl NumExt for f64 {} @@ -57,7 +57,7 @@ impl UnSignedExt for u8 {} impl UnSignedExt for u16 {} impl UnSignedExt for u32 {} impl UnSignedExt for u64 {} -impl UnSignedExt for uint {} +impl UnSignedExt for usize {} pub trait SignedExt: NumExt {} @@ -66,7 +66,7 @@ impl SignedExt for i8 {} impl SignedExt for i16 {} impl SignedExt for i32 {} impl SignedExt for i64 {} -impl SignedExt for int {} +impl SignedExt for isize {} impl SignedExt for f32 {} impl SignedExt for f64 {} @@ -78,13 +78,13 @@ impl IntegerExt for u8 {} impl IntegerExt for u16 {} impl IntegerExt for u32 {} impl IntegerExt for u64 {} -impl IntegerExt for uint {} +impl IntegerExt for usize {} impl IntegerExt for i8 {} impl IntegerExt for i16 {} impl IntegerExt for i32 {} impl IntegerExt for i64 {} -impl IntegerExt for int {} +impl IntegerExt for isize {} pub trait FloatExt: NumExt {} diff --git a/src/test/run-pass/trait-inheritance-num5.rs b/src/test/run-pass/trait-inheritance-num5.rs index cce9bd3c714..b2c3900bc02 100644 --- a/src/test/run-pass/trait-inheritance-num5.rs +++ b/src/test/run-pass/trait-inheritance-num5.rs @@ -18,12 +18,12 @@ use std::num::NumCast; pub trait NumExt: PartialEq + NumCast {} impl NumExt for f32 {} -impl NumExt for int {} +impl NumExt for isize {} fn num_eq_one() -> T { NumCast::from(1).unwrap() } pub fn main() { - num_eq_one::(); // you need to actually use the function to trigger the ICE + num_eq_one::(); // you need to actually use the function to trigger the ICE } diff --git a/src/test/run-pass/trait-inheritance-overloading-simple.rs b/src/test/run-pass/trait-inheritance-overloading-simple.rs index 4cd9fbeba9c..9c1f585fe45 100644 --- a/src/test/run-pass/trait-inheritance-overloading-simple.rs +++ b/src/test/run-pass/trait-inheritance-overloading-simple.rs @@ -13,7 +13,7 @@ use std::cmp::PartialEq; trait MyNum : PartialEq { } #[derive(Debug)] -struct MyInt { val: int } +struct MyInt { val: isize } impl PartialEq for MyInt { fn eq(&self, other: &MyInt) -> bool { self.val == other.val } @@ -26,7 +26,7 @@ fn f(x: T, y: T) -> bool { return x == y; } -fn mi(v: int) -> MyInt { MyInt { val: v } } +fn mi(v: isize) -> MyInt { MyInt { val: v } } pub fn main() { let (x, y, z) = (mi(3), mi(5), mi(3)); diff --git a/src/test/run-pass/trait-inheritance-overloading-xc-exe.rs b/src/test/run-pass/trait-inheritance-overloading-xc-exe.rs index 20d6817fcdd..f44c6927c87 100644 --- a/src/test/run-pass/trait-inheritance-overloading-xc-exe.rs +++ b/src/test/run-pass/trait-inheritance-overloading-xc-exe.rs @@ -19,7 +19,7 @@ fn f(x: T, y: T) -> (T, T, T) { return (x.clone() + y.clone(), x.clone() - y.clone(), x * y); } -fn mi(v: int) -> MyInt { MyInt { val: v } } +fn mi(v: isize) -> MyInt { MyInt { val: v } } pub fn main() { let (x, y) = (mi(3), mi(5)); diff --git a/src/test/run-pass/trait-inheritance-overloading.rs b/src/test/run-pass/trait-inheritance-overloading.rs index 893f782cba4..b7d0400dd89 100644 --- a/src/test/run-pass/trait-inheritance-overloading.rs +++ b/src/test/run-pass/trait-inheritance-overloading.rs @@ -14,7 +14,7 @@ use std::ops::{Add, Sub, Mul}; trait MyNum : Add + Sub + Mul + PartialEq + Clone { } #[derive(Clone, Debug)] -struct MyInt { val: int } +struct MyInt { val: isize } impl Add for MyInt { type Output = MyInt; @@ -45,7 +45,7 @@ fn f(x: T, y: T) -> (T, T, T) { return (x.clone() + y.clone(), x.clone() - y.clone(), x * y); } -fn mi(v: int) -> MyInt { MyInt { val: v } } +fn mi(v: isize) -> MyInt { MyInt { val: v } } pub fn main() { let (x, y) = (mi(3), mi(5)); diff --git a/src/test/run-pass/trait-inheritance-self.rs b/src/test/run-pass/trait-inheritance-self.rs index 07b0929968d..7d975da4a24 100644 --- a/src/test/run-pass/trait-inheritance-self.rs +++ b/src/test/run-pass/trait-inheritance-self.rs @@ -17,7 +17,7 @@ trait Bar : Foo { } struct S { - x: int + x: isize } impl Foo for S { diff --git a/src/test/run-pass/trait-inheritance-simple.rs b/src/test/run-pass/trait-inheritance-simple.rs index f06ae1104c0..ff89b1ee5d3 100644 --- a/src/test/run-pass/trait-inheritance-simple.rs +++ b/src/test/run-pass/trait-inheritance-simple.rs @@ -10,19 +10,19 @@ // pretty-expanded FIXME #23616 -trait Foo { fn f(&self) -> int; } -trait Bar : Foo { fn g(&self) -> int; } +trait Foo { fn f(&self) -> isize; } +trait Bar : Foo { fn g(&self) -> isize; } -struct A { x: int } +struct A { x: isize } -impl Foo for A { fn f(&self) -> int { 10 } } -impl Bar for A { fn g(&self) -> int { 20 } } +impl Foo for A { fn f(&self) -> isize { 10 } } +impl Bar for A { fn g(&self) -> isize { 20 } } -fn ff(a: &T) -> int { +fn ff(a: &T) -> isize { a.f() } -fn gg(a: &T) -> int { +fn gg(a: &T) -> isize { a.g() } diff --git a/src/test/run-pass/trait-inheritance-static.rs b/src/test/run-pass/trait-inheritance-static.rs index cd486754e78..9ed5fd0aaa5 100644 --- a/src/test/run-pass/trait-inheritance-static.rs +++ b/src/test/run-pass/trait-inheritance-static.rs @@ -11,15 +11,15 @@ // pretty-expanded FIXME #23616 pub trait MyNum { - fn from_int(int) -> Self; + fn from_int(isize) -> Self; } pub trait NumExt: MyNum { } -struct S { v: int } +struct S { v: isize } impl MyNum for S { - fn from_int(i: int) -> S { + fn from_int(i: isize) -> S { S { v: i } diff --git a/src/test/run-pass/trait-inheritance-static2.rs b/src/test/run-pass/trait-inheritance-static2.rs index 86bfe0aa5c8..9fe9d7fce7a 100644 --- a/src/test/run-pass/trait-inheritance-static2.rs +++ b/src/test/run-pass/trait-inheritance-static2.rs @@ -15,17 +15,17 @@ pub trait MyEq : ::std::marker::MarkerTrait { } pub trait MyNum : ::std::marker::MarkerTrait { - fn from_int(int) -> Self; + fn from_int(isize) -> Self; } pub trait NumExt: MyEq + MyNum { } -struct S { v: int } +struct S { v: isize } impl MyEq for S { } impl MyNum for S { - fn from_int(i: int) -> S { + fn from_int(i: isize) -> S { S { v: i } diff --git a/src/test/run-pass/trait-inheritance-subst.rs b/src/test/run-pass/trait-inheritance-subst.rs index d7cddbe62ca..d35a937a573 100644 --- a/src/test/run-pass/trait-inheritance-subst.rs +++ b/src/test/run-pass/trait-inheritance-subst.rs @@ -16,7 +16,7 @@ pub trait Add { trait MyNum : Add { } -struct MyInt { val: int } +struct MyInt { val: isize } impl Add for MyInt { fn add(&self, other: &MyInt) -> MyInt { mi(self.val + other.val) } @@ -28,7 +28,7 @@ fn f(x: T, y: T) -> T { return x.add(&y); } -fn mi(v: int) -> MyInt { MyInt { val: v } } +fn mi(v: isize) -> MyInt { MyInt { val: v } } pub fn main() { let (x, y) = (mi(3), mi(5)); diff --git a/src/test/run-pass/trait-inheritance-subst2.rs b/src/test/run-pass/trait-inheritance-subst2.rs index 5949308a7eb..e0be5759503 100644 --- a/src/test/run-pass/trait-inheritance-subst2.rs +++ b/src/test/run-pass/trait-inheritance-subst2.rs @@ -20,7 +20,7 @@ trait Add: Panda { trait MyNum : Add { } -struct MyInt { val: int } +struct MyInt { val: isize } impl Panda for MyInt { fn chomp(&self, bamboo: &MyInt) -> MyInt { @@ -38,7 +38,7 @@ fn f(x: T, y: T) -> T { return x.add(&y).chomp(&y); } -fn mi(v: int) -> MyInt { MyInt { val: v } } +fn mi(v: isize) -> MyInt { MyInt { val: v } } pub fn main() { let (x, y) = (mi(3), mi(5)); diff --git a/src/test/run-pass/trait-inheritance-visibility.rs b/src/test/run-pass/trait-inheritance-visibility.rs index 225e0ee90eb..8c8b9232dee 100644 --- a/src/test/run-pass/trait-inheritance-visibility.rs +++ b/src/test/run-pass/trait-inheritance-visibility.rs @@ -11,9 +11,9 @@ // pretty-expanded FIXME #23616 mod traits { - pub trait Foo { fn f(&self) -> int; } + pub trait Foo { fn f(&self) -> isize; } - impl Foo for int { fn f(&self) -> int { 10 } } + impl Foo for isize { fn f(&self) -> isize { 10 } } } trait Quux: traits::Foo { } diff --git a/src/test/run-pass/trait-inheritance2.rs b/src/test/run-pass/trait-inheritance2.rs index 2885afd7bd6..9e721836d63 100644 --- a/src/test/run-pass/trait-inheritance2.rs +++ b/src/test/run-pass/trait-inheritance2.rs @@ -10,17 +10,17 @@ // pretty-expanded FIXME #23616 -trait Foo { fn f(&self) -> int; } -trait Bar { fn g(&self) -> int; } -trait Baz { fn h(&self) -> int; } +trait Foo { fn f(&self) -> isize; } +trait Bar { fn g(&self) -> isize; } +trait Baz { fn h(&self) -> isize; } trait Quux: Foo + Bar + Baz { } -struct A { x: int } +struct A { x: isize } -impl Foo for A { fn f(&self) -> int { 10 } } -impl Bar for A { fn g(&self) -> int { 20 } } -impl Baz for A { fn h(&self) -> int { 30 } } +impl Foo for A { fn f(&self) -> isize { 10 } } +impl Bar for A { fn g(&self) -> isize { 20 } } +impl Baz for A { fn h(&self) -> isize { 30 } } impl Quux for A {} fn f(a: &T) { diff --git a/src/test/run-pass/trait-object-generics.rs b/src/test/run-pass/trait-object-generics.rs index b528cbe271a..63246b870cb 100644 --- a/src/test/run-pass/trait-object-generics.rs +++ b/src/test/run-pass/trait-object-generics.rs @@ -42,11 +42,11 @@ impl Impl { enum Type { Constant(T) } trait Trait { - fn method(&self,Type<(K,V)>) -> int; + fn method(&self,Type<(K,V)>) -> isize; } impl Trait for () { - fn method(&self, _x: Type<(u8,V)>) -> int { 0 } + fn method(&self, _x: Type<(u8,V)>) -> isize { 0 } } pub fn main() { diff --git a/src/test/run-pass/trait-region-pointer-simple.rs b/src/test/run-pass/trait-region-pointer-simple.rs index 412fb6625e3..95311e62e63 100644 --- a/src/test/run-pass/trait-region-pointer-simple.rs +++ b/src/test/run-pass/trait-region-pointer-simple.rs @@ -9,15 +9,15 @@ // except according to those terms. trait Foo { - fn f(&self) -> int; + fn f(&self) -> isize; } struct A { - x: int + x: isize } impl Foo for A { - fn f(&self) -> int { + fn f(&self) -> isize { println!("Today's number is {}", self.x); return self.x; } diff --git a/src/test/run-pass/trait-safety-ok-cc.rs b/src/test/run-pass/trait-safety-ok-cc.rs index 28f683c485a..ada79399561 100644 --- a/src/test/run-pass/trait-safety-ok-cc.rs +++ b/src/test/run-pass/trait-safety-ok-cc.rs @@ -18,15 +18,15 @@ extern crate trait_safety_lib as lib; use lib::Foo; -struct Bar { x: int } +struct Bar { x: isize } unsafe impl Foo for Bar { - fn foo(&self) -> int { self.x } + fn foo(&self) -> isize { self.x } } -fn take_foo(f: &F) -> int { f.foo() } +fn take_foo(f: &F) -> isize { f.foo() } fn main() { - let x: int = 22; + let x: isize = 22; assert_eq!(22, take_foo(&x)); let x: Bar = Bar { x: 23 }; diff --git a/src/test/run-pass/trait-safety-ok.rs b/src/test/run-pass/trait-safety-ok.rs index c5679627fc3..3cd23aeaf27 100644 --- a/src/test/run-pass/trait-safety-ok.rs +++ b/src/test/run-pass/trait-safety-ok.rs @@ -13,16 +13,16 @@ // pretty-expanded FIXME #23616 unsafe trait Foo { - fn foo(&self) -> int; + fn foo(&self) -> isize; } -unsafe impl Foo for int { - fn foo(&self) -> int { *self } +unsafe impl Foo for isize { + fn foo(&self) -> isize { *self } } -fn take_foo(f: &F) -> int { f.foo() } +fn take_foo(f: &F) -> isize { f.foo() } fn main() { - let x: int = 22; + let x: isize = 22; assert_eq!(22, take_foo(&x)); } diff --git a/src/test/run-pass/trait-to-str.rs b/src/test/run-pass/trait-to-str.rs index ea8a5a28c34..3d84092c062 100644 --- a/src/test/run-pass/trait-to-str.rs +++ b/src/test/run-pass/trait-to-str.rs @@ -15,7 +15,7 @@ trait to_str { fn to_string_(&self) -> String; } -impl to_str for int { +impl to_str for isize { fn to_string_(&self) -> String { self.to_string() } } diff --git a/src/test/run-pass/trait-with-bounds-default.rs b/src/test/run-pass/trait-with-bounds-default.rs index 6b2c5093c83..34a79c4cf31 100644 --- a/src/test/run-pass/trait-with-bounds-default.rs +++ b/src/test/run-pass/trait-with-bounds-default.rs @@ -27,8 +27,8 @@ trait Getter { } -impl Getter for int { - fn do_get(&self) -> int { *self } +impl Getter for isize { + fn do_get(&self) -> isize { *self } } impl Getter for Option { diff --git a/src/test/run-pass/traits-conditional-model-fn.rs b/src/test/run-pass/traits-conditional-model-fn.rs index c9f003a0220..65a48844620 100644 --- a/src/test/run-pass/traits-conditional-model-fn.rs +++ b/src/test/run-pass/traits-conditional-model-fn.rs @@ -26,11 +26,11 @@ use std::cell::Cell; /////////////////////////////////////////////////////////////////////////// struct SomeGoableThing { - counter: Rc> + counter: Rc> } impl Go for SomeGoableThing { - fn go(&self, arg: int) { + fn go(&self, arg: isize) { self.counter.set(self.counter.get() + arg); } } @@ -38,11 +38,11 @@ impl Go for SomeGoableThing { /////////////////////////////////////////////////////////////////////////// struct SomeGoOnceableThing { - counter: Rc> + counter: Rc> } impl GoOnce for SomeGoOnceableThing { - fn go_once(self, arg: int) { + fn go_once(self, arg: isize) { self.counter.set(self.counter.get() + arg); } } diff --git a/src/test/run-pass/traits-default-method-mut.rs b/src/test/run-pass/traits-default-method-mut.rs index 29b52ea5897..3f61eb47233 100644 --- a/src/test/run-pass/traits-default-method-mut.rs +++ b/src/test/run-pass/traits-default-method-mut.rs @@ -14,7 +14,7 @@ #![allow(unused_variable)] trait Foo { - fn foo(&self, mut v: int) { v = 1; } + fn foo(&self, mut v: isize) { v = 1; } } pub fn main() {} diff --git a/src/test/run-pass/traits-default-method-self.rs b/src/test/run-pass/traits-default-method-self.rs index 270b9545218..d9536108f4d 100644 --- a/src/test/run-pass/traits-default-method-self.rs +++ b/src/test/run-pass/traits-default-method-self.rs @@ -17,7 +17,7 @@ trait Cat { fn purr(&self) -> bool { true } } -impl Cat for int { +impl Cat for isize { fn meow(&self) -> bool { self.scratch() } diff --git a/src/test/run-pass/traits-default-method-trivial.rs b/src/test/run-pass/traits-default-method-trivial.rs index 474632a7ffa..0e71fcab9d1 100644 --- a/src/test/run-pass/traits-default-method-trivial.rs +++ b/src/test/run-pass/traits-default-method-trivial.rs @@ -17,7 +17,7 @@ trait Cat { fn purr(&self) -> bool { true } } -impl Cat for int { +impl Cat for isize { fn meow(&self) -> bool { self.scratch() } diff --git a/src/test/run-pass/traits-multidispatch-infer-convert-target.rs b/src/test/run-pass/traits-multidispatch-infer-convert-target.rs index f81b753acbb..1f1d1a46cf9 100644 --- a/src/test/run-pass/traits-multidispatch-infer-convert-target.rs +++ b/src/test/run-pass/traits-multidispatch-infer-convert-target.rs @@ -30,7 +30,7 @@ impl Convert for u32 { } } -fn test(_: T, _: U, t_size: uint, u_size: uint) +fn test(_: T, _: U, t_size: usize, u_size: usize) where T : Convert { assert_eq!(mem::size_of::(), t_size); diff --git a/src/test/run-pass/transmute-non-immediate-to-immediate.rs b/src/test/run-pass/transmute-non-immediate-to-immediate.rs index d8314005082..bd705a909b0 100644 --- a/src/test/run-pass/transmute-non-immediate-to-immediate.rs +++ b/src/test/run-pass/transmute-non-immediate-to-immediate.rs @@ -15,6 +15,6 @@ pub fn main() { unsafe { - ::std::mem::transmute::<[int; 1],int>([1]) + ::std::mem::transmute::<[isize; 1],isize>([1]) }; } diff --git a/src/test/run-pass/tup.rs b/src/test/run-pass/tup.rs index 396d6911cf2..50687756e2a 100644 --- a/src/test/run-pass/tup.rs +++ b/src/test/run-pass/tup.rs @@ -10,9 +10,9 @@ // pretty-expanded FIXME #23616 -type point = (int, int); +type point = (isize, isize); -fn f(p: point, x: int, y: int) { +fn f(p: point, x: isize, y: isize) { let (a, b) = p; assert_eq!(a, x); assert_eq!(b, y); diff --git a/src/test/run-pass/tuple-index-fat-types.rs b/src/test/run-pass/tuple-index-fat-types.rs index 7d6f42c7ddc..395531d1573 100644 --- a/src/test/run-pass/tuple-index-fat-types.rs +++ b/src/test/run-pass/tuple-index-fat-types.rs @@ -10,14 +10,14 @@ // pretty-expanded FIXME #23616 -struct Foo<'a>(&'a [int]); +struct Foo<'a>(&'a [isize]); fn main() { - let x: &[int] = &[1, 2, 3]; + let x: &[isize] = &[1, 2, 3]; let y = (x,); assert_eq!(y.0, x); - let x: &[int] = &[1, 2, 3]; + let x: &[isize] = &[1, 2, 3]; let y = Foo(x); assert_eq!(y.0, x); } diff --git a/src/test/run-pass/tuple-index.rs b/src/test/run-pass/tuple-index.rs index 004e7e33d4e..a70b49296fa 100644 --- a/src/test/run-pass/tuple-index.rs +++ b/src/test/run-pass/tuple-index.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -struct Point(int, int); +struct Point(isize, isize); fn main() { let mut x = Point(3, 2); diff --git a/src/test/run-pass/tuple-struct-construct.rs b/src/test/run-pass/tuple-struct-construct.rs index 7773bf647f9..c40adf2260d 100644 --- a/src/test/run-pass/tuple-struct-construct.rs +++ b/src/test/run-pass/tuple-struct-construct.rs @@ -9,7 +9,7 @@ // except according to those terms. #[derive(Debug)] -struct Foo(int, int); +struct Foo(isize, isize); pub fn main() { let x = Foo(1, 2); diff --git a/src/test/run-pass/tuple-struct-constructor-pointer.rs b/src/test/run-pass/tuple-struct-constructor-pointer.rs index bcd62e92b46..90cf94666de 100644 --- a/src/test/run-pass/tuple-struct-constructor-pointer.rs +++ b/src/test/run-pass/tuple-struct-constructor-pointer.rs @@ -9,13 +9,13 @@ // except according to those terms. #[derive(PartialEq, Debug)] -struct Foo(int); +struct Foo(isize); #[derive(PartialEq, Debug)] -struct Bar(int, int); +struct Bar(isize, isize); pub fn main() { - let f: fn(int) -> Foo = Foo; - let g: fn(int, int) -> Bar = Bar; + let f: fn(isize) -> Foo = Foo; + let g: fn(isize, isize) -> Bar = Bar; assert_eq!(f(42), Foo(42)); assert_eq!(g(4, 7), Bar(4, 7)); } diff --git a/src/test/run-pass/tuple-struct-destructuring.rs b/src/test/run-pass/tuple-struct-destructuring.rs index ec7675abf83..4b0eb26cf94 100644 --- a/src/test/run-pass/tuple-struct-destructuring.rs +++ b/src/test/run-pass/tuple-struct-destructuring.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -struct Foo(int, int); +struct Foo(isize, isize); pub fn main() { let x = Foo(1, 2); diff --git a/src/test/run-pass/tuple-struct-matching.rs b/src/test/run-pass/tuple-struct-matching.rs index f50b0405953..b37302fce08 100644 --- a/src/test/run-pass/tuple-struct-matching.rs +++ b/src/test/run-pass/tuple-struct-matching.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -struct Foo(int, int); +struct Foo(isize, isize); pub fn main() { let x = Foo(1, 2); diff --git a/src/test/run-pass/tuple-struct-trivial.rs b/src/test/run-pass/tuple-struct-trivial.rs index 5b25dcbb347..fa2c9768fcb 100644 --- a/src/test/run-pass/tuple-struct-trivial.rs +++ b/src/test/run-pass/tuple-struct-trivial.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -struct Foo(int, int, int); +struct Foo(isize, isize, isize); pub fn main() { } diff --git a/src/test/run-pass/tydesc-name.rs b/src/test/run-pass/tydesc-name.rs index cc97959e41a..4ba7e786ec8 100644 --- a/src/test/run-pass/tydesc-name.rs +++ b/src/test/run-pass/tydesc-name.rs @@ -20,7 +20,7 @@ struct Foo { pub fn main() { unsafe { - assert_eq!(type_name::(), "isize"); - assert_eq!(type_name::>(), "Foo"); + assert_eq!(type_name::(), "isize"); + assert_eq!(type_name::>(), "Foo"); } } diff --git a/src/test/run-pass/type-id-higher-rank.rs b/src/test/run-pass/type-id-higher-rank.rs index 5670c45b68a..dea6311fe27 100644 --- a/src/test/run-pass/type-id-higher-rank.rs +++ b/src/test/run-pass/type-id-higher-rank.rs @@ -20,10 +20,10 @@ use std::any::TypeId; fn main() { // Bare fns { - let a = TypeId::of::(); - let b = TypeId::of:: fn(&'static int, &'a int)>(); - let c = TypeId::of:: fn(&'a int, &'b int)>(); - let d = TypeId::of:: fn(&'b int, &'a int)>(); + let a = TypeId::of::(); + let b = TypeId::of:: fn(&'static isize, &'a isize)>(); + let c = TypeId::of:: fn(&'a isize, &'b isize)>(); + let d = TypeId::of:: fn(&'b isize, &'a isize)>(); assert!(a != b); assert!(a != c); assert!(a != d); @@ -32,16 +32,16 @@ fn main() { assert_eq!(c, d); // Make sure De Bruijn indices are handled correctly - let e = TypeId::of:: fn(fn(&'a int) -> &'a int)>(); - let f = TypeId::of:: fn(&'a int) -> &'a int)>(); + let e = TypeId::of:: fn(fn(&'a isize) -> &'a isize)>(); + let f = TypeId::of:: fn(&'a isize) -> &'a isize)>(); assert!(e != f); } // Boxed unboxed closures { - let a = TypeId::of::>(); - let b = TypeId::of:: Fn(&'static int, &'a int)>>(); - let c = TypeId::of:: Fn(&'a int, &'b int)>>(); - let d = TypeId::of:: Fn(&'b int, &'a int)>>(); + let a = TypeId::of::>(); + let b = TypeId::of:: Fn(&'static isize, &'a isize)>>(); + let c = TypeId::of:: Fn(&'a isize, &'b isize)>>(); + let d = TypeId::of:: Fn(&'b isize, &'a isize)>>(); assert!(a != b); assert!(a != c); assert!(a != d); @@ -50,16 +50,16 @@ fn main() { assert_eq!(c, d); // Make sure De Bruijn indices are handled correctly - let e = TypeId::of:: Fn(Box &'a int>)>>(); - let f = TypeId::of:: Fn(&'a int) -> &'a int>)>>(); + let e = TypeId::of:: Fn(Box &'a isize>)>>(); + let f = TypeId::of:: Fn(&'a isize) -> &'a isize>)>>(); assert!(e != f); } // Raw unboxed closures // Note that every unboxed closure has its own anonymous type, // so no two IDs should equal each other, even when compatible { - let a = id(|_: &int, _: &int| {}); - let b = id(|_: &int, _: &int| {}); + let a = id(|_: &isize, _: &isize| {}); + let b = id(|_: &isize, _: &isize| {}); assert!(a != b); } diff --git a/src/test/run-pass/type-in-nested-module.rs b/src/test/run-pass/type-in-nested-module.rs index 02b7fa50a2d..7e2360caa93 100644 --- a/src/test/run-pass/type-in-nested-module.rs +++ b/src/test/run-pass/type-in-nested-module.rs @@ -14,7 +14,7 @@ mod a { pub mod b { - pub type t = int; + pub type t = isize; pub fn foo() { let _x: t = 10; } } diff --git a/src/test/run-pass/type-namespace.rs b/src/test/run-pass/type-namespace.rs index 00b7b0c359b..c03ddd0c649 100644 --- a/src/test/run-pass/type-namespace.rs +++ b/src/test/run-pass/type-namespace.rs @@ -10,8 +10,8 @@ // pretty-expanded FIXME #23616 -struct A { a: int } +struct A { a: isize } -fn a(a: A) -> int { return a.a; } +fn a(a: A) -> isize { return a.a; } pub fn main() { let x: A = A {a: 1}; assert!((a(x) == 1)); } diff --git a/src/test/run-pass/type-param-constraints.rs b/src/test/run-pass/type-param-constraints.rs index 5b8e78ba71a..381f1b68257 100644 --- a/src/test/run-pass/type-param-constraints.rs +++ b/src/test/run-pass/type-param-constraints.rs @@ -18,14 +18,14 @@ fn s_foo(_shared: T) { } fn u_foo(_unique: T) { } struct r { - i: int, + i: isize, } impl Drop for r { fn drop(&mut self) {} } -fn r(i:int) -> r { +fn r(i:isize) -> r { r { i: i } diff --git a/src/test/run-pass/type-params-in-for-each.rs b/src/test/run-pass/type-params-in-for-each.rs index 3bfc61ddcbe..fea2bd978eb 100644 --- a/src/test/run-pass/type-params-in-for-each.rs +++ b/src/test/run-pass/type-params-in-for-each.rs @@ -13,15 +13,15 @@ struct S { a: T, - b: uint, + b: usize, } -fn range_(lo: uint, hi: uint, mut it: F) where F: FnMut(uint) { +fn range_(lo: usize, hi: usize, mut it: F) where F: FnMut(usize) { let mut lo_ = lo; while lo_ < hi { it(lo_); lo_ += 1; } } -fn create_index(_index: Vec> , _hash_fn: extern fn(T) -> uint) { +fn create_index(_index: Vec> , _hash_fn: extern fn(T) -> usize) { range_(0, 256, |_i| { let _bucket: Vec = Vec::new(); }) diff --git a/src/test/run-pass/type-ptr.rs b/src/test/run-pass/type-ptr.rs index 3b97cbbaa90..67ead80c89b 100644 --- a/src/test/run-pass/type-ptr.rs +++ b/src/test/run-pass/type-ptr.rs @@ -10,8 +10,8 @@ // pretty-expanded FIXME #23616 -fn f(a: *const int) -> *const int { return a; } +fn f(a: *const isize) -> *const isize { return a; } -fn g(a: *const int) -> *const int { let b = f(a); return b; } +fn g(a: *const isize) -> *const isize { let b = f(a); return b; } pub fn main() { return; } diff --git a/src/test/run-pass/type-sizes.rs b/src/test/run-pass/type-sizes.rs index 286a12100c4..8c1251feea2 100644 --- a/src/test/run-pass/type-sizes.rs +++ b/src/test/run-pass/type-sizes.rs @@ -16,9 +16,9 @@ struct t {a: u8, b: i8} struct u {a: u8, b: i8, c: u8} struct v {a: u8, b: i8, c: v2, d: u32} struct v2 {u: char, v: u8} -struct w {a: int, b: ()} -struct x {a: int, b: (), c: ()} -struct y {x: int} +struct w {a: isize, b: ()} +struct x {a: isize, b: (), c: ()} +struct y {x: isize} enum e1 { a(u8, u32), b(u32), c @@ -32,26 +32,26 @@ enum e3 { } pub fn main() { - assert_eq!(size_of::(), 1 as uint); - assert_eq!(size_of::(), 4 as uint); - assert_eq!(size_of::(), 4 as uint); - assert_eq!(size_of::(), 1 as uint); - assert_eq!(size_of::(), 4 as uint); - assert_eq!(size_of::(), 2 as uint); - assert_eq!(size_of::(), 3 as uint); + assert_eq!(size_of::(), 1 as usize); + assert_eq!(size_of::(), 4 as usize); + assert_eq!(size_of::(), 4 as usize); + assert_eq!(size_of::(), 1 as usize); + assert_eq!(size_of::(), 4 as usize); + assert_eq!(size_of::(), 2 as usize); + assert_eq!(size_of::(), 3 as usize); // Alignment causes padding before the char and the u32. assert!(size_of::() == - 16 as uint); - assert_eq!(size_of::(), size_of::()); - assert_eq!(size_of::(), size_of::()); - assert_eq!(size_of::(), size_of::()); - assert_eq!(size_of::(), size_of::()); + 16 as usize); + assert_eq!(size_of::(), size_of::()); + assert_eq!(size_of::(), size_of::()); + assert_eq!(size_of::(), size_of::()); + assert_eq!(size_of::(), size_of::()); // Make sure enum types are the appropriate size, mostly // around ensuring alignment is handled properly - assert_eq!(size_of::(), 8 as uint); - assert_eq!(size_of::(), 8 as uint); - assert_eq!(size_of::(), 4 as uint); + assert_eq!(size_of::(), 8 as usize); + assert_eq!(size_of::(), 8 as usize); + assert_eq!(size_of::(), 4 as usize); } diff --git a/src/test/run-pass/typeck-macro-interaction-issue-8852.rs b/src/test/run-pass/typeck-macro-interaction-issue-8852.rs index 6a684fe9d8c..2da8b0a508a 100644 --- a/src/test/run-pass/typeck-macro-interaction-issue-8852.rs +++ b/src/test/run-pass/typeck-macro-interaction-issue-8852.rs @@ -11,7 +11,7 @@ // pretty-expanded FIXME #23616 enum T { - A(int), + A(isize), B(f64) } diff --git a/src/test/run-pass/typeid-intrinsic.rs b/src/test/run-pass/typeid-intrinsic.rs index 9dfd25b4fc4..a34204d6831 100644 --- a/src/test/run-pass/typeid-intrinsic.rs +++ b/src/test/run-pass/typeid-intrinsic.rs @@ -48,18 +48,18 @@ pub fn main() { assert_eq!(other1::id_G(), other2::id_G()); assert_eq!(other1::id_H(), other2::id_H()); - assert_eq!(TypeId::of::(), other2::foo::()); - assert_eq!(TypeId::of::(), other1::foo::()); - assert_eq!(other2::foo::(), other1::foo::()); + assert_eq!(TypeId::of::(), other2::foo::()); + assert_eq!(TypeId::of::(), other1::foo::()); + assert_eq!(other2::foo::(), other1::foo::()); assert_eq!(TypeId::of::(), other2::foo::()); assert_eq!(TypeId::of::(), other1::foo::()); assert_eq!(other2::foo::(), other1::foo::()); } // sanity test of TypeId - let (a, b, c) = (TypeId::of::(), TypeId::of::<&'static str>(), + let (a, b, c) = (TypeId::of::(), TypeId::of::<&'static str>(), TypeId::of::()); - let (d, e, f) = (TypeId::of::(), TypeId::of::<&'static str>(), + let (d, e, f) = (TypeId::of::(), TypeId::of::<&'static str>(), TypeId::of::()); assert!(a != b); @@ -71,7 +71,7 @@ pub fn main() { assert_eq!(c, f); // check it has a hash - let (a, b) = (TypeId::of::(), TypeId::of::()); + let (a, b) = (TypeId::of::(), TypeId::of::()); assert_eq!(hash::hash::(&a), hash::hash::(&b)); diff --git a/src/test/run-pass/ufcs-explicit-self.rs b/src/test/run-pass/ufcs-explicit-self.rs index 810148b012d..3a1394447f6 100644 --- a/src/test/run-pass/ufcs-explicit-self.rs +++ b/src/test/run-pass/ufcs-explicit-self.rs @@ -13,17 +13,17 @@ #[derive(Copy)] struct Foo { - f: int, + f: isize, } impl Foo { - fn foo(self: Foo, x: int) -> int { + fn foo(self: Foo, x: isize) -> isize { self.f + x } - fn bar(self: &Foo, x: int) -> int { + fn bar(self: &Foo, x: isize) -> isize { self.f + x } - fn baz(self: Box, x: int) -> int { + fn baz(self: Box, x: isize) -> isize { self.f + x } } @@ -34,13 +34,13 @@ struct Bar { } impl Bar { - fn foo(self: Bar, x: int) -> int { + fn foo(self: Bar, x: isize) -> isize { x } - fn bar<'a>(self: &'a Bar, x: int) -> int { + fn bar<'a>(self: &'a Bar, x: isize) -> isize { x } - fn baz(self: Bar, x: int) -> int { + fn baz(self: Bar, x: isize) -> isize { x } } @@ -54,6 +54,6 @@ fn main() { f: 1, }; println!("{} {} {}", bar.foo(2), bar.bar(2), bar.baz(2)); - let bar: Box> = bar; + let bar: Box> = bar; println!("{} {} {}", bar.foo(2), bar.bar(2), bar.baz(2)); } diff --git a/src/test/run-pass/uint.rs b/src/test/run-pass/uint.rs index 79ca103a294..a894d762979 100644 --- a/src/test/run-pass/uint.rs +++ b/src/test/run-pass/uint.rs @@ -13,4 +13,4 @@ // pretty-expanded FIXME #23616 -pub fn main() { let _x: uint = 10 as uint; } +pub fn main() { let _x: usize = 10 as usize; } diff --git a/src/test/run-pass/unary-minus-suffix-inference.rs b/src/test/run-pass/unary-minus-suffix-inference.rs index adbbf1aec9a..9d685e0263f 100644 --- a/src/test/run-pass/unary-minus-suffix-inference.rs +++ b/src/test/run-pass/unary-minus-suffix-inference.rs @@ -26,7 +26,7 @@ pub fn main() { println!("{}", d_neg); let e = 1; - let e_neg: int = -e; + let e_neg: isize = -e; println!("{}", e_neg); // intentional overflows @@ -48,6 +48,6 @@ pub fn main() { println!("{}", i_neg); let j = 1; - let j_neg: uint = -j; + let j_neg: usize = -j; println!("{}", j_neg); } diff --git a/src/test/run-pass/unboxed-closures-all-traits.rs b/src/test/run-pass/unboxed-closures-all-traits.rs index b98f5549b01..9ca8e5403a1 100644 --- a/src/test/run-pass/unboxed-closures-all-traits.rs +++ b/src/test/run-pass/unboxed-closures-all-traits.rs @@ -12,21 +12,21 @@ #![feature(lang_items, unboxed_closures)] -fn a int>(f: F) -> int { +fn a isize>(f: F) -> isize { f(1, 2) } -fn b int>(mut f: F) -> int { +fn b isize>(mut f: F) -> isize { f(3, 4) } -fn c int>(f: F) -> int { +fn c isize>(f: F) -> isize { f(5, 6) } fn main() { - let z: int = 7; - assert_eq!(a(move |x: int, y| x + y + z), 10); - assert_eq!(b(move |x: int, y| x + y + z), 14); - assert_eq!(c(move |x: int, y| x + y + z), 18); + let z: isize = 7; + assert_eq!(a(move |x: isize, y| x + y + z), 10); + assert_eq!(b(move |x: isize, y| x + y + z), 14); + assert_eq!(c(move |x: isize, y| x + y + z), 18); } diff --git a/src/test/run-pass/unboxed-closures-call-fn-autoderef.rs b/src/test/run-pass/unboxed-closures-call-fn-autoderef.rs index 7eb5e988424..6e92850ac2e 100644 --- a/src/test/run-pass/unboxed-closures-call-fn-autoderef.rs +++ b/src/test/run-pass/unboxed-closures-call-fn-autoderef.rs @@ -16,15 +16,15 @@ use std::ops::FnMut; -fn call_with_2(x: &fn(int) -> int) -> int +fn call_with_2(x: &fn(isize) -> isize) -> isize { x(2) // look ma, no `*` } -fn subtract_22(x: int) -> int { x - 22 } +fn subtract_22(x: isize) -> isize { x - 22 } pub fn main() { - let subtract_22: fn(int) -> int = subtract_22; + let subtract_22: fn(isize) -> isize = subtract_22; let z = call_with_2(&subtract_22); assert_eq!(z, -20); } diff --git a/src/test/run-pass/unboxed-closures-call-sugar-autoderef.rs b/src/test/run-pass/unboxed-closures-call-sugar-autoderef.rs index 6e8253d49ea..402b4b0b85d 100644 --- a/src/test/run-pass/unboxed-closures-call-sugar-autoderef.rs +++ b/src/test/run-pass/unboxed-closures-call-sugar-autoderef.rs @@ -16,8 +16,8 @@ use std::ops::FnMut; -fn call_with_2(x: &mut F) -> int - where F : FnMut(int) -> int +fn call_with_2(x: &mut F) -> isize + where F : FnMut(isize) -> isize { x(2) // look ma, no `*` } diff --git a/src/test/run-pass/unboxed-closures-call-sugar-object-autoderef.rs b/src/test/run-pass/unboxed-closures-call-sugar-object-autoderef.rs index 271381f520e..c82026235c2 100644 --- a/src/test/run-pass/unboxed-closures-call-sugar-object-autoderef.rs +++ b/src/test/run-pass/unboxed-closures-call-sugar-object-autoderef.rs @@ -15,7 +15,7 @@ use std::ops::FnMut; -fn make_adder(x: int) -> Boxint + 'static> { +fn make_adder(x: isize) -> Boxisize + 'static> { // FIXME (#22405): Replace `Box::new` with `box` here when/if possible. Box::new(move |y| { x + y }) } diff --git a/src/test/run-pass/unboxed-closures-call-sugar-object.rs b/src/test/run-pass/unboxed-closures-call-sugar-object.rs index e51e35d2c65..629da1091ac 100644 --- a/src/test/run-pass/unboxed-closures-call-sugar-object.rs +++ b/src/test/run-pass/unboxed-closures-call-sugar-object.rs @@ -13,7 +13,7 @@ use std::ops::FnMut; -fn make_adder(x: int) -> Boxint + 'static> { +fn make_adder(x: isize) -> Boxisize + 'static> { // FIXME (#22405): Replace `Box::new` with `box` here when/if possible. Box::new(move |y| { x + y }) } diff --git a/src/test/run-pass/unboxed-closures-drop.rs b/src/test/run-pass/unboxed-closures-drop.rs index 156934f909d..f0c6c0ff453 100644 --- a/src/test/run-pass/unboxed-closures-drop.rs +++ b/src/test/run-pass/unboxed-closures-drop.rs @@ -15,16 +15,16 @@ #![feature(unboxed_closures)] -static mut DROP_COUNT: uint = 0; +static mut DROP_COUNT: usize = 0; -fn drop_count() -> uint { +fn drop_count() -> usize { unsafe { DROP_COUNT } } struct Droppable { - x: int, + x: isize, } impl Droppable { @@ -43,27 +43,27 @@ impl Drop for Droppable { } } -fn a int>(f: F) -> int { +fn a isize>(f: F) -> isize { f(1, 2) } -fn b int>(mut f: F) -> int { +fn b isize>(mut f: F) -> isize { f(3, 4) } -fn c int>(f: F) -> int { +fn c isize>(f: F) -> isize { f(5, 6) } fn test_fn() { { - a(move |a: int, b| { a + b }); + a(move |a: isize, b| { a + b }); } assert_eq!(drop_count(), 0); { let z = &Droppable::new(); - a(move |a: int, b| { z; a + b }); + a(move |a: isize, b| { z; a + b }); assert_eq!(drop_count(), 0); } assert_eq!(drop_count(), 1); @@ -71,7 +71,7 @@ fn test_fn() { { let z = &Droppable::new(); let zz = &Droppable::new(); - a(move |a: int, b| { z; zz; a + b }); + a(move |a: isize, b| { z; zz; a + b }); assert_eq!(drop_count(), 1); } assert_eq!(drop_count(), 3); @@ -79,13 +79,13 @@ fn test_fn() { fn test_fn_mut() { { - b(move |a: int, b| { a + b }); + b(move |a: isize, b| { a + b }); } assert_eq!(drop_count(), 3); { let z = &Droppable::new(); - b(move |a: int, b| { z; a + b }); + b(move |a: isize, b| { z; a + b }); assert_eq!(drop_count(), 3); } assert_eq!(drop_count(), 4); @@ -93,7 +93,7 @@ fn test_fn_mut() { { let z = &Droppable::new(); let zz = &Droppable::new(); - b(move |a: int, b| { z; zz; a + b }); + b(move |a: isize, b| { z; zz; a + b }); assert_eq!(drop_count(), 4); } assert_eq!(drop_count(), 6); @@ -101,13 +101,13 @@ fn test_fn_mut() { fn test_fn_once() { { - c(move |a: int, b| { a + b }); + c(move |a: isize, b| { a + b }); } assert_eq!(drop_count(), 6); { let z = Droppable::new(); - c(move |a: int, b| { z; a + b }); + c(move |a: isize, b| { z; a + b }); assert_eq!(drop_count(), 7); } assert_eq!(drop_count(), 7); @@ -115,7 +115,7 @@ fn test_fn_once() { { let z = Droppable::new(); let zz = Droppable::new(); - c(move |a: int, b| { z; zz; a + b }); + c(move |a: isize, b| { z; zz; a + b }); assert_eq!(drop_count(), 9); } assert_eq!(drop_count(), 9); diff --git a/src/test/run-pass/unboxed-closures-extern-fn-hr.rs b/src/test/run-pass/unboxed-closures-extern-fn-hr.rs index 83fe32f9ca3..4af4b320d0e 100644 --- a/src/test/run-pass/unboxed-closures-extern-fn-hr.rs +++ b/src/test/run-pass/unboxed-closures-extern-fn-hr.rs @@ -16,21 +16,21 @@ use std::ops::{Fn,FnMut,FnOnce}; -fn square(x: &int) -> int { (*x) * (*x) } +fn square(x: &isize) -> isize { (*x) * (*x) } -fn call_itint>(f: &F, x: int) -> int { +fn call_itisize>(f: &F, x: isize) -> isize { (*f)(&x) } -fn call_it_boxed(f: &Fn(&int) -> int, x: int) -> int { +fn call_it_boxed(f: &Fn(&isize) -> isize, x: isize) -> isize { f.call((&x,)) } -fn call_it_mutint>(f: &mut F, x: int) -> int { +fn call_it_mutisize>(f: &mut F, x: isize) -> isize { (*f)(&x) } -fn call_it_onceint>(f: F, x: int) -> int { +fn call_it_onceisize>(f: F, x: isize) -> isize { f(&x) } diff --git a/src/test/run-pass/unboxed-closures-extern-fn.rs b/src/test/run-pass/unboxed-closures-extern-fn.rs index 570627374b7..d711ebbe4b8 100644 --- a/src/test/run-pass/unboxed-closures-extern-fn.rs +++ b/src/test/run-pass/unboxed-closures-extern-fn.rs @@ -17,17 +17,17 @@ use std::ops::{Fn,FnMut,FnOnce}; -fn square(x: int) -> int { x * x } +fn square(x: isize) -> isize { x * x } -fn call_itint>(f: &F, x: int) -> int { +fn call_itisize>(f: &F, x: isize) -> isize { f(x) } -fn call_it_mutint>(f: &mut F, x: int) -> int { +fn call_it_mutisize>(f: &mut F, x: isize) -> isize { f(x) } -fn call_it_onceint>(f: F, x: int) -> int { +fn call_it_onceisize>(f: F, x: isize) -> isize { f(x) } diff --git a/src/test/run-pass/unboxed-closures-infer-argument-types-from-expected-bound.rs b/src/test/run-pass/unboxed-closures-infer-argument-types-from-expected-bound.rs index 790272c257c..d408612f9b8 100644 --- a/src/test/run-pass/unboxed-closures-infer-argument-types-from-expected-bound.rs +++ b/src/test/run-pass/unboxed-closures-infer-argument-types-from-expected-bound.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// Test that we are able to infer that the type of `x` is `int` based +// Test that we are able to infer that the type of `x` is `isize` based // on the expected type from the object. // pretty-expanded FIXME #23616 @@ -24,5 +24,5 @@ fn doit(val: T, f: &F) } pub fn main() { - doit(0, &|x /*: int*/ | { x.to_int(); }); + doit(0, &|x /*: isize*/ | { x.to_int(); }); } diff --git a/src/test/run-pass/unboxed-closures-infer-argument-types-from-expected-object-type.rs b/src/test/run-pass/unboxed-closures-infer-argument-types-from-expected-object-type.rs index 8f4e4f353f3..c1e1ff3cd8e 100644 --- a/src/test/run-pass/unboxed-closures-infer-argument-types-from-expected-object-type.rs +++ b/src/test/run-pass/unboxed-closures-infer-argument-types-from-expected-object-type.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// Test that we are able to infer that the type of `x` is `int` based +// Test that we are able to infer that the type of `x` is `isize` based // on the expected type from the object. // pretty-expanded FIXME #23616 @@ -20,5 +20,5 @@ use std::num::ToPrimitive; fn doit(val: T, f: &Fn(T)) { f.call((val,)) } pub fn main() { - doit(0, &|x /*: int*/ | { x.to_int(); }); + doit(0, &|x /*: isize*/ | { x.to_int(); }); } diff --git a/src/test/run-pass/unboxed-closures-infer-argument-types-with-bound-regions-from-expected-bound.rs b/src/test/run-pass/unboxed-closures-infer-argument-types-with-bound-regions-from-expected-bound.rs index 1b8c9af8d4e..99e2149de96 100644 --- a/src/test/run-pass/unboxed-closures-infer-argument-types-with-bound-regions-from-expected-bound.rs +++ b/src/test/run-pass/unboxed-closures-infer-argument-types-with-bound-regions-from-expected-bound.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// Test that we are able to infer that the type of `x` is `int` based +// Test that we are able to infer that the type of `x` is `isize` based // on the expected type from the object. // pretty-expanded FIXME #23616 @@ -24,5 +24,5 @@ fn doit(val: T, f: &F) } pub fn main() { - doit(0, &|x /*: int*/ | { x.to_int(); }); + doit(0, &|x /*: isize*/ | { x.to_int(); }); } diff --git a/src/test/run-pass/unboxed-closures-monomorphization.rs b/src/test/run-pass/unboxed-closures-monomorphization.rs index e221811948c..f16f757c645 100644 --- a/src/test/run-pass/unboxed-closures-monomorphization.rs +++ b/src/test/run-pass/unboxed-closures-monomorphization.rs @@ -32,7 +32,7 @@ fn main(){ assert_eq!(f.call_mut(()), &x); #[derive(Clone, Copy, Debug, PartialEq)] - struct Foo(uint, &'static str); + struct Foo(usize, &'static str); let x = Foo(42, "forty-two"); let mut f = bar(x); diff --git a/src/test/run-pass/unboxed-closures-move-mutable.rs b/src/test/run-pass/unboxed-closures-move-mutable.rs index 88baa16c945..1aca3174e1f 100644 --- a/src/test/run-pass/unboxed-closures-move-mutable.rs +++ b/src/test/run-pass/unboxed-closures-move-mutable.rs @@ -18,7 +18,7 @@ // mutably so we do not get a spurious warning about it not needing to // be declared mutable (issue #18336 and #18769) -fn set(x: &mut uint) { *x = 42; } +fn set(x: &mut usize) { *x = 42; } fn main() { { diff --git a/src/test/run-pass/unboxed-closures-prelude.rs b/src/test/run-pass/unboxed-closures-prelude.rs index e8c977b4ed1..313fb67637e 100644 --- a/src/test/run-pass/unboxed-closures-prelude.rs +++ b/src/test/run-pass/unboxed-closures-prelude.rs @@ -18,15 +18,15 @@ fn main() { // FIXME (#22405): Replace `Box::new` with `box` here when/if possible. - let task: Box int> = Box::new(|x| x); + let task: Box isize> = Box::new(|x| x); task.call((0, )); - let mut task: Box int> = Box::new(|x| x); + let mut task: Box isize> = Box::new(|x| x); task(0); call(|x| x, 22); } -fn call int>(f: F, x: int) -> int { +fn call isize>(f: F, x: isize) -> isize { f(x) } diff --git a/src/test/run-pass/unboxed-closures-simple.rs b/src/test/run-pass/unboxed-closures-simple.rs index 9335bc936d9..1443d305bce 100644 --- a/src/test/run-pass/unboxed-closures-simple.rs +++ b/src/test/run-pass/unboxed-closures-simple.rs @@ -15,7 +15,7 @@ use std::ops::FnMut; pub fn main() { - let mut f = |x: int, y: int| -> int { x + y }; + let mut f = |x: isize, y: isize| -> isize { x + y }; let z = f(1, 2); assert_eq!(z, 3); } diff --git a/src/test/run-pass/unboxed-closures-single-word-env.rs b/src/test/run-pass/unboxed-closures-single-word-env.rs index 1517698fc82..65a26d14e12 100644 --- a/src/test/run-pass/unboxed-closures-single-word-env.rs +++ b/src/test/run-pass/unboxed-closures-single-word-env.rs @@ -15,21 +15,21 @@ #![feature(unboxed_closures)] -fn a int>(f: F) -> int { +fn a isize>(f: F) -> isize { f(1, 2) } -fn b int>(mut f: F) -> int { +fn b isize>(mut f: F) -> isize { f(3, 4) } -fn c int>(f: F) -> int { +fn c isize>(f: F) -> isize { f(5, 6) } fn main() { let z = 10; - assert_eq!(a(move |x: int, y| x + y + z), 13); - assert_eq!(b(move |x: int, y| x + y + z), 17); - assert_eq!(c(move |x: int, y| x + y + z), 21); + assert_eq!(a(move |x: isize, y| x + y + z), 13); + assert_eq!(b(move |x: isize, y| x + y + z), 17); + assert_eq!(c(move |x: isize, y| x + y + z), 21); } diff --git a/src/test/run-pass/unboxed-closures-unique-type-id.rs b/src/test/run-pass/unboxed-closures-unique-type-id.rs index e827833bbb2..403b2ca9aaf 100644 --- a/src/test/run-pass/unboxed-closures-unique-type-id.rs +++ b/src/test/run-pass/unboxed-closures-unique-type-id.rs @@ -32,6 +32,6 @@ pub fn replace_map<'a, T, F>(src: &mut T, prod: F) where F: FnOnce(T) -> T { pub fn main() { let mut a = 7; let b = &mut a; - replace_map(b, |x: uint| x * 2); + replace_map(b, |x: usize| x * 2); assert_eq!(*b, 14); } diff --git a/src/test/run-pass/unfold-cross-crate.rs b/src/test/run-pass/unfold-cross-crate.rs index a0c2b6c0a22..fceccb499c7 100644 --- a/src/test/run-pass/unfold-cross-crate.rs +++ b/src/test/run-pass/unfold-cross-crate.rs @@ -20,7 +20,7 @@ use std::iter::Unfold; // cross-crate pub fn main() { - fn count(st: &mut uint) -> Option { + fn count(st: &mut usize) -> Option { if *st < 10 { let ret = Some(*st); *st += 1; diff --git a/src/test/run-pass/unify-return-ty.rs b/src/test/run-pass/unify-return-ty.rs index b8184b62db1..01b55ebb8e2 100644 --- a/src/test/run-pass/unify-return-ty.rs +++ b/src/test/run-pass/unify-return-ty.rs @@ -22,4 +22,4 @@ fn null() -> *const T { } } -pub fn main() { null::(); } +pub fn main() { null::(); } diff --git a/src/test/run-pass/uniq-self-in-mut-slot.rs b/src/test/run-pass/uniq-self-in-mut-slot.rs index 49f552edd83..a6408128c3a 100644 --- a/src/test/run-pass/uniq-self-in-mut-slot.rs +++ b/src/test/run-pass/uniq-self-in-mut-slot.rs @@ -14,7 +14,7 @@ #![feature(box_syntax)] struct X { - a: int + a: isize } trait Changer { diff --git a/src/test/run-pass/unique-autoderef-field.rs b/src/test/run-pass/unique-autoderef-field.rs index 290adcfb014..8ee1b28ea2e 100644 --- a/src/test/run-pass/unique-autoderef-field.rs +++ b/src/test/run-pass/unique-autoderef-field.rs @@ -13,7 +13,7 @@ #![allow(unknown_features)] #![feature(box_syntax)] -struct J { j: int } +struct J { j: isize } pub fn main() { let i: Box<_> = box J { diff --git a/src/test/run-pass/unique-containing-tag.rs b/src/test/run-pass/unique-containing-tag.rs index 21433d6c39b..ce5a2bed48d 100644 --- a/src/test/run-pass/unique-containing-tag.rs +++ b/src/test/run-pass/unique-containing-tag.rs @@ -14,7 +14,7 @@ #![feature(box_syntax)] pub fn main() { - enum t { t1(int), t2(int), } + enum t { t1(isize), t2(isize), } let _x: Box<_> = box t::t1(10); diff --git a/src/test/run-pass/unique-decl.rs b/src/test/run-pass/unique-decl.rs index 6c8177e6cd8..7404e8887eb 100644 --- a/src/test/run-pass/unique-decl.rs +++ b/src/test/run-pass/unique-decl.rs @@ -12,9 +12,9 @@ // pretty-expanded FIXME #23616 pub fn main() { - let _: Box; + let _: Box; } -fn f(_i: Box) -> Box { +fn f(_i: Box) -> Box { panic!(); } diff --git a/src/test/run-pass/unique-destructure.rs b/src/test/run-pass/unique-destructure.rs index 92fa8d7af66..87bc6f6639d 100644 --- a/src/test/run-pass/unique-destructure.rs +++ b/src/test/run-pass/unique-destructure.rs @@ -14,7 +14,7 @@ #![feature(box_patterns)] #![feature(box_syntax)] -struct Foo { a: int, b: int } +struct Foo { a: isize, b: isize } pub fn main() { let box Foo{a, b} = box Foo{a: 100, b: 200}; diff --git a/src/test/run-pass/unique-fn-arg-move.rs b/src/test/run-pass/unique-fn-arg-move.rs index c79dc6a6cfd..e608ab9b636 100644 --- a/src/test/run-pass/unique-fn-arg-move.rs +++ b/src/test/run-pass/unique-fn-arg-move.rs @@ -13,7 +13,7 @@ #![allow(unknown_features)] #![feature(box_syntax)] -fn f(i: Box) { +fn f(i: Box) { assert_eq!(*i, 100); } diff --git a/src/test/run-pass/unique-fn-arg-mut.rs b/src/test/run-pass/unique-fn-arg-mut.rs index 82d724831c3..f0d2abfe27c 100644 --- a/src/test/run-pass/unique-fn-arg-mut.rs +++ b/src/test/run-pass/unique-fn-arg-mut.rs @@ -13,7 +13,7 @@ #![allow(unknown_features)] #![feature(box_syntax)] -fn f(i: &mut Box) { +fn f(i: &mut Box) { *i = box 200; } diff --git a/src/test/run-pass/unique-fn-arg.rs b/src/test/run-pass/unique-fn-arg.rs index a4687cae653..3d7ef31d020 100644 --- a/src/test/run-pass/unique-fn-arg.rs +++ b/src/test/run-pass/unique-fn-arg.rs @@ -13,7 +13,7 @@ #![allow(unknown_features)] #![feature(box_syntax)] -fn f(i: Box) { +fn f(i: Box) { assert_eq!(*i, 100); } diff --git a/src/test/run-pass/unique-fn-ret.rs b/src/test/run-pass/unique-fn-ret.rs index 5e248ebeb33..bb1948bf3c8 100644 --- a/src/test/run-pass/unique-fn-ret.rs +++ b/src/test/run-pass/unique-fn-ret.rs @@ -13,7 +13,7 @@ #![allow(unknown_features)] #![feature(box_syntax)] -fn f() -> Box { +fn f() -> Box { box 100 } diff --git a/src/test/run-pass/unique-in-tag.rs b/src/test/run-pass/unique-in-tag.rs index 4f02018346b..0762b37ff8b 100644 --- a/src/test/run-pass/unique-in-tag.rs +++ b/src/test/run-pass/unique-in-tag.rs @@ -12,7 +12,7 @@ #![feature(box_syntax)] fn test1() { - enum bar { u(Box), w(int), } + enum bar { u(Box), w(isize), } let x = bar::u(box 10); assert!(match x { diff --git a/src/test/run-pass/unique-object-move.rs b/src/test/run-pass/unique-object-move.rs index 0677e6a8df3..4d120e7caf3 100644 --- a/src/test/run-pass/unique-object-move.rs +++ b/src/test/run-pass/unique-object-move.rs @@ -18,7 +18,7 @@ pub trait EventLoop { fn foo(&self) {} } pub struct UvEventLoop { - uvio: int + uvio: isize } impl EventLoop for UvEventLoop { } diff --git a/src/test/run-pass/unique-pat-2.rs b/src/test/run-pass/unique-pat-2.rs index 9063f15e7e7..d16355af99f 100644 --- a/src/test/run-pass/unique-pat-2.rs +++ b/src/test/run-pass/unique-pat-2.rs @@ -14,13 +14,13 @@ #![feature(box_patterns)] #![feature(box_syntax)] -struct Foo {a: int, b: uint} +struct Foo {a: isize, b: usize} -enum bar { u(Box), w(int), } +enum bar { u(Box), w(isize), } pub fn main() { assert!(match bar::u(box Foo{a: 10, b: 40}) { - bar::u(box Foo{a: a, b: b}) => { a + (b as int) } + bar::u(box Foo{a: a, b: b}) => { a + (b as isize) } _ => { 66 } } == 50); } diff --git a/src/test/run-pass/unique-pat-3.rs b/src/test/run-pass/unique-pat-3.rs index 42a4b1a9c0c..648e9599a97 100644 --- a/src/test/run-pass/unique-pat-3.rs +++ b/src/test/run-pass/unique-pat-3.rs @@ -11,7 +11,7 @@ #![allow(unknown_features)] #![feature(box_syntax)] -enum bar { u(Box), w(int), } +enum bar { u(Box), w(isize), } pub fn main() { assert!(match bar::u(box 10) { diff --git a/src/test/run-pass/unique-rec.rs b/src/test/run-pass/unique-rec.rs index 6770fa5fb16..7a09e241ca6 100644 --- a/src/test/run-pass/unique-rec.rs +++ b/src/test/run-pass/unique-rec.rs @@ -13,7 +13,7 @@ #![allow(unknown_features)] #![feature(box_syntax)] -struct X { x: int } +struct X { x: isize } pub fn main() { let x: Box<_> = box X {x: 1}; diff --git a/src/test/run-pass/unique-send-2.rs b/src/test/run-pass/unique-send-2.rs index 1fb39ee8ca7..99a3b641053 100644 --- a/src/test/run-pass/unique-send-2.rs +++ b/src/test/run-pass/unique-send-2.rs @@ -16,7 +16,7 @@ use std::sync::mpsc::{channel, Sender}; use std::thread; -fn child(tx: &Sender>, i: uint) { +fn child(tx: &Sender>, i: usize) { tx.send(box i).unwrap(); } diff --git a/src/test/run-pass/unnamed_argument_mode.rs b/src/test/run-pass/unnamed_argument_mode.rs index 64a6d40f2c8..d498a70be49 100644 --- a/src/test/run-pass/unnamed_argument_mode.rs +++ b/src/test/run-pass/unnamed_argument_mode.rs @@ -10,12 +10,12 @@ // pretty-expanded FIXME #23616 -fn good(_a: &int) { +fn good(_a: &isize) { } -// unnamed argument &int is now parse x: &int +// unnamed argument &isize is now parse x: &isize -fn called(_f: F) where F: FnOnce(&int) { +fn called(_f: F) where F: FnOnce(&isize) { } pub fn main() { diff --git a/src/test/run-pass/unsafe-pointer-assignability.rs b/src/test/run-pass/unsafe-pointer-assignability.rs index 171f4cb8a89..75c7cabfcb6 100644 --- a/src/test/run-pass/unsafe-pointer-assignability.rs +++ b/src/test/run-pass/unsafe-pointer-assignability.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -fn f(x: *const int) { +fn f(x: *const isize) { unsafe { assert_eq!(*x, 3); } diff --git a/src/test/run-pass/unsized2.rs b/src/test/run-pass/unsized2.rs index 9eee782a630..965ce6bad16 100644 --- a/src/test/run-pass/unsized2.rs +++ b/src/test/run-pass/unsized2.rs @@ -96,14 +96,14 @@ struct S2 { f: X, } struct S3 { - f1: int, + f1: isize, f2: X, } enum E { V1(X), V2{x: X}, - V3(int, X), - V4{u: int, x: X}, + V3(isize, X), + V4{u: isize, x: X}, } pub fn main() { diff --git a/src/test/run-pass/use-import-export.rs b/src/test/run-pass/use-import-export.rs index 2106da6d25f..044472606a5 100644 --- a/src/test/run-pass/use-import-export.rs +++ b/src/test/run-pass/use-import-export.rs @@ -13,11 +13,11 @@ // pretty-expanded FIXME #23616 mod foo { - pub fn x() -> int { return 1; } + pub fn x() -> isize { return 1; } } mod bar { - pub fn y() -> int { return 1; } + pub fn y() -> isize { return 1; } } pub fn main() { foo::x(); bar::y(); } diff --git a/src/test/run-pass/use-trait-before-def.rs b/src/test/run-pass/use-trait-before-def.rs index 5f44b572361..38952334e4d 100644 --- a/src/test/run-pass/use-trait-before-def.rs +++ b/src/test/run-pass/use-trait-before-def.rs @@ -12,6 +12,6 @@ // pretty-expanded FIXME #23616 -impl foo for int { fn foo(&self) -> int { 10 } } -trait foo { fn foo(&self) -> int; } +impl foo for isize { fn foo(&self) -> isize { 10 } } +trait foo { fn foo(&self) -> isize; } pub fn main() {} diff --git a/src/test/run-pass/use-uninit-match.rs b/src/test/run-pass/use-uninit-match.rs index efa6a2c5834..9e606384f3f 100644 --- a/src/test/run-pass/use-uninit-match.rs +++ b/src/test/run-pass/use-uninit-match.rs @@ -10,8 +10,8 @@ -fn foo(o: myoption) -> int { - let mut x: int = 5; +fn foo(o: myoption) -> isize { + let mut x: isize = 5; match o { myoption::none:: => { } myoption::some::(_t) => { x += 1; } diff --git a/src/test/run-pass/use-uninit-match2.rs b/src/test/run-pass/use-uninit-match2.rs index f2b487b7034..dc0a6a26bc0 100644 --- a/src/test/run-pass/use-uninit-match2.rs +++ b/src/test/run-pass/use-uninit-match2.rs @@ -10,8 +10,8 @@ -fn foo(o: myoption) -> int { - let mut x: int; +fn foo(o: myoption) -> isize { + let mut x: isize; match o { myoption::none:: => { panic!(); } myoption::some::(_t) => { x = 5; } diff --git a/src/test/run-pass/use.rs b/src/test/run-pass/use.rs index 446bb4a148e..664a8b27e78 100644 --- a/src/test/run-pass/use.rs +++ b/src/test/run-pass/use.rs @@ -24,4 +24,4 @@ mod baz { } #[start] -pub fn start(_: int, _: *const *const u8) -> int { 0 } +pub fn start(_: isize, _: *const *const u8) -> isize { 0 } diff --git a/src/test/run-pass/utf8.rs b/src/test/run-pass/utf8.rs index 4be54bd7080..07fd7b297b4 100644 --- a/src/test/run-pass/utf8.rs +++ b/src/test/run-pass/utf8.rs @@ -18,14 +18,14 @@ pub fn main() { let y_diaeresis: char = 'ÿ'; // 0xff let pi: char = 'Π'; // 0x3a0 - assert_eq!(yen as int, 0xa5); - assert_eq!(c_cedilla as int, 0xe7); - assert_eq!(thorn as int, 0xfe); - assert_eq!(y_diaeresis as int, 0xff); - assert_eq!(pi as int, 0x3a0); + assert_eq!(yen as isize, 0xa5); + assert_eq!(c_cedilla as isize, 0xe7); + assert_eq!(thorn as isize, 0xfe); + assert_eq!(y_diaeresis as isize, 0xff); + assert_eq!(pi as isize, 0x3a0); - assert_eq!(pi as int, '\u{3a0}' as int); - assert_eq!('\x0a' as int, '\n' as int); + assert_eq!(pi as isize, '\u{3a0}' as isize); + assert_eq!('\x0a' as isize, '\n' as isize); let bhutan: String = "འབྲུག་ཡུལ།".to_string(); let japan: String = "日本".to_string(); @@ -40,14 +40,14 @@ pub fn main() { let austria_e: String = "\u{d6}sterreich".to_string(); let oo: char = 'Ö'; - assert_eq!(oo as int, 0xd6); + assert_eq!(oo as isize, 0xd6); fn check_str_eq(a: String, b: String) { - let mut i: int = 0; + let mut i: isize = 0; for ab in a.bytes() { println!("{}", i); println!("{}", ab); - let bb: u8 = b.as_bytes()[i as uint]; + let bb: u8 = b.as_bytes()[i as usize]; println!("{}", bb); assert_eq!(ab, bb); i += 1; diff --git a/src/test/run-pass/utf8_idents.rs b/src/test/run-pass/utf8_idents.rs index beb2f4d9969..b11b7e83eb6 100644 --- a/src/test/run-pass/utf8_idents.rs +++ b/src/test/run-pass/utf8_idents.rs @@ -22,7 +22,7 @@ pub fn main() { assert_eq!(საჭმელად_გემრიელი_სადილი(), 0); } -fn საჭმელად_გემრიელი_სადილი() -> int { +fn საჭმელად_გემრიელი_სადილი() -> isize { // Lunch in several languages. diff --git a/src/test/run-pass/variant-structs-trivial.rs b/src/test/run-pass/variant-structs-trivial.rs index 34c9fb5038a..6961cd4977d 100644 --- a/src/test/run-pass/variant-structs-trivial.rs +++ b/src/test/run-pass/variant-structs-trivial.rs @@ -11,8 +11,8 @@ // pretty-expanded FIXME #23616 enum Foo { - Bar { x: int }, - Baz { y: int } + Bar { x: isize }, + Baz { y: isize } } pub fn main() { } diff --git a/src/test/run-pass/vec-concat.rs b/src/test/run-pass/vec-concat.rs index 870d48213c7..658c35ae8d5 100644 --- a/src/test/run-pass/vec-concat.rs +++ b/src/test/run-pass/vec-concat.rs @@ -13,9 +13,9 @@ use std::vec; pub fn main() { - let a: Vec = vec!(1, 2, 3, 4, 5); - let b: Vec = vec!(6, 7, 8, 9, 0); - let mut v: Vec = a; + let a: Vec = vec!(1, 2, 3, 4, 5); + let b: Vec = vec!(6, 7, 8, 9, 0); + let mut v: Vec = a; v.push_all(&b); println!("{}", v[9]); assert_eq!(v[0], 1); diff --git a/src/test/run-pass/vec-dst.rs b/src/test/run-pass/vec-dst.rs index 23b1ff7417e..e88acb3838b 100644 --- a/src/test/run-pass/vec-dst.rs +++ b/src/test/run-pass/vec-dst.rs @@ -15,8 +15,8 @@ pub fn main() { // Tests for indexing into box/& [T; n] - let x: [int; 3] = [1, 2, 3]; - let mut x: Box<[int; 3]> = box x; + let x: [isize; 3] = [1, 2, 3]; + let mut x: Box<[isize; 3]> = box x; assert!(x[0] == 1); assert!(x[1] == 2); assert!(x[2] == 3); @@ -25,8 +25,8 @@ pub fn main() { assert!(x[1] == 45); assert!(x[2] == 3); - let mut x: [int; 3] = [1, 2, 3]; - let x: &mut [int; 3] = &mut x; + let mut x: [isize; 3] = [1, 2, 3]; + let x: &mut [isize; 3] = &mut x; assert!(x[0] == 1); assert!(x[1] == 2); assert!(x[2] == 3); diff --git a/src/test/run-pass/vec-fixed-length.rs b/src/test/run-pass/vec-fixed-length.rs index bd196aa4e4e..4dadf53c772 100644 --- a/src/test/run-pass/vec-fixed-length.rs +++ b/src/test/run-pass/vec-fixed-length.rs @@ -13,7 +13,7 @@ use std::mem::size_of; pub fn main() { - let x: [int; 4] = [1, 2, 3, 4]; + let x: [isize; 4] = [1, 2, 3, 4]; assert_eq!(x[0], 1); assert_eq!(x[1], 2); assert_eq!(x[2], 3); diff --git a/src/test/run-pass/vec-late-init.rs b/src/test/run-pass/vec-late-init.rs index dec0b3eaa78..7a8c0739efe 100644 --- a/src/test/run-pass/vec-late-init.rs +++ b/src/test/run-pass/vec-late-init.rs @@ -10,7 +10,7 @@ pub fn main() { - let mut later: Vec ; + let mut later: Vec ; if true { later = vec!(1); } else { later = vec!(2); } println!("{}", later[0]); } diff --git a/src/test/run-pass/vec-macro-no-std.rs b/src/test/run-pass/vec-macro-no-std.rs index 360cecb9e6a..d1729c9dde4 100644 --- a/src/test/run-pass/vec-macro-no-std.rs +++ b/src/test/run-pass/vec-macro-no-std.rs @@ -29,7 +29,7 @@ use collections::vec::Vec; // Issue #16806 #[start] -fn start(_argc: int, _argv: *const *const u8) -> int { +fn start(_argc: isize, _argv: *const *const u8) -> isize { let x: Vec = vec![0, 1, 2]; match x.last() { Some(&2) => (), diff --git a/src/test/run-pass/vec-matching-legal-tail-element-borrow.rs b/src/test/run-pass/vec-matching-legal-tail-element-borrow.rs index 64309906156..716975b4d28 100644 --- a/src/test/run-pass/vec-matching-legal-tail-element-borrow.rs +++ b/src/test/run-pass/vec-matching-legal-tail-element-borrow.rs @@ -10,7 +10,7 @@ pub fn main() { let x = &[1, 2, 3, 4, 5]; - let x: &[int] = &[1, 2, 3, 4, 5]; + let x: &[isize] = &[1, 2, 3, 4, 5]; if !x.is_empty() { let el = match x { [1, ref tail..] => &tail[0], diff --git a/src/test/run-pass/vec-matching.rs b/src/test/run-pass/vec-matching.rs index 306d200319d..e745d03b0e9 100644 --- a/src/test/run-pass/vec-matching.rs +++ b/src/test/run-pass/vec-matching.rs @@ -76,7 +76,7 @@ fn d() { } fn e() { - let x: &[int] = &[1, 2, 3]; + let x: &[isize] = &[1, 2, 3]; match x { [1, 2] => (), [..] => () diff --git a/src/test/run-pass/vec-repeat-with-cast.rs b/src/test/run-pass/vec-repeat-with-cast.rs index 11a96ca533f..a6ca02d4fa9 100644 --- a/src/test/run-pass/vec-repeat-with-cast.rs +++ b/src/test/run-pass/vec-repeat-with-cast.rs @@ -10,4 +10,4 @@ // pretty-expanded FIXME #23616 -pub fn main() { let _a = [0; 1 as uint]; } +pub fn main() { let _a = [0; 1 as usize]; } diff --git a/src/test/run-pass/vec-slice-drop.rs b/src/test/run-pass/vec-slice-drop.rs index 25dc5db5a60..1d749d4963c 100644 --- a/src/test/run-pass/vec-slice-drop.rs +++ b/src/test/run-pass/vec-slice-drop.rs @@ -16,7 +16,7 @@ use std::cell::Cell; // Make sure that destructors get run on slice literals struct foo<'a> { - x: &'a Cell, + x: &'a Cell, } #[unsafe_destructor] @@ -26,7 +26,7 @@ impl<'a> Drop for foo<'a> { } } -fn foo(x: &Cell) -> foo { +fn foo(x: &Cell) -> foo { foo { x: x } diff --git a/src/test/run-pass/vec-to_str.rs b/src/test/run-pass/vec-to_str.rs index d34c6bd4d0b..a9bb68395c4 100644 --- a/src/test/run-pass/vec-to_str.rs +++ b/src/test/run-pass/vec-to_str.rs @@ -14,7 +14,7 @@ pub fn main() { assert_eq!(format!("{:?}", vec!(0, 1)), "[0, 1]".to_string()); let foo = vec!(3, 4); - let bar: &[int] = &[4, 5]; + let bar: &[isize] = &[4, 5]; assert_eq!(format!("{:?}", foo), "[3, 4]"); assert_eq!(format!("{:?}", bar), "[4, 5]"); diff --git a/src/test/run-pass/vec.rs b/src/test/run-pass/vec.rs index ff4077b249d..ce20d452c40 100644 --- a/src/test/run-pass/vec.rs +++ b/src/test/run-pass/vec.rs @@ -12,10 +12,10 @@ // pretty-expanded FIXME #23616 pub fn main() { - let v: Vec = vec!(10, 20); + let v: Vec = vec!(10, 20); assert_eq!(v[0], 10); assert_eq!(v[1], 20); - let mut x: uint = 0; + let mut x: usize = 0; assert_eq!(v[x], 10); assert_eq!(v[x + 1], 20); x = x + 1; diff --git a/src/test/run-pass/vector-no-ann-2.rs b/src/test/run-pass/vector-no-ann-2.rs index eb5b75639d5..10f71b3e12c 100644 --- a/src/test/run-pass/vector-no-ann-2.rs +++ b/src/test/run-pass/vector-no-ann-2.rs @@ -13,4 +13,4 @@ #![allow(unknown_features)] #![feature(box_syntax)] -pub fn main() { let _quux: Box> = box Vec::new(); } +pub fn main() { let _quux: Box> = box Vec::new(); } diff --git a/src/test/run-pass/warn-ctypes-inhibit.rs b/src/test/run-pass/warn-ctypes-inhibit.rs index c22a584f6d4..81a3c94eec3 100644 --- a/src/test/run-pass/warn-ctypes-inhibit.rs +++ b/src/test/run-pass/warn-ctypes-inhibit.rs @@ -16,7 +16,7 @@ mod libc { extern { - pub fn malloc(size: int) -> *const u8; + pub fn malloc(size: isize) -> *const u8; } } diff --git a/src/test/run-pass/weird-exprs.rs b/src/test/run-pass/weird-exprs.rs index 20e42575b27..b28760e6c91 100644 --- a/src/test/run-pass/weird-exprs.rs +++ b/src/test/run-pass/weird-exprs.rs @@ -54,14 +54,14 @@ fn zombiejesus() { } fn notsure() { - let mut _x: int; + let mut _x: isize; let mut _y = (_x = 0) == (_x = 0); let mut _z = (_x = 0) < (_x = 0); let _a = (_x += 0) == (_x = 0); let _b = swap(&mut _y, &mut _z) == swap(&mut _y, &mut _z); } -fn canttouchthis() -> uint { +fn canttouchthis() -> usize { fn p() -> bool { true } let _a = (assert!((true)) == (assert!(p()))); let _c = (assert!((p())) == ()); diff --git a/src/test/run-pass/wf-bound-region-in-object-type.rs b/src/test/run-pass/wf-bound-region-in-object-type.rs index 47066232b87..cdb5e3fe1d4 100644 --- a/src/test/run-pass/wf-bound-region-in-object-type.rs +++ b/src/test/run-pass/wf-bound-region-in-object-type.rs @@ -14,13 +14,13 @@ // pretty-expanded FIXME #23616 pub struct Context<'tcx> { - vec: &'tcx Vec + vec: &'tcx Vec } -pub type Cmd<'a> = &'a int; +pub type Cmd<'a> = &'a isize; pub type DecodeInlinedItem<'a> = - Box FnMut(Cmd, &Context<'tcx>) -> Result<&'tcx int, ()> + 'a>; + Box FnMut(Cmd, &Context<'tcx>) -> Result<&'tcx isize, ()> + 'a>; fn foo(d: DecodeInlinedItem) { } diff --git a/src/test/run-pass/where-clause-early-bound-lifetimes.rs b/src/test/run-pass/where-clause-early-bound-lifetimes.rs index c73e5a774eb..b9f605ec548 100644 --- a/src/test/run-pass/where-clause-early-bound-lifetimes.rs +++ b/src/test/run-pass/where-clause-early-bound-lifetimes.rs @@ -12,14 +12,14 @@ trait TheTrait { fn dummy(&self) { } } -impl TheTrait for &'static int { } +impl TheTrait for &'static isize { } fn foo<'a,T>(_: &'a T) where &'a T : TheTrait { } fn bar(_: &'static T) where &'static T : TheTrait { } fn main() { - static x: int = 1; + static x: isize = 1; foo(&x); bar(&x); } diff --git a/src/test/run-pass/where-clause-region-outlives.rs b/src/test/run-pass/where-clause-region-outlives.rs index 1972b11d2cb..60df52bfeb9 100644 --- a/src/test/run-pass/where-clause-region-outlives.rs +++ b/src/test/run-pass/where-clause-region-outlives.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -struct A<'a, 'b> where 'a : 'b { x: &'a int, y: &'b int } +struct A<'a, 'b> where 'a : 'b { x: &'a isize, y: &'b isize } fn main() { let x = 1; diff --git a/src/test/run-pass/where-clauses-cross-crate.rs b/src/test/run-pass/where-clauses-cross-crate.rs index 6a2fec7260a..1b349b25ef3 100644 --- a/src/test/run-pass/where-clauses-cross-crate.rs +++ b/src/test/run-pass/where-clauses-cross-crate.rs @@ -18,5 +18,5 @@ fn main() { println!("{}", equal(&1, &2)); println!("{}", equal(&1, &1)); println!("{}", "hello".equal(&"hello")); - println!("{}", "hello".equals::(&1, &1, &"foo", &"bar")); + println!("{}", "hello".equals::(&1, &1, &"foo", &"bar")); } diff --git a/src/test/run-pass/where-clauses-lifetimes.rs b/src/test/run-pass/where-clauses-lifetimes.rs index 2803890d9d1..bba20e8e92e 100644 --- a/src/test/run-pass/where-clauses-lifetimes.rs +++ b/src/test/run-pass/where-clauses-lifetimes.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -fn foo<'a, I>(mut it: I) where I: Iterator {} +fn foo<'a, I>(mut it: I) where I: Iterator {} fn main() { foo([1, 2].iter()); diff --git a/src/test/run-pass/where-clauses.rs b/src/test/run-pass/where-clauses.rs index 0f0741dcea7..ab1f30c3d14 100644 --- a/src/test/run-pass/where-clauses.rs +++ b/src/test/run-pass/where-clauses.rs @@ -32,5 +32,5 @@ fn main() { println!("{}", equal(&1, &2)); println!("{}", equal(&1, &1)); println!("{}", "hello".equal(&"hello")); - println!("{}", "hello".equals::(&1, &1, &"foo", &"bar")); + println!("{}", "hello".equals::(&1, &1, &"foo", &"bar")); } diff --git a/src/test/run-pass/while-flow-graph.rs b/src/test/run-pass/while-flow-graph.rs index 3ea075d1586..102a5a7558e 100644 --- a/src/test/run-pass/while-flow-graph.rs +++ b/src/test/run-pass/while-flow-graph.rs @@ -12,4 +12,4 @@ // pretty-expanded FIXME #23616 -pub fn main() { let x: int = 10; while x == 10 && x == 11 { let _y = 0xf00_usize; } } +pub fn main() { let x: isize = 10; while x == 10 && x == 11 { let _y = 0xf00_usize; } } diff --git a/src/test/run-pass/while-let.rs b/src/test/run-pass/while-let.rs index fa45d084060..b1e80c86ec7 100644 --- a/src/test/run-pass/while-let.rs +++ b/src/test/run-pass/while-let.rs @@ -14,7 +14,7 @@ use std::collections::BinaryHeap; -fn make_pq() -> BinaryHeap { +fn make_pq() -> BinaryHeap { BinaryHeap::from_vec(vec![1,2,3]) } diff --git a/src/test/run-pass/while-loop-constraints-2.rs b/src/test/run-pass/while-loop-constraints-2.rs index 622b66d22a1..6e339232475 100644 --- a/src/test/run-pass/while-loop-constraints-2.rs +++ b/src/test/run-pass/while-loop-constraints-2.rs @@ -12,9 +12,9 @@ #![allow(unused_variable)] pub fn main() { - let mut y: int = 42; - let mut z: int = 42; - let mut x: int; + let mut y: isize = 42; + let mut z: isize = 42; + let mut x: isize; while z < 50 { z += 1; while false { x = y; y = z; } diff --git a/src/test/run-pass/while-prelude-drop.rs b/src/test/run-pass/while-prelude-drop.rs index b8473abb06d..88d5314a96a 100644 --- a/src/test/run-pass/while-prelude-drop.rs +++ b/src/test/run-pass/while-prelude-drop.rs @@ -17,7 +17,7 @@ use std::string::String; #[derive(PartialEq)] enum t { a, b(String), } -fn make(i: int) -> t { +fn make(i: isize) -> t { if i > 10 { return t::a; } let mut s = String::from_str("hello"); // Ensure s is non-const. diff --git a/src/test/run-pass/while-with-break.rs b/src/test/run-pass/while-with-break.rs index a7328267541..ed149ad5109 100644 --- a/src/test/run-pass/while-with-break.rs +++ b/src/test/run-pass/while-with-break.rs @@ -10,12 +10,12 @@ pub fn main() { - let mut i: int = 90; + let mut i: isize = 90; while i < 100 { println!("{}", i); i = i + 1; if i == 95 { - let _v: Vec = + let _v: Vec = vec!(1, 2, 3, 4, 5); // we check that it is freed by break println!("breaking"); diff --git a/src/test/run-pass/while.rs b/src/test/run-pass/while.rs index bd8b1f0f088..bf56e76687f 100644 --- a/src/test/run-pass/while.rs +++ b/src/test/run-pass/while.rs @@ -11,8 +11,8 @@ pub fn main() { - let mut x: int = 10; - let mut y: int = 0; + let mut x: isize = 10; + let mut y: isize = 0; while y < x { println!("{}", y); println!("hello"); y = y + 1; } while x > 0 { println!("goodbye"); diff --git a/src/test/run-pass/writealias.rs b/src/test/run-pass/writealias.rs index 874360e6399..10718e981ff 100644 --- a/src/test/run-pass/writealias.rs +++ b/src/test/run-pass/writealias.rs @@ -12,7 +12,7 @@ use std::sync::Mutex; -struct Point {x: int, y: int, z: int} +struct Point {x: isize, y: isize, z: isize} fn f(p: &mut Point) { p.z = 13; } diff --git a/src/test/run-pass/x86stdcall.rs b/src/test/run-pass/x86stdcall.rs index b884adb7a6e..b0bfb5c29c1 100644 --- a/src/test/run-pass/x86stdcall.rs +++ b/src/test/run-pass/x86stdcall.rs @@ -13,8 +13,8 @@ #[cfg(windows)] mod kernel32 { extern "system" { - pub fn SetLastError(err: uint); - pub fn GetLastError() -> uint; + pub fn SetLastError(err: usize); + pub fn GetLastError() -> usize; } } diff --git a/src/test/run-pass/x86stdcall2.rs b/src/test/run-pass/x86stdcall2.rs index b359251a394..7b15531dacc 100644 --- a/src/test/run-pass/x86stdcall2.rs +++ b/src/test/run-pass/x86stdcall2.rs @@ -13,7 +13,7 @@ pub type HANDLE = u32; pub type DWORD = u32; pub type SIZE_T = u32; -pub type LPVOID = uint; +pub type LPVOID = usize; pub type BOOL = u8; #[cfg(windows)] diff --git a/src/test/run-pass/yield2.rs b/src/test/run-pass/yield2.rs index 56dc02c6d2e..acc55833133 100644 --- a/src/test/run-pass/yield2.rs +++ b/src/test/run-pass/yield2.rs @@ -11,6 +11,6 @@ use std::thread; pub fn main() { - let mut i: int = 0; + let mut i: isize = 0; while i < 100 { i = i + 1; println!("{}", i); thread::yield_now(); } } diff --git a/src/test/run-pass/zero-size-type-destructors.rs b/src/test/run-pass/zero-size-type-destructors.rs index 76fe8150d3f..dea9edf0582 100644 --- a/src/test/run-pass/zero-size-type-destructors.rs +++ b/src/test/run-pass/zero-size-type-destructors.rs @@ -12,7 +12,7 @@ #![feature(unsafe_no_drop_flag)] -static mut destructions : int = 3; +static mut destructions : isize = 3; pub fn foo() { #[unsafe_no_drop_flag] -- cgit 1.4.1-3-g733a5 From 9754b06cd80cfcc523573535090519bec935fec3 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 26 Mar 2015 13:25:06 -0700 Subject: rustc: Remove support for old_impl_check This commit removes compiler support for the `old_impl_check` attribute which should in theory be entirely removed now. The last remaining use of it in the standard library has been updated by moving the type parameter on the `old_io::Acceptor` trait into an associated type. As a result, this is a breaking change for all current users of the deprecated `old_io::Acceptor` trait. Code can be migrated by using the `Connection` associated type instead. [breaking-change] --- src/librustc_typeck/collect.rs | 16 ++++------------ src/libstd/lib.rs | 1 - src/libstd/old_io/mod.rs | 18 +++++++++--------- src/libstd/old_io/net/pipe.rs | 5 +++-- src/libstd/old_io/net/tcp.rs | 5 +++-- src/libstd/old_io/result.rs | 7 ++++--- src/libsyntax/feature_gate.rs | 11 ----------- 7 files changed, 23 insertions(+), 40 deletions(-) (limited to 'src/libsyntax') diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index 5816fe58bc9..abb68d8fe0d 100644 --- a/src/librustc_typeck/collect.rs +++ b/src/librustc_typeck/collect.rs @@ -2208,18 +2208,10 @@ fn enforce_impl_ty_params_are_constrained<'tcx>(tcx: &ty::ctxt<'tcx>, idx: index as u32, name: ty_param.ident.name }; if !input_parameters.contains(¶m_ty) { - if ty::has_attr(tcx, impl_def_id, "old_impl_check") { - tcx.sess.span_warn( - ty_param.span, - &format!("the type parameter `{}` is not constrained by the \ - impl trait, self type, or predicates", - param_ty.user_string(tcx))); - } else { - span_err!(tcx.sess, ty_param.span, E0207, - "the type parameter `{}` is not constrained by the \ - impl trait, self type, or predicates", - param_ty.user_string(tcx)); - } + span_err!(tcx.sess, ty_param.span, E0207, + "the type parameter `{}` is not constrained by the \ + impl trait, self type, or predicates", + param_ty.user_string(tcx)); } } } diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index cca6bb747d4..c2d49810d59 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -114,7 +114,6 @@ #![feature(lang_items)] #![feature(libc)] #![feature(linkage, thread_local, asm)] -#![feature(old_impl_check)] #![feature(optin_builtin_traits)] #![feature(rand)] #![feature(staged_api)] diff --git a/src/libstd/old_io/mod.rs b/src/libstd/old_io/mod.rs index ac908c529dc..3d318d97da7 100644 --- a/src/libstd/old_io/mod.rs +++ b/src/libstd/old_io/mod.rs @@ -1588,9 +1588,7 @@ pub trait Seek { /// connections. /// /// Doing so produces some sort of Acceptor. -pub trait Listener> - : PhantomFn // FIXME should be an assoc type anyhow -{ +pub trait Listener { /// Spin up the listener and start queuing incoming connections /// /// # Error @@ -1601,13 +1599,16 @@ pub trait Listener> } /// An acceptor is a value that presents incoming connections -pub trait Acceptor { +pub trait Acceptor { + /// Type of connection that is accepted by this acceptor. + type Connection; + /// Wait for and accept an incoming connection /// /// # Error /// /// Returns `Err` if an I/O error is encountered. - fn accept(&mut self) -> IoResult; + fn accept(&mut self) -> IoResult; /// Create an iterator over incoming connection attempts. /// @@ -1628,11 +1629,10 @@ pub struct IncomingConnections<'a, A: ?Sized +'a> { inc: &'a mut A, } -#[old_impl_check] -impl<'a, T, A: ?Sized + Acceptor> Iterator for IncomingConnections<'a, A> { - type Item = IoResult; +impl<'a, A: ?Sized + Acceptor> Iterator for IncomingConnections<'a, A> { + type Item = IoResult; - fn next(&mut self) -> Option> { + fn next(&mut self) -> Option> { Some(self.inc.accept()) } } diff --git a/src/libstd/old_io/net/pipe.rs b/src/libstd/old_io/net/pipe.rs index f9e5ae71e12..d2e6aa896d3 100644 --- a/src/libstd/old_io/net/pipe.rs +++ b/src/libstd/old_io/net/pipe.rs @@ -202,7 +202,7 @@ impl UnixListener { } } -impl Listener for UnixListener { +impl Listener for UnixListener { fn listen(self) -> IoResult { self.inner.listen() .map(|inner| UnixAcceptor { inner: inner }) @@ -250,7 +250,8 @@ impl UnixAcceptor { } } -impl Acceptor for UnixAcceptor { +impl Acceptor for UnixAcceptor { + type Connection = UnixStream; fn accept(&mut self) -> IoResult { self.inner.accept().map(|s| { UnixStream { inner: s } diff --git a/src/libstd/old_io/net/tcp.rs b/src/libstd/old_io/net/tcp.rs index 75f786f0bb1..67a6e2c29b4 100644 --- a/src/libstd/old_io/net/tcp.rs +++ b/src/libstd/old_io/net/tcp.rs @@ -338,7 +338,7 @@ impl TcpListener { } } -impl Listener for TcpListener { +impl Listener for TcpListener { fn listen(self) -> IoResult { self.inner.listen(128).map(|a| TcpAcceptor { inner: a }) } @@ -453,7 +453,8 @@ impl TcpAcceptor { } } -impl Acceptor for TcpAcceptor { +impl Acceptor for TcpAcceptor { + type Connection = TcpStream; fn accept(&mut self) -> IoResult { self.inner.accept().map(TcpStream::new) } diff --git a/src/libstd/old_io/result.rs b/src/libstd/old_io/result.rs index 9dcb487cdb0..29ebfb229bb 100644 --- a/src/libstd/old_io/result.rs +++ b/src/libstd/old_io/result.rs @@ -58,7 +58,7 @@ impl Seek for IoResult { } } -impl, L: Listener> Listener for IoResult { +impl> Listener for IoResult { fn listen(self) -> IoResult { match self { Ok(listener) => listener.listen(), @@ -67,8 +67,9 @@ impl, L: Listener> Listener for IoResult { } } -impl> Acceptor for IoResult { - fn accept(&mut self) -> IoResult { +impl Acceptor for IoResult { + type Connection = A::Connection; + fn accept(&mut self) -> IoResult { match *self { Ok(ref mut acceptor) => acceptor.accept(), Err(ref e) => Err(e.clone()), diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 60f81dac1e9..0f281c6f8f9 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -102,9 +102,6 @@ const KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[ // A way to temporarily opt out of the new orphan rules. This will *never* be accepted. ("old_orphan_check", "1.0.0", Deprecated), - // A way to temporarily opt out of the new impl rules. This will *never* be accepted. - ("old_impl_check", "1.0.0", Deprecated), - // OIBIT specific features ("optin_builtin_traits", "1.0.0", Active), @@ -280,7 +277,6 @@ pub const KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType)] = &[ // FIXME: #19470 this shouldn't be needed forever ("old_orphan_check", Whitelisted), - ("old_impl_check", Whitelisted), ("rustc_paren_sugar", Whitelisted), // FIXME: #18101 temporary unboxed closure hack // Crate level attributes @@ -595,13 +591,6 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> { i.span, "the new orphan check rules will eventually be strictly enforced"); } - - if attr::contains_name(&i.attrs[..], - "old_impl_check") { - self.gate_feature("old_impl_check", - i.span, - "`#[old_impl_check]` will be removed in the future"); - } } _ => {} -- cgit 1.4.1-3-g733a5 From 3752958e4029e9d9cfb1ff020e92142b53fb810f Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 26 Mar 2015 13:30:33 -0700 Subject: syntax: Remove support for #[should_fail] This attribute has been deprecated in favor of #[should_panic]. This also updates rustdoc to no longer accept the `should_fail` directive and instead renames it to `should_panic`. --- src/doc/trpl/documentation.md | 2 +- src/libcore/option.rs | 4 ++-- src/libcore/result.rs | 4 ++-- src/librustdoc/html/markdown.rs | 18 +++++++++--------- src/libstd/io/buffered.rs | 2 +- src/libstd/macros.rs | 2 +- src/libstd/old_io/fs.rs | 2 +- src/libstd/old_io/process.rs | 2 +- src/libstd/process.rs | 2 +- src/libstd/thread/mod.rs | 4 ++-- src/libsyntax/feature_gate.rs | 1 - src/libsyntax/test.rs | 14 +++----------- 12 files changed, 24 insertions(+), 33 deletions(-) (limited to 'src/libsyntax') diff --git a/src/doc/trpl/documentation.md b/src/doc/trpl/documentation.md index 54821e3ce30..43b49c09ae4 100644 --- a/src/doc/trpl/documentation.md +++ b/src/doc/trpl/documentation.md @@ -352,7 +352,7 @@ Here’s an example of documenting a macro: /// # } /// ``` /// -/// ```should_fail +/// ```should_panic /// # #[macro_use] extern crate foo; /// # fn main() { /// panic_unless!(true == false, “I’m broken.”); diff --git a/src/libcore/option.rs b/src/libcore/option.rs index a565b137cc8..623fcc56e6a 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -320,7 +320,7 @@ impl Option { /// assert_eq!(x.expect("the world is ending"), "value"); /// ``` /// - /// ```{.should_fail} + /// ```{.should_panic} /// let x: Option<&str> = None; /// x.expect("the world is ending"); // panics with `world is ending` /// ``` @@ -352,7 +352,7 @@ impl Option { /// assert_eq!(x.unwrap(), "air"); /// ``` /// - /// ```{.should_fail} + /// ```{.should_panic} /// let x: Option<&str> = None; /// assert_eq!(x.unwrap(), "air"); // fails /// ``` diff --git a/src/libcore/result.rs b/src/libcore/result.rs index 62e1bcd827a..6b25bbdb0bb 100644 --- a/src/libcore/result.rs +++ b/src/libcore/result.rs @@ -762,7 +762,7 @@ impl Result { /// assert_eq!(x.unwrap(), 2); /// ``` /// - /// ```{.should_fail} + /// ```{.should_panic} /// let x: Result = Err("emergency failure"); /// x.unwrap(); // panics with `emergency failure` /// ``` @@ -788,7 +788,7 @@ impl Result { /// /// # Examples /// - /// ```{.should_fail} + /// ```{.should_panic} /// let x: Result = Ok(2); /// x.unwrap_err(); // panics with `2` /// ``` diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs index cfa84de5ca7..8022f2d466f 100644 --- a/src/librustdoc/html/markdown.rs +++ b/src/librustdoc/html/markdown.rs @@ -356,7 +356,7 @@ pub fn find_testable_code(doc: &str, tests: &mut ::test::Collector) { }); let text = lines.collect::>().connect("\n"); tests.add_test(text.to_string(), - block_info.should_fail, block_info.no_run, + block_info.should_panic, block_info.no_run, block_info.ignore, block_info.test_harness); } } @@ -397,7 +397,7 @@ pub fn find_testable_code(doc: &str, tests: &mut ::test::Collector) { #[derive(Eq, PartialEq, Clone, Debug)] struct LangString { - should_fail: bool, + should_panic: bool, no_run: bool, ignore: bool, rust: bool, @@ -407,7 +407,7 @@ struct LangString { impl LangString { fn all_false() -> LangString { LangString { - should_fail: false, + should_panic: false, no_run: false, ignore: false, rust: true, // NB This used to be `notrust = false` @@ -427,7 +427,7 @@ impl LangString { for token in tokens { match token { "" => {}, - "should_fail" => { data.should_fail = true; seen_rust_tags = true; }, + "should_panic" => { data.should_panic = true; seen_rust_tags = true; }, "no_run" => { data.no_run = true; seen_rust_tags = true; }, "ignore" => { data.ignore = true; seen_rust_tags = true; }, "rust" => { data.rust = true; seen_rust_tags = true; }, @@ -528,9 +528,9 @@ mod tests { #[test] fn test_lang_string_parse() { fn t(s: &str, - should_fail: bool, no_run: bool, ignore: bool, rust: bool, test_harness: bool) { + should_panic: bool, no_run: bool, ignore: bool, rust: bool, test_harness: bool) { assert_eq!(LangString::parse(s), LangString { - should_fail: should_fail, + should_panic: should_panic, no_run: no_run, ignore: ignore, rust: rust, @@ -538,16 +538,16 @@ mod tests { }) } - // marker | should_fail | no_run | ignore | rust | test_harness + // marker | should_panic| no_run | ignore | rust | test_harness t("", false, false, false, true, false); t("rust", false, false, false, true, false); t("sh", false, false, false, false, false); t("ignore", false, false, true, true, false); - t("should_fail", true, false, false, true, false); + t("should_panic", true, false, false, true, false); t("no_run", false, true, false, true, false); t("test_harness", false, false, false, true, true); t("{.no_run .example}", false, true, false, true, false); - t("{.sh .should_fail}", true, false, false, true, false); + t("{.sh .should_panic}", true, false, false, true, false); t("{.example .rust}", false, false, false, true, false); t("{.test_harness .rust}", false, false, false, true, true); } diff --git a/src/libstd/io/buffered.rs b/src/libstd/io/buffered.rs index 2a1294f23b2..23cbe79145a 100644 --- a/src/libstd/io/buffered.rs +++ b/src/libstd/io/buffered.rs @@ -681,7 +681,7 @@ mod tests { } #[test] - #[should_fail] + #[should_panic] fn dont_panic_in_drop_on_panicked_flush() { struct FailFlushWriter; diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index 1681ed4282f..52492a019a2 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -28,7 +28,7 @@ /// /// # Examples /// -/// ```should_fail +/// ```should_panic /// # #![allow(unreachable_code)] /// panic!(); /// panic!("this is a terrible mistake!"); diff --git a/src/libstd/old_io/fs.rs b/src/libstd/old_io/fs.rs index 40a7cce81dd..c2a0477b4d1 100644 --- a/src/libstd/old_io/fs.rs +++ b/src/libstd/old_io/fs.rs @@ -105,7 +105,7 @@ impl File { /// /// # Examples /// - /// ```rust,should_fail + /// ```rust,should_panic /// # #![feature(old_io, old_path)] /// use std::old_io::*; /// use std::old_path::Path; diff --git a/src/libstd/old_io/process.rs b/src/libstd/old_io/process.rs index d7ede451fb8..40be2a8b9d9 100644 --- a/src/libstd/old_io/process.rs +++ b/src/libstd/old_io/process.rs @@ -60,7 +60,7 @@ use thread; /// /// # Examples /// -/// ```should_fail +/// ```should_panic /// # #![feature(old_io)] /// use std::old_io::*; /// diff --git a/src/libstd/process.rs b/src/libstd/process.rs index 6a36ecefcf4..b4bd513e8f0 100644 --- a/src/libstd/process.rs +++ b/src/libstd/process.rs @@ -37,7 +37,7 @@ use thread; /// /// # Examples /// -/// ```should_fail +/// ```should_panic /// # #![feature(process)] /// /// use std::process::Command; diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index 27b50fc9aaa..8f08bf76fc4 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -821,13 +821,13 @@ mod test { } #[test] - #[should_fail] + #[should_panic] fn test_scoped_panic() { thread::scoped(|| panic!()).join(); } #[test] - #[should_fail] + #[should_panic] fn test_scoped_implicit_panic() { let _ = thread::scoped(|| panic!()); } diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 60f81dac1e9..d5a8d3cc439 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -201,7 +201,6 @@ pub const KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType)] = &[ ("no_mangle", Normal), ("no_link", Normal), ("derive", Normal), - ("should_fail", Normal), ("should_panic", Normal), ("ignore", Normal), ("no_implicit_prelude", Normal), diff --git a/src/libsyntax/test.rs b/src/libsyntax/test.rs index 2a47a696b1c..fbee11ee657 100644 --- a/src/libsyntax/test.rs +++ b/src/libsyntax/test.rs @@ -134,7 +134,7 @@ impl<'a> fold::Folder for TestHarnessGenerator<'a> { path: self.cx.path.clone(), bench: is_bench_fn(&self.cx, &*i), ignore: is_ignored(&*i), - should_panic: should_panic(&*i, self.cx.span_diagnostic) + should_panic: should_panic(&*i) }; self.cx.testfns.push(test); self.tests.push(i.ident); @@ -386,16 +386,8 @@ fn is_ignored(i: &ast::Item) -> bool { i.attrs.iter().any(|attr| attr.check_name("ignore")) } -fn should_panic(i: &ast::Item, diag: &diagnostic::SpanHandler) -> ShouldPanic { - match i.attrs.iter().find(|attr| { - if attr.check_name("should_panic") { return true; } - if attr.check_name("should_fail") { - diag.span_warn(attr.span, "`#[should_fail]` is deprecated. Use `#[should_panic]` \ - instead"); - return true; - } - false - }) { +fn should_panic(i: &ast::Item) -> ShouldPanic { + match i.attrs.iter().find(|attr| attr.check_name("should_panic")) { Some(attr) => { let msg = attr.meta_item_list() .and_then(|list| list.iter().find(|mi| mi.check_name("expected"))) -- cgit 1.4.1-3-g733a5 From 671d896294eb07825d52fdeed5f3fbc1989d4939 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 26 Mar 2015 15:10:31 -0700 Subject: rustc: Remove old #[phase] and #[plugin] This commit removes the extra deprecation warnings and support for the old `phase` and `plugin` attributes for loading plugins. --- src/librustc/metadata/macro_import.rs | 9 --------- src/libsyntax/feature_gate.rs | 1 - src/test/compile-fail/deprecated-phase.rs | 17 ----------------- .../compile-fail/plugin-extern-crate-attr-deprecated.rs | 17 ----------------- 4 files changed, 44 deletions(-) delete mode 100644 src/test/compile-fail/deprecated-phase.rs delete mode 100644 src/test/compile-fail/plugin-extern-crate-attr-deprecated.rs (limited to 'src/libsyntax') diff --git a/src/librustc/metadata/macro_import.rs b/src/librustc/metadata/macro_import.rs index 3714e3b8c73..c2d7911d151 100644 --- a/src/librustc/metadata/macro_import.rs +++ b/src/librustc/metadata/macro_import.rs @@ -79,15 +79,6 @@ impl<'a, 'v> Visitor<'v> for MacroLoader<'a> { for attr in &item.attrs { let mut used = true; match &attr.name()[..] { - "phase" => { - self.sess.span_err(attr.span, "#[phase] is deprecated"); - } - "plugin" => { - self.sess.span_err(attr.span, "#[plugin] on `extern crate` is deprecated"); - self.sess.fileline_help(attr.span, &format!("use a crate attribute instead, \ - i.e. #![plugin({})]", - item.ident.as_str())); - } "macro_use" => { let names = attr.meta_item_list(); if names.is_none() { diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 60f81dac1e9..e5e92503fcc 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -54,7 +54,6 @@ const KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[ ("non_ascii_idents", "1.0.0", Active), ("thread_local", "1.0.0", Active), ("link_args", "1.0.0", Active), - ("phase", "1.0.0", Removed), ("plugin_registrar", "1.0.0", Active), ("log_syntax", "1.0.0", Active), ("trace_macros", "1.0.0", Active), diff --git a/src/test/compile-fail/deprecated-phase.rs b/src/test/compile-fail/deprecated-phase.rs deleted file mode 100644 index 22fc4a94cd2..00000000000 --- a/src/test/compile-fail/deprecated-phase.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(custom_attribute)] - -#[phase(blah)] -//~^ ERROR #[phase] is deprecated -extern crate foo; - -fn main() {} diff --git a/src/test/compile-fail/plugin-extern-crate-attr-deprecated.rs b/src/test/compile-fail/plugin-extern-crate-attr-deprecated.rs deleted file mode 100644 index efa352e386d..00000000000 --- a/src/test/compile-fail/plugin-extern-crate-attr-deprecated.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![feature(plugin)] - -#[plugin] //~ ERROR #[plugin] on `extern crate` is deprecated -//~^ HELP use a crate attribute instead, i.e. #![plugin(std)] -extern crate std; - -fn main() {} -- cgit 1.4.1-3-g733a5 From a67faf1b25f40c3a4ad8545192136ceea8c4e63f Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Fri, 27 Mar 2015 18:41:18 +1300 Subject: Change the trivial cast lints to allow by default --- src/libcollections/lib.rs | 1 - src/libcore/fmt/num.rs | 1 - src/libcore/num/i16.rs | 1 - src/libcore/num/i32.rs | 1 - src/libcore/num/i64.rs | 1 - src/libcore/num/i8.rs | 1 - src/libcore/num/int_macros.rs | 1 - src/libcore/num/isize.rs | 1 - src/libcore/num/mod.rs | 1 - src/libcore/num/u16.rs | 1 - src/libcore/num/u32.rs | 1 - src/libcore/num/u64.rs | 1 - src/libcore/num/u8.rs | 1 - src/libcore/num/uint_macros.rs | 1 - src/libcore/num/usize.rs | 1 - src/librand/distributions/range.rs | 2 -- src/librand/isaac.rs | 1 - src/librustc/lib.rs | 1 - src/librustc/lint/builtin.rs | 4 ++-- src/librustc_llvm/lib.rs | 1 - src/librustc_trans/lib.rs | 1 - src/librustc_typeck/check/mod.rs | 11 ++++++----- src/libserialize/json.rs | 2 -- src/libstd/lib.rs | 1 - src/libsyntax/ext/quote.rs | 1 - 25 files changed, 8 insertions(+), 32 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libcollections/lib.rs b/src/libcollections/lib.rs index 6a65c991c95..2e6a3527706 100644 --- a/src/libcollections/lib.rs +++ b/src/libcollections/lib.rs @@ -25,7 +25,6 @@ #![doc(test(no_crate_inject))] #![allow(trivial_casts)] -#![allow(trivial_numeric_casts)] #![feature(alloc)] #![feature(box_syntax)] #![feature(box_patterns)] diff --git a/src/libcore/fmt/num.rs b/src/libcore/fmt/num.rs index 56d2eabc095..49da99b97cb 100644 --- a/src/libcore/fmt/num.rs +++ b/src/libcore/fmt/num.rs @@ -13,7 +13,6 @@ // FIXME: #6220 Implement floating point formatting #![allow(unsigned_negation)] -#![allow(trivial_numeric_casts)] use fmt; use iter::IteratorExt; diff --git a/src/libcore/num/i16.rs b/src/libcore/num/i16.rs index efafce3fdef..5ea60d0d96d 100644 --- a/src/libcore/num/i16.rs +++ b/src/libcore/num/i16.rs @@ -12,6 +12,5 @@ #![stable(feature = "rust1", since = "1.0.0")] #![doc(primitive = "i16")] -#![allow(trivial_numeric_casts)] int_module! { i16, 16 } diff --git a/src/libcore/num/i32.rs b/src/libcore/num/i32.rs index 72b0236a8d2..7d9faa998c1 100644 --- a/src/libcore/num/i32.rs +++ b/src/libcore/num/i32.rs @@ -12,6 +12,5 @@ #![stable(feature = "rust1", since = "1.0.0")] #![doc(primitive = "i32")] -#![allow(trivial_numeric_casts)] int_module! { i32, 32 } diff --git a/src/libcore/num/i64.rs b/src/libcore/num/i64.rs index a64a4febd5a..5a70911387b 100644 --- a/src/libcore/num/i64.rs +++ b/src/libcore/num/i64.rs @@ -12,6 +12,5 @@ #![stable(feature = "rust1", since = "1.0.0")] #![doc(primitive = "i64")] -#![allow(trivial_numeric_casts)] int_module! { i64, 64 } diff --git a/src/libcore/num/i8.rs b/src/libcore/num/i8.rs index 459814875ee..1d7d78ffa6c 100644 --- a/src/libcore/num/i8.rs +++ b/src/libcore/num/i8.rs @@ -12,6 +12,5 @@ #![stable(feature = "rust1", since = "1.0.0")] #![doc(primitive = "i8")] -#![allow(trivial_numeric_casts)] int_module! { i8, 8 } diff --git a/src/libcore/num/int_macros.rs b/src/libcore/num/int_macros.rs index 675f568a960..fe0d6d13c4c 100644 --- a/src/libcore/num/int_macros.rs +++ b/src/libcore/num/int_macros.rs @@ -9,7 +9,6 @@ // except according to those terms. #![doc(hidden)] -#![allow(trivial_numeric_casts)] macro_rules! int_module { ($T:ty, $bits:expr) => ( diff --git a/src/libcore/num/isize.rs b/src/libcore/num/isize.rs index 9af51a36748..0fd0d90b125 100644 --- a/src/libcore/num/isize.rs +++ b/src/libcore/num/isize.rs @@ -16,7 +16,6 @@ #![stable(feature = "rust1", since = "1.0.0")] #![doc(primitive = "isize")] -#![allow(trivial_numeric_casts)] #[cfg(target_pointer_width = "32")] int_module! { isize, 32 } diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 0eec875afc3..9ca7b48fbe5 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -14,7 +14,6 @@ #![stable(feature = "rust1", since = "1.0.0")] #![allow(missing_docs)] -#![allow(trivial_numeric_casts)] use self::wrapping::{OverflowingOps, WrappingOps}; diff --git a/src/libcore/num/u16.rs b/src/libcore/num/u16.rs index 289c5dbd08e..21635799a77 100644 --- a/src/libcore/num/u16.rs +++ b/src/libcore/num/u16.rs @@ -12,6 +12,5 @@ #![stable(feature = "rust1", since = "1.0.0")] #![doc(primitive = "u16")] -#![allow(trivial_numeric_casts)] uint_module! { u16, i16, 16 } diff --git a/src/libcore/num/u32.rs b/src/libcore/num/u32.rs index 6d0b6b0e5ea..7d520770503 100644 --- a/src/libcore/num/u32.rs +++ b/src/libcore/num/u32.rs @@ -12,6 +12,5 @@ #![stable(feature = "rust1", since = "1.0.0")] #![doc(primitive = "u32")] -#![allow(trivial_numeric_casts)] uint_module! { u32, i32, 32 } diff --git a/src/libcore/num/u64.rs b/src/libcore/num/u64.rs index bf8747fdb6e..f10822077dc 100644 --- a/src/libcore/num/u64.rs +++ b/src/libcore/num/u64.rs @@ -12,6 +12,5 @@ #![stable(feature = "rust1", since = "1.0.0")] #![doc(primitive = "u64")] -#![allow(trivial_numeric_casts)] uint_module! { u64, i64, 64 } diff --git a/src/libcore/num/u8.rs b/src/libcore/num/u8.rs index 05199735d4a..3d6922b07b1 100644 --- a/src/libcore/num/u8.rs +++ b/src/libcore/num/u8.rs @@ -12,6 +12,5 @@ #![stable(feature = "rust1", since = "1.0.0")] #![doc(primitive = "u8")] -#![allow(trivial_numeric_casts)] uint_module! { u8, i8, 8 } diff --git a/src/libcore/num/uint_macros.rs b/src/libcore/num/uint_macros.rs index c22f31cc57e..d0c4885ad00 100644 --- a/src/libcore/num/uint_macros.rs +++ b/src/libcore/num/uint_macros.rs @@ -9,7 +9,6 @@ // except according to those terms. #![doc(hidden)] -#![allow(trivial_numeric_casts)] macro_rules! uint_module { ($T:ty, $T_SIGNED:ty, $bits:expr) => ( diff --git a/src/libcore/num/usize.rs b/src/libcore/num/usize.rs index 82dd3312782..602ef4fe45e 100644 --- a/src/libcore/num/usize.rs +++ b/src/libcore/num/usize.rs @@ -16,6 +16,5 @@ #![stable(feature = "rust1", since = "1.0.0")] #![doc(primitive = "usize")] -#![allow(trivial_numeric_casts)] uint_module! { usize, isize, ::isize::BITS } diff --git a/src/librand/distributions/range.rs b/src/librand/distributions/range.rs index a682fa85841..e6f27a28ffa 100644 --- a/src/librand/distributions/range.rs +++ b/src/librand/distributions/range.rs @@ -10,8 +10,6 @@ //! Generating numbers between two others. -#![allow(trivial_numeric_casts)] - // this is surprisingly complicated to be both generic & correct use core::prelude::{PartialOrd}; diff --git a/src/librand/isaac.rs b/src/librand/isaac.rs index 14bebe0cd91..7ea62b7fd3f 100644 --- a/src/librand/isaac.rs +++ b/src/librand/isaac.rs @@ -447,7 +447,6 @@ impl Rng for Isaac64Rng { #[inline] fn next_u64(&mut self) -> u64 { - #![allow(trivial_numeric_casts)] if self.cnt == 0 { // make some more numbers self.isaac64(); diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index e8af07e4381..62ff7dd8131 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -48,7 +48,6 @@ #![cfg_attr(test, feature(test))] #![allow(trivial_casts)] -#![allow(trivial_numeric_casts)] extern crate arena; extern crate flate; diff --git a/src/librustc/lint/builtin.rs b/src/librustc/lint/builtin.rs index 2cc47f258f0..9093cd00ca0 100644 --- a/src/librustc/lint/builtin.rs +++ b/src/librustc/lint/builtin.rs @@ -102,13 +102,13 @@ declare_lint! { declare_lint! { pub TRIVIAL_CASTS, - Warn, + Allow, "detects trivial casts which could be removed" } declare_lint! { pub TRIVIAL_NUMERIC_CASTS, - Warn, + Allow, "detects trivial casts of numeric types which could be removed" } /// Does nothing as a lint pass, but registers some `Lint`s diff --git a/src/librustc_llvm/lib.rs b/src/librustc_llvm/lib.rs index 9d564fa56f5..d128e6f1a5f 100644 --- a/src/librustc_llvm/lib.rs +++ b/src/librustc_llvm/lib.rs @@ -15,7 +15,6 @@ #![allow(non_snake_case)] #![allow(dead_code)] #![allow(trivial_casts)] -#![allow(trivial_numeric_casts)] #![crate_name = "rustc_llvm"] #![unstable(feature = "rustc_private")] diff --git a/src/librustc_trans/lib.rs b/src/librustc_trans/lib.rs index 99a64156d66..a9147205f7d 100644 --- a/src/librustc_trans/lib.rs +++ b/src/librustc_trans/lib.rs @@ -44,7 +44,6 @@ #![feature(path_relative_from)] #![allow(trivial_casts)] -#![allow(trivial_numeric_casts)] extern crate arena; extern crate flate; diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 1e38a7d2d9f..3efe3a13562 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -1105,14 +1105,18 @@ fn check_cast<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>, cast: &CastCheck<'tcx>) { fcx.tcx().sess.add_lint(lint::builtin::TRIVIAL_NUMERIC_CASTS, e.id, span, - format!("trivial numeric cast: `{}` as `{}`", + format!("trivial numeric cast: `{}` as `{}`. Cast can be \ + replaced by coercion, this might require type \ + ascription or a temporary variable", fcx.infcx().ty_to_string(t_e), fcx.infcx().ty_to_string(t_1))); } else { fcx.tcx().sess.add_lint(lint::builtin::TRIVIAL_CASTS, e.id, span, - format!("trivial cast: `{}` as `{}`", + format!("trivial cast: `{}` as `{}`. Cast can be \ + replaced by coercion, this might require type \ + ascription or a temporary variable", fcx.infcx().ty_to_string(t_e), fcx.infcx().ty_to_string(t_1))); } @@ -4595,8 +4599,6 @@ pub fn check_enum_variants<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>, ty: attr::IntType, disr: ty::Disr) -> bool { fn uint_in_range(ccx: &CrateCtxt, ty: ast::UintTy, disr: ty::Disr) -> bool { - #![allow(trivial_numeric_casts)] - match ty { ast::TyU8 => disr as u8 as Disr == disr, ast::TyU16 => disr as u16 as Disr == disr, @@ -4625,7 +4627,6 @@ pub fn check_enum_variants<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>, id: ast::NodeId, hint: attr::ReprAttr) -> Vec>> { - #![allow(trivial_numeric_casts)] use std::num::Int; let rty = ty::node_id_to_type(ccx.tcx, id); diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs index 0d6ed91d529..acd27161064 100644 --- a/src/libserialize/json.rs +++ b/src/libserialize/json.rs @@ -2430,7 +2430,6 @@ macro_rules! to_json_impl_i64 { ($($t:ty), +) => ( $(impl ToJson for $t { fn to_json(&self) -> Json { - #![allow(trivial_numeric_casts)] Json::I64(*self as i64) } })+ @@ -2443,7 +2442,6 @@ macro_rules! to_json_impl_u64 { ($($t:ty), +) => ( $(impl ToJson for $t { fn to_json(&self) -> Json { - #![allow(trivial_numeric_casts)] Json::U64(*self as u64) } })+ diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index cca6bb747d4..f3fb98e8c66 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -136,7 +136,6 @@ #![no_std] #![allow(trivial_casts)] -#![allow(trivial_numeric_casts)] #![deny(missing_docs)] #[cfg(test)] extern crate test; diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs index a25a6451918..c11ffe66e6c 100644 --- a/src/libsyntax/ext/quote.rs +++ b/src/libsyntax/ext/quote.rs @@ -262,7 +262,6 @@ pub mod rt { (unsigned, $t:ty, $tag:expr) => ( impl ToSource for $t { fn to_source(&self) -> String { - #![allow(trivial_numeric_casts)] let lit = ast::LitInt(*self as u64, ast::UnsignedIntLit($tag)); pprust::lit_to_string(&dummy_spanned(lit)) } -- cgit 1.4.1-3-g733a5 From b24a3b82011c3b78573ace4ade3f99d7c4701a11 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 26 Mar 2015 17:35:13 -0700 Subject: rustc: Remove support for hyphens in crate names This commit removes parser support for `extern crate "foo" as bar` as the renamed crate is now required to be an identifier. Additionally this commit enables hard errors on crate names that contain hyphens in them, they must now solely contain alphanumeric characters or underscores. If the crate name is inferred from the file name, however, the file name `foo-bar.rs` will have the crate name inferred as `foo_bar`. If a binary is being emitted it will have the name `foo-bar` and a library will have the name `libfoo_bar.rlib`. This commit is a breaking change for a number of reasons: * Old syntax is being removed. This was previously only issuing warnings. * The output for the compiler when input is received on stdin is now `rust_out` instead of `rust-out`. * The crate name for a crate in the file `foo-bar.rs` is now `foo_bar` which can affect infrastructure such as logging. [breaking-change] --- src/librustc/metadata/creader.rs | 20 +++------- src/librustc_trans/back/link.rs | 18 +++++++-- src/librustdoc/test.rs | 2 +- src/libsyntax/parse/parser.rs | 47 +++++------------------- src/test/compile-fail/bad-crate-id.rs | 14 ------- src/test/compile-fail/bad-crate-id2.rs | 14 ------- src/test/run-make/output-with-hyphens/Makefile | 6 +++ src/test/run-make/output-with-hyphens/foo-bar.rs | 14 +++++++ 8 files changed, 51 insertions(+), 84 deletions(-) delete mode 100644 src/test/compile-fail/bad-crate-id.rs delete mode 100644 src/test/compile-fail/bad-crate-id2.rs create mode 100644 src/test/run-make/output-with-hyphens/Makefile create mode 100644 src/test/run-make/output-with-hyphens/foo-bar.rs (limited to 'src/libsyntax') diff --git a/src/librustc/metadata/creader.rs b/src/librustc/metadata/creader.rs index 7d8789c3cd1..b6a8525675e 100644 --- a/src/librustc/metadata/creader.rs +++ b/src/librustc/metadata/creader.rs @@ -73,24 +73,20 @@ struct CrateInfo { } pub fn validate_crate_name(sess: Option<&Session>, s: &str, sp: Option) { - let say = |s: &str, warn: bool| { + let say = |s: &str| { match (sp, sess) { (_, None) => panic!("{}", s), - (Some(sp), Some(sess)) if warn => sess.span_warn(sp, s), (Some(sp), Some(sess)) => sess.span_err(sp, s), - (None, Some(sess)) if warn => sess.warn(s), (None, Some(sess)) => sess.err(s), } }; if s.len() == 0 { - say("crate name must not be empty", false); - } else if s.contains("-") { - say(&format!("crate names soon cannot contain hyphens: {}", s), true); + say("crate name must not be empty"); } for c in s.chars() { if c.is_alphanumeric() { continue } - if c == '_' || c == '-' { continue } - say(&format!("invalid character `{}` in crate name: `{}`", c, s), false); + if c == '_' { continue } + say(&format!("invalid character `{}` in crate name: `{}`", c, s)); } match sess { Some(sess) => sess.abort_if_errors(), @@ -306,13 +302,7 @@ impl<'a> CrateReader<'a> { -> Option { let mut ret = None; self.sess.cstore.iter_crate_data(|cnum, data| { - // For now we do a "fuzzy match" on crate names by considering - // hyphens equal to underscores. This is purely meant to be a - // transitionary feature while we deprecate the quote syntax of - // `extern crate` statements. - if data.name != name.replace("-", "_") { - return - } + if data.name != name { return } match hash { Some(hash) if *hash == data.hash() => { ret = Some(cnum); return } diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs index bb7880161d5..8347571a480 100644 --- a/src/librustc_trans/back/link.rs +++ b/src/librustc_trans/back/link.rs @@ -159,11 +159,19 @@ pub fn find_crate_name(sess: Option<&Session>, } if let Input::File(ref path) = *input { if let Some(s) = path.file_stem().and_then(|s| s.to_str()) { - return validate(s.to_string(), None); + if s.starts_with("-") { + let msg = format!("crate names cannot start with a `-`, but \ + `{}` has a leading hyphen", s); + if let Some(sess) = sess { + sess.err(&msg); + } + } else { + return validate(s.replace("-", "_"), None); + } } } - "rust-out".to_string() + "rust_out".to_string() } pub fn build_link_meta(sess: &Session, krate: &ast::Crate, @@ -455,7 +463,11 @@ pub fn filename_for_input(sess: &Session, } config::CrateTypeExecutable => { let suffix = &sess.target.target.options.exe_suffix; - out_filename.with_file_name(&format!("{}{}", libname, suffix)) + if suffix.len() == 0 { + out_filename.to_path_buf() + } else { + out_filename.with_extension(&suffix[1..]) + } } } } diff --git a/src/librustdoc/test.rs b/src/librustdoc/test.rs index 7b37a5a9d1c..8e25ee095a0 100644 --- a/src/librustdoc/test.rs +++ b/src/librustdoc/test.rs @@ -224,7 +224,7 @@ fn runtest(test: &str, cratename: &str, libs: SearchPaths, // environment to ensure that the target loads the right libraries at // runtime. It would be a sad day if the *host* libraries were loaded as a // mistake. - let mut cmd = Command::new(&outdir.path().join("rust-out")); + let mut cmd = Command::new(&outdir.path().join("rust_out")); let var = DynamicLibrary::envvar(); let newpath = { let path = env::var_os(var).unwrap_or(OsString::new()); diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 220ea30256e..92795bb2002 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -4977,46 +4977,19 @@ impl<'a> Parser<'a> { /// /// # Examples /// - /// extern crate url; - /// extern crate foo = "bar"; //deprecated - /// extern crate "bar" as foo; + /// extern crate foo; + /// extern crate bar as foo; fn parse_item_extern_crate(&mut self, - lo: BytePos, - visibility: Visibility, - attrs: Vec) + lo: BytePos, + visibility: Visibility, + attrs: Vec) -> P { - let (maybe_path, ident) = match self.token { - token::Ident(..) => { - let crate_name = self.parse_ident(); - if self.eat_keyword(keywords::As) { - (Some(crate_name.name), self.parse_ident()) - } else { - (None, crate_name) - } - }, - token::Literal(token::Str_(..), suf) | - token::Literal(token::StrRaw(..), suf) => { - let sp = self.span; - self.expect_no_suffix(sp, "extern crate name", suf); - // forgo the internal suffix check of `parse_str` to - // avoid repeats (this unwrap will always succeed due - // to the restriction of the `match`) - let (s, _, _) = self.parse_optional_str().unwrap(); - self.expect_keyword(keywords::As); - let the_ident = self.parse_ident(); - self.obsolete(sp, ObsoleteSyntax::ExternCrateString); - let s = token::intern(&s); - (Some(s), the_ident) - }, - _ => { - let span = self.span; - let token_str = self.this_token_to_string(); - self.span_fatal(span, - &format!("expected extern crate name but \ - found `{}`", - token_str)); - } + let crate_name = self.parse_ident(); + let (maybe_path, ident) = if self.eat_keyword(keywords::As) { + (Some(crate_name.name), self.parse_ident()) + } else { + (None, crate_name) }; self.expect(&token::Semi); diff --git a/src/test/compile-fail/bad-crate-id.rs b/src/test/compile-fail/bad-crate-id.rs deleted file mode 100644 index 193666f8269..00000000000 --- a/src/test/compile-fail/bad-crate-id.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -extern crate "" as foo; //~ ERROR: crate name must not be empty -//~^ WARNING: obsolete syntax - -fn main() {} diff --git a/src/test/compile-fail/bad-crate-id2.rs b/src/test/compile-fail/bad-crate-id2.rs deleted file mode 100644 index 29df0fa705e..00000000000 --- a/src/test/compile-fail/bad-crate-id2.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -extern crate "#a" as bar; //~ ERROR: invalid character `#` in crate name: `#a` -//~^ WARNING: obsolete syntax - -fn main() {} diff --git a/src/test/run-make/output-with-hyphens/Makefile b/src/test/run-make/output-with-hyphens/Makefile new file mode 100644 index 00000000000..783d826a53d --- /dev/null +++ b/src/test/run-make/output-with-hyphens/Makefile @@ -0,0 +1,6 @@ +-include ../tools.mk + +all: + $(RUSTC) foo-bar.rs + [ -f $(TMPDIR)/$(call BIN,foo-bar) ] + [ -f $(TMPDIR)/libfoo_bar.rlib ] diff --git a/src/test/run-make/output-with-hyphens/foo-bar.rs b/src/test/run-make/output-with-hyphens/foo-bar.rs new file mode 100644 index 00000000000..2f93b2d1ead --- /dev/null +++ b/src/test/run-make/output-with-hyphens/foo-bar.rs @@ -0,0 +1,14 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![crate_type = "lib"] +#![crate_type = "bin"] + +fn main() {} -- cgit 1.4.1-3-g733a5 From 13e4270bf9468e9213b6cc16ca217062791599a0 Mon Sep 17 00:00:00 2001 From: Richo Healey Date: Fri, 27 Mar 2015 10:58:12 -0700 Subject: Unquote all crate names without underscores --- src/doc/reference.md | 2 +- src/driver/driver.rs | 4 ++-- src/liblibc/lib.rs | 2 +- src/librustc/lib.rs | 2 +- src/librustc_borrowck/lib.rs | 2 +- src/librustc_driver/lib.rs | 2 +- src/librustc_trans/lib.rs | 2 +- src/librustdoc/lib.rs | 4 ++-- src/libstd/lib.rs | 6 +++--- src/libstd/old_io/mem.rs | 2 +- src/libsyntax/lib.rs | 2 +- src/libsyntax/parse/parser.rs | 2 +- src/libsyntax/std_inject.rs | 2 +- src/libtest/lib.rs | 2 +- src/test/auxiliary/syntax_extension_with_dll_deps_2.rs | 2 +- src/test/auxiliary/trait_default_method_xc_aux_2.rs | 2 +- src/test/run-make/save-analysis/foo.rs | 2 +- src/test/run-pass/derive-no-std.rs | 2 +- src/test/run-pass/extern-foreign-crate.rs | 2 +- src/test/run-pass/for-loop-no-std.rs | 2 +- src/test/run-pass/format-no-std.rs | 2 +- src/test/run-pass/issue-14330.rs | 2 +- src/test/run-pass/linkage1.rs | 2 +- src/test/run-pass/macro-crate-nonterminal-renamed.rs | 2 +- src/test/run-pass/static-fn-inline-xc.rs | 2 +- src/test/run-pass/static-fn-trait-xc.rs | 2 +- src/test/run-pass/trait-default-method-xc-2.rs | 4 ++-- src/test/run-pass/trait-default-method-xc.rs | 2 +- src/test/run-pass/trait-inheritance-auto-xc-2.rs | 2 +- src/test/run-pass/trait-inheritance-auto-xc.rs | 2 +- src/test/run-pass/trait-inheritance-cross-trait-call-xc.rs | 2 +- src/test/run-pass/use-crate-name-alias.rs | 2 +- src/test/run-pass/use.rs | 2 +- src/test/run-pass/vec-macro-no-std.rs | 2 +- src/test/run-pass/xcrate-address-insignificant.rs | 2 +- 35 files changed, 40 insertions(+), 40 deletions(-) (limited to 'src/libsyntax') diff --git a/src/doc/reference.md b/src/doc/reference.md index 32088b2ab67..b39a4f7b516 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -980,7 +980,7 @@ extern crate pcre; extern crate std; // equivalent to: extern crate std as std; -extern crate "std" as ruststd; // linking to 'std' under another name +extern crate std as ruststd; // linking to 'std' under another name ``` ##### Use declarations diff --git a/src/driver/driver.rs b/src/driver/driver.rs index 6b56c2b6303..c5c58bb49ac 100644 --- a/src/driver/driver.rs +++ b/src/driver/driver.rs @@ -12,9 +12,9 @@ #![cfg_attr(rustdoc, feature(rustdoc))] #[cfg(rustdoc)] -extern crate "rustdoc" as this; +extern crate rustdoc as this; #[cfg(rustc)] -extern crate "rustc_driver" as this; +extern crate rustc_driver as this; fn main() { this::main() } diff --git a/src/liblibc/lib.rs b/src/liblibc/lib.rs index 89843979cd0..7174b2d2c29 100644 --- a/src/liblibc/lib.rs +++ b/src/liblibc/lib.rs @@ -76,7 +76,7 @@ #![allow(bad_style, raw_pointer_derive)] #![cfg_attr(target_os = "nacl", allow(unused_imports))] -#[cfg(feature = "cargo-build")] extern crate "std" as core; +#[cfg(feature = "cargo-build")] extern crate std as core; #[cfg(not(feature = "cargo-build"))] extern crate core; #[cfg(test)] extern crate std; diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index e8af07e4381..90d9324b909 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -65,7 +65,7 @@ extern crate collections; #[macro_use] extern crate syntax; #[macro_use] #[no_link] extern crate rustc_bitflags; -extern crate "serialize" as rustc_serialize; // used by deriving +extern crate serialize as rustc_serialize; // used by deriving #[cfg(test)] extern crate test; diff --git a/src/librustc_borrowck/lib.rs b/src/librustc_borrowck/lib.rs index e927ea5b86c..99f19ad7110 100644 --- a/src/librustc_borrowck/lib.rs +++ b/src/librustc_borrowck/lib.rs @@ -35,7 +35,7 @@ // for "clarity", rename the graphviz crate to dot; graphviz within `borrowck` // refers to the borrowck-specific graphviz adapter traits. -extern crate "graphviz" as dot; +extern crate graphviz as dot; extern crate rustc; pub use borrowck::check_crate; diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index 5e6f2fb835b..c433aed4ae9 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -55,7 +55,7 @@ extern crate rustc_resolve; extern crate rustc_trans; extern crate rustc_typeck; extern crate serialize; -extern crate "rustc_llvm" as llvm; +extern crate rustc_llvm as llvm; #[macro_use] extern crate log; #[macro_use] extern crate syntax; diff --git a/src/librustc_trans/lib.rs b/src/librustc_trans/lib.rs index 99a64156d66..83525dffaae 100644 --- a/src/librustc_trans/lib.rs +++ b/src/librustc_trans/lib.rs @@ -54,7 +54,7 @@ extern crate libc; extern crate rustc; extern crate rustc_back; extern crate serialize; -extern crate "rustc_llvm" as llvm; +extern crate rustc_llvm as llvm; #[macro_use] extern crate log; #[macro_use] extern crate syntax; diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 9f1d876432c..62c9199a0fa 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -51,11 +51,11 @@ extern crate rustc_lint; extern crate rustc_back; extern crate serialize; extern crate syntax; -extern crate "test" as testing; +extern crate test as testing; extern crate unicode; #[macro_use] extern crate log; -extern crate "serialize" as rustc_serialize; // used by deriving +extern crate serialize as rustc_serialize; // used by deriving use std::cell::RefCell; use std::collections::HashMap; diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index cca6bb747d4..7eb575a3a68 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -149,9 +149,9 @@ extern crate core; #[macro_use] #[macro_reexport(vec, format)] -extern crate "collections" as core_collections; +extern crate collections as core_collections; -#[allow(deprecated)] extern crate "rand" as core_rand; +#[allow(deprecated)] extern crate rand as core_rand; extern crate alloc; extern crate unicode; extern crate libc; @@ -159,7 +159,7 @@ extern crate libc; #[macro_use] #[no_link] extern crate rustc_bitflags; // Make std testable by not duplicating lang items. See #2912 -#[cfg(test)] extern crate "std" as realstd; +#[cfg(test)] extern crate std as realstd; #[cfg(test)] pub use realstd::marker; #[cfg(test)] pub use realstd::ops; #[cfg(test)] pub use realstd::cmp; diff --git a/src/libstd/old_io/mem.rs b/src/libstd/old_io/mem.rs index d877a60b079..298085806bd 100644 --- a/src/libstd/old_io/mem.rs +++ b/src/libstd/old_io/mem.rs @@ -397,7 +397,7 @@ impl<'a> Buffer for BufReader<'a> { #[cfg(test)] mod test { - extern crate "test" as test_crate; + extern crate test as test_crate; use old_io::{SeekSet, SeekCur, SeekEnd, Reader, Writer, Seek, Buffer}; use prelude::v1::{Ok, Err, Vec, AsSlice}; use prelude::v1::IteratorExt; diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 9af7b9ab633..79132b2e543 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -50,7 +50,7 @@ extern crate libc; #[macro_use] extern crate log; #[macro_use] #[no_link] extern crate rustc_bitflags; -extern crate "serialize" as rustc_serialize; // used by deriving +extern crate serialize as rustc_serialize; // used by deriving pub mod util { pub mod interner; diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 220ea30256e..7c95f16bee9 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -4979,7 +4979,7 @@ impl<'a> Parser<'a> { /// /// extern crate url; /// extern crate foo = "bar"; //deprecated - /// extern crate "bar" as foo; + /// extern crate bar as foo; fn parse_item_extern_crate(&mut self, lo: BytePos, visibility: Visibility, diff --git a/src/libsyntax/std_inject.rs b/src/libsyntax/std_inject.rs index 0fa7e4f902c..021ec4738ed 100644 --- a/src/libsyntax/std_inject.rs +++ b/src/libsyntax/std_inject.rs @@ -52,7 +52,7 @@ struct StandardLibraryInjector { impl fold::Folder for StandardLibraryInjector { fn fold_crate(&mut self, mut krate: ast::Crate) -> ast::Crate { - // The name to use in `extern crate "name" as std;` + // The name to use in `extern crate name as std;` let actual_crate_name = match self.alt_std_name { Some(ref s) => token::intern(&s), None => token::intern("std"), diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index c48c7e413d0..3e26a68d590 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -50,7 +50,7 @@ extern crate getopts; extern crate serialize; -extern crate "serialize" as rustc_serialize; +extern crate serialize as rustc_serialize; extern crate term; extern crate libc; diff --git a/src/test/auxiliary/syntax_extension_with_dll_deps_2.rs b/src/test/auxiliary/syntax_extension_with_dll_deps_2.rs index 54da1a1e451..4980eb8b913 100644 --- a/src/test/auxiliary/syntax_extension_with_dll_deps_2.rs +++ b/src/test/auxiliary/syntax_extension_with_dll_deps_2.rs @@ -13,7 +13,7 @@ #![crate_type = "dylib"] #![feature(plugin_registrar, quote, rustc_private)] -extern crate "syntax_extension_with_dll_deps_1" as other; +extern crate syntax_extension_with_dll_deps_1 as other; extern crate syntax; extern crate rustc; diff --git a/src/test/auxiliary/trait_default_method_xc_aux_2.rs b/src/test/auxiliary/trait_default_method_xc_aux_2.rs index 4239865d577..4e99cc26bce 100644 --- a/src/test/auxiliary/trait_default_method_xc_aux_2.rs +++ b/src/test/auxiliary/trait_default_method_xc_aux_2.rs @@ -10,7 +10,7 @@ // aux-build:trait_default_method_xc_aux.rs -extern crate "trait_default_method_xc_aux" as aux; +extern crate trait_default_method_xc_aux as aux; use aux::A; pub struct a_struct { pub x: int } diff --git a/src/test/run-make/save-analysis/foo.rs b/src/test/run-make/save-analysis/foo.rs index 74251c3c63e..a613aa84d71 100644 --- a/src/test/run-make/save-analysis/foo.rs +++ b/src/test/run-make/save-analysis/foo.rs @@ -15,7 +15,7 @@ extern crate graphviz; // A simple rust project -extern crate "flate" as myflate; +extern crate flate as myflate; use std::collections::{HashMap,HashSet}; use std::cell::RefCell; diff --git a/src/test/run-pass/derive-no-std.rs b/src/test/run-pass/derive-no-std.rs index 4f48549d499..fbc6c28fd4a 100644 --- a/src/test/run-pass/derive-no-std.rs +++ b/src/test/run-pass/derive-no-std.rs @@ -13,7 +13,7 @@ extern crate core; extern crate rand; -extern crate "serialize" as rustc_serialize; +extern crate serialize as rustc_serialize; extern crate collections; // Issue #16803 diff --git a/src/test/run-pass/extern-foreign-crate.rs b/src/test/run-pass/extern-foreign-crate.rs index 50c070483f6..1757ff51fed 100644 --- a/src/test/run-pass/extern-foreign-crate.rs +++ b/src/test/run-pass/extern-foreign-crate.rs @@ -10,6 +10,6 @@ // pretty-expanded FIXME #23616 -extern crate "std" as mystd; +extern crate std as mystd; pub fn main() {} diff --git a/src/test/run-pass/for-loop-no-std.rs b/src/test/run-pass/for-loop-no-std.rs index 769d9116f5a..72d4dd73667 100644 --- a/src/test/run-pass/for-loop-no-std.rs +++ b/src/test/run-pass/for-loop-no-std.rs @@ -13,7 +13,7 @@ #![feature(lang_items, start, no_std, core, collections)] #![no_std] -extern crate "std" as other; +extern crate std as other; #[macro_use] extern crate core; #[macro_use] extern crate collections; diff --git a/src/test/run-pass/format-no-std.rs b/src/test/run-pass/format-no-std.rs index 71934b42c33..8ee4becbb81 100644 --- a/src/test/run-pass/format-no-std.rs +++ b/src/test/run-pass/format-no-std.rs @@ -13,7 +13,7 @@ #![feature(lang_items, start, no_std, core, collections)] #![no_std] -extern crate "std" as other; +extern crate std as other; #[macro_use] extern crate core; #[macro_use] extern crate collections; diff --git a/src/test/run-pass/issue-14330.rs b/src/test/run-pass/issue-14330.rs index 48c4aed50f4..dd5b7e722fe 100644 --- a/src/test/run-pass/issue-14330.rs +++ b/src/test/run-pass/issue-14330.rs @@ -10,6 +10,6 @@ // pretty-expanded FIXME #23616 -#[macro_use] extern crate "std" as std2; +#[macro_use] extern crate std as std2; fn main() {} diff --git a/src/test/run-pass/linkage1.rs b/src/test/run-pass/linkage1.rs index 5cd741350d5..9cada12685f 100644 --- a/src/test/run-pass/linkage1.rs +++ b/src/test/run-pass/linkage1.rs @@ -14,7 +14,7 @@ #![feature(linkage)] -extern crate "linkage1" as other; +extern crate linkage1 as other; extern { #[linkage = "extern_weak"] diff --git a/src/test/run-pass/macro-crate-nonterminal-renamed.rs b/src/test/run-pass/macro-crate-nonterminal-renamed.rs index cb919297b04..ed7b1cbacad 100644 --- a/src/test/run-pass/macro-crate-nonterminal-renamed.rs +++ b/src/test/run-pass/macro-crate-nonterminal-renamed.rs @@ -12,7 +12,7 @@ // ignore-stage1 #[macro_use] -extern crate "macro_crate_nonterminal" as new_name; +extern crate macro_crate_nonterminal as new_name; pub fn main() { new_name::check_local(); diff --git a/src/test/run-pass/static-fn-inline-xc.rs b/src/test/run-pass/static-fn-inline-xc.rs index b2fbff67ac7..80de65c0e9f 100644 --- a/src/test/run-pass/static-fn-inline-xc.rs +++ b/src/test/run-pass/static-fn-inline-xc.rs @@ -12,7 +12,7 @@ // pretty-expanded FIXME #23616 -extern crate "static_fn_inline_xc_aux" as mycore; +extern crate static_fn_inline_xc_aux as mycore; use mycore::num; diff --git a/src/test/run-pass/static-fn-trait-xc.rs b/src/test/run-pass/static-fn-trait-xc.rs index 7c9049ffacf..550e03c8b12 100644 --- a/src/test/run-pass/static-fn-trait-xc.rs +++ b/src/test/run-pass/static-fn-trait-xc.rs @@ -12,7 +12,7 @@ // pretty-expanded FIXME #23616 -extern crate "static_fn_trait_xc_aux" as mycore; +extern crate static_fn_trait_xc_aux as mycore; use mycore::num; diff --git a/src/test/run-pass/trait-default-method-xc-2.rs b/src/test/run-pass/trait-default-method-xc-2.rs index b3e83f747a3..d4ed7270400 100644 --- a/src/test/run-pass/trait-default-method-xc-2.rs +++ b/src/test/run-pass/trait-default-method-xc-2.rs @@ -14,8 +14,8 @@ // pretty-expanded FIXME #23616 -extern crate "trait_default_method_xc_aux" as aux; -extern crate "trait_default_method_xc_aux_2" as aux2; +extern crate trait_default_method_xc_aux as aux; +extern crate trait_default_method_xc_aux_2 as aux2; use aux::A; use aux2::{a_struct, welp}; diff --git a/src/test/run-pass/trait-default-method-xc.rs b/src/test/run-pass/trait-default-method-xc.rs index eb2a75f62fb..59b44a7a6dc 100644 --- a/src/test/run-pass/trait-default-method-xc.rs +++ b/src/test/run-pass/trait-default-method-xc.rs @@ -12,7 +12,7 @@ // pretty-expanded FIXME #23616 -extern crate "trait_default_method_xc_aux" as aux; +extern crate trait_default_method_xc_aux as aux; use aux::{A, TestEquality, Something}; use aux::B; diff --git a/src/test/run-pass/trait-inheritance-auto-xc-2.rs b/src/test/run-pass/trait-inheritance-auto-xc-2.rs index 9db1af230d5..128be2993ec 100644 --- a/src/test/run-pass/trait-inheritance-auto-xc-2.rs +++ b/src/test/run-pass/trait-inheritance-auto-xc-2.rs @@ -12,7 +12,7 @@ // pretty-expanded FIXME #23616 -extern crate "trait_inheritance_auto_xc_2_aux" as aux; +extern crate trait_inheritance_auto_xc_2_aux as aux; // aux defines impls of Foo, Bar and Baz for A use aux::{Foo, Bar, Baz, A}; diff --git a/src/test/run-pass/trait-inheritance-auto-xc.rs b/src/test/run-pass/trait-inheritance-auto-xc.rs index b58839931b0..cfef5c2b503 100644 --- a/src/test/run-pass/trait-inheritance-auto-xc.rs +++ b/src/test/run-pass/trait-inheritance-auto-xc.rs @@ -12,7 +12,7 @@ // pretty-expanded FIXME #23616 -extern crate "trait_inheritance_auto_xc_aux" as aux; +extern crate trait_inheritance_auto_xc_aux as aux; use aux::{Foo, Bar, Baz, Quux}; diff --git a/src/test/run-pass/trait-inheritance-cross-trait-call-xc.rs b/src/test/run-pass/trait-inheritance-cross-trait-call-xc.rs index 8de867eff90..23d612baa1c 100644 --- a/src/test/run-pass/trait-inheritance-cross-trait-call-xc.rs +++ b/src/test/run-pass/trait-inheritance-cross-trait-call-xc.rs @@ -12,7 +12,7 @@ // pretty-expanded FIXME #23616 -extern crate "trait_inheritance_cross_trait_call_xc_aux" as aux; +extern crate trait_inheritance_cross_trait_call_xc_aux as aux; use aux::Foo; diff --git a/src/test/run-pass/use-crate-name-alias.rs b/src/test/run-pass/use-crate-name-alias.rs index 2821de6f1e7..98594183a00 100644 --- a/src/test/run-pass/use-crate-name-alias.rs +++ b/src/test/run-pass/use-crate-name-alias.rs @@ -11,6 +11,6 @@ // Issue #1706 // pretty-expanded FIXME #23616 -extern crate "std" as stdlib; +extern crate std as stdlib; pub fn main() {} diff --git a/src/test/run-pass/use.rs b/src/test/run-pass/use.rs index 446bb4a148e..e4b13b60176 100644 --- a/src/test/run-pass/use.rs +++ b/src/test/run-pass/use.rs @@ -15,7 +15,7 @@ #![no_std] extern crate std; -extern crate "std" as zed; +extern crate std as zed; use std::str; use zed::str as x; diff --git a/src/test/run-pass/vec-macro-no-std.rs b/src/test/run-pass/vec-macro-no-std.rs index 360cecb9e6a..f81509025a8 100644 --- a/src/test/run-pass/vec-macro-no-std.rs +++ b/src/test/run-pass/vec-macro-no-std.rs @@ -13,7 +13,7 @@ #![feature(lang_items, start, no_std, core, libc, collections)] #![no_std] -extern crate "std" as other; +extern crate std as other; #[macro_use] extern crate core; diff --git a/src/test/run-pass/xcrate-address-insignificant.rs b/src/test/run-pass/xcrate-address-insignificant.rs index f133396a725..ac8b15d7bf5 100644 --- a/src/test/run-pass/xcrate-address-insignificant.rs +++ b/src/test/run-pass/xcrate-address-insignificant.rs @@ -12,7 +12,7 @@ // pretty-expanded FIXME #23616 -extern crate "xcrate_address_insignificant" as foo; +extern crate xcrate_address_insignificant as foo; pub fn main() { assert_eq!(foo::foo::(), foo::bar()); -- cgit 1.4.1-3-g733a5 From 1639e51f6e4d036478705f4581de3a7417ccec0f Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 26 Mar 2015 18:34:27 -0700 Subject: Feature gate *all* slice patterns. #23121 Until some backwards-compatibility hazards are fixed in #23121, these need to be unstable. [breaking-change] --- src/doc/reference.md | 10 +++++++--- src/doc/trpl/patterns.md | 1 + src/libcollections/lib.rs | 1 + src/libcoretest/lib.rs | 1 + src/librustc/lib.rs | 1 + src/librustdoc/lib.rs | 1 + src/libstd/lib.rs | 1 + src/libsyntax/feature_gate.rs | 8 ++++++++ src/libsyntax/lib.rs | 1 + src/test/auxiliary/roman_numerals.rs | 1 + src/test/compile-fail/borrowck-match-binding-is-assignment.rs | 2 ++ src/test/compile-fail/borrowck-move-out-of-vec-tail.rs | 2 ++ src/test/compile-fail/borrowck-vec-pattern-element-loan.rs | 1 + src/test/compile-fail/borrowck-vec-pattern-loan-from-mut.rs | 2 ++ src/test/compile-fail/borrowck-vec-pattern-move-tail.rs | 2 ++ src/test/compile-fail/borrowck-vec-pattern-nesting.rs | 1 + .../compile-fail/borrowck-vec-pattern-tail-element-loan.rs | 2 ++ src/test/compile-fail/feature-gate-advanced-slice-features.rs | 2 ++ src/test/compile-fail/issue-12369.rs | 2 ++ src/test/compile-fail/issue-12567.rs | 2 ++ src/test/compile-fail/issue-13482-2.rs | 2 ++ src/test/compile-fail/issue-13482.rs | 2 ++ src/test/compile-fail/issue-15381.rs | 2 ++ src/test/compile-fail/issue-6804.rs | 1 + src/test/compile-fail/match-ref-ice.rs | 2 ++ src/test/compile-fail/match-vec-fixed.rs | 2 ++ src/test/compile-fail/match-vec-mismatch-2.rs | 2 ++ src/test/compile-fail/match-vec-mismatch.rs | 2 ++ src/test/compile-fail/match-vec-unreachable.rs | 1 + src/test/compile-fail/non-exhaustive-match-nested.rs | 2 ++ src/test/compile-fail/non-exhaustive-match.rs | 2 ++ src/test/compile-fail/non-exhaustive-pattern-witness.rs | 1 + src/test/compile-fail/regions-pattern-typing-issue-19552.rs | 2 ++ src/test/run-make/graphviz-flowgraph/f07.rs | 2 ++ src/test/run-pass/destructure-array-1.rs | 2 ++ src/test/run-pass/ignore-all-the-things.rs | 1 + src/test/run-pass/issue-13027.rs | 2 ++ src/test/run-pass/issue-15080.rs | 2 ++ src/test/run-pass/issue-15104.rs | 2 ++ src/test/run-pass/issue-16648.rs | 2 ++ src/test/run-pass/issue-17877.rs | 2 ++ src/test/run-pass/issue-7784.rs | 1 + src/test/run-pass/match-vec-alternatives.rs | 1 + src/test/run-pass/trailing-comma.rs | 1 + src/test/run-pass/vec-matching-autoslice.rs | 2 ++ src/test/run-pass/vec-matching-fixed.rs | 1 + src/test/run-pass/vec-matching-fold.rs | 1 + src/test/run-pass/vec-matching-legal-tail-element-borrow.rs | 2 ++ src/test/run-pass/vec-matching.rs | 1 + src/test/run-pass/vec-tail-matching.rs | 2 ++ src/test/run-pass/zero_sized_subslice_match.rs | 2 ++ 51 files changed, 93 insertions(+), 3 deletions(-) (limited to 'src/libsyntax') diff --git a/src/doc/reference.md b/src/doc/reference.md index 32088b2ab67..465918f2918 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -2408,9 +2408,13 @@ considered off, and using the features will result in a compiler error. The currently implemented features of the reference compiler are: -* `advanced_slice_patterns` - see the [match expressions](#match-expressions) +* `advanced_slice_patterns` - See the [match expressions](#match-expressions) section for discussion; the exact semantics of - slice patterns are subject to change. + slice patterns are subject to change, so some types + are still unstable. + +* `slice_patterns` - OK, actually, slice patterns are just scary and + completely unstable. * `asm` - The `asm!` macro provides a means for inline assembly. This is often useful, but the exact syntax for this feature along with its @@ -3329,7 +3333,7 @@ array, like `[.., 42, ..]`. If preceded by a variable name, it will bind the corresponding slice to the variable. Example: ``` -# #![feature(advanced_slice_patterns)] +# #![feature(advanced_slice_patterns, slice_patterns)] fn is_symmetric(list: &[u32]) -> bool { match list { [] | [_] => true, diff --git a/src/doc/trpl/patterns.md b/src/doc/trpl/patterns.md index 9e82e48fd18..4ebf696aa57 100644 --- a/src/doc/trpl/patterns.md +++ b/src/doc/trpl/patterns.md @@ -177,6 +177,7 @@ match origin { If you want to match against a slice or array, you can use `&`: ```{rust} +# #![feature(slice_patterns)] fn main() { let v = vec!["match_this", "1"]; diff --git a/src/libcollections/lib.rs b/src/libcollections/lib.rs index 6a65c991c95..fa83a88b8d2 100644 --- a/src/libcollections/lib.rs +++ b/src/libcollections/lib.rs @@ -40,6 +40,7 @@ #![feature(step_by)] #![feature(str_char)] #![feature(convert)] +#![feature(slice_patterns)] #![cfg_attr(test, feature(rand, rustc_private, test, hash, collections))] #![cfg_attr(test, allow(deprecated))] // rand diff --git a/src/libcoretest/lib.rs b/src/libcoretest/lib.rs index 33f9b63bc49..9cc3063dee6 100644 --- a/src/libcoretest/lib.rs +++ b/src/libcoretest/lib.rs @@ -26,6 +26,7 @@ #![feature(debug_builders)] #![feature(unique)] #![feature(step_by)] +#![feature(slice_patterns)] #![allow(deprecated)] // rand extern crate core; diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index e8af07e4381..426555b0611 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -45,6 +45,7 @@ #![feature(str_char)] #![feature(convert)] #![feature(into_cow)] +#![feature(slice_patterns)] #![cfg_attr(test, feature(test))] #![allow(trivial_casts)] diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 9f1d876432c..db651de3cbf 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -39,6 +39,7 @@ #![feature(path_ext)] #![feature(path_relative_from)] #![feature(convert)] +#![feature(slice_patterns)] extern crate arena; extern crate getopts; diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index cca6bb747d4..56ab38b8d5a 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -129,6 +129,7 @@ #![feature(allow_internal_unstable)] #![feature(str_char)] #![feature(into_cow)] +#![feature(slice_patterns)] #![cfg_attr(test, feature(test, rustc_private, std_misc))] // Don't link to std. We are std. diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 60f81dac1e9..ef8a0aa7b52 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -153,6 +153,9 @@ const KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[ // below (it has to be checked before expansion possibly makes // macros disappear). ("allow_internal_unstable", "1.0.0", Active), + + // #23121. Array patterns have some hazards yet. + ("slice_patterns", "1.0.0", Active), ]; // (changing above list without updating src/doc/reference.md makes @cmr sad) @@ -694,6 +697,11 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> { but at the end of a slice (e.g. \ `[0, ..xs, 0]` are experimental") } + ast::PatVec(..) => { + self.gate_feature("slice_patterns", + pattern.span, + "slice pattern syntax is experimental"); + } ast::PatBox(..) => { self.gate_feature("box_patterns", pattern.span, diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 9af7b9ab633..a456807bb90 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -41,6 +41,7 @@ #![feature(str_char)] #![feature(convert)] #![feature(into_cow)] +#![feature(slice_patterns)] extern crate arena; extern crate fmt_macros; diff --git a/src/test/auxiliary/roman_numerals.rs b/src/test/auxiliary/roman_numerals.rs index a105cb7ae6c..8ddca3cb103 100644 --- a/src/test/auxiliary/roman_numerals.rs +++ b/src/test/auxiliary/roman_numerals.rs @@ -12,6 +12,7 @@ #![crate_type="dylib"] #![feature(plugin_registrar, rustc_private)] +#![feature(slice_patterns)] extern crate syntax; extern crate rustc; diff --git a/src/test/compile-fail/borrowck-match-binding-is-assignment.rs b/src/test/compile-fail/borrowck-match-binding-is-assignment.rs index 38593d31842..c219b7c5424 100644 --- a/src/test/compile-fail/borrowck-match-binding-is-assignment.rs +++ b/src/test/compile-fail/borrowck-match-binding-is-assignment.rs @@ -10,6 +10,8 @@ // Test that immutable pattern bindings cannot be reassigned. +#![feature(slice_patterns)] + enum E { Foo(isize) } diff --git a/src/test/compile-fail/borrowck-move-out-of-vec-tail.rs b/src/test/compile-fail/borrowck-move-out-of-vec-tail.rs index f9d24130e47..d9a2f89a9e2 100644 --- a/src/test/compile-fail/borrowck-move-out-of-vec-tail.rs +++ b/src/test/compile-fail/borrowck-move-out-of-vec-tail.rs @@ -10,6 +10,8 @@ // Test that we do not permit moves from &[] matched by a vec pattern. +#![feature(slice_patterns)] + #[derive(Clone, Debug)] struct Foo { string: String diff --git a/src/test/compile-fail/borrowck-vec-pattern-element-loan.rs b/src/test/compile-fail/borrowck-vec-pattern-element-loan.rs index 2d6a4b7d2c9..98052ad31a7 100644 --- a/src/test/compile-fail/borrowck-vec-pattern-element-loan.rs +++ b/src/test/compile-fail/borrowck-vec-pattern-element-loan.rs @@ -9,6 +9,7 @@ // except according to those terms. #![feature(advanced_slice_patterns)] +#![feature(slice_patterns)] fn a<'a>() -> &'a [isize] { let vec = vec!(1, 2, 3, 4); diff --git a/src/test/compile-fail/borrowck-vec-pattern-loan-from-mut.rs b/src/test/compile-fail/borrowck-vec-pattern-loan-from-mut.rs index c1906758a5a..db635893c81 100644 --- a/src/test/compile-fail/borrowck-vec-pattern-loan-from-mut.rs +++ b/src/test/compile-fail/borrowck-vec-pattern-loan-from-mut.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(slice_patterns)] + fn a() { let mut v = vec!(1, 2, 3); let vb: &mut [isize] = &mut v; diff --git a/src/test/compile-fail/borrowck-vec-pattern-move-tail.rs b/src/test/compile-fail/borrowck-vec-pattern-move-tail.rs index 242a3844003..97dcaeb0bf1 100644 --- a/src/test/compile-fail/borrowck-vec-pattern-move-tail.rs +++ b/src/test/compile-fail/borrowck-vec-pattern-move-tail.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(slice_patterns)] + fn main() { let mut a = [1, 2, 3, 4]; let t = match a { diff --git a/src/test/compile-fail/borrowck-vec-pattern-nesting.rs b/src/test/compile-fail/borrowck-vec-pattern-nesting.rs index b471439f751..a69ce0cb365 100644 --- a/src/test/compile-fail/borrowck-vec-pattern-nesting.rs +++ b/src/test/compile-fail/borrowck-vec-pattern-nesting.rs @@ -11,6 +11,7 @@ #![feature(advanced_slice_patterns)] #![feature(box_patterns)] #![feature(box_syntax)] +#![feature(slice_patterns)] fn a() { let mut vec = [box 1, box 2, box 3]; diff --git a/src/test/compile-fail/borrowck-vec-pattern-tail-element-loan.rs b/src/test/compile-fail/borrowck-vec-pattern-tail-element-loan.rs index df0fee437b9..82b3490d7d7 100644 --- a/src/test/compile-fail/borrowck-vec-pattern-tail-element-loan.rs +++ b/src/test/compile-fail/borrowck-vec-pattern-tail-element-loan.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(slice_patterns)] + fn a<'a>() -> &'a isize { let vec = vec!(1, 2, 3, 4); let vec: &[isize] = &vec; //~ ERROR `vec` does not live long enough diff --git a/src/test/compile-fail/feature-gate-advanced-slice-features.rs b/src/test/compile-fail/feature-gate-advanced-slice-features.rs index a4524ccd9db..1daca371b34 100644 --- a/src/test/compile-fail/feature-gate-advanced-slice-features.rs +++ b/src/test/compile-fail/feature-gate-advanced-slice-features.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(slice_patterns)] + fn main() { let x = [ 1, 2, 3, 4, 5 ]; match x { diff --git a/src/test/compile-fail/issue-12369.rs b/src/test/compile-fail/issue-12369.rs index 9a471a4341f..1333bfac64e 100644 --- a/src/test/compile-fail/issue-12369.rs +++ b/src/test/compile-fail/issue-12369.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(slice_patterns)] + fn main() { let sl = vec![1,2,3]; let v: isize = match &*sl { diff --git a/src/test/compile-fail/issue-12567.rs b/src/test/compile-fail/issue-12567.rs index d186a83676a..1580ec00f94 100644 --- a/src/test/compile-fail/issue-12567.rs +++ b/src/test/compile-fail/issue-12567.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(slice_patterns)] + fn match_vecs<'a, T>(l1: &'a [T], l2: &'a [T]) { match (l1, l2) { ([], []) => println!("both empty"), diff --git a/src/test/compile-fail/issue-13482-2.rs b/src/test/compile-fail/issue-13482-2.rs index 86a79416c77..f907be161fa 100644 --- a/src/test/compile-fail/issue-13482-2.rs +++ b/src/test/compile-fail/issue-13482-2.rs @@ -10,6 +10,8 @@ // compile-flags:-Z verbose +#![feature(slice_patterns)] + fn main() { let x = [1,2]; let y = match x { diff --git a/src/test/compile-fail/issue-13482.rs b/src/test/compile-fail/issue-13482.rs index a345ce79612..2fbfd6cc84e 100644 --- a/src/test/compile-fail/issue-13482.rs +++ b/src/test/compile-fail/issue-13482.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(slice_patterns)] + fn main() { let x = [1,2]; let y = match x { diff --git a/src/test/compile-fail/issue-15381.rs b/src/test/compile-fail/issue-15381.rs index 817e4ae1650..653ba165e74 100644 --- a/src/test/compile-fail/issue-15381.rs +++ b/src/test/compile-fail/issue-15381.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(slice_patterns)] + fn main() { let values: Vec = vec![1,2,3,4,5,6,7,8]; diff --git a/src/test/compile-fail/issue-6804.rs b/src/test/compile-fail/issue-6804.rs index 08c5cae9f5f..ffab194149e 100644 --- a/src/test/compile-fail/issue-6804.rs +++ b/src/test/compile-fail/issue-6804.rs @@ -9,6 +9,7 @@ // except according to those terms. #![feature(rustc_attrs)] +#![feature(slice_patterns)] #![allow(dead_code)] // Matching against NaN should result in a warning diff --git a/src/test/compile-fail/match-ref-ice.rs b/src/test/compile-fail/match-ref-ice.rs index d0f7c7ca986..042ec95f7e7 100644 --- a/src/test/compile-fail/match-ref-ice.rs +++ b/src/test/compile-fail/match-ref-ice.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(slice_patterns)] + // The arity of `ref x` is always 1. If the pattern is compared to some non-structural type whose // arity is always 0, an ICE occurs. // diff --git a/src/test/compile-fail/match-vec-fixed.rs b/src/test/compile-fail/match-vec-fixed.rs index e778dd18e68..60d0c24bb3d 100644 --- a/src/test/compile-fail/match-vec-fixed.rs +++ b/src/test/compile-fail/match-vec-fixed.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(slice_patterns)] + fn a() { let v = [1, 2, 3]; match v { diff --git a/src/test/compile-fail/match-vec-mismatch-2.rs b/src/test/compile-fail/match-vec-mismatch-2.rs index a4abdf3ddfe..0bbba886121 100644 --- a/src/test/compile-fail/match-vec-mismatch-2.rs +++ b/src/test/compile-fail/match-vec-mismatch-2.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(slice_patterns)] + fn main() { match () { [()] => { } diff --git a/src/test/compile-fail/match-vec-mismatch.rs b/src/test/compile-fail/match-vec-mismatch.rs index edbdc77f030..ef75213d34b 100644 --- a/src/test/compile-fail/match-vec-mismatch.rs +++ b/src/test/compile-fail/match-vec-mismatch.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(slice_patterns)] + fn main() { match "foo".to_string() { ['f', 'o', ..] => {} //~ ERROR mismatched types diff --git a/src/test/compile-fail/match-vec-unreachable.rs b/src/test/compile-fail/match-vec-unreachable.rs index 2c63438cbf3..48b70b4bda0 100644 --- a/src/test/compile-fail/match-vec-unreachable.rs +++ b/src/test/compile-fail/match-vec-unreachable.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(slice_patterns)] fn main() { let x: Vec<(isize, isize)> = Vec::new(); diff --git a/src/test/compile-fail/non-exhaustive-match-nested.rs b/src/test/compile-fail/non-exhaustive-match-nested.rs index 8f2cb61f955..ad2b8c400e5 100644 --- a/src/test/compile-fail/non-exhaustive-match-nested.rs +++ b/src/test/compile-fail/non-exhaustive-match-nested.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(slice_patterns)] + enum t { a(u), b } enum u { c, d } diff --git a/src/test/compile-fail/non-exhaustive-match.rs b/src/test/compile-fail/non-exhaustive-match.rs index 1dec049aed5..b9749c2696e 100644 --- a/src/test/compile-fail/non-exhaustive-match.rs +++ b/src/test/compile-fail/non-exhaustive-match.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(slice_patterns)] + enum t { a, b, } fn main() { diff --git a/src/test/compile-fail/non-exhaustive-pattern-witness.rs b/src/test/compile-fail/non-exhaustive-pattern-witness.rs index 3ed91459ae9..146265bf0e1 100644 --- a/src/test/compile-fail/non-exhaustive-pattern-witness.rs +++ b/src/test/compile-fail/non-exhaustive-pattern-witness.rs @@ -9,6 +9,7 @@ // except according to those terms. #![feature(advanced_slice_patterns)] +#![feature(slice_patterns)] struct Foo { first: bool, diff --git a/src/test/compile-fail/regions-pattern-typing-issue-19552.rs b/src/test/compile-fail/regions-pattern-typing-issue-19552.rs index 3401dd1becd..8e83177090b 100644 --- a/src/test/compile-fail/regions-pattern-typing-issue-19552.rs +++ b/src/test/compile-fail/regions-pattern-typing-issue-19552.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(slice_patterns)] + fn assert_static(_t: T) {} fn main() { diff --git a/src/test/run-make/graphviz-flowgraph/f07.rs b/src/test/run-make/graphviz-flowgraph/f07.rs index 39f71d309fd..f36b8d0abc7 100644 --- a/src/test/run-make/graphviz-flowgraph/f07.rs +++ b/src/test/run-make/graphviz-flowgraph/f07.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(slice_patterns)] + pub fn pat_vec_7() { match [7, 77, 777, 7777] { [x, y, ..] => x + y diff --git a/src/test/run-pass/destructure-array-1.rs b/src/test/run-pass/destructure-array-1.rs index 22853c5ad80..e2c96085714 100644 --- a/src/test/run-pass/destructure-array-1.rs +++ b/src/test/run-pass/destructure-array-1.rs @@ -13,6 +13,8 @@ // pretty-expanded FIXME #23616 +#![feature(slice_patterns)] + struct D { x: u8 } impl Drop for D { fn drop(&mut self) { } } diff --git a/src/test/run-pass/ignore-all-the-things.rs b/src/test/run-pass/ignore-all-the-things.rs index 839ec6457e1..158bc8fcc1a 100644 --- a/src/test/run-pass/ignore-all-the-things.rs +++ b/src/test/run-pass/ignore-all-the-things.rs @@ -11,6 +11,7 @@ // pretty-expanded FIXME #23616 #![feature(advanced_slice_patterns)] +#![feature(slice_patterns)] struct Foo(int, int, int, int); struct Bar{a: int, b: int, c: int, d: int} diff --git a/src/test/run-pass/issue-13027.rs b/src/test/run-pass/issue-13027.rs index 056c86b01f7..f89ad8c3010 100644 --- a/src/test/run-pass/issue-13027.rs +++ b/src/test/run-pass/issue-13027.rs @@ -13,6 +13,8 @@ // Tests that match expression handles overlapped literal and range // properly in the presence of guard function. +#![feature(slice_patterns)] + fn val() -> uint { 1 } static CONST: uint = 1; diff --git a/src/test/run-pass/issue-15080.rs b/src/test/run-pass/issue-15080.rs index a6d4f5fde5d..4369dc6292c 100644 --- a/src/test/run-pass/issue-15080.rs +++ b/src/test/run-pass/issue-15080.rs @@ -10,6 +10,8 @@ // pretty-expanded FIXME #23616 +#![feature(slice_patterns)] + fn main() { let mut x: &[_] = &[1, 2, 3, 4]; diff --git a/src/test/run-pass/issue-15104.rs b/src/test/run-pass/issue-15104.rs index f56f3b63927..16c15daa80b 100644 --- a/src/test/run-pass/issue-15104.rs +++ b/src/test/run-pass/issue-15104.rs @@ -10,6 +10,8 @@ // pretty-expanded FIXME #23616 +#![feature(slice_patterns)] + fn main() { assert_eq!(count_members(&[1, 2, 3, 4]), 4); } diff --git a/src/test/run-pass/issue-16648.rs b/src/test/run-pass/issue-16648.rs index 6b0d5d7c513..66c7f7ccec5 100644 --- a/src/test/run-pass/issue-16648.rs +++ b/src/test/run-pass/issue-16648.rs @@ -10,6 +10,8 @@ // pretty-expanded FIXME #23616 +#![feature(slice_patterns)] + fn main() { let x: (int, &[int]) = (2, &[1, 2]); assert_eq!(match x { diff --git a/src/test/run-pass/issue-17877.rs b/src/test/run-pass/issue-17877.rs index 82f324a395a..41fab9d9d54 100644 --- a/src/test/run-pass/issue-17877.rs +++ b/src/test/run-pass/issue-17877.rs @@ -10,6 +10,8 @@ // pretty-expanded FIXME #23616 +#![feature(slice_patterns)] + fn main() { assert_eq!(match [0u8; 1024] { _ => 42_usize, diff --git a/src/test/run-pass/issue-7784.rs b/src/test/run-pass/issue-7784.rs index 9dc2bd81182..e2016feeb0a 100644 --- a/src/test/run-pass/issue-7784.rs +++ b/src/test/run-pass/issue-7784.rs @@ -11,6 +11,7 @@ // pretty-expanded FIXME #23616 #![feature(advanced_slice_patterns)] +#![feature(slice_patterns)] use std::ops::Add; diff --git a/src/test/run-pass/match-vec-alternatives.rs b/src/test/run-pass/match-vec-alternatives.rs index 520c2e8108d..1ba23de69a7 100644 --- a/src/test/run-pass/match-vec-alternatives.rs +++ b/src/test/run-pass/match-vec-alternatives.rs @@ -11,6 +11,7 @@ // pretty-expanded FIXME #23616 #![feature(advanced_slice_patterns)] +#![feature(slice_patterns)] fn match_vecs<'a, T>(l1: &'a [T], l2: &'a [T]) -> &'static str { match (l1, l2) { diff --git a/src/test/run-pass/trailing-comma.rs b/src/test/run-pass/trailing-comma.rs index 79e0df0133b..983ebc1b8dc 100644 --- a/src/test/run-pass/trailing-comma.rs +++ b/src/test/run-pass/trailing-comma.rs @@ -11,6 +11,7 @@ // pretty-expanded FIXME #23616 #![feature(advanced_slice_patterns,)] +#![feature(slice_patterns)] fn f(_: T,) {} diff --git a/src/test/run-pass/vec-matching-autoslice.rs b/src/test/run-pass/vec-matching-autoslice.rs index 8f38123fe28..2b80ad81037 100644 --- a/src/test/run-pass/vec-matching-autoslice.rs +++ b/src/test/run-pass/vec-matching-autoslice.rs @@ -10,6 +10,8 @@ // pretty-expanded FIXME #23616 +#![feature(slice_patterns)] + pub fn main() { let x = [1, 2, 3]; match x { diff --git a/src/test/run-pass/vec-matching-fixed.rs b/src/test/run-pass/vec-matching-fixed.rs index b03a9a64b21..1278eaf96a4 100644 --- a/src/test/run-pass/vec-matching-fixed.rs +++ b/src/test/run-pass/vec-matching-fixed.rs @@ -11,6 +11,7 @@ // pretty-expanded FIXME #23616 #![feature(advanced_slice_patterns)] +#![feature(slice_patterns)] fn a() { let x = [1, 2, 3]; diff --git a/src/test/run-pass/vec-matching-fold.rs b/src/test/run-pass/vec-matching-fold.rs index 494a9d658a1..c375fc85bc1 100644 --- a/src/test/run-pass/vec-matching-fold.rs +++ b/src/test/run-pass/vec-matching-fold.rs @@ -11,6 +11,7 @@ // pretty-expanded FIXME #23616 #![feature(advanced_slice_patterns)] +#![feature(slice_patterns)] fn foldl(values: &[T], initial: U, diff --git a/src/test/run-pass/vec-matching-legal-tail-element-borrow.rs b/src/test/run-pass/vec-matching-legal-tail-element-borrow.rs index 64309906156..b6c2d050f7c 100644 --- a/src/test/run-pass/vec-matching-legal-tail-element-borrow.rs +++ b/src/test/run-pass/vec-matching-legal-tail-element-borrow.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(slice_patterns)] + pub fn main() { let x = &[1, 2, 3, 4, 5]; let x: &[int] = &[1, 2, 3, 4, 5]; diff --git a/src/test/run-pass/vec-matching.rs b/src/test/run-pass/vec-matching.rs index 306d200319d..9ffd9a9a04c 100644 --- a/src/test/run-pass/vec-matching.rs +++ b/src/test/run-pass/vec-matching.rs @@ -11,6 +11,7 @@ // pretty-expanded FIXME #23616 #![feature(advanced_slice_patterns)] +#![feature(slice_patterns)] fn a() { let x = [1]; diff --git a/src/test/run-pass/vec-tail-matching.rs b/src/test/run-pass/vec-tail-matching.rs index 3ee0cf33e43..091e3f03e7a 100644 --- a/src/test/run-pass/vec-tail-matching.rs +++ b/src/test/run-pass/vec-tail-matching.rs @@ -11,6 +11,8 @@ // pretty-expanded FIXME #23616 +#![feature(slice_patterns)] + struct Foo { string: String } diff --git a/src/test/run-pass/zero_sized_subslice_match.rs b/src/test/run-pass/zero_sized_subslice_match.rs index ba125997470..b98f907774b 100644 --- a/src/test/run-pass/zero_sized_subslice_match.rs +++ b/src/test/run-pass/zero_sized_subslice_match.rs @@ -10,6 +10,8 @@ // pretty-expanded FIXME #23616 +#![feature(slice_patterns)] + fn main() { let x = [(), ()]; -- cgit 1.4.1-3-g733a5 From cbce6bfbdb140561add2ff258b305e7c7f2ad5c6 Mon Sep 17 00:00:00 2001 From: Richo Healey Date: Sat, 28 Mar 2015 02:23:20 -0700 Subject: cleanup: Remove unused braces in use statements --- src/liballoc/arc.rs | 2 +- src/libcollections/btree/map.rs | 2 +- src/libcollections/vec.rs | 2 +- src/libcore/option.rs | 2 +- src/librand/distributions/range.rs | 2 +- src/librustc/metadata/encoder.rs | 2 +- src/librustc/metadata/loader.rs | 2 +- src/librustc/middle/astencode.rs | 2 +- src/librustc/middle/check_match.rs | 2 +- src/librustc/middle/infer/bivariate.rs | 8 ++++---- src/librustc/middle/infer/combine.rs | 2 +- src/librustc/middle/infer/equate.rs | 8 ++++---- src/librustc/middle/infer/glb.rs | 2 +- src/librustc/middle/infer/lattice.rs | 2 +- src/librustc/middle/infer/lub.rs | 4 ++-- src/librustc/middle/infer/mod.rs | 4 ++-- src/librustc/middle/infer/sub.rs | 6 +++--- src/librustc/middle/mem_categorization.rs | 2 +- src/librustc/middle/pat_util.rs | 2 +- src/librustc/middle/region.rs | 2 +- src/librustc/middle/resolve_lifetime.rs | 2 +- src/librustc/middle/traits/coherence.rs | 2 +- src/librustc/middle/traits/fulfill.rs | 2 +- src/librustc/middle/traits/select.rs | 8 ++++---- src/librustc/middle/ty.rs | 2 +- src/librustc/plugin/registry.rs | 2 +- src/librustc/util/nodemap.rs | 2 +- src/librustc/util/ppaux.rs | 2 +- src/librustc_borrowck/borrowck/fragments.rs | 4 ++-- src/librustc_borrowck/borrowck/gather_loans/mod.rs | 2 +- src/librustc_borrowck/graphviz.rs | 2 +- src/librustc_driver/driver.rs | 2 +- src/librustc_lint/builtin.rs | 2 +- src/librustc_privacy/lib.rs | 2 +- src/librustc_resolve/build_reduced_graph.rs | 2 +- src/librustc_resolve/lib.rs | 2 +- src/librustc_trans/trans/base.rs | 2 +- src/librustc_trans/trans/basic_block.rs | 2 +- src/librustc_trans/trans/callee.rs | 2 +- src/librustc_trans/trans/closure.rs | 2 +- src/librustc_trans/trans/context.rs | 2 +- src/librustc_trans/trans/datum.rs | 2 +- src/librustc_trans/trans/expr.rs | 2 +- src/librustc_trans/trans/foreign.rs | 4 ++-- src/librustc_trans/trans/tvec.rs | 2 +- src/librustc_typeck/check/_match.rs | 2 +- src/librustc_typeck/check/compare_method.rs | 2 +- src/librustc_typeck/check/implicator.rs | 2 +- src/librustc_typeck/check/method/mod.rs | 4 ++-- src/librustc_typeck/check/method/probe.rs | 2 +- src/librustc_typeck/check/vtable.rs | 2 +- src/librustc_typeck/check/wf.rs | 2 +- src/librustc_typeck/coherence/mod.rs | 10 +++++----- src/librustc_typeck/coherence/overlap.rs | 4 ++-- src/librustc_typeck/collect.rs | 2 +- src/libserialize/json.rs | 2 +- src/libstd/collections/hash/bench.rs | 2 +- src/libstd/old_io/net/addrinfo.rs | 2 +- src/libstd/old_io/tempfile.rs | 2 +- src/libstd/sync/future.rs | 2 +- src/libstd/sys/windows/tty.rs | 2 +- src/libsyntax/ast_map/blocks.rs | 2 +- src/libsyntax/ext/concat_idents.rs | 2 +- src/libsyntax/ext/deriving/rand.rs | 2 +- src/libsyntax/parse/lexer/mod.rs | 2 +- src/libsyntax/parse/parser.rs | 2 +- src/libsyntax/util/parser_testing.rs | 4 ++-- src/libtest/lib.rs | 2 +- src/test/run-make/sepcomp-cci-copies/foo.rs | 2 +- src/test/run-pass/builtin-superkinds-in-metadata.rs | 2 +- src/test/run-pass/issue-3424.rs | 2 +- src/test/run-pass/overloaded-calls-zero-args.rs | 2 +- 72 files changed, 94 insertions(+), 94 deletions(-) (limited to 'src/libsyntax') diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index b5d16d29272..1607fd34c51 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -76,7 +76,7 @@ use core::prelude::*; use core::atomic; use core::atomic::Ordering::{Relaxed, Release, Acquire, SeqCst}; use core::fmt; -use core::cmp::{Ordering}; +use core::cmp::Ordering; use core::default::Default; use core::mem::{min_align_of, size_of}; use core::mem; diff --git a/src/libcollections/btree/map.rs b/src/libcollections/btree/map.rs index 04a692cc3ae..a4b7abde5c8 100644 --- a/src/libcollections/btree/map.rs +++ b/src/libcollections/btree/map.rs @@ -24,7 +24,7 @@ use core::default::Default; use core::fmt::Debug; use core::hash::{Hash, Hasher}; use core::iter::{Map, FromIterator, IntoIterator}; -use core::ops::{Index}; +use core::ops::Index; use core::{iter, fmt, mem, usize}; use Bound::{self, Included, Excluded, Unbounded}; diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index e71077c96c7..f6647fb27ee 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -52,7 +52,7 @@ use core::prelude::*; use alloc::boxed::Box; use alloc::heap::{EMPTY, allocate, reallocate, deallocate}; use core::cmp::max; -use core::cmp::{Ordering}; +use core::cmp::Ordering; use core::default::Default; use core::fmt; use core::hash::{self, Hash}; diff --git a/src/libcore/option.rs b/src/libcore/option.rs index a565b137cc8..3ffbb0b7539 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -148,7 +148,7 @@ use self::Option::*; use clone::Clone; use cmp::{Eq, Ord}; use default::Default; -use iter::{ExactSizeIterator}; +use iter::ExactSizeIterator; use iter::{Iterator, IteratorExt, DoubleEndedIterator, FromIterator, IntoIterator}; use mem; use ops::{Deref, FnOnce}; diff --git a/src/librand/distributions/range.rs b/src/librand/distributions/range.rs index a682fa85841..fab80b8425a 100644 --- a/src/librand/distributions/range.rs +++ b/src/librand/distributions/range.rs @@ -14,7 +14,7 @@ // this is surprisingly complicated to be both generic & correct -use core::prelude::{PartialOrd}; +use core::prelude::PartialOrd; use core::num::Int; use core::num::wrapping::WrappingOps; diff --git a/src/librustc/metadata/encoder.rs b/src/librustc/metadata/encoder.rs index fa8d0b2a56e..211b2568985 100644 --- a/src/librustc/metadata/encoder.rs +++ b/src/librustc/metadata/encoder.rs @@ -22,7 +22,7 @@ use metadata::cstore; use metadata::decoder; use metadata::tyencode; use middle::def; -use middle::ty::{lookup_item_type}; +use middle::ty::lookup_item_type; use middle::ty::{self, Ty}; use middle::stability; use util::nodemap::{FnvHashMap, NodeMap, NodeSet}; diff --git a/src/librustc/metadata/loader.rs b/src/librustc/metadata/loader.rs index 80fc3769453..35313080c39 100644 --- a/src/librustc/metadata/loader.rs +++ b/src/librustc/metadata/loader.rs @@ -212,7 +212,7 @@ //! no means all of the necessary details. Take a look at the rest of //! metadata::loader or metadata::creader for all the juicy details! -use back::archive::{METADATA_FILENAME}; +use back::archive::METADATA_FILENAME; use back::svh::Svh; use session::Session; use session::search_paths::PathKind; diff --git a/src/librustc/middle/astencode.rs b/src/librustc/middle/astencode.rs index 801350e8a1e..40e15ec67bb 100644 --- a/src/librustc/middle/astencode.rs +++ b/src/librustc/middle/astencode.rs @@ -50,7 +50,7 @@ use rbml::writer::Encoder; use rbml; use serialize; use serialize::{Decodable, Decoder, DecoderHelpers, Encodable}; -use serialize::{EncoderHelpers}; +use serialize::EncoderHelpers; #[cfg(test)] use std::io::Cursor; #[cfg(test)] use syntax::parse; diff --git a/src/librustc/middle/check_match.rs b/src/librustc/middle/check_match.rs index 97cd9456098..6923de7cad7 100644 --- a/src/librustc/middle/check_match.rs +++ b/src/librustc/middle/check_match.rs @@ -18,7 +18,7 @@ use middle::const_eval::{const_expr_to_pat, lookup_const_by_id}; use middle::def::*; use middle::expr_use_visitor::{ConsumeMode, Delegate, ExprUseVisitor, Init}; use middle::expr_use_visitor::{JustWrite, LoanCause, MutateMode}; -use middle::expr_use_visitor::{WriteAndRead}; +use middle::expr_use_visitor::WriteAndRead; use middle::expr_use_visitor as euv; use middle::mem_categorization::cmt; use middle::pat_util::*; diff --git a/src/librustc/middle/infer/bivariate.rs b/src/librustc/middle/infer/bivariate.rs index cedb30eebfd..17b0d788590 100644 --- a/src/librustc/middle/infer/bivariate.rs +++ b/src/librustc/middle/infer/bivariate.rs @@ -25,13 +25,13 @@ //! In particular, it might be enough to say (A,B) are bivariant for //! all (A,B). -use middle::ty::{BuiltinBounds}; +use middle::ty::BuiltinBounds; use middle::ty::{self, Ty}; use middle::ty::TyVar; use middle::infer::combine::*; -use middle::infer::{cres}; -use middle::infer::type_variable::{BiTo}; -use util::ppaux::{Repr}; +use middle::infer::cres; +use middle::infer::type_variable::BiTo; +use util::ppaux::Repr; pub struct Bivariate<'f, 'tcx: 'f> { fields: CombineFields<'f, 'tcx> diff --git a/src/librustc/middle/infer/combine.rs b/src/librustc/middle/infer/combine.rs index 930e95d1f93..9aa17b2b1d9 100644 --- a/src/librustc/middle/infer/combine.rs +++ b/src/librustc/middle/infer/combine.rs @@ -46,7 +46,7 @@ use middle::subst; use middle::subst::{ErasedRegions, NonerasedRegions, Substs}; use middle::ty::{FloatVar, FnSig, IntVar, TyVar}; use middle::ty::{IntType, UintType}; -use middle::ty::{BuiltinBounds}; +use middle::ty::BuiltinBounds; use middle::ty::{self, Ty}; use middle::ty_fold; use middle::ty_fold::{TypeFolder, TypeFoldable}; diff --git a/src/librustc/middle/infer/equate.rs b/src/librustc/middle/infer/equate.rs index c2b73bca858..59ed2dfd24f 100644 --- a/src/librustc/middle/infer/equate.rs +++ b/src/librustc/middle/infer/equate.rs @@ -11,10 +11,10 @@ use middle::ty::{self, Ty}; use middle::ty::TyVar; use middle::infer::combine::*; -use middle::infer::{cres}; -use middle::infer::{Subtype}; -use middle::infer::type_variable::{EqTo}; -use util::ppaux::{Repr}; +use middle::infer::cres; +use middle::infer::Subtype; +use middle::infer::type_variable::EqTo; +use util::ppaux::Repr; pub struct Equate<'f, 'tcx: 'f> { fields: CombineFields<'f, 'tcx> diff --git a/src/librustc/middle/infer/glb.rs b/src/librustc/middle/infer/glb.rs index e17155a2ae6..3b83d37f582 100644 --- a/src/librustc/middle/infer/glb.rs +++ b/src/librustc/middle/infer/glb.rs @@ -11,7 +11,7 @@ use super::combine::*; use super::lattice::*; use super::higher_ranked::HigherRankedRelations; -use super::{cres}; +use super::cres; use super::Subtype; use middle::ty::{self, Ty}; diff --git a/src/librustc/middle/infer/lattice.rs b/src/librustc/middle/infer/lattice.rs index 121e5405f26..9c764628c14 100644 --- a/src/librustc/middle/infer/lattice.rs +++ b/src/librustc/middle/infer/lattice.rs @@ -34,7 +34,7 @@ use super::combine::*; use super::glb::Glb; use super::lub::Lub; -use middle::ty::{TyVar}; +use middle::ty::TyVar; use middle::ty::{self, Ty}; use util::ppaux::Repr; diff --git a/src/librustc/middle/infer/lub.rs b/src/librustc/middle/infer/lub.rs index be814b2acc1..5000ab32ff6 100644 --- a/src/librustc/middle/infer/lub.rs +++ b/src/librustc/middle/infer/lub.rs @@ -11,8 +11,8 @@ use super::combine::*; use super::higher_ranked::HigherRankedRelations; use super::lattice::*; -use super::{cres}; -use super::{Subtype}; +use super::cres; +use super::Subtype; use middle::ty::{self, Ty}; use util::ppaux::Repr; diff --git a/src/librustc/middle/infer/mod.rs b/src/librustc/middle/infer/mod.rs index 8bd3ca826a6..2107d1ee4c4 100644 --- a/src/librustc/middle/infer/mod.rs +++ b/src/librustc/middle/infer/mod.rs @@ -28,14 +28,14 @@ use middle::ty::{TyVid, IntVid, FloatVid, RegionVid, UnconstrainedNumeric}; use middle::ty::replace_late_bound_regions; use middle::ty::{self, Ty}; use middle::ty_fold::{TypeFolder, TypeFoldable}; -use std::cell::{RefCell}; +use std::cell::RefCell; use std::fmt; use std::rc::Rc; use syntax::ast; use syntax::codemap; use syntax::codemap::Span; use util::nodemap::FnvHashMap; -use util::ppaux::{ty_to_string}; +use util::ppaux::ty_to_string; use util::ppaux::{Repr, UserString}; use self::combine::{Combine, Combineable, CombineFields}; diff --git a/src/librustc/middle/infer/sub.rs b/src/librustc/middle/infer/sub.rs index 423fb86dc5c..5d23fe3f134 100644 --- a/src/librustc/middle/infer/sub.rs +++ b/src/librustc/middle/infer/sub.rs @@ -9,14 +9,14 @@ // except according to those terms. use super::combine::*; -use super::{cres}; +use super::cres; use super::higher_ranked::HigherRankedRelations; -use super::{Subtype}; +use super::Subtype; use super::type_variable::{SubtypeOf, SupertypeOf}; use middle::ty::{self, Ty}; use middle::ty::TyVar; -use util::ppaux::{Repr}; +use util::ppaux::Repr; /// "Greatest lower bound" (common subtype) pub struct Sub<'f, 'tcx: 'f> { diff --git a/src/librustc/middle/mem_categorization.rs b/src/librustc/middle/mem_categorization.rs index bdcfc67f92b..ab894b236fe 100644 --- a/src/librustc/middle/mem_categorization.rs +++ b/src/librustc/middle/mem_categorization.rs @@ -75,7 +75,7 @@ use middle::check_const; use middle::def; use middle::region; use middle::ty::{self, Ty}; -use util::nodemap::{NodeMap}; +use util::nodemap::NodeMap; use util::ppaux::{Repr, UserString}; use syntax::ast::{MutImmutable, MutMutable}; diff --git a/src/librustc/middle/pat_util.rs b/src/librustc/middle/pat_util.rs index 4f365beed21..12b56562c84 100644 --- a/src/librustc/middle/pat_util.rs +++ b/src/librustc/middle/pat_util.rs @@ -13,7 +13,7 @@ use middle::ty; use util::nodemap::FnvHashMap; use syntax::ast; -use syntax::ast_util::{walk_pat}; +use syntax::ast_util::walk_pat; use syntax::codemap::{Span, DUMMY_SP}; pub type PatIdMap = FnvHashMap; diff --git a/src/librustc/middle/region.rs b/src/librustc/middle/region.rs index b4db3aba786..dbc879e59bc 100644 --- a/src/librustc/middle/region.rs +++ b/src/librustc/middle/region.rs @@ -25,7 +25,7 @@ use std::cell::RefCell; use syntax::codemap::{self, Span}; use syntax::{ast, visit}; use syntax::ast::{Block, Item, FnDecl, NodeId, Arm, Pat, Stmt, Expr, Local}; -use syntax::ast_util::{stmt_id}; +use syntax::ast_util::stmt_id; use syntax::ast_map; use syntax::ptr::P; use syntax::visit::{Visitor, FnKind}; diff --git a/src/librustc/middle/resolve_lifetime.rs b/src/librustc/middle/resolve_lifetime.rs index e33a2553431..a3d71c989bf 100644 --- a/src/librustc/middle/resolve_lifetime.rs +++ b/src/librustc/middle/resolve_lifetime.rs @@ -28,7 +28,7 @@ use syntax::ast; use syntax::codemap::Span; use syntax::parse::token::special_idents; use syntax::parse::token; -use syntax::print::pprust::{lifetime_to_string}; +use syntax::print::pprust::lifetime_to_string; use syntax::visit; use syntax::visit::Visitor; use util::nodemap::NodeMap; diff --git a/src/librustc/middle/traits/coherence.rs b/src/librustc/middle/traits/coherence.rs index 62b81f0ebe7..11d073ce72e 100644 --- a/src/librustc/middle/traits/coherence.rs +++ b/src/librustc/middle/traits/coherence.rs @@ -12,7 +12,7 @@ use super::Normalized; use super::SelectionContext; -use super::{ObligationCause}; +use super::ObligationCause; use super::PredicateObligation; use super::project; use super::util; diff --git a/src/librustc/middle/traits/fulfill.rs b/src/librustc/middle/traits/fulfill.rs index 3d46f93914a..f7ff256744e 100644 --- a/src/librustc/middle/traits/fulfill.rs +++ b/src/librustc/middle/traits/fulfill.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use middle::infer::{InferCtxt}; +use middle::infer::InferCtxt; use middle::ty::{self, RegionEscape, Ty}; use std::collections::HashSet; use std::default::Default; diff --git a/src/librustc/middle/traits/select.rs b/src/librustc/middle/traits/select.rs index 0d6a1f7df5e..20863664871 100644 --- a/src/librustc/middle/traits/select.rs +++ b/src/librustc/middle/traits/select.rs @@ -21,16 +21,16 @@ use super::DerivedObligationCause; use super::project; use super::project::{normalize_with_depth, Normalized}; use super::{PredicateObligation, TraitObligation, ObligationCause}; -use super::{report_overflow_error}; +use super::report_overflow_error; use super::{ObligationCauseCode, BuiltinDerivedObligation, ImplDerivedObligation}; use super::{SelectionError, Unimplemented, OutputTypeParameterMismatch}; -use super::{Selection}; -use super::{SelectionResult}; +use super::Selection; +use super::SelectionResult; use super::{VtableBuiltin, VtableImpl, VtableParam, VtableClosure, VtableFnPointer, VtableObject, VtableDefaultImpl}; use super::{VtableImplData, VtableObjectData, VtableBuiltinData, VtableDefaultImplData}; use super::object_safety; -use super::{util}; +use super::util; use middle::fast_reject; use middle::subst::{Subst, Substs, TypeSpace, VecPerParamSpace}; diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index 23fba5ead22..9eb3eb56fa4 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -64,7 +64,7 @@ use util::ppaux::ty_to_string; use util::ppaux::{Repr, UserString}; use util::common::{memoized, ErrorReported}; use util::nodemap::{NodeMap, NodeSet, DefIdMap, DefIdSet}; -use util::nodemap::{FnvHashMap}; +use util::nodemap::FnvHashMap; use arena::TypedArena; use std::borrow::{Borrow, Cow}; diff --git a/src/librustc/plugin/registry.rs b/src/librustc/plugin/registry.rs index 78f7b3b91dd..a73ed04ac0a 100644 --- a/src/librustc/plugin/registry.rs +++ b/src/librustc/plugin/registry.rs @@ -15,7 +15,7 @@ use session::Session; use syntax::ext::base::{SyntaxExtension, NamedSyntaxExtension, NormalTT}; use syntax::ext::base::{IdentTT, Decorator, Modifier, MultiModifier, MacroRulesTT}; -use syntax::ext::base::{MacroExpanderFn}; +use syntax::ext::base::MacroExpanderFn; use syntax::codemap::Span; use syntax::parse::token; use syntax::ptr::P; diff --git a/src/librustc/util/nodemap.rs b/src/librustc/util/nodemap.rs index 0f69aa941a3..61d28e0ca1e 100644 --- a/src/librustc/util/nodemap.rs +++ b/src/librustc/util/nodemap.rs @@ -12,7 +12,7 @@ #![allow(non_snake_case)] -use std::collections::hash_state::{DefaultState}; +use std::collections::hash_state::DefaultState; use std::collections::{HashMap, HashSet}; use std::default::Default; use std::hash::{Hasher, Hash}; diff --git a/src/librustc/util/ppaux.rs b/src/librustc/util/ppaux.rs index 60540a9cfa6..452589a2407 100644 --- a/src/librustc/util/ppaux.rs +++ b/src/librustc/util/ppaux.rs @@ -21,7 +21,7 @@ use middle::ty::{mt, Ty, ParamTy}; use middle::ty::{ty_bool, ty_char, ty_struct, ty_enum}; use middle::ty::{ty_err, ty_str, ty_vec, ty_float, ty_bare_fn}; use middle::ty::{ty_param, ty_ptr, ty_rptr, ty_tup}; -use middle::ty::{ty_closure}; +use middle::ty::ty_closure; use middle::ty::{ty_uniq, ty_trait, ty_int, ty_uint, ty_infer}; use middle::ty; use middle::ty_fold::TypeFoldable; diff --git a/src/librustc_borrowck/borrowck/fragments.rs b/src/librustc_borrowck/borrowck/fragments.rs index f3abcb4376c..a13d1d1112a 100644 --- a/src/librustc_borrowck/borrowck/fragments.rs +++ b/src/librustc_borrowck/borrowck/fragments.rs @@ -15,10 +15,10 @@ use self::Fragment::*; use borrowck::InteriorKind::{InteriorField, InteriorElement}; -use borrowck::{LoanPath}; +use borrowck::LoanPath; use borrowck::LoanPathKind::{LpVar, LpUpvar, LpDowncast, LpExtend}; use borrowck::LoanPathElem::{LpDeref, LpInterior}; -use borrowck::move_data::{InvalidMovePathIndex}; +use borrowck::move_data::InvalidMovePathIndex; use borrowck::move_data::{MoveData, MovePathIndex}; use rustc::middle::ty; use rustc::middle::mem_categorization as mc; diff --git a/src/librustc_borrowck/borrowck/gather_loans/mod.rs b/src/librustc_borrowck/borrowck/gather_loans/mod.rs index 7d77eb23b6e..bbdec402bdc 100644 --- a/src/librustc_borrowck/borrowck/gather_loans/mod.rs +++ b/src/librustc_borrowck/borrowck/gather_loans/mod.rs @@ -22,7 +22,7 @@ use rustc::middle::expr_use_visitor as euv; use rustc::middle::mem_categorization as mc; use rustc::middle::region; use rustc::middle::ty; -use rustc::util::ppaux::{Repr}; +use rustc::util::ppaux::Repr; use syntax::ast; use syntax::codemap::Span; use syntax::visit; diff --git a/src/librustc_borrowck/graphviz.rs b/src/librustc_borrowck/graphviz.rs index a2c9930c0ed..94c18d7d003 100644 --- a/src/librustc_borrowck/graphviz.rs +++ b/src/librustc_borrowck/graphviz.rs @@ -20,7 +20,7 @@ use rustc::middle::cfg::graphviz as cfg_dot; use borrowck; use borrowck::{BorrowckCtxt, LoanPath}; use dot; -use rustc::middle::cfg::{CFGIndex}; +use rustc::middle::cfg::CFGIndex; use rustc::middle::dataflow::{DataFlowOperator, DataFlowContext, EntryOrExit}; use rustc::middle::dataflow; use std::rc::Rc; diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index 4c654cbf27d..d4b4165d2f9 100644 --- a/src/librustc_driver/driver.rs +++ b/src/librustc_driver/driver.rs @@ -39,7 +39,7 @@ use std::path::{Path, PathBuf}; use syntax::ast; use syntax::ast_map; use syntax::attr; -use syntax::attr::{AttrMetaMethods}; +use syntax::attr::AttrMetaMethods; use syntax::diagnostics; use syntax::parse; use syntax::parse::token; diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index 8b57a48f3ce..12e6d122605 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -35,7 +35,7 @@ use middle::ty::{self, Ty}; use middle::{def, pat_util, stability}; use middle::const_eval::{eval_const_expr_partial, const_int, const_uint}; use middle::cfg; -use util::ppaux::{ty_to_string}; +use util::ppaux::ty_to_string; use util::nodemap::{FnvHashMap, NodeSet}; use lint::{Level, Context, LintPass, LintArray, Lint}; diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs index 2e7fe91365a..eb3589fa78b 100644 --- a/src/librustc_privacy/lib.rs +++ b/src/librustc_privacy/lib.rs @@ -43,7 +43,7 @@ use rustc::middle::privacy::{ExternalExports, ExportedItems, PublicItems}; use rustc::middle::ty::{MethodTypeParam, MethodStatic}; use rustc::middle::ty::{MethodCall, MethodMap, MethodOrigin, MethodParam}; use rustc::middle::ty::{MethodStaticClosure, MethodObject}; -use rustc::middle::ty::{MethodTraitObject}; +use rustc::middle::ty::MethodTraitObject; use rustc::middle::ty::{self, Ty}; use rustc::util::nodemap::{NodeMap, NodeSet}; diff --git a/src/librustc_resolve/build_reduced_graph.rs b/src/librustc_resolve/build_reduced_graph.rs index e62300098f6..5bff5479e2e 100644 --- a/src/librustc_resolve/build_reduced_graph.rs +++ b/src/librustc_resolve/build_reduced_graph.rs @@ -47,7 +47,7 @@ use syntax::ast::StructVariantKind; use syntax::ast::TupleVariantKind; use syntax::ast::UnnamedField; use syntax::ast::{Variant, ViewPathGlob, ViewPathList, ViewPathSimple}; -use syntax::ast::{Visibility}; +use syntax::ast::Visibility; use syntax::ast; use syntax::ast_util::local_def; use syntax::attr::AttrMetaMethods; diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 5bf561c218d..3508c6289ca 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -77,7 +77,7 @@ use syntax::ast::{TraitRef, Ty, TyBool, TyChar, TyF32}; use syntax::ast::{TyF64, TyFloat, TyIs, TyI8, TyI16, TyI32, TyI64, TyInt}; use syntax::ast::{TyPath, TyPtr}; use syntax::ast::{TyRptr, TyStr, TyUs, TyU8, TyU16, TyU32, TyU64, TyUint}; -use syntax::ast::{TypeImplItem}; +use syntax::ast::TypeImplItem; use syntax::ast; use syntax::ast_map; use syntax::ast_util::{local_def, walk_pat}; diff --git a/src/librustc_trans/trans/base.rs b/src/librustc_trans/trans/base.rs index 2f944e49b15..f842c011258 100644 --- a/src/librustc_trans/trans/base.rs +++ b/src/librustc_trans/trans/base.rs @@ -30,7 +30,7 @@ pub use self::ValueOrigin::*; use super::CrateTranslation; use super::ModuleTranslation; -use back::link::{mangle_exported_name}; +use back::link::mangle_exported_name; use back::{link, abi}; use lint; use llvm::{AttrHelper, BasicBlockRef, Linkage, ValueRef, Vector, get_param}; diff --git a/src/librustc_trans/trans/basic_block.rs b/src/librustc_trans/trans/basic_block.rs index f11c3154274..a0aca17538f 100644 --- a/src/librustc_trans/trans/basic_block.rs +++ b/src/librustc_trans/trans/basic_block.rs @@ -9,7 +9,7 @@ // except according to those terms. use llvm; -use llvm::{BasicBlockRef}; +use llvm::BasicBlockRef; use trans::value::{Users, Value}; use std::iter::{Filter, Map}; diff --git a/src/librustc_trans/trans/callee.rs b/src/librustc_trans/trans/callee.rs index e7911d5cc19..e33ec29017c 100644 --- a/src/librustc_trans/trans/callee.rs +++ b/src/librustc_trans/trans/callee.rs @@ -21,7 +21,7 @@ pub use self::CallArgs::*; use arena::TypedArena; use back::link; use session; -use llvm::{ValueRef}; +use llvm::ValueRef; use llvm::get_param; use llvm; use metadata::csearch; diff --git a/src/librustc_trans/trans/closure.rs b/src/librustc_trans/trans/closure.rs index 5a48b8e4bce..c1aade3663e 100644 --- a/src/librustc_trans/trans/closure.rs +++ b/src/librustc_trans/trans/closure.rs @@ -24,7 +24,7 @@ use trans::expr; use trans::monomorphize::{self, MonoId}; use trans::type_of::*; use middle::ty::{self, ClosureTyper}; -use middle::subst::{Substs}; +use middle::subst::Substs; use session::config::FullDebugInfo; use util::ppaux::Repr; diff --git a/src/librustc_trans/trans/context.rs b/src/librustc_trans/trans/context.rs index 6614d538971..ce96df3c29d 100644 --- a/src/librustc_trans/trans/context.rs +++ b/src/librustc_trans/trans/context.rs @@ -10,7 +10,7 @@ use llvm; use llvm::{ContextRef, ModuleRef, ValueRef, BuilderRef}; -use llvm::{TargetData}; +use llvm::TargetData; use llvm::mk_target_data; use metadata::common::LinkMeta; use middle::def::ExportMap; diff --git a/src/librustc_trans/trans/datum.rs b/src/librustc_trans/trans/datum.rs index 15738d1e61a..969c614cee0 100644 --- a/src/librustc_trans/trans/datum.rs +++ b/src/librustc_trans/trans/datum.rs @@ -113,7 +113,7 @@ use trans::expr; use trans::tvec; use trans::type_of; use middle::ty::{self, Ty}; -use util::ppaux::{ty_to_string}; +use util::ppaux::ty_to_string; use std::fmt; use syntax::ast; diff --git a/src/librustc_trans/trans/expr.rs b/src/librustc_trans/trans/expr.rs index ba8de6da42f..17b4b536df5 100644 --- a/src/librustc_trans/trans/expr.rs +++ b/src/librustc_trans/trans/expr.rs @@ -73,7 +73,7 @@ use trans::tvec; use trans::type_of; use middle::ty::{struct_fields, tup_fields}; use middle::ty::{AdjustDerefRef, AdjustReifyFnPointer, AdjustUnsafeFnPointer, AutoUnsafe}; -use middle::ty::{AutoPtr}; +use middle::ty::AutoPtr; use middle::ty::{self, Ty}; use middle::ty::MethodCall; use util::common::indenter; diff --git a/src/librustc_trans/trans/foreign.rs b/src/librustc_trans/trans/foreign.rs index dfc7e7f604f..e87a5865df0 100644 --- a/src/librustc_trans/trans/foreign.rs +++ b/src/librustc_trans/trans/foreign.rs @@ -9,7 +9,7 @@ // except according to those terms. -use back::{link}; +use back::link; use llvm::{ValueRef, CallConv, get_param}; use llvm; use middle::weak_lang_items; @@ -35,7 +35,7 @@ use syntax::abi::{RustIntrinsic, Rust, RustCall, Stdcall, Fastcall, System}; use syntax::codemap::Span; use syntax::parse::token::{InternedString, special_idents}; use syntax::parse::token; -use syntax::{ast}; +use syntax::ast; use syntax::{attr, ast_map}; use syntax::print::pprust; use util::ppaux::Repr; diff --git a/src/librustc_trans/trans/tvec.rs b/src/librustc_trans/trans/tvec.rs index 6a35a1a55b6..dec5263484d 100644 --- a/src/librustc_trans/trans/tvec.rs +++ b/src/librustc_trans/trans/tvec.rs @@ -12,7 +12,7 @@ use back::abi; use llvm; -use llvm::{ValueRef}; +use llvm::ValueRef; use trans::base::*; use trans::base; use trans::build::*; diff --git a/src/librustc_typeck/check/_match.rs b/src/librustc_typeck/check/_match.rs index e8da19efa06..8f1a67723cb 100644 --- a/src/librustc_typeck/check/_match.rs +++ b/src/librustc_typeck/check/_match.rs @@ -12,7 +12,7 @@ use middle::const_eval; use middle::def; use middle::infer; use middle::pat_util::{PatIdMap, pat_id_map, pat_is_binding, pat_is_const}; -use middle::subst::{Substs}; +use middle::subst::Substs; use middle::ty::{self, Ty}; use check::{check_expr, check_expr_has_type, check_expr_with_expectation}; use check::{check_expr_coercable_to_type, demand, FnCtxt, Expectation}; diff --git a/src/librustc_typeck/check/compare_method.rs b/src/librustc_typeck/check/compare_method.rs index 1e1d7e09260..1c5f2c56078 100644 --- a/src/librustc_typeck/check/compare_method.rs +++ b/src/librustc_typeck/check/compare_method.rs @@ -15,7 +15,7 @@ use middle::subst::{self, Subst, Substs, VecPerParamSpace}; use util::ppaux::{self, Repr}; use syntax::ast; -use syntax::codemap::{Span}; +use syntax::codemap::Span; use syntax::parse::token; use super::assoc; diff --git a/src/librustc_typeck/check/implicator.rs b/src/librustc_typeck/check/implicator.rs index 6b4a7761d0a..a4a18c7cfde 100644 --- a/src/librustc_typeck/check/implicator.rs +++ b/src/librustc_typeck/check/implicator.rs @@ -12,7 +12,7 @@ use astconv::object_region_bounds; use middle::infer::{InferCtxt, GenericKind}; -use middle::subst::{Substs}; +use middle::subst::Substs; use middle::traits; use middle::ty::{self, ToPolyTraitRef, Ty}; use middle::ty_fold::{TypeFoldable, TypeFolder}; diff --git a/src/librustc_typeck/check/method/mod.rs b/src/librustc_typeck/check/method/mod.rs index 7ef2db2c28d..ff0413f1765 100644 --- a/src/librustc_typeck/check/method/mod.rs +++ b/src/librustc_typeck/check/method/mod.rs @@ -11,7 +11,7 @@ //! Method lookup: the secret sauce of Rust. See `README.md`. use astconv::AstConv; -use check::{FnCtxt}; +use check::FnCtxt; use check::vtable; use check::vtable::select_new_fcx_obligations; use middle::def; @@ -24,7 +24,7 @@ use middle::infer; use util::ppaux::Repr; use std::rc::Rc; -use syntax::ast::{DefId}; +use syntax::ast::DefId; use syntax::ast; use syntax::codemap::Span; diff --git a/src/librustc_typeck/check/method/probe.rs b/src/librustc_typeck/check/method/probe.rs index b95e0ce8cb3..d7fd36a6f8d 100644 --- a/src/librustc_typeck/check/method/probe.rs +++ b/src/librustc_typeck/check/method/probe.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use super::{MethodError}; +use super::MethodError; use super::MethodIndex; use super::{CandidateSource,ImplSource,TraitSource}; use super::suggest; diff --git a/src/librustc_typeck/check/vtable.rs b/src/librustc_typeck/check/vtable.rs index 2858dc9b569..40295954cf6 100644 --- a/src/librustc_typeck/check/vtable.rs +++ b/src/librustc_typeck/check/vtable.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use check::{FnCtxt}; +use check::FnCtxt; use middle::traits::{self, ObjectSafetyViolation, MethodViolationCode}; use middle::traits::{Obligation, ObligationCause}; use middle::traits::report_fulfillment_errors; diff --git a/src/librustc_typeck/check/wf.rs b/src/librustc_typeck/check/wf.rs index adbf4c6b210..6f1747a7d09 100644 --- a/src/librustc_typeck/check/wf.rs +++ b/src/librustc_typeck/check/wf.rs @@ -22,7 +22,7 @@ use util::ppaux::{Repr, UserString}; use std::collections::HashSet; use syntax::ast; -use syntax::ast_util::{local_def}; +use syntax::ast_util::local_def; use syntax::attr; use syntax::codemap::Span; use syntax::parse::token::{self, special_idents}; diff --git a/src/librustc_typeck/coherence/mod.rs b/src/librustc_typeck/coherence/mod.rs index ffd99ff2eec..eaf07a3ef13 100644 --- a/src/librustc_typeck/coherence/mod.rs +++ b/src/librustc_typeck/coherence/mod.rs @@ -27,13 +27,13 @@ use middle::ty::{ty_param, TypeScheme, ty_ptr}; use middle::ty::{ty_rptr, ty_struct, ty_trait, ty_tup}; use middle::ty::{ty_str, ty_vec, ty_float, ty_infer, ty_int}; use middle::ty::{ty_uint, ty_closure, ty_uniq, ty_bare_fn}; -use middle::ty::{ty_projection}; +use middle::ty::ty_projection; use middle::ty; use CrateCtxt; use middle::infer::combine::Combine; use middle::infer::InferCtxt; -use middle::infer::{new_infer_ctxt}; -use std::collections::{HashSet}; +use middle::infer::new_infer_ctxt; +use std::collections::HashSet; use std::cell::RefCell; use std::rc::Rc; use syntax::ast::{Crate, DefId}; @@ -42,8 +42,8 @@ use syntax::ast::{LOCAL_CRATE, TraitRef}; use syntax::ast; use syntax::ast_map::NodeItem; use syntax::ast_map; -use syntax::ast_util::{local_def}; -use syntax::codemap::{Span}; +use syntax::ast_util::local_def; +use syntax::codemap::Span; use syntax::parse::token; use syntax::visit; use util::nodemap::{DefIdMap, FnvHashMap}; diff --git a/src/librustc_typeck/coherence/overlap.rs b/src/librustc_typeck/coherence/overlap.rs index 466d00b348b..f8ca51b9e49 100644 --- a/src/librustc_typeck/coherence/overlap.rs +++ b/src/librustc_typeck/coherence/overlap.rs @@ -14,8 +14,8 @@ use middle::traits; use middle::ty; use middle::infer::{self, new_infer_ctxt}; -use syntax::ast::{DefId}; -use syntax::ast::{LOCAL_CRATE}; +use syntax::ast::DefId; +use syntax::ast::LOCAL_CRATE; use syntax::ast; use syntax::ast_util; use syntax::visit; diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index 5816fe58bc9..6257e645fb7 100644 --- a/src/librustc_typeck/collect.rs +++ b/src/librustc_typeck/collect.rs @@ -91,7 +91,7 @@ use syntax::ast; use syntax::ast_map; use syntax::ast_util::local_def; use syntax::codemap::Span; -use syntax::parse::token::{special_idents}; +use syntax::parse::token::special_idents; use syntax::parse::token; use syntax::ptr::P; use syntax::visit; diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs index 0d6ed91d529..5f2101a4790 100644 --- a/src/libserialize/json.rs +++ b/src/libserialize/json.rs @@ -202,7 +202,7 @@ use self::InternalStackElement::*; use std::collections::{HashMap, BTreeMap}; use std::io::prelude::*; use std::io; -use std::mem::{swap}; +use std::mem::swap; use std::num::FpCategory as Fp; use std::ops::Index; use std::str::FromStr; diff --git a/src/libstd/collections/hash/bench.rs b/src/libstd/collections/hash/bench.rs index ca506e8c36f..ac21ae0f0aa 100644 --- a/src/libstd/collections/hash/bench.rs +++ b/src/libstd/collections/hash/bench.rs @@ -14,7 +14,7 @@ extern crate test; use prelude::v1::*; use self::test::Bencher; -use iter::{range_inclusive}; +use iter::range_inclusive; #[bench] fn new_drop(b : &mut Bencher) { diff --git a/src/libstd/old_io/net/addrinfo.rs b/src/libstd/old_io/net/addrinfo.rs index 2b7506b5c34..7c362b5a044 100644 --- a/src/libstd/old_io/net/addrinfo.rs +++ b/src/libstd/old_io/net/addrinfo.rs @@ -20,7 +20,7 @@ pub use self::Flag::*; pub use self::Protocol::*; use iter::IteratorExt; -use old_io::{IoResult}; +use old_io::IoResult; use old_io::net::ip::{SocketAddr, IpAddr}; use option::Option; use option::Option::{Some, None}; diff --git a/src/libstd/old_io/tempfile.rs b/src/libstd/old_io/tempfile.rs index c0f6ddaaef7..eebe28e045e 100644 --- a/src/libstd/old_io/tempfile.rs +++ b/src/libstd/old_io/tempfile.rs @@ -12,7 +12,7 @@ #![allow(deprecated)] // rand use env; -use iter::{IteratorExt}; +use iter::IteratorExt; use old_io::{fs, IoError, IoErrorKind, IoResult}; use old_io; use ops::Drop; diff --git a/src/libstd/sync/future.rs b/src/libstd/sync/future.rs index 3c7fecb7515..b2afe28fed4 100644 --- a/src/libstd/sync/future.rs +++ b/src/libstd/sync/future.rs @@ -38,7 +38,7 @@ use core::mem::replace; use self::FutureState::*; use sync::mpsc::{Receiver, channel}; -use thunk::{Thunk}; +use thunk::Thunk; use thread; /// A type encapsulating the result of a computation which may not be complete diff --git a/src/libstd/sys/windows/tty.rs b/src/libstd/sys/windows/tty.rs index 52f4cce4aa3..6b999f466cf 100644 --- a/src/libstd/sys/windows/tty.rs +++ b/src/libstd/sys/windows/tty.rs @@ -42,7 +42,7 @@ use super::c::{ENABLE_INSERT_MODE, ENABLE_LINE_INPUT}; use super::c::{ENABLE_PROCESSED_INPUT, ENABLE_QUICK_EDIT_MODE}; use super::c::CONSOLE_SCREEN_BUFFER_INFO; use super::c::{ReadConsoleW, WriteConsoleW, GetConsoleMode, SetConsoleMode}; -use super::c::{GetConsoleScreenBufferInfo}; +use super::c::GetConsoleScreenBufferInfo; fn invalid_encoding() -> IoError { IoError { diff --git a/src/libsyntax/ast_map/blocks.rs b/src/libsyntax/ast_map/blocks.rs index 16a339cdcb5..1994ca70bbb 100644 --- a/src/libsyntax/ast_map/blocks.rs +++ b/src/libsyntax/ast_map/blocks.rs @@ -26,7 +26,7 @@ pub use self::Code::*; use abi; use ast::{Block, FnDecl, NodeId}; use ast; -use ast_map::{Node}; +use ast_map::Node; use ast_map; use codemap::Span; use visit; diff --git a/src/libsyntax/ext/concat_idents.rs b/src/libsyntax/ext/concat_idents.rs index e350ce61017..5d07c36c929 100644 --- a/src/libsyntax/ext/concat_idents.rs +++ b/src/libsyntax/ext/concat_idents.rs @@ -14,7 +14,7 @@ use ext::base::*; use ext::base; use feature_gate; use parse::token; -use parse::token::{str_to_ident}; +use parse::token::str_to_ident; use ptr::P; pub fn expand_syntax_ext<'cx>(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) diff --git a/src/libsyntax/ext/deriving/rand.rs b/src/libsyntax/ext/deriving/rand.rs index 8a764fded6f..631e5f979d9 100644 --- a/src/libsyntax/ext/deriving/rand.rs +++ b/src/libsyntax/ext/deriving/rand.rs @@ -12,7 +12,7 @@ use ast; use ast::{MetaItem, Item, Expr}; use codemap::Span; use ext::base::ExtCtxt; -use ext::build::{AstBuilder}; +use ext::build::AstBuilder; use ext::deriving::generic::*; use ext::deriving::generic::ty::*; use ptr::P; diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index 0843713681b..51d5fa531d5 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -14,7 +14,7 @@ use codemap; use diagnostic::SpanHandler; use ext::tt::transcribe::tt_next_token; use parse::token; -use parse::token::{str_to_ident}; +use parse::token::str_to_ident; use std::borrow::{IntoCow, Cow}; use std::char; diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 786970ce252..c1369d7c2e6 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -11,7 +11,7 @@ pub use self::PathParsingMode::*; use abi; -use ast::{BareFnTy}; +use ast::BareFnTy; use ast::{RegionTyParamBound, TraitTyParamBound, TraitBoundModifier}; use ast::{Public, Unsafety}; use ast::{Mod, BiAdd, Arg, Arm, Attribute, BindByRef, BindByValue}; diff --git a/src/libsyntax/util/parser_testing.rs b/src/libsyntax/util/parser_testing.rs index 9b570c2b1fe..ec608646327 100644 --- a/src/libsyntax/util/parser_testing.rs +++ b/src/libsyntax/util/parser_testing.rs @@ -9,9 +9,9 @@ // except according to those terms. use ast; -use parse::{new_parse_sess}; +use parse::new_parse_sess; use parse::{ParseSess,string_to_filemap,filemap_to_tts}; -use parse::{new_parser_from_source_str}; +use parse::new_parser_from_source_str; use parse::parser::Parser; use parse::token; use ptr::P; diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index c48c7e413d0..5372b2041bc 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -78,7 +78,7 @@ use std::io::prelude::*; use std::io; use std::iter::repeat; use std::num::{Float, Int}; -use std::path::{PathBuf}; +use std::path::PathBuf; use std::sync::mpsc::{channel, Sender}; use std::sync::{Arc, Mutex}; use std::thread; diff --git a/src/test/run-make/sepcomp-cci-copies/foo.rs b/src/test/run-make/sepcomp-cci-copies/foo.rs index b0642b64cda..474ae8d8bb9 100644 --- a/src/test/run-make/sepcomp-cci-copies/foo.rs +++ b/src/test/run-make/sepcomp-cci-copies/foo.rs @@ -9,7 +9,7 @@ // except according to those terms. extern crate cci_lib; -use cci_lib::{cci_fn}; +use cci_lib::cci_fn; fn call1() -> uint { cci_fn() diff --git a/src/test/run-pass/builtin-superkinds-in-metadata.rs b/src/test/run-pass/builtin-superkinds-in-metadata.rs index e38a7bac67a..717348652ed 100644 --- a/src/test/run-pass/builtin-superkinds-in-metadata.rs +++ b/src/test/run-pass/builtin-superkinds-in-metadata.rs @@ -17,7 +17,7 @@ extern crate trait_superkinds_in_metadata; use trait_superkinds_in_metadata::{RequiresRequiresShareAndSend, RequiresShare}; -use trait_superkinds_in_metadata::{RequiresCopy}; +use trait_superkinds_in_metadata::RequiresCopy; use std::marker; #[derive(Copy)] diff --git a/src/test/run-pass/issue-3424.rs b/src/test/run-pass/issue-3424.rs index ecce97a3013..29d963bb704 100644 --- a/src/test/run-pass/issue-3424.rs +++ b/src/test/run-pass/issue-3424.rs @@ -13,7 +13,7 @@ #![allow(unknown_features)] #![feature(unboxed_closures, old_path, std_misc)] -use std::old_path::{Path}; +use std::old_path::Path; use std::old_path; use std::result; use std::thunk::Thunk; diff --git a/src/test/run-pass/overloaded-calls-zero-args.rs b/src/test/run-pass/overloaded-calls-zero-args.rs index 110109018db..8df4adf6713 100644 --- a/src/test/run-pass/overloaded-calls-zero-args.rs +++ b/src/test/run-pass/overloaded-calls-zero-args.rs @@ -12,7 +12,7 @@ #![feature(unboxed_closures, core)] -use std::ops::{FnMut}; +use std::ops::FnMut; struct S { x: i32, -- cgit 1.4.1-3-g733a5 From 64c48f390ccd6410c02e96968a2cff187eeaf442 Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Mon, 27 Oct 2014 12:57:14 +0100 Subject: Port of pcwalton removal of `#[unsafe_destructor]` check. Earlier commits impose rules on lifetimes that make generic destructors safe; thus we no longer need the `#[unsafe_destructor]` attribute nor its associated check. ---- So remove the check for the unsafe_destructor attribute. And remove outdated compile-fail tests from when lifetime-parameteric dtors were disallowed/unsafe. In addition, when one uses the attribute without the associated feature, report that the attribute is deprecated. However, I do not think this is a breaking-change, because the attribute and feature are still currently accepted by the compiler. (After the next snapshot that has this commit, we can remove the feature itself and the attribute as well.) ---- I consider this to: Fix #22196 (techincally there is still the post snapshot work of removing the last remants of the feature and the attribute, but the ticket can still be closed in my opinion). --- src/librustc_typeck/check/wf.rs | 36 ---------------------- src/libsyntax/feature_gate.rs | 18 ++++------- src/test/compile-fail/gated-unsafe-destructor.rs | 8 +++-- src/test/compile-fail/issue-13853-3.rs | 36 ---------------------- src/test/compile-fail/issue-13853-4.rs | 21 ------------- src/test/compile-fail/issue-16465.rs | 24 --------------- src/test/compile-fail/kindck-destructor-owned.rs | 31 ------------------- .../compile-fail/unsafe-destructor-check-crash.rs | 23 -------------- 8 files changed, 12 insertions(+), 185 deletions(-) delete mode 100644 src/test/compile-fail/issue-13853-3.rs delete mode 100644 src/test/compile-fail/issue-13853-4.rs delete mode 100644 src/test/compile-fail/issue-16465.rs delete mode 100644 src/test/compile-fail/kindck-destructor-owned.rs delete mode 100644 src/test/compile-fail/unsafe-destructor-check-crash.rs (limited to 'src/libsyntax') diff --git a/src/librustc_typeck/check/wf.rs b/src/librustc_typeck/check/wf.rs index 16da3237c81..23e31df5395 100644 --- a/src/librustc_typeck/check/wf.rs +++ b/src/librustc_typeck/check/wf.rs @@ -23,7 +23,6 @@ use util::ppaux::{Repr, UserString}; use std::collections::HashSet; use syntax::ast; use syntax::ast_util::local_def; -use syntax::attr; use syntax::codemap::Span; use syntax::parse::token::{self, special_idents}; use syntax::visit; @@ -250,22 +249,6 @@ impl<'ccx, 'tcx> CheckTypeWellFormedVisitor<'ccx, 'tcx> { &fcx.inh.param_env.free_substs, &trait_ref); - // There are special rules that apply to drop. - if - fcx.tcx().lang_items.drop_trait() == Some(trait_ref.def_id) && - !attr::contains_name(&item.attrs, "unsafe_destructor") - { - match self_ty.sty { - ty::ty_struct(def_id, _) | - ty::ty_enum(def_id, _) => { - check_struct_safe_for_destructor(fcx, item.span, def_id); - } - _ => { - // Coherence already reports an error in this case. - } - } - } - if fcx.tcx().lang_items.copy_trait() == Some(trait_ref.def_id) { // This is checked in coherence. return @@ -761,22 +744,3 @@ fn filter_to_trait_obligations<'tcx>(bounds: ty::InstantiatedPredicates<'tcx>) } result } - -/////////////////////////////////////////////////////////////////////////// -// Special drop trait checking - -fn check_struct_safe_for_destructor<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>, - span: Span, - struct_did: ast::DefId) { - let struct_tpt = ty::lookup_item_type(fcx.tcx(), struct_did); - if struct_tpt.generics.has_type_params(subst::TypeSpace) - || struct_tpt.generics.has_region_params(subst::TypeSpace) - { - span_err!(fcx.tcx().sess, span, E0141, - "cannot implement a destructor on a structure \ - with type parameters"); - span_note!(fcx.tcx().sess, span, - "use \"#[unsafe_destructor]\" on the implementation \ - to force the compiler to allow this"); - } -} diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index c6e6e749860..1b03a180720 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -58,7 +58,6 @@ const KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[ ("log_syntax", "1.0.0", Active), ("trace_macros", "1.0.0", Active), ("concat_idents", "1.0.0", Active), - ("unsafe_destructor", "1.0.0", Active), ("intrinsics", "1.0.0", Active), ("lang_items", "1.0.0", Active), @@ -92,6 +91,10 @@ const KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[ ("start", "1.0.0", Active), ("main", "1.0.0", Active), + // Deprecate after snapshot + // SNAP a923278 + ("unsafe_destructor", "1.0.0", Active), + // A temporary feature gate used to enable parser extensions needed // to bootstrap fix for #5723. ("issue_5723_bootstrap", "1.0.0", Accepted), @@ -193,7 +196,6 @@ pub const KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType)] = &[ ("repr", Normal), ("path", Normal), ("abi", Normal), - ("unsafe_destructor", Normal), ("automatically_derived", Normal), ("no_mangle", Normal), ("no_link", Normal), @@ -205,7 +207,8 @@ pub const KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType)] = &[ ("link_args", Normal), ("macro_escape", Normal), - + ("unsafe_destructor", Gated("unsafe_destructor", + "`#[unsafe_destructor]` does nothing anymore")), ("staged_api", Gated("staged_api", "staged_api is for use by rustc only")), ("plugin", Gated("plugin", @@ -571,15 +574,6 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> { _ => {} } - if attr::contains_name(&i.attrs, - "unsafe_destructor") { - self.gate_feature("unsafe_destructor", - i.span, - "`#[unsafe_destructor]` allows too \ - many unsafe patterns and may be \ - removed in the future"); - } - if attr::contains_name(&i.attrs[..], "old_orphan_check") { self.gate_feature( diff --git a/src/test/compile-fail/gated-unsafe-destructor.rs b/src/test/compile-fail/gated-unsafe-destructor.rs index 6024fef9fb8..2aebbf3d54b 100644 --- a/src/test/compile-fail/gated-unsafe-destructor.rs +++ b/src/test/compile-fail/gated-unsafe-destructor.rs @@ -10,14 +10,18 @@ // Test that `#[unsafe_destructor]` attribute is gated by `unsafe_destructor` // feature gate. +// +// (This test can be removed entirely when we remove the +// `unsafe_destructor` feature itself.) struct D<'a>(&'a u32); #[unsafe_destructor] +//~^ ERROR `#[unsafe_destructor]` does nothing anymore +//~| HELP: add #![feature(unsafe_destructor)] to the crate attributes to enable +// (but of couse there is no point in doing so) impl<'a> Drop for D<'a> { - //~^ ERROR `#[unsafe_destructor]` allows too many unsafe patterns fn drop(&mut self) { } } -//~^ HELP: add #![feature(unsafe_destructor)] to the crate attributes to enable pub fn main() { } diff --git a/src/test/compile-fail/issue-13853-3.rs b/src/test/compile-fail/issue-13853-3.rs deleted file mode 100644 index 7ca158c3e32..00000000000 --- a/src/test/compile-fail/issue-13853-3.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![crate_type = "lib"] - -use std::marker::PhantomData; - -enum NodeContents<'a> { - Children(Vec>), -} - -impl<'a> Drop for NodeContents<'a> { - //~^ ERROR cannot implement a destructor on a structure with type parameters - fn drop( &mut self ) { - } -} - -struct Node<'a> { - contents: NodeContents<'a>, - marker: PhantomData<&'a ()>, -} - -impl<'a> Node<'a> { - fn noName(contents: NodeContents<'a>) -> Node<'a> { - Node { contents: contents, marker: PhantomData } - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-13853-4.rs b/src/test/compile-fail/issue-13853-4.rs deleted file mode 100644 index b0db9e58dba..00000000000 --- a/src/test/compile-fail/issue-13853-4.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -struct AutoBuilder<'a> { - context: &'a isize -} - -impl<'a> Drop for AutoBuilder<'a> { - //~^ ERROR cannot implement a destructor on a structure with type parameters - fn drop(&mut self) { - } -} - -fn main() {} diff --git a/src/test/compile-fail/issue-16465.rs b/src/test/compile-fail/issue-16465.rs deleted file mode 100644 index 825b40cb322..00000000000 --- a/src/test/compile-fail/issue-16465.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Used to cause an ICE - -struct Foo{ - x : T -} - -type FooInt = Foo; - -impl Drop for FooInt { -//~^ ERROR cannot implement a destructor on a structure with type parameters - fn drop(&mut self){} -} - -fn main() {} diff --git a/src/test/compile-fail/kindck-destructor-owned.rs b/src/test/compile-fail/kindck-destructor-owned.rs deleted file mode 100644 index 7f3704144be..00000000000 --- a/src/test/compile-fail/kindck-destructor-owned.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - - -struct Bar<'a> { - f: &'a isize, -} - -impl<'a> Drop for Bar<'a> { -//~^ ERROR E0141 - fn drop(&mut self) { - } -} - -struct Baz { - f: &'static isize, -} - -impl Drop for Baz { - fn drop(&mut self) { - } -} - -fn main() { } diff --git a/src/test/compile-fail/unsafe-destructor-check-crash.rs b/src/test/compile-fail/unsafe-destructor-check-crash.rs deleted file mode 100644 index af675587728..00000000000 --- a/src/test/compile-fail/unsafe-destructor-check-crash.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - - - -// Regression test for issue #15557 - -#![allow(dead_code)] -struct AReg1<'a>(&'a u32); - -impl<'a> Drop for AReg1<'a> { -//~^ ERROR: cannot implement a destructor on a structure with type parameters - fn drop(&mut self) {} -} - -fn main() {} -- cgit 1.4.1-3-g733a5