]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_lint/types.rs
Auto merge of #29291 - petrochenkov:privacy, r=alexcrichton
[rust.git] / src / librustc_lint / types.rs
index cf6cc9bb7ce12a9419096806acf67071b88b8570..abbb733d8848da10d40941142d93e820d8e7dabc 100644 (file)
@@ -120,7 +120,7 @@ fn check_expr(&mut self, cx: &LateContext, e: &hir::Expr) {
                             if let ast::LitInt(shift, _) = lit.node { shift >= bits }
                             else { false }
                         } else {
-                            match eval_const_expr_partial(cx.tcx, &r, ExprTypeChecked) {
+                            match eval_const_expr_partial(cx.tcx, &r, ExprTypeChecked, None) {
                                 Ok(ConstVal::Int(shift)) => { shift as u64 >= bits },
                                 Ok(ConstVal::Uint(shift)) => { shift >= bits },
                                 _ => { false }
@@ -497,14 +497,6 @@ fn check_type_for_ffi(&self,
                 FfiSafe
             }
 
-            ty::TyInt(ast::TyIs) => {
-                FfiUnsafe("found Rust type `isize` in foreign module, while \
-                          `libc::c_int` or `libc::c_long` should be used")
-            }
-            ty::TyUint(ast::TyUs) => {
-                FfiUnsafe("found Rust type `usize` in foreign module, while \
-                          `libc::c_uint` or `libc::c_ulong` should be used")
-            }
             ty::TyChar => {
                 FfiUnsafe("found Rust type `char` in foreign module, while \
                            `u32` or `libc::wchar_t` should be used")
@@ -667,10 +659,8 @@ fn check_foreign_fn(cx: &LateContext, decl: &hir::FnDecl) {
             }
         }
 
-        match it.node {
-            hir::ItemForeignMod(ref nmod)
-                if nmod.abi != abi::RustIntrinsic &&
-                   nmod.abi != abi::PlatformIntrinsic => {
+        if let hir::ItemForeignMod(ref nmod) = it.node {
+            if nmod.abi != abi::RustIntrinsic && nmod.abi != abi::PlatformIntrinsic {
                 for ni in &nmod.items {
                     match ni.node {
                         hir::ForeignItemFn(ref decl, _) => check_foreign_fn(cx, &**decl),
@@ -678,8 +668,6 @@ fn check_foreign_fn(cx: &LateContext, decl: &hir::FnDecl) {
                     }
                 }
             }
-            _ => (),
         }
     }
 }
-