Prevent symbocalypse

This commit is contained in:
Oliver Scherer
2019-05-17 23:53:54 +02:00
parent 11194e3d05
commit f7f85a0dca
78 changed files with 686 additions and 1160 deletions

View File

@@ -122,10 +122,10 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for DropForgetRef {
let arg_ty = cx.tables.expr_ty(arg);
if let ty::Ref(..) = arg_ty.sty {
if match_def_path(cx, def_id, &*paths::DROP) {
if match_def_path(cx, def_id, &paths::DROP) {
lint = DROP_REF;
msg = DROP_REF_SUMMARY.to_string();
} else if match_def_path(cx, def_id, &*paths::MEM_FORGET) {
} else if match_def_path(cx, def_id, &paths::MEM_FORGET) {
lint = FORGET_REF;
msg = FORGET_REF_SUMMARY.to_string();
} else {
@@ -138,10 +138,10 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for DropForgetRef {
arg.span,
&format!("argument has type {}", arg_ty));
} else if is_copy(cx, arg_ty) {
if match_def_path(cx, def_id, &*paths::DROP) {
if match_def_path(cx, def_id, &paths::DROP) {
lint = DROP_COPY;
msg = DROP_COPY_SUMMARY.to_string();
} else if match_def_path(cx, def_id, &*paths::MEM_FORGET) {
} else if match_def_path(cx, def_id, &paths::MEM_FORGET) {
lint = FORGET_COPY;
msg = FORGET_COPY_SUMMARY.to_string();
} else {