Skip to content

Commit 9aee389

Browse files
committed
rollup merge of rust-lang#22485: pnkfelix/fsk-int-uint-audit
cc rust-lang#22240
2 parents b90e407 + fc0f6e8 commit 9aee389

File tree

4 files changed

+27
-27
lines changed

4 files changed

+27
-27
lines changed

src/libcore/borrow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ impl<T> ToOwned<T> for T where T: Clone {
124124
/// ```rust
125125
/// use std::borrow::Cow;
126126
///
127-
/// fn abs_all(input: &mut Cow<Vec<int>, [int]>) {
127+
/// fn abs_all(input: &mut Cow<Vec<i32>, [i32]>) {
128128
/// for i in 0..input.len() {
129129
/// let v = input[i];
130130
/// if v < 0 {

src/libcore/cmp.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ impl Ord for Ordering {
215215
#[inline]
216216
#[stable(feature = "rust1", since = "1.0.0")]
217217
fn cmp(&self, other: &Ordering) -> Ordering {
218-
(*self as int).cmp(&(*other as int))
218+
(*self as i32).cmp(&(*other as i32))
219219
}
220220
}
221221

@@ -224,7 +224,7 @@ impl PartialOrd for Ordering {
224224
#[inline]
225225
#[stable(feature = "rust1", since = "1.0.0")]
226226
fn partial_cmp(&self, other: &Ordering) -> Option<Ordering> {
227-
(*self as int).partial_cmp(&(*other as int))
227+
(*self as i32).partial_cmp(&(*other as i32))
228228
}
229229
}
230230

@@ -482,7 +482,7 @@ mod impls {
482482
}
483483

484484
partial_eq_impl! {
485-
bool char uint u8 u16 u32 u64 int i8 i16 i32 i64 f32 f64
485+
bool char usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64
486486
}
487487

488488
macro_rules! eq_impl {
@@ -492,7 +492,7 @@ mod impls {
492492
)*)
493493
}
494494

495-
eq_impl! { () bool char uint u8 u16 u32 u64 int i8 i16 i32 i64 }
495+
eq_impl! { () bool char usize u8 u16 u32 u64 isize i8 i16 i32 i64 }
496496

