"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)
}
}
&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();