Skip to content

Commit c0865df

Browse files
committed
Rollup merge of rust-lang#22401 - pnkfelix:fsk-int-uint-audit, r=Gankro
cc rust-lang#22240
2 parents 071f8cc + 480ea5a commit c0865df

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

src/libcore/cell.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@
7878
//! use std::cell::RefCell;
7979
//!
8080
//! struct Graph {
81-
//! edges: Vec<(uint, uint)>,
82-
//! span_tree_cache: RefCell<Option<Vec<(uint, uint)>>>
81+
//! edges: Vec<(i32, i32)>,
82+
//! span_tree_cache: RefCell<Option<Vec<(i32, i32)>>>
8383
//! }
8484
//!
8585
//! impl Graph {
86-
//! fn minimum_spanning_tree(&self) -> Vec<(uint, uint)> {
86+
//! fn minimum_spanning_tree(&self) -> Vec<(i32, i32)> {
8787
//! // Create a new scope to contain the lifetime of the
8888
//! // dynamic borrow
8989
//! {
@@ -104,7 +104,7 @@
104104
//! // This is the major hazard of using `RefCell`.
105105
//! self.minimum_spanning_tree()
106106
//! }
107-
//! # fn calc_span_tree(&self) -> Vec<(uint, uint)> { vec![] }
107+
//! # fn calc_span_tree(&self) -> Vec<(i32, i32)> { vec![] }
108108
//! }
109109
//! ```
110110
//!
@@ -125,7 +125,7 @@
125125
//!
126126
//! struct RcBox<T> {
127127
//! value: T,
128-
//! refcount: Cell<uint>
128+
//! refcount: Cell<usize>
129129
//! }
130130
//!
131131
//! impl<T> Clone for Rc<T> {
@@ -279,8 +279,8 @@ pub enum BorrowState {
279279
}
280280

281281
// Values [1, MAX-1] represent the number of `Ref` active
282-
// (will not outgrow its range since `uint` is the size of the address space)
283-
type BorrowFlag = uint;
282+
// (will not outgrow its range since `usize` is the size of the address space)
283+
type BorrowFlag = usize;
284284
const UNUSED: BorrowFlag = 0;
285285
const WRITING: BorrowFlag = -1;
286286

src/libcore/mem.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub use intrinsics::forget;
4343
/// ```
4444
#[inline]
4545
#[stable(feature = "rust1", since = "1.0.0")]
46-
pub fn size_of<T>() -> uint {
46+
pub fn size_of<T>() -> usize {
4747
unsafe { intrinsics::size_of::<T>() }
4848
}
4949

@@ -58,7 +58,7 @@ pub fn size_of<T>() -> uint {
5858
/// ```
5959
#[inline]
6060
#[stable(feature = "rust1", since = "1.0.0")]
61-
pub fn size_of_val<T>(_val: &T) -> uint {
61+
pub fn size_of_val<T>(_val: &T) -> usize {
6262
size_of::<T>()
6363
}
6464

@@ -75,7 +75,7 @@ pub fn size_of_val<T>(_val: &T) -> uint {
7575
/// ```
7676
#[inline]
7777
#[stable(feature = "rust1", since = "1.0.0")]
78-
pub fn min_align_of<T>() -> uint {
78+
pub fn min_align_of<T>() -> usize {
7979
unsafe { intrinsics::min_align_of::<T>() }
8080
}
8181

@@ -90,7 +90,7 @@ pub fn min_align_of<T>() -> uint {
9090
/// ```
9191
#[inline]
9292
#[stable(feature = "rust1", since = "1.0.0")]
93-
pub fn min_align_of_val<T>(_val: &T) -> uint {
93+
pub fn min_align_of_val<T>(_val: &T) -> usize {
9494
min_align_of::<T>()
9595
}
9696

@@ -108,7 +108,7 @@ pub fn min_align_of_val<T>(_val: &T) -> uint {
108108
/// ```
109109
#[inline]
110110
#[stable(feature = "rust1", since = "1.0.0")]
111-
pub fn align_of<T>() -> uint {
111+
pub fn align_of<T>() -> usize {
112112
// We use the preferred alignment as the default alignment for a type. This
113113
// appears to be what clang migrated towards as well:
114114
//
@@ -130,7 +130,7 @@ pub fn align_of<T>() -> uint {
130130
/// ```
131131
#[inline]
132132
#[stable(feature = "rust1", since = "1.0.0")]
133-
pub fn align_of_val<T>(_val: &T) -> uint {
133+
pub fn align_of_val<T>(_val: &T) -> usize {
134134
align_of::<T>()
135135
}
136136

@@ -150,7 +150,7 @@ pub fn align_of_val<T>(_val: &T) -> uint {
150150
/// ```
151151
/// use std::mem;
152152
///
153-
/// let x: int = unsafe { mem::zeroed() };
153+
/// let x: i32 = unsafe { mem::zeroed() };
154154
/// ```
155155
#[inline]
156156
#[stable(feature = "rust1", since = "1.0.0")]
@@ -171,7 +171,7 @@ pub unsafe fn zeroed<T>() -> T {
171171
/// ```
172172
/// use std::mem;
173173
///
174-
/// let x: int = unsafe { mem::uninitialized() };
174+
/// let x: i32 = unsafe { mem::uninitialized() };
175175
/// ```
176176
#[inline]
177177
#[stable(feature = "rust1", since = "1.0.0")]

src/libcore/nonzero.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ pub unsafe trait Zeroable {}
1919
unsafe impl<T> Zeroable for *const T {}
2020
unsafe impl<T> Zeroable for *mut T {}
2121
unsafe impl<T> Zeroable for Unique<T> { }
22-
unsafe impl Zeroable for int {}
23-
unsafe impl Zeroable for uint {}
22+
unsafe impl Zeroable for isize {}
23+
unsafe impl Zeroable for usize {}
2424
unsafe impl Zeroable for i8 {}
2525
unsafe impl Zeroable for u8 {}
2626
unsafe impl Zeroable for i16 {}

0 commit comments

Comments
 (0)