Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e9c3d3d

Browse files
authoredAug 23, 2018
Merge pull request #3072 from matthiaskrgr/rustup
rustup, fix breakage introduced by rust-lang/rust#53581 and rust-lang/rust#53459
2 parents f05a103 + 8ab16b6 commit e9c3d3d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+166
-169
lines changed
 

‎clippy_lints/src/bytecount.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ByteCount {
6565
_ => { return; }
6666
}
6767
};
68-
if ty::TyUint(UintTy::U8) != walk_ptrs_ty(cx.tables.expr_ty(needle)).sty {
68+
if ty::Uint(UintTy::U8) != walk_ptrs_ty(cx.tables.expr_ty(needle)).sty {
6969
return;
7070
}
7171
let haystack = if let ExprKind::MethodCall(ref path, _, ref args) =

‎clippy_lints/src/consts.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ impl Hash for Constant {
123123
}
124124

125125
impl Constant {
126-
pub fn partial_cmp(tcx: TyCtxt<'_, '_, '_>, cmp_type: &ty::TypeVariants<'_>, left: &Self, right: &Self) -> Option<Ordering> {
126+
pub fn partial_cmp(tcx: TyCtxt<'_, '_, '_>, cmp_type: &ty::TyKind<'_>, left: &Self, right: &Self) -> Option<Ordering> {
127127
match (left, right) {
128128
(&Constant::Str(ref ls), &Constant::Str(ref rs)) => Some(ls.cmp(rs)),
129129
(&Constant::Char(ref l), &Constant::Char(ref r)) => Some(l.cmp(r)),
130130
(&Constant::Int(l), &Constant::Int(r)) => {
131-
if let ty::TyInt(int_ty) = *cmp_type {
131+
if let ty::Int(int_ty) = *cmp_type {
132132
Some(sext(tcx, l, int_ty).cmp(&sext(tcx, r, int_ty)))
133133
} else {
134134
Some(l.cmp(&r))
@@ -166,8 +166,8 @@ pub fn lit_to_constant<'tcx>(lit: &LitKind, ty: Ty<'tcx>) -> Constant {
166166
LitKind::Int(n, _) => Constant::Int(n),
167167
LitKind::Float(ref is, _) |
168168
LitKind::FloatUnsuffixed(ref is) => match ty.sty {
169-
ty::TyFloat(FloatTy::F32) => Constant::F32(is.as_str().parse().unwrap()),
170-
ty::TyFloat(FloatTy::F64) => Constant::F64(is.as_str().parse().unwrap()),
169+
ty::Float(FloatTy::F32) => Constant::F32(is.as_str().parse().unwrap()),
170+
ty::Float(FloatTy::F64) => Constant::F64(is.as_str().parse().unwrap()),
171171
_ => bug!(),
172172
},
173173
LitKind::Bool(b) => Constant::Bool(b),
@@ -220,7 +220,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
220220
ExprKind::Tup(ref tup) => self.multi(tup).map(Constant::Tuple),
221221
ExprKind::Repeat(ref value, _) => {
222222
let n = match self.tables.expr_ty(e).sty {
223-
ty::TyArray(_, n) => n.assert_usize(self.tcx).expect("array length"),
223+
ty::Array(_, n) => n.assert_usize(self.tcx).expect("array length"),
224224
_ => span_bug!(e.span, "typeck error"),
225225
};
226226
self.expr(value).map(|v| Constant::Repeat(Box::new(v), n as u64))
@@ -243,8 +243,8 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
243243
Int(value) => {
244244
let value = !value;
245245
match ty.sty {
246-
ty::TyInt(ity) => Some(Int(unsext(self.tcx, value as i128, ity))),
247-
ty::TyUint(ity) => Some(Int(clip(self.tcx, value, ity))),
246+
ty::Int(ity) => Some(Int(unsext(self.tcx, value as i128, ity))),
247+
ty::Uint(ity) => Some(Int(clip(self.tcx, value, ity))),
248248
_ => None,
249249
}
250250
},
@@ -257,7 +257,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
257257
match *o {
258258
Int(value) => {
259259
let ity = match ty.sty {
260-
ty::TyInt(ity) => ity,
260+
ty::Int(ity) => ity,
261261
_ => return None,
262262
};
263263
// sign extend
@@ -336,7 +336,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
336336
match (l, r) {
337337
(Constant::Int(l), Some(Constant::Int(r))) => {
338338
match self.tables.expr_ty(left).sty {
339-
ty::TyInt(ity) => {
339+
ty::Int(ity) => {
340340
let l = sext(self.tcx, l, ity);
341341
let r = sext(self.tcx, r, ity);
342342
let zext = |n: i128| Constant::Int(unsext(self.tcx, n, ity));
@@ -360,7 +360,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
360360
_ => None,
361361
}
362362
}
363-
ty::TyUint(_) => {
363+
ty::Uint(_) => {
364364
match op.node {
365365
BinOpKind::Add => l.checked_add(r).map(Constant::Int),
366366
BinOpKind::Sub => l.checked_sub(r).map(Constant::Int),
@@ -429,18 +429,18 @@ pub fn miri_to_const<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, result: &ty::Const<'
429429
use rustc::mir::interpret::{Scalar, ScalarMaybeUndef, ConstValue};
430430
match result.val {
431431
ConstValue::Scalar(Scalar::Bits{ bits: b, ..}) => match result.ty.sty {
432-
ty::TyBool => Some(Constant::Bool(b == 1)),
433-
ty::TyUint(_) | ty::TyInt(_) => Some(Constant::Int(b)),
434-
ty::TyFloat(FloatTy::F32) => Some(Constant::F32(f32::from_bits(b as u32))),
435-
ty::TyFloat(FloatTy::F64) => Some(Constant::F64(f64::from_bits(b as u64))),
432+
ty::Bool => Some(Constant::Bool(b == 1)),
433+
ty::Uint(_) | ty::Int(_) => Some(Constant::Int(b)),
434+
ty::Float(FloatTy::F32) => Some(Constant::F32(f32::from_bits(b as u32))),
435+
ty::Float(FloatTy::F64) => Some(Constant::F64(f64::from_bits(b as u64))),
436436
// FIXME: implement other conversion
437437
_ => None,
438438
},
439439
ConstValue::ScalarPair(Scalar::Ptr(ptr),
440440
ScalarMaybeUndef::Scalar(
441441
Scalar::Bits { bits: n, .. })) => match result.ty.sty {
442-
ty::TyRef(_, tam, _) => match tam.sty {
443-
ty::TyStr => {
442+
ty::Ref(_, tam, _) => match tam.sty {
443+
ty::Str => {
444444
let alloc = tcx
445445
.alloc_map
446446
.lock()

0 commit comments

Comments
 (0)