Merge pull request #2758 from CAD97/patch-1

Update for rust-lang/rust#50536
This commit is contained in:
Oliver Schneider 2018-05-14 11:26:43 +02:00 committed by GitHub
commit ff0f8d5ac3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -201,7 +201,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
if let ty::TypeVariants::TyAdt(def, ..) = ty.sty { if let ty::TypeVariants::TyAdt(def, ..) = ty.sty {
if let Some(span) = cx.tcx.hir.span_if_local(def.did) { if let Some(span) = cx.tcx.hir.span_if_local(def.did) {
let param_env = ty::ParamEnv::empty(); let param_env = ty::ParamEnv::empty();
if param_env.can_type_implement_copy(cx.tcx, ty, span).is_ok() { if param_env.can_type_implement_copy(cx.tcx, ty).is_ok() {
db.span_help(span, "consider marking this type as Copy"); db.span_help(span, "consider marking this type as Copy");
} }
} }