Skip to content

Commit 91ecb3b

Browse files
committed
Implement nightly libsyntax changes
1 parent 5815681 commit 91ecb3b

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

clippy_lints/src/mutex_atomic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MutexAtomic {
6969
atomic_name
7070
);
7171
match mutex_param.sty {
72-
ty::TyUint(t) if t != ast::UintTy::Us => span_lint(cx, MUTEX_INTEGER, expr.span, &msg),
73-
ty::TyInt(t) if t != ast::IntTy::Is => span_lint(cx, MUTEX_INTEGER, expr.span, &msg),
72+
ty::TyUint(t) if t != ast::UintTy::Usize => span_lint(cx, MUTEX_INTEGER, expr.span, &msg),
73+
ty::TyInt(t) if t != ast::IntTy::Isize => span_lint(cx, MUTEX_INTEGER, expr.span, &msg),
7474
_ => span_lint(cx, MUTEX_ATOMIC, expr.span, &msg),
7575
};
7676
}

clippy_lints/src/types.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -541,15 +541,15 @@ declare_lint! {
541541
fn int_ty_to_nbits(typ: Ty, tcx: TyCtxt) -> u64 {
542542
match typ.sty {
543543
ty::TyInt(i) => match i {
544-
IntTy::Is => tcx.data_layout.pointer_size.bits(),
544+
IntTy::Isize => tcx.data_layout.pointer_size.bits(),
545545
IntTy::I8 => 8,
546546
IntTy::I16 => 16,
547547
IntTy::I32 => 32,
548548
IntTy::I64 => 64,
549549
IntTy::I128 => 128,
550550
},
551551
ty::TyUint(i) => match i {
552-
UintTy::Us => tcx.data_layout.pointer_size.bits(),
552+
UintTy::Usize => tcx.data_layout.pointer_size.bits(),
553553
UintTy::U8 => 8,
554554
UintTy::U16 => 16,
555555
UintTy::U32 => 32,
@@ -562,7 +562,7 @@ fn int_ty_to_nbits(typ: Ty, tcx: TyCtxt) -> u64 {
562562

563563
fn is_isize_or_usize(typ: Ty) -> bool {
564564
match typ.sty {
565-
ty::TyInt(IntTy::Is) | ty::TyUint(UintTy::Us) => true,
565+
ty::TyInt(IntTy::Isize) | ty::TyUint(UintTy::Usize) => true,
566566
_ => false,
567567
}
568568
}
@@ -1151,31 +1151,31 @@ fn detect_extreme_expr<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) -
11511151

11521152
let which = match (&ty.sty, cv.val) {
11531153
(&ty::TyBool, Bool(false)) |
1154-
(&ty::TyInt(IntTy::Is), Integral(Isize(Is32(::std::i32::MIN)))) |
1155-
(&ty::TyInt(IntTy::Is), Integral(Isize(Is64(::std::i64::MIN)))) |
1154+
(&ty::TyInt(IntTy::Isize), Integral(Isize(Is32(::std::i32::MIN)))) |
1155+
(&ty::TyInt(IntTy::Isize), Integral(Isize(Is64(::std::i64::MIN)))) |
11561156
(&ty::TyInt(IntTy::I8), Integral(I8(::std::i8::MIN))) |
11571157
(&ty::TyInt(IntTy::I16), Integral(I16(::std::i16::MIN))) |
11581158
(&ty::TyInt(IntTy::I32), Integral(I32(::std::i32::MIN))) |
11591159
(&ty::TyInt(IntTy::I64), Integral(I64(::std::i64::MIN))) |
11601160
(&ty::TyInt(IntTy::I128), Integral(I128(::std::i128::MIN))) |
1161-
(&ty::TyUint(UintTy::Us), Integral(Usize(Us32(::std::u32::MIN)))) |
1162-
(&ty::TyUint(UintTy::Us), Integral(Usize(Us64(::std::u64::MIN)))) |
1161+
(&ty::TyUint(UintTy::Usize), Integral(Usize(Us32(::std::u32::MIN)))) |
1162+
(&ty::TyUint(UintTy::Usize), Integral(Usize(Us64(::std::u64::MIN)))) |
11631163
(&ty::TyUint(UintTy::U8), Integral(U8(::std::u8::MIN))) |
11641164
(&ty::TyUint(UintTy::U16), Integral(U16(::std::u16::MIN))) |
11651165
(&ty::TyUint(UintTy::U32), Integral(U32(::std::u32::MIN))) |
11661166
(&ty::TyUint(UintTy::U64), Integral(U64(::std::u64::MIN))) |
11671167
(&ty::TyUint(UintTy::U128), Integral(U128(::std::u128::MIN))) => Minimum,
11681168

11691169
(&ty::TyBool, Bool(true)) |
1170-
(&ty::TyInt(IntTy::Is), Integral(Isize(Is32(::std::i32::MAX)))) |
1171-
(&ty::TyInt(IntTy::Is), Integral(Isize(Is64(::std::i64::MAX)))) |
1170+
(&ty::TyInt(IntTy::Isize), Integral(Isize(Is32(::std::i32::MAX)))) |
1171+
(&ty::TyInt(IntTy::Isize), Integral(Isize(Is64(::std::i64::MAX)))) |
11721172
(&ty::TyInt(IntTy::I8), Integral(I8(::std::i8::MAX))) |
11731173
(&ty::TyInt(IntTy::I16), Integral(I16(::std::i16::MAX))) |
11741174
(&ty::TyInt(IntTy::I32), Integral(I32(::std::i32::MAX))) |
11751175
(&ty::TyInt(IntTy::I64), Integral(I64(::std::i64::MAX))) |
11761176
(&ty::TyInt(IntTy::I128), Integral(I128(::std::i128::MAX))) |
1177-
(&ty::TyUint(UintTy::Us), Integral(Usize(Us32(::std::u32::MAX)))) |
1178-
(&ty::TyUint(UintTy::Us), Integral(Usize(Us64(::std::u64::MAX)))) |
1177+
(&ty::TyUint(UintTy::Usize), Integral(Usize(Us32(::std::u32::MAX)))) |
1178+
(&ty::TyUint(UintTy::Usize), Integral(Usize(Us64(::std::u64::MAX)))) |
11791179
(&ty::TyUint(UintTy::U8), Integral(U8(::std::u8::MAX))) |
11801180
(&ty::TyUint(UintTy::U16), Integral(U16(::std::u16::MAX))) |
11811181
(&ty::TyUint(UintTy::U32), Integral(U32(::std::u32::MAX))) |
@@ -1329,7 +1329,7 @@ fn numeric_cast_precast_bounds<'a>(cx: &LateContext, expr: &'a Expr) -> Option<(
13291329
FullInt::S(i128::from(i64::max_value())),
13301330
),
13311331
IntTy::I128 => (FullInt::S(i128::min_value() as i128), FullInt::S(i128::max_value() as i128)),
1332-
IntTy::Is => (FullInt::S(isize::min_value() as i128), FullInt::S(isize::max_value() as i128)),
1332+
IntTy::Isize => (FullInt::S(isize::min_value() as i128), FullInt::S(isize::max_value() as i128)),
13331333
}),
13341334
ty::TyUint(uint_ty) => Some(match uint_ty {
13351335
UintTy::U8 => (FullInt::U(u128::from(u8::min_value())), FullInt::U(u128::from(u8::max_value()))),
@@ -1346,7 +1346,7 @@ fn numeric_cast_precast_bounds<'a>(cx: &LateContext, expr: &'a Expr) -> Option<(
13461346
FullInt::U(u128::from(u64::max_value())),
13471347
),
13481348
UintTy::U128 => (FullInt::U(u128::min_value() as u128), FullInt::U(u128::max_value() as u128)),
1349-
UintTy::Us => (FullInt::U(usize::min_value() as u128), FullInt::U(usize::max_value() as u128)),
1349+
UintTy::Usize => (FullInt::U(usize::min_value() as u128), FullInt::U(usize::max_value() as u128)),
13501350
}),
13511351
_ => None,
13521352
}

0 commit comments

Comments
 (0)