497497
macro_rules! partial_ord_impl {
498498
($($t:ty)*) => ($(
@@ -535,7 +535,7 @@ mod impls {
535535
}
536536
}
537537

538-
partial_ord_impl! { char uint u8 u16 u32 u64 int i8 i16 i32 i64 f32 f64 }
538+
partial_ord_impl! { char usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 }
539539

540540
macro_rules! ord_impl {
541541
($($t:ty)*) => ($(
@@ -565,7 +565,7 @@ mod impls {
565565
}
566566
}
567567

568-
ord_impl! { char uint u8 u16 u32 u64 int i8 i16 i32 i64 }
568+
ord_impl! { char usize u8 u16 u32 u64 isize i8 i16 i32 i64 }
569569

570570
// & pointers
571571

src/libcore/default.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
//!
1717
//! ```
1818
//! struct SomeOptions {
19-
//! foo: int,
19+
//! foo: i32,
2020
//! bar: f32,
2121
//! }
2222
//! ```
@@ -28,7 +28,7 @@
2828
//!
2929
//! #[derive(Default)]
3030
//! struct SomeOptions {
31-
//! foo: int,
31+
//! foo: i32,
3232
//! bar: f32,
3333
//! }
3434
//!
@@ -56,7 +56,7 @@
5656
//!
5757
//! #[derive(Default)]
5858
//! struct SomeOptions {
59-
//! foo: int,
59+
//! foo: i32,
6060
//! bar: f32,
6161
//! baz: Kind,
6262
//! }
@@ -73,7 +73,7 @@
7373
//! # use std::default::Default;
7474
//! # #[derive(Default)]
7575
//! # struct SomeOptions {
76-
//! # foo: int,
76+
//! # foo: i32,
7777
//! # bar: f32,
7878
//! # }
7979
//! fn main() {
@@ -93,7 +93,7 @@
9393
/// ```
9494
/// #[derive(Default)]
9595
/// struct SomeOptions {
96-
/// foo: int,
96+
/// foo: i32,
9797
/// bar: f32,
9898
/// }
9999
/// ```
@@ -113,7 +113,7 @@ pub trait Default {
113113
///
114114
/// let i: i8 = Default::default();
115115
/// let (x, y): (Option<String>, f64) = Default::default();
116-
/// let (a, b, (c, d)): (int, uint, (bool, bool)) = Default::default();
116+
/// let (a, b, (c, d)): (i32, u32, (bool, bool)) = Default::default();
117117
/// ```
118118
///
119119
/// Making your own:
@@ -150,13 +150,13 @@ default_impl! { (), () }
150150
default_impl! { bool, false }
151151
default_impl! { char, '\x00' }
152152

153-
default_impl! { uint, 0 }
153+
default_impl! { usize, 0 }
154154
default_impl! { u8, 0 }
155155
default_impl! { u16, 0 }
156156
default_impl! { u32, 0 }
157157
default_impl! { u64, 0 }
158158

159-
default_impl! { int, 0 }
159+
default_impl! { isize, 0 }
160160
default_impl! { i8, 0 }
161161
default_impl! { i16, 0 }
162162
default_impl! { i32, 0 }

src/libcore/intrinsics.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ pub type GlueFn = extern "Rust" fn(*const i8);
5050
#[derive(Copy)]
5151
pub struct TyDesc {
5252
// sizeof(T)
53-
pub size: uint,
53+
pub size: usize,
5454

5555
// alignof(T)
56-
pub align: uint,
56+
pub align: usize,
5757

5858
// Called when a value of type `T` is no longer needed
5959
pub drop_glue: GlueFn,
@@ -186,15 +186,15 @@ extern "rust-intrinsic" {
186186
/// would *exactly* overwrite a value. When laid out in vectors
187187
/// and structures there may be additional padding between
188188
/// elements.
189-
pub fn size_of<T>() -> uint;
189+
pub fn size_of<T>() -> usize;
190190

191191
/// Move a value to an uninitialized memory location.
192192
///
193193
/// Drop glue is not run on the destination.
194194
pub fn move_val_init<T>(dst: &mut T, src: T);
195195

196-
pub fn min_align_of<T>() -> uint;
197-
pub fn pref_align_of<T>() -> uint;
196+
pub fn min_align_of<T>() -> usize;
197+
pub fn pref_align_of<T>() -> usize;
198198

199199
/// Get a static pointer to a type descriptor.
200200
pub fn get_tydesc<T: ?Sized>() -> *const TyDesc;
@@ -253,7 +253,7 @@ extern "rust-intrinsic" {
253253
///
254254
/// This is implemented as an intrinsic to avoid converting to and from an
255255
/// integer, since the conversion would throw away aliasing information.
256-
pub fn offset<T>(dst: *const T, offset: int) -> *const T;
256+
pub fn offset<T>(dst: *const T, offset: isize) -> *const T;
257257

258258
/// Copies `count * size_of<T>` bytes from `src` to `dst`. The source
259259
/// and destination may *not* overlap.
@@ -294,7 +294,7 @@ extern "rust-intrinsic" {
294294
/// }
295295
/// ```
296296
#[unstable(feature = "core")]
297-
pub fn copy_nonoverlapping_memory<T>(dst: *mut T, src: *const T, count: uint);
297+
pub fn copy_nonoverlapping_memory<T>(dst: *mut T, src: *const T, count: usize);
298298

299299
/// Copies `count * size_of<T>` bytes from `src` to `dst`. The source
300300
/// and destination may overlap.
@@ -324,33 +324,33 @@ extern "rust-intrinsic" {
324324
/// ```
325325
///
326326
#[unstable(feature = "core")]
327-
pub fn copy_memory<T>(dst: *mut T, src: *const T, count: uint);
327+
pub fn copy_memory<T>(dst: *mut T, src: *const T, count: usize);
328328

329329
/// Invokes memset on the specified pointer, setting `count * size_of::<T>()`
330330
/// bytes of memory starting at `dst` to `c`.
331331
#[unstable(feature = "core",
332332
reason = "uncertain about naming and semantics")]
333-
pub fn set_memory<T>(dst: *mut T, val: u8, count: uint);
333+
pub fn set_memory<T>(dst: *mut T, val: u8, count: usize);
334334

335335
/// Equivalent to the appropriate `llvm.memcpy.p0i8.0i8.*` intrinsic, with
336336
/// a size of `count` * `size_of::<T>()` and an alignment of
337337
/// `min_align_of::<T>()`
338338
///
339339
/// The volatile parameter parameter is set to `true`, so it will not be optimized out.
340340
pub fn volatile_copy_nonoverlapping_memory<T>(dst: *mut T, src: *const T,
341-
count: uint);
341+
count: usize);
342342
/// Equivalent to the appropriate `llvm.memmove.p0i8.0i8.*` intrinsic, with
343343
/// a size of `count` * `size_of::<T>()` and an alignment of
344344
/// `min_align_of::<T>()`
345345
///
346346
/// The volatile parameter parameter is set to `true`, so it will not be optimized out.
347-
pub fn volatile_copy_memory<T>(dst: *mut T, src: *const T, count: uint);
347+
pub fn volatile_copy_memory<T>(dst: *mut T, src: *const T, count: usize);
348348
/// Equivalent to the appropriate `llvm.memset.p0i8.*` intrinsic, with a
349349
/// size of `count` * `size_of::<T>()` and an alignment of
350350
/// `min_align_of::<T>()`.
351351
///
352352
/// The volatile parameter parameter is set to `true`, so it will not be optimized out.
353-
pub fn volatile_set_memory<T>(dst: *mut T, val: u8, count: uint);
353+
pub fn volatile_set_memory<T>(dst: *mut T, val: u8, count: usize);
354354

355355
/// Perform a volatile load from the `src` pointer.
356356
pub fn volatile_load<T>(src: *const T) -> T;

0 commit comments

Comments
 (0)