]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_lint/types.rs
Rollup merge of #67948 - llogiq:gallop, r=Mark-Simulacrum
[rust.git] / src / librustc_lint / types.rs
index 7983c0e35c8db8b20280e20364a14d500bce3bea..ab6841c0c09bcf26d946d6dc6c2bf0d984eb1dee 100644 (file)
@@ -1,30 +1,25 @@
 #![allow(non_snake_case)]
 
-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::{LateContext, LateLintPass, LintContext};
+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_errors::Applicability;
+use rustc_hir as hir;
+use rustc_hir::def_id::DefId;
+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::{ast, attr, source_map};
-
-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,
@@ -379,7 +374,7 @@ fn lint_literal<'a, 'tcx>(
 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;
@@ -972,7 +967,7 @@ fn check_foreign_fn(&mut self, id: hir::HirId, decl: &hir::FnDecl<'_>) {
             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);