Skip to content

Commit 64af362

Browse files
authored
Merge pull request #2334 from Rantanen/ast-fix
Implement nightly libsyntax changes to fix the build
2 parents 752c02d + 91ecb3b commit 64af362

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
@@ -561,15 +561,15 @@ declare_lint! {
561561
fn int_ty_to_nbits(typ: Ty, tcx: TyCtxt) -> u64 {
562562
match typ.sty {
563563
ty::TyInt(i) => match i {
564-
IntTy::Is => tcx.data_layout.pointer_size.bits(),
564+
IntTy::Isize => tcx.data_layout.pointer_size.bits(),
565565
IntTy::I8 => 8,
566566
IntTy::I16 => 16,
567567
IntTy::I32 => 32,
568568
IntTy::I64 => 64,
569569
IntTy::I128 => 128,
570570
},
571571
ty::TyUint(i) => match i {
572-
UintTy::Us => tcx.data_layout.pointer_size.bits(),
572+
UintTy::Usize => tcx.data_layout.pointer_size.bits(),
573573
UintTy::U8 => 8,
574574
UintTy::U16 => 16,
575575
UintTy::U32 => 32,
@@ -582,7 +582,7 @@ fn int_ty_to_nbits(typ: Ty, tcx: TyCtxt) -> u64 {
582582

583583
fn is_isize_or_usize(typ: Ty) -> bool {
584584
match typ.sty {
585-
ty::TyInt(IntTy::Is) | ty::TyUint(UintTy::Us) => true,
585+
ty::TyInt(IntTy::Isize) | ty::TyUint(UintTy::Usize) => true,
586586
_ => false,
587587
}
588588
}
@@ -1177,31 +1177,31 @@ fn detect_extreme_expr<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) -
11771177

11781178
let which = match (&ty.sty, cv.val) {
11791179
(&ty::TyBool, Bool(false)) |
1180-
(&ty::TyInt(IntTy::Is), Integral(Isize(Is32(::std::i32::MIN)))) |
1181-
(&ty::TyInt(IntTy::Is), Integral(Isize(Is64(::std::i64::MIN)))) |
1180+
(&ty::TyInt(IntTy::Isize), Integral(Isize(Is32(::std::i32::MIN)))) |
1181+
(&ty::TyInt(IntTy::Isize), Integral(Isize(Is64(::std::i64::MIN)))) |
11821182
(&ty::TyInt(IntTy::I8), Integral(I8(::std::i8::MIN))) |
11831183
(&ty::TyInt(IntTy::I16), Integral(I16(::std::i16::MIN))) |
11841184
(&ty::TyInt(IntTy::I32), Integral(I32(::std::i32::MIN))) |
11851185
(&ty::TyInt(IntTy::I64), Integral(I64(::std::i64::MIN))) |
11861186
(&ty::TyInt(IntTy::I128), Integral(I128(::std::i128::MIN))) |
1187-
(&ty::TyUint(UintTy::Us), Integral(Usize(Us32(::std::u32::MIN)))) |
1188-
(&ty::TyUint(UintTy::Us), Integral(Usize(Us64(::std::u64::MIN)))) |
1187+
(&ty::TyUint(UintTy::Usize), Integral(Usize(Us32(::std::u32::MIN)))) |
1188+
(&ty::TyUint(UintTy::Usize), Integral(Usize(Us64(::std::u64::MIN)))) |
11891189
(&ty::TyUint(UintTy::U8), Integral(U8(::std::u8::MIN))) |
11901190
(&ty::TyUint(UintTy::U16), Integral(U16(::std::u16::MIN))) |
11911191
(&ty::TyUint(UintTy::U32), Integral(U32(::std::u32::MIN))) |
11921192
(&ty::TyUint(UintTy::U64), Integral(U64(::std::u64::MIN))) |
11931193
(&ty::TyUint(UintTy::U128), Integral(U128(::std::u128::MIN))) => Minimum,
11941194

11951195
(&ty::TyBool, Bool(true)) |
1196-
(&ty::TyInt(IntTy::Is), Integral(Isize(Is32(::std::i32::MAX)))) |
1197-
(&ty::TyInt(IntTy::Is), Integral(Isize(Is64(::std::i64::MAX)))) |
1196+
(&ty::TyInt(IntTy::Isize), Integral(Isize(Is32(::std::i32::MAX)))) |
1197+
(&ty::TyInt(IntTy::Isize), Integral(Isize(Is64(::std::i64::MAX)))) |
11981198
(&ty::TyInt(IntTy::I8), Integral(I8(::std::i8::MAX))) |
11991199
(&ty::TyInt(IntTy::I16), Integral(I16(::std::i16::MAX))) |
12001200
(&ty::TyInt(IntTy::I32), Integral(I32(::std::i32::MAX))) |
12011201
(&ty::TyInt(IntTy::I64), Integral(I64(::std::i64::MAX))) |
12021202
(&ty::TyInt(IntTy::I128), Integral(I128(::std::i128::MAX))) |
1203-
(&ty::TyUint(UintTy::Us), Integral(Usize(Us32(::std::u32::MAX)))) |
1204-
(&ty::TyUint(UintTy::Us), Integral(Usize(Us64(::std::u64::MAX)))) |
1203+
(&ty::TyUint(UintTy::Usize), Integral(Usize(Us32(::std::u32::MAX)))) |
1204+
(&ty::TyUint(UintTy::Usize), Integral(Usize(Us64(::std::u64::MAX)))) |
12051205
(&ty::TyUint(UintTy::U8), Integral(U8(::std::u8::MAX))) |
12061206
(&ty::TyUint(UintTy::U16), Integral(U16(::std::u16::MAX))) |
12071207
(&ty::TyUint(UintTy::U32), Integral(U32(::std::u32::MAX))) |
@@ -1355,7 +1355,7 @@ fn numeric_cast_precast_bounds<'a>(cx: &LateContext, expr: &'a Expr) -> Option<(
13551355
FullInt::S(i128::from(i64::max_value())),
13561356
),
13571357
IntTy::I128 => (FullInt::S(i128::min_value() as i128), FullInt::S(i128::max_value() as i128)),
1358-
IntTy::Is => (FullInt::S(isize::min_value() as i128), FullInt::S(isize::max_value() as i128)),
1358+
IntTy::Isize => (FullInt::S(isize::min_value() as i128), FullInt::S(isize::max_value() as i128)),
13591359
}),
13601360
ty::TyUint(uint_ty) => Some(match uint_ty {
13611361
UintTy::U8 => (FullInt::U(u128::from(u8::min_value())), FullInt::U(u128::from(u8::max_value()))),
@@ -1372,7 +1372,7 @@ fn numeric_cast_precast_bounds<'a>(cx: &LateContext, expr: &'a Expr) -> Option<(
13721372
FullInt::U(u128::from(u64::max_value())),
13731373
),
13741374
UintTy::U128 => (FullInt::U(u128::min_value() as u128), FullInt::U(u128::max_value() as u128)),
1375-
UintTy::Us => (FullInt::U(usize::min_value() as u128), FullInt::U(usize::max_value() as u128)),
1375+
UintTy::Usize => (FullInt::U(usize::min_value() as u128), FullInt::U(usize::max_value() as u128)),
13761376
}),
13771377
_ => None,
13781378
}

0 commit comments

Comments
 (0)