Skip to content

Commit 210ac01

Browse files
committed
rustc: use {U,I}size instead of {U,I}s shorthands.
1 parent 9599066 commit 210ac01

File tree

33 files changed

+93
-92
lines changed

33 files changed

+93
-92
lines changed

src/librustc/ich/impls_syntax.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ impl_stable_hash_for!(enum ::syntax::ast::LitKind {
155155
Bool(value)
156156
});
157157

158-
impl_stable_hash_for!(enum ::syntax::ast::IntTy { Is, I8, I16, I32, I64, I128 });
159-
impl_stable_hash_for!(enum ::syntax::ast::UintTy { Us, U8, U16, U32, U64, U128 });
158+
impl_stable_hash_for!(enum ::syntax::ast::IntTy { Isize, I8, I16, I32, I64, I128 });
159+
impl_stable_hash_for!(enum ::syntax::ast::UintTy { Usize, U8, U16, U32, U64, U128 });
160160
impl_stable_hash_for!(enum ::syntax::ast::FloatTy { F32, F64 });
161161
impl_stable_hash_for!(enum ::syntax::ast::Unsafety { Unsafe, Normal });
162162
impl_stable_hash_for!(enum ::syntax::ast::Constness { Const, NotConst });

src/librustc/ty/context.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -754,13 +754,13 @@ impl<'tcx> CommonTypes<'tcx> {
754754
char: mk(TyChar),
755755
never: mk(TyNever),
756756
err: mk(TyError),
757-
isize: mk(TyInt(ast::IntTy::Is)),
757+
isize: mk(TyInt(ast::IntTy::Isize)),
758758
i8: mk(TyInt(ast::IntTy::I8)),
759759
i16: mk(TyInt(ast::IntTy::I16)),
760760
i32: mk(TyInt(ast::IntTy::I32)),
761761
i64: mk(TyInt(ast::IntTy::I64)),
762762
i128: mk(TyInt(ast::IntTy::I128)),
763-
usize: mk(TyUint(ast::UintTy::Us)),
763+
usize: mk(TyUint(ast::UintTy::Usize)),
764764
u8: mk(TyUint(ast::UintTy::U8)),
765765
u16: mk(TyUint(ast::UintTy::U16)),
766766
u32: mk(TyUint(ast::UintTy::U32)),
@@ -1912,7 +1912,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
19121912

19131913
pub fn mk_mach_int(self, tm: ast::IntTy) -> Ty<'tcx> {
19141914
match tm {
1915-
ast::IntTy::Is => self.types.isize,
1915+
ast::IntTy::Isize => self.types.isize,
19161916
ast::IntTy::I8 => self.types.i8,
19171917
ast::IntTy::I16 => self.types.i16,
19181918
ast::IntTy::I32 => self.types.i32,
@@ -1923,7 +1923,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
19231923

19241924
pub fn mk_mach_uint(self, tm: ast::UintTy) -> Ty<'tcx> {
19251925
match tm {
1926-
ast::UintTy::Us => self.types.usize,
1926+
ast::UintTy::Usize => self.types.usize,
19271927
ast::UintTy::U8 => self.types.u8,
19281928
ast::UintTy::U16 => self.types.u16,
19291929
ast::UintTy::U32 => self.types.u32,

src/librustc/ty/layout.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ impl<'a, 'tcx> Integer {
520520
attr::SignedInt(IntTy::I32) | attr::UnsignedInt(UintTy::U32) => I32,
521521
attr::SignedInt(IntTy::I64) | attr::UnsignedInt(UintTy::U64) => I64,
522522
attr::SignedInt(IntTy::I128) | attr::UnsignedInt(UintTy::U128) => I128,
523-
attr::SignedInt(IntTy::Is) | attr::UnsignedInt(UintTy::Us) => {
523+
attr::SignedInt(IntTy::Isize) | attr::UnsignedInt(UintTy::Usize) => {
524524
dl.ptr_sized_integer()
525525
}
526526
}

src/librustc/ty/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1575,7 +1575,7 @@ impl ReprOptions {
15751575
pub fn linear(&self) -> bool { self.flags.contains(ReprFlags::IS_LINEAR) }
15761576

15771577
pub fn discr_type(&self) -> attr::IntType {
1578-
self.int.unwrap_or(attr::SignedInt(ast::IntTy::Is))
1578+
self.int.unwrap_or(attr::SignedInt(ast::IntTy::Isize))
15791579
}
15801580

15811581
/// Returns true if this `#[repr()]` should inhabit "smart enum

src/librustc/ty/sty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1505,7 +1505,7 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
15051505

15061506
pub fn is_machine(&self) -> bool {
15071507
match self.sty {
1508-
TyInt(ast::IntTy::Is) | TyUint(ast::UintTy::Us) => false,
1508+
TyInt(ast::IntTy::Isize) | TyUint(ast::UintTy::Usize) => false,
15091509
TyInt(..) | TyUint(..) | TyFloat(..) => true,
15101510
_ => false,
15111511
}

src/librustc/ty/util.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ macro_rules! typed_literal {
5555
SignedInt(ast::IntTy::I32) => ConstInt::I32($lit),
5656
SignedInt(ast::IntTy::I64) => ConstInt::I64($lit),
5757
SignedInt(ast::IntTy::I128) => ConstInt::I128($lit),
58-
SignedInt(ast::IntTy::Is) => match $tcx.sess.target.isize_ty {
58+
SignedInt(ast::IntTy::Isize) => match $tcx.sess.target.isize_ty {
5959
ast::IntTy::I16 => ConstInt::Isize(ConstIsize::Is16($lit)),
6060
ast::IntTy::I32 => ConstInt::Isize(ConstIsize::Is32($lit)),
6161
ast::IntTy::I64 => ConstInt::Isize(ConstIsize::Is64($lit)),
@@ -66,7 +66,7 @@ macro_rules! typed_literal {
6666
UnsignedInt(ast::UintTy::U32) => ConstInt::U32($lit),
6767
UnsignedInt(ast::UintTy::U64) => ConstInt::U64($lit),
6868
UnsignedInt(ast::UintTy::U128) => ConstInt::U128($lit),
69-
UnsignedInt(ast::UintTy::Us) => match $tcx.sess.target.usize_ty {
69+
UnsignedInt(ast::UintTy::Usize) => match $tcx.sess.target.usize_ty {
7070
ast::UintTy::U16 => ConstInt::Usize(ConstUsize::Us16($lit)),
7171
ast::UintTy::U32 => ConstInt::Usize(ConstUsize::Us32($lit)),
7272
ast::UintTy::U64 => ConstInt::Usize(ConstUsize::Us64($lit)),
@@ -84,13 +84,13 @@ impl IntTypeExt for attr::IntType {
8484
SignedInt(ast::IntTy::I32) => tcx.types.i32,
8585
SignedInt(ast::IntTy::I64) => tcx.types.i64,
8686
SignedInt(ast::IntTy::I128) => tcx.types.i128,
87-
SignedInt(ast::IntTy::Is) => tcx.types.isize,
87+
SignedInt(ast::IntTy::Isize) => tcx.types.isize,
8888
UnsignedInt(ast::UintTy::U8) => tcx.types.u8,
8989
UnsignedInt(ast::UintTy::U16) => tcx.types.u16,
9090
UnsignedInt(ast::UintTy::U32) => tcx.types.u32,
9191
UnsignedInt(ast::UintTy::U64) => tcx.types.u64,
9292
UnsignedInt(ast::UintTy::U128) => tcx.types.u128,
93-
UnsignedInt(ast::UintTy::Us) => tcx.types.usize,
93+
UnsignedInt(ast::UintTy::Usize) => tcx.types.usize,
9494
}
9595
}
9696

@@ -105,13 +105,13 @@ impl IntTypeExt for attr::IntType {
105105
(SignedInt(ast::IntTy::I32), ConstInt::I32(_)) => {},
106106
(SignedInt(ast::IntTy::I64), ConstInt::I64(_)) => {},
107107
(SignedInt(ast::IntTy::I128), ConstInt::I128(_)) => {},
108-
(SignedInt(ast::IntTy::Is), ConstInt::Isize(_)) => {},
108+
(SignedInt(ast::IntTy::Isize), ConstInt::Isize(_)) => {},
109109
(UnsignedInt(ast::UintTy::U8), ConstInt::U8(_)) => {},
110110
(UnsignedInt(ast::UintTy::U16), ConstInt::U16(_)) => {},
111111
(UnsignedInt(ast::UintTy::U32), ConstInt::U32(_)) => {},
112112
(UnsignedInt(ast::UintTy::U64), ConstInt::U64(_)) => {},
113113
(UnsignedInt(ast::UintTy::U128), ConstInt::U128(_)) => {},
114-
(UnsignedInt(ast::UintTy::Us), ConstInt::Usize(_)) => {},
114+
(UnsignedInt(ast::UintTy::Usize), ConstInt::Usize(_)) => {},
115115
_ => bug!("disr type mismatch: {:?} vs {:?}", self, val),
116116
}
117117
}

src/librustc_const_eval/eval.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ fn eval_const_expr_partial<'a, 'tcx>(cx: &ConstContext<'a, 'tcx>,
133133
(&LitKind::Int(I128_OVERFLOW, Signed(IntTy::I128)), _) => {
134134
Some(I128(i128::min_value()))
135135
},
136-
(&LitKind::Int(n, _), &ty::TyInt(IntTy::Is)) |
137-
(&LitKind::Int(n, Signed(IntTy::Is)), _) => {
136+
(&LitKind::Int(n, _), &ty::TyInt(IntTy::Isize)) |
137+
(&LitKind::Int(n, Signed(IntTy::Isize)), _) => {
138138
match tcx.sess.target.isize_ty {
139139
IntTy::I16 => if n == I16_OVERFLOW {
140140
Some(Isize(Is16(i16::min_value())))
@@ -478,15 +478,15 @@ fn cast_const_int<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
478478
ty::TyInt(ast::IntTy::I32) => Ok(Integral(I32(v as i128 as i32))),
479479
ty::TyInt(ast::IntTy::I64) => Ok(Integral(I64(v as i128 as i64))),
480480
ty::TyInt(ast::IntTy::I128) => Ok(Integral(I128(v as i128))),
481-
ty::TyInt(ast::IntTy::Is) => {
481+
ty::TyInt(ast::IntTy::Isize) => {
482482
Ok(Integral(Isize(ConstIsize::new_truncating(v as i128, tcx.sess.target.isize_ty))))
483483
},
484484
ty::TyUint(ast::UintTy::U8) => Ok(Integral(U8(v as u8))),
485485
ty::TyUint(ast::UintTy::U16) => Ok(Integral(U16(v as u16))),
486486
ty::TyUint(ast::UintTy::U32) => Ok(Integral(U32(v as u32))),
487487
ty::TyUint(ast::UintTy::U64) => Ok(Integral(U64(v as u64))),
488488
ty::TyUint(ast::UintTy::U128) => Ok(Integral(U128(v as u128))),
489-
ty::TyUint(ast::UintTy::Us) => {
489+
ty::TyUint(ast::UintTy::Usize) => {
490490
Ok(Integral(Usize(ConstUsize::new_truncating(v, tcx.sess.target.usize_ty))))
491491
},
492492
ty::TyFloat(fty) => {

src/librustc_const_math/err.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ impl ConstMathErr {
7575
ULitOutOfRange(ast::UintTy::U32) => "literal out of range for u32",
7676
ULitOutOfRange(ast::UintTy::U64) => "literal out of range for u64",
7777
ULitOutOfRange(ast::UintTy::U128) => "literal out of range for u128",
78-
ULitOutOfRange(ast::UintTy::Us) => "literal out of range for usize",
78+
ULitOutOfRange(ast::UintTy::Usize) => "literal out of range for usize",
7979
LitOutOfRange(ast::IntTy::I8) => "literal out of range for i8",
8080
LitOutOfRange(ast::IntTy::I16) => "literal out of range for i16",
8181
LitOutOfRange(ast::IntTy::I32) => "literal out of range for i32",
8282
LitOutOfRange(ast::IntTy::I64) => "literal out of range for i64",
8383
LitOutOfRange(ast::IntTy::I128) => "literal out of range for i128",
84-
LitOutOfRange(ast::IntTy::Is) => "literal out of range for isize",
84+
LitOutOfRange(ast::IntTy::Isize) => "literal out of range for isize",
8585
}
8686
}
8787
}

src/librustc_const_math/int.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ use std::cmp::Ordering;
1212
use syntax::attr::IntType;
1313
use syntax::ast::{IntTy, UintTy};
1414

15-
use super::is::*;
16-
use super::us::*;
15+
use super::isize::*;
16+
use super::usize::*;
1717
use super::err::*;
1818

1919
#[derive(Copy, Clone, Debug, RustcEncodable, RustcDecodable, Hash, Eq, PartialEq)]
@@ -83,7 +83,7 @@ impl ConstInt {
8383
UintTy::U16 if val <= ubounds::U16MAX => Some(U16(val as u16)),
8484
UintTy::U32 if val <= ubounds::U32MAX => Some(U32(val as u32)),
8585
UintTy::U64 if val <= ubounds::U64MAX => Some(U64(val as u64)),
86-
UintTy::Us if val <= ubounds::U64MAX => ConstUsize::new(val as u64, usize_ty).ok()
86+
UintTy::Usize if val <= ubounds::U64MAX => ConstUsize::new(val as u64, usize_ty).ok()
8787
.map(Usize),
8888
UintTy::U128 => Some(U128(val)),
8989
_ => None
@@ -98,7 +98,7 @@ impl ConstInt {
9898
IntTy::I16 if val <= ibounds::I16MAX => Some(I16(val as i16)),
9999
IntTy::I32 if val <= ibounds::I32MAX => Some(I32(val as i32)),
100100
IntTy::I64 if val <= ibounds::I64MAX => Some(I64(val as i64)),
101-
IntTy::Is if val <= ibounds::I64MAX => ConstIsize::new(val as i64, isize_ty).ok()
101+
IntTy::Isize if val <= ibounds::I64MAX => ConstIsize::new(val as i64, isize_ty).ok()
102102
.map(Isize),
103103
IntTy::I128 => Some(I128(val)),
104104
_ => None
@@ -112,7 +112,7 @@ impl ConstInt {
112112
UintTy::U16 => U16(val as u16),
113113
UintTy::U32 => U32(val as u32),
114114
UintTy::U64 => U64(val as u64),
115-
UintTy::Us => Usize(ConstUsize::new_truncating(val, usize_ty)),
115+
UintTy::Usize => Usize(ConstUsize::new_truncating(val, usize_ty)),
116116
UintTy::U128 => U128(val)
117117
}
118118
}
@@ -124,7 +124,7 @@ impl ConstInt {
124124
IntTy::I16 => I16(val as i16),
125125
IntTy::I32 => I32(val as i32),
126126
IntTy::I64 => I64(val as i64),
127-
IntTy::Is => Isize(ConstIsize::new_truncating(val, isize_ty)),
127+
IntTy::Isize => Isize(ConstIsize::new_truncating(val, isize_ty)),
128128
IntTy::I128 => I128(val)
129129
}
130130
}
@@ -280,13 +280,13 @@ impl ConstInt {
280280
ConstInt::I32(_) => IntType::SignedInt(IntTy::I32),
281281
ConstInt::I64(_) => IntType::SignedInt(IntTy::I64),
282282
ConstInt::I128(_) => IntType::SignedInt(IntTy::I128),
283-
ConstInt::Isize(_) => IntType::SignedInt(IntTy::Is),
283+
ConstInt::Isize(_) => IntType::SignedInt(IntTy::Isize),
284284
ConstInt::U8(_) => IntType::UnsignedInt(UintTy::U8),
285285
ConstInt::U16(_) => IntType::UnsignedInt(UintTy::U16),
286286
ConstInt::U32(_) => IntType::UnsignedInt(UintTy::U32),
287287
ConstInt::U64(_) => IntType::UnsignedInt(UintTy::U64),
288288
ConstInt::U128(_) => IntType::UnsignedInt(UintTy::U128),
289-
ConstInt::Usize(_) => IntType::UnsignedInt(UintTy::Us),
289+
ConstInt::Usize(_) => IntType::UnsignedInt(UintTy::Usize),
290290
}
291291
}
292292
}

src/librustc_const_math/is.rs renamed to src/librustc_const_math/isize.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ impl ConstIsize {
3838
pub fn new(i: i64, isize_ty: ast::IntTy) -> Result<Self, ConstMathErr> {
3939
match isize_ty {
4040
ast::IntTy::I16 if i as i16 as i64 == i => Ok(Is16(i as i16)),
41-
ast::IntTy::I16 => Err(LitOutOfRange(ast::IntTy::Is)),
41+
ast::IntTy::I16 => Err(LitOutOfRange(ast::IntTy::Isize)),
4242
ast::IntTy::I32 if i as i32 as i64 == i => Ok(Is32(i as i32)),
43-
ast::IntTy::I32 => Err(LitOutOfRange(ast::IntTy::Is)),
43+
ast::IntTy::I32 => Err(LitOutOfRange(ast::IntTy::Isize)),
4444
ast::IntTy::I64 => Ok(Is64(i)),
4545
_ => unreachable!(),
4646
}

src/librustc_const_math/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ extern crate serialize as rustc_serialize; // used by deriving
3030

3131
mod float;
3232
mod int;
33-
mod us;
34-
mod is;
33+
mod usize;
34+
mod isize;
3535
mod err;
3636

3737
pub use float::*;
3838
pub use int::*;
39-
pub use us::*;
40-
pub use is::*;
39+
pub use usize::*;
40+
pub use isize::*;
4141
pub use err::{ConstMathErr, Op};

src/librustc_const_math/us.rs renamed to src/librustc_const_math/usize.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ impl ConstUsize {
3838
pub fn new(i: u64, usize_ty: ast::UintTy) -> Result<Self, ConstMathErr> {
3939
match usize_ty {
4040
ast::UintTy::U16 if i as u16 as u64 == i => Ok(Us16(i as u16)),
41-
ast::UintTy::U16 => Err(ULitOutOfRange(ast::UintTy::Us)),
41+
ast::UintTy::U16 => Err(ULitOutOfRange(ast::UintTy::Usize)),
4242
ast::UintTy::U32 if i as u32 as u64 == i => Ok(Us32(i as u32)),
43-
ast::UintTy::U32 => Err(ULitOutOfRange(ast::UintTy::Us)),
43+
ast::UintTy::U32 => Err(ULitOutOfRange(ast::UintTy::Usize)),
4444
ast::UintTy::U64 => Ok(Us64(i)),
4545
_ => unreachable!(),
4646
}

src/librustc_lint/types.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TypeLimits {
140140
match lit.node {
141141
ast::LitKind::Int(v, ast::LitIntType::Signed(_)) |
142142
ast::LitKind::Int(v, ast::LitIntType::Unsuffixed) => {
143-
let int_type = if let ast::IntTy::Is = t {
143+
let int_type = if let ast::IntTy::Isize = t {
144144
cx.sess().target.isize_ty
145145
} else {
146146
t
@@ -163,7 +163,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TypeLimits {
163163
};
164164
}
165165
ty::TyUint(t) => {
166-
let uint_type = if let ast::UintTy::Us = t {
166+
let uint_type = if let ast::UintTy::Usize = t {
167167
cx.sess().target.usize_ty
168168
} else {
169169
t
@@ -230,7 +230,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TypeLimits {
230230
// warnings are consistent between 32- and 64-bit platforms
231231
fn int_ty_range(int_ty: ast::IntTy) -> (i128, i128) {
232232
match int_ty {
233-
ast::IntTy::Is => (i64::min_value() as i128, i64::max_value() as i128),
233+
ast::IntTy::Isize => (i64::min_value() as i128, i64::max_value() as i128),
234234
ast::IntTy::I8 => (i8::min_value() as i64 as i128, i8::max_value() as i128),
235235
ast::IntTy::I16 => (i16::min_value() as i64 as i128, i16::max_value() as i128),
236236
ast::IntTy::I32 => (i32::min_value() as i64 as i128, i32::max_value() as i128),
@@ -241,7 +241,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TypeLimits {
241241

242242
fn uint_ty_range(uint_ty: ast::UintTy) -> (u128, u128) {
243243
match uint_ty {
244-
ast::UintTy::Us => (u64::min_value() as u128, u64::max_value() as u128),
244+
ast::UintTy::Usize => (u64::min_value() as u128, u64::max_value() as u128),
245245
ast::UintTy::U8 => (u8::min_value() as u128, u8::max_value() as u128),
246246
ast::UintTy::U16 => (u16::min_value() as u128, u16::max_value() as u128),
247247
ast::UintTy::U32 => (u32::min_value() as u128, u32::max_value() as u128),
@@ -252,7 +252,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TypeLimits {
252252

253253
fn int_ty_bits(int_ty: ast::IntTy, isize_ty: ast::IntTy) -> u64 {
254254
match int_ty {
255-
ast::IntTy::Is => int_ty_bits(isize_ty, isize_ty),
255+
ast::IntTy::Isize => int_ty_bits(isize_ty, isize_ty),
256256
ast::IntTy::I8 => 8,
257257
ast::IntTy::I16 => 16 as u64,
258258
ast::IntTy::I32 => 32,
@@ -263,7 +263,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TypeLimits {
263263

264264
fn uint_ty_bits(uint_ty: ast::UintTy, usize_ty: ast::UintTy) -> u64 {
265265
match uint_ty {
266-
ast::UintTy::Us => uint_ty_bits(usize_ty, usize_ty),
266+
ast::UintTy::Usize => uint_ty_bits(usize_ty, usize_ty),
267267
ast::UintTy::U8 => 8,
268268
ast::UintTy::U16 => 16,
269269
ast::UintTy::U32 => 32,
@@ -387,7 +387,7 @@ fn is_ffi_safe(ty: attr::IntType) -> bool {
387387
attr::SignedInt(ast::IntTy::I32) | attr::UnsignedInt(ast::UintTy::U32) |
388388
attr::SignedInt(ast::IntTy::I64) | attr::UnsignedInt(ast::UintTy::U64) |
389389
attr::SignedInt(ast::IntTy::I128) | attr::UnsignedInt(ast::UintTy::U128) => true,
390-
attr::SignedInt(ast::IntTy::Is) | attr::UnsignedInt(ast::UintTy::Us) => false
390+
attr::SignedInt(ast::IntTy::Isize) | attr::UnsignedInt(ast::UintTy::Usize) => false
391391
}
392392
}
393393

src/librustc_mir/build/expr/as_rvalue.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
392392
ast::IntTy::I32 => ConstInt::I32(-1),
393393
ast::IntTy::I64 => ConstInt::I64(-1),
394394
ast::IntTy::I128 => ConstInt::I128(-1),
395-
ast::IntTy::Is => {
395+
ast::IntTy::Isize => {
396396
let int_ty = self.hir.tcx().sess.target.isize_ty;
397397
let val = ConstIsize::new(-1, int_ty).unwrap();
398398
ConstInt::Isize(val)
@@ -424,7 +424,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
424424
ast::IntTy::I32 => ConstInt::I32(i32::min_value()),
425425
ast::IntTy::I64 => ConstInt::I64(i64::min_value()),
426426
ast::IntTy::I128 => ConstInt::I128(i128::min_value()),
427-
ast::IntTy::Is => {
427+
ast::IntTy::Isize => {
428428
let int_ty = self.hir.tcx().sess.target.isize_ty;
429429
let min = match int_ty {
430430
ast::IntTy::I16 => std::i16::MIN as i64,

src/librustc_mir/build/misc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
7474
ast::UintTy::U32 => ConstInt::U32(0),
7575
ast::UintTy::U64 => ConstInt::U64(0),
7676
ast::UintTy::U128 => ConstInt::U128(0),
77-
ast::UintTy::Us => {
77+
ast::UintTy::Usize => {
7878
let uint_ty = self.hir.tcx().sess.target.usize_ty;
7979
let val = ConstUsize::new(0, uint_ty).unwrap();
8080
ConstInt::Usize(val)
@@ -95,7 +95,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
9595
ast::IntTy::I32 => ConstInt::I32(0),
9696
ast::IntTy::I64 => ConstInt::I64(0),
9797
ast::IntTy::I128 => ConstInt::I128(0),
98-
ast::IntTy::Is => {
98+
ast::IntTy::Isize => {
9999
let int_ty = self.hir.tcx().sess.target.isize_ty;
100100
let val = ConstIsize::new(0, int_ty).unwrap();
101101
ConstInt::Isize(val)

0 commit comments

Comments
 (0)