Rollup merge of #108101 - matthiaskrgr:noclonecopy, r=compiler-errors

don't clone types that are copy
This commit is contained in:
Dylan DPC 2023-02-16 11:40:21 +05:30 committed by GitHub
commit ef0b12189e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 7 deletions

View file

@ -547,7 +547,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
response.value.certainty == Certainty::Yes
&& response.has_no_inference_or_external_constraints()
}) {
return Ok(response.clone());
return Ok(*response);
}
let certainty = candidates.iter().fold(Certainty::AMBIGUOUS, |certainty, response| {

View file

@ -599,7 +599,7 @@ fn virtual_call_violation_for_method<'tcx>(
return false;
}
contains_illegal_self_type_reference(tcx, trait_def_id, pred.clone())
contains_illegal_self_type_reference(tcx, trait_def_id, pred)
}) {
return Some(MethodViolationCode::WhereClauseReferencesSelf);
}