use crate::hir::def_id::DefId;
use lint::{LateContext, LintArray, LintContext};
use lint::{LateLintPass, LintPass};
-use rustc::hir::{is_range_literal, ExprKind, Node};
+use rustc::lint;
+use rustc::mir::interpret::{sign_extend, truncate};
use rustc::ty::layout::{self, IntegerExt, LayoutOf, SizeSkeleton, VariantIdx};
use rustc::ty::subst::SubstsRef;
use rustc::ty::{self, AdtKind, ParamEnv, Ty, TyCtxt};
-use rustc::{lint, util};
+use rustc_data_structures::fx::FxHashSet;
+use rustc_hir as hir;
+use rustc_hir::{is_range_literal, ExprKind, Node};
use rustc_index::vec::Idx;
-use util::nodemap::FxHashSet;
-
-use std::cmp;
-use std::{f32, f64, i16, i32, i64, i8, u16, u32, u64, u8};
-
+use rustc_span::source_map;
+use rustc_span::symbol::sym;
+use rustc_span::Span;
use rustc_target::spec::abi::Abi;
use syntax::errors::Applicability;
-use syntax::symbol::sym;
-use syntax::{ast, attr, source_map};
-use syntax_pos::Span;
-
-use rustc::hir;
-
-use rustc::mir::interpret::{sign_extend, truncate};
+use syntax::{ast, attr};
use log::debug;
+use std::cmp;
+use std::{f32, f64, i16, i32, i64, i8, u16, u32, u64, u8};
declare_lint! {
UNUSED_COMPARISONS,
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TypeLimits {
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx hir::Expr<'tcx>) {
match e.kind {
- hir::ExprKind::Unary(hir::UnNeg, ref expr) => {
+ hir::ExprKind::Unary(hir::UnOp::UnNeg, ref expr) => {
// propagate negation, if the negation itself isn't negated
if self.negated_expr_id != e.hir_id {
self.negated_expr_id = expr.hir_id;
self.check_type_for_ffi_and_report_errors(input_hir.span, input_ty, false);
}
- if let hir::Return(ref ret_hir) = decl.output {
+ if let hir::FunctionRetTy::Return(ref ret_hir) = decl.output {
let ret_ty = sig.output();
if !ret_ty.is_unit() {
self.check_type_for_ffi_and_report_errors(ret_hir.span, ret_ty, false);