diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index cf293ded13f..5d351adfca0 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -78,12 +78,12 @@ //! use std::cell::RefCell; //! //! struct Graph { -//! edges: Vec<(uint, uint)>, -//! span_tree_cache: RefCell>> +//! edges: Vec<(i32, i32)>, +//! span_tree_cache: RefCell>> //! } //! //! impl Graph { -//! fn minimum_spanning_tree(&self) -> Vec<(uint, uint)> { +//! fn minimum_spanning_tree(&self) -> Vec<(i32, i32)> { //! // Create a new scope to contain the lifetime of the //! // dynamic borrow //! { @@ -104,7 +104,7 @@ //! // This is the major hazard of using `RefCell`. //! self.minimum_spanning_tree() //! } -//! # fn calc_span_tree(&self) -> Vec<(uint, uint)> { vec![] } +//! # fn calc_span_tree(&self) -> Vec<(i32, i32)> { vec![] } //! } //! ``` //! @@ -125,7 +125,7 @@ //! //! struct RcBox { //! value: T, -//! refcount: Cell +//! refcount: Cell //! } //! //! impl Clone for Rc { @@ -279,8 +279,8 @@ pub enum BorrowState { } // Values [1, MAX-1] represent the number of `Ref` active -// (will not outgrow its range since `uint` is the size of the address space) -type BorrowFlag = uint; +// (will not outgrow its range since `usize` is the size of the address space) +type BorrowFlag = usize; const UNUSED: BorrowFlag = 0; const WRITING: BorrowFlag = -1; diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs index 51bf3c1648f..740997b7a24 100644 --- a/src/libcore/mem.rs +++ b/src/libcore/mem.rs @@ -43,7 +43,7 @@ pub use intrinsics::forget; /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] -pub fn size_of() -> uint { +pub fn size_of() -> usize { unsafe { intrinsics::size_of::() } } @@ -58,7 +58,7 @@ pub fn size_of() -> uint { /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] -pub fn size_of_val(_val: &T) -> uint { +pub fn size_of_val(_val: &T) -> usize { size_of::() } @@ -75,7 +75,7 @@ pub fn size_of_val(_val: &T) -> uint { /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] -pub fn min_align_of() -> uint { +pub fn min_align_of() -> usize { unsafe { intrinsics::min_align_of::() } } @@ -90,7 +90,7 @@ pub fn min_align_of() -> uint { /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] -pub fn min_align_of_val(_val: &T) -> uint { +pub fn min_align_of_val(_val: &T) -> usize { min_align_of::() } @@ -108,7 +108,7 @@ pub fn min_align_of_val(_val: &T) -> uint { /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] -pub fn align_of() -> uint { +pub fn align_of() -> usize { // We use the preferred alignment as the default alignment for a type. This // appears to be what clang migrated towards as well: // @@ -130,7 +130,7 @@ pub fn align_of() -> uint { /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] -pub fn align_of_val(_val: &T) -> uint { +pub fn align_of_val(_val: &T) -> usize { align_of::() } @@ -150,7 +150,7 @@ pub fn align_of_val(_val: &T) -> uint { /// ``` /// use std::mem; /// -/// let x: int = unsafe { mem::zeroed() }; +/// let x: i32 = unsafe { mem::zeroed() }; /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] @@ -171,7 +171,7 @@ pub unsafe fn zeroed() -> T { /// ``` /// use std::mem; /// -/// let x: int = unsafe { mem::uninitialized() }; +/// let x: i32 = unsafe { mem::uninitialized() }; /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] diff --git a/src/libcore/nonzero.rs b/src/libcore/nonzero.rs index 3f83302742c..5644f763069 100644 --- a/src/libcore/nonzero.rs +++ b/src/libcore/nonzero.rs @@ -19,8 +19,8 @@ pub unsafe trait Zeroable {} unsafe impl Zeroable for *const T {} unsafe impl Zeroable for *mut T {} unsafe impl Zeroable for Unique { } -unsafe impl Zeroable for int {} -unsafe impl Zeroable for uint {} +unsafe impl Zeroable for isize {} +unsafe impl Zeroable for usize {} unsafe impl Zeroable for i8 {} unsafe impl Zeroable for u8 {} unsafe impl Zeroable for i16 {}