]> git.lizzy.rs Git - rust.git/commitdiff
Merge pull request #1173 from oli-obk/never_rustup
authorOliver Schneider <oli-obk@users.noreply.github.com>
Wed, 17 Aug 2016 16:10:33 +0000 (18:10 +0200)
committerGitHub <noreply@github.com>
Wed, 17 Aug 2016 16:10:33 +0000 (18:10 +0200)
rustup for the ! type

CHANGELOG.md
Cargo.toml
clippy_lints/Cargo.toml
clippy_lints/src/cyclomatic_complexity.rs
clippy_lints/src/eta_reduction.rs
clippy_lints/src/methods.rs
clippy_lints/src/new_without_default.rs
clippy_lints/src/utils/mod.rs

index b0c6454b2ae6cd297189dcb18bd402eb1f4a4021..c92ad5ca14022a7262c1d6a0dec56a4c07b8e980 100644 (file)
@@ -1,14 +1,17 @@
 # Change Log
 All notable changes to this project will be documented in this file.
 
-## 0.0.83 — TBD
+## 0.0.84 — TBD
+
+## 0.0.83 — 2016-08-17
+* Rustup to *rustc 1.12.0-nightly (1bf5fa326 2016-08-16)*
 * New lints: [`print_with_newline`], [`useless_attribute`]
 
 ## 0.0.82 — 2016-08-17
 * Rustup to *rustc 1.12.0-nightly (197be89f3 2016-08-15)*
 * New lint: [`module_inception`]
 
-## 0.0.81 - 2016-08-14
+## 0.0.81  2016-08-14
 * Rustup to *rustc 1.12.0-nightly (1deb02ea6 2016-08-12)*
 * New lints: [`eval_order_dependence`], [`mixed_case_hex_literals`], [`unseparated_literal_suffix`]
 * False positive fix in [`too_many_arguments`]
index 61d2e8bec6cc0bc3149f4d54a0d74ccb42cc031a..df7301cf2948525a057789a189c630f9ec54a988 100644 (file)
@@ -1,6 +1,6 @@
 [package]
 name = "clippy"
-version = "0.0.82"
+version = "0.0.83"
 authors = [
        "Manish Goregaokar <manishsmail@gmail.com>",
        "Andre Bogus <bogusandre@gmail.com>",
@@ -25,7 +25,7 @@ test = false
 
 [dependencies]
 # begin automatic update
-clippy_lints = { version = "0.0.82", path = "clippy_lints" }
+clippy_lints = { version = "0.0.83", path = "clippy_lints" }
 # end automatic update
 
 [dev-dependencies]
index 896f4a6fb926bc0e124cc2ff626c4898fd5e1c63..49fdd2ae714852539724422f158fc58b094aac48 100644 (file)
@@ -1,7 +1,7 @@
 [package]
 name = "clippy_lints"
 # begin automatic update
-version = "0.0.82"
+version = "0.0.83"
 # end automatic update
 authors = [
        "Manish Goregaokar <manishsmail@gmail.com>",
index 3e3237ffe08796b44ca4d00c8e242fad6415ffcc..faa56bccb2280cdec7ee74823a6fcd95f5ae4702 100644 (file)
@@ -142,7 +142,7 @@ fn visit_expr(&mut self, e: &'a Expr) {
                 let ty = self.tcx.node_id_to_type(callee.id);
                 match ty.sty {
                     ty::TyFnDef(_, _, ty) |
-                    ty::TyFnPtr(ty) if ty.sig.skip_binder().output.diverges() => {
+                    ty::TyFnPtr(ty) if ty.sig.skip_binder().output.sty == ty::TyNever => {
                         self.divergence += 1;
                     }
                     _ => (),
index 1d9eb70b008de253959eff1731815ac1162454af..ad7da71eab05c29308ac9c9d1e31ae059d9fd174 100644 (file)
@@ -71,7 +71,7 @@ fn check_closure(cx: &LateContext, expr: &Expr) {
                     ty::TyFnDef(_, _, fn_ty) |
                     ty::TyFnPtr(fn_ty) => {
                         if fn_ty.unsafety == Unsafety::Unsafe ||
-                           fn_ty.sig.skip_binder().output == ty::FnOutput::FnDiverging {
+                           fn_ty.sig.skip_binder().output.sty == ty::TyNever {
                             return;
                         }
                     }
index 75f41661d7e29743674ddf0af598e428fc6707f9..c914d5210ecf3680a00df5b7469a919c9bad9e81 100644 (file)
@@ -590,7 +590,7 @@ fn check_impl_item(&mut self, cx: &LateContext, implitem: &hir::ImplItem) {
 
             let ret_ty = return_ty(cx, implitem.id);
             if &name.as_str() == &"new" &&
-               !ret_ty.map_or(false, |ret_ty| ret_ty.walk().any(|t| same_tys(cx, t, ty, implitem.id))) {
+               !ret_ty.walk().any(|t| same_tys(cx, t, ty, implitem.id)) {
                 span_lint(cx,
                           NEW_RET_NO_SELF,
                           explicit_self.span,
index 7a2db85b3c71ac195a91055686eda57bd8ab9b64..b1bffb8c2362eb11fae84330b036a7b7cb809da3 100644 (file)
@@ -106,8 +106,7 @@ fn check_fn(&mut self, cx: &LateContext, kind: FnKind, decl: &hir::FnDecl, _: &h
                     .ty;
                 if_let_chain!{[
                     self_ty.walk_shallow().next().is_none(), // implements_trait does not work with generics
-                    let Some(ret_ty) = return_ty(cx, id),
-                    same_tys(cx, self_ty, ret_ty, id),
+                    same_tys(cx, self_ty, return_ty(cx, id), id),
                     let Some(default_trait_id) = get_trait_def_id(cx, &paths::DEFAULT_TRAIT),
                     !implements_trait(cx, self_ty, default_trait_id, Vec::new())
                 ], {
index 62174f0359599fe4835975806ab4c00ae1164fa4..c458bb1dff3909966d6b3999494bc0248bfbaa14 100644 (file)
@@ -692,16 +692,12 @@ pub fn camel_case_from(s: &str) -> usize {
     last_i
 }
 
-/// Convenience function to get the return type of a function or `None` if the function diverges.
-pub fn return_ty<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, fn_item: NodeId) -> Option<ty::Ty<'tcx>> {
+/// Convenience function to get the return type of a function
+pub fn return_ty<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, fn_item: NodeId) -> ty::Ty<'tcx> {
     let parameter_env = ty::ParameterEnvironment::for_item(cx.tcx, fn_item);
     let fn_sig = cx.tcx.node_id_to_type(fn_item).fn_sig().subst(cx.tcx, parameter_env.free_substs);
     let fn_sig = cx.tcx.liberate_late_bound_regions(parameter_env.free_id_outlive, &fn_sig);
-    if let ty::FnConverging(ret_ty) = fn_sig.output {
-        Some(ret_ty)
-    } else {
-        None
-    }
+    fn_sig.output
 }
 
 /// Check if two types are the same.