]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/drop_forget_ref.rs
Update for rustc 1.19.0-nightly (4bf5c99af 2017-06-10).
[rust.git] / clippy_lints / src / drop_forget_ref.rs
index 9d0201b0d09093505999617b01ced14669a9ca8e..c938f17cd4979c08244aed58949582bd5a2f698b 100644 (file)
     "calls to `std::mem::forget` with a value that implements Copy"
 }
 
-const DROP_REF_SUMMARY: &str = "calls to `std::mem::drop` with a reference instead of an owned value.
+const DROP_REF_SUMMARY: &str = "calls to `std::mem::drop` with a reference instead of an owned value. \
                                Dropping a reference does nothing.";
-const FORGET_REF_SUMMARY: &str = "calls to `std::mem::forget` with a reference instead of an owned value.
+const FORGET_REF_SUMMARY: &str = "calls to `std::mem::forget` with a reference instead of an owned value. \
                                  Forgetting a reference does nothing.";
-const DROP_COPY_SUMMARY: &str = "calls to `std::mem::drop` with a value that implements Copy.
+const DROP_COPY_SUMMARY: &str = "calls to `std::mem::drop` with a value that implements Copy. \
                                 Dropping a copy leaves the original intact.";
-const FORGET_COPY_SUMMARY: &str = "calls to `std::mem::forget` with a value that implements Copy.
+const FORGET_COPY_SUMMARY: &str = "calls to `std::mem::forget` with a value that implements Copy. \
                                   Forgetting a copy leaves the original intact.";
 
 #[allow(missing_copy_implementations)]
 
 impl LintPass for Pass {
     fn get_lints(&self) -> LintArray {
-        lint_array!(DROP_REF, FORGET_REF)
+        lint_array!(DROP_REF, FORGET_REF, DROP_COPY, FORGET_COPY)
     }
 }
 
@@ -136,7 +136,7 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
                                    &msg,
                                    arg.span,
                                    &format!("argument has type {}", arg_ty.sty));
-            } else if is_copy(cx, arg_ty, cx.tcx.hir.get_parent(arg.id)) {
+            } else if is_copy(cx, arg_ty) {
                 if match_def_path(cx.tcx, def_id, &paths::DROP) {
                     lint = DROP_COPY;
                     msg = DROP_COPY_SUMMARY.to_string();