Rollup merge of #108101 - matthiaskrgr:noclonecopy, r=compiler-errors
don't clone types that are copy
This commit is contained in:
commit
ef0b12189e
4 changed files with 6 additions and 7 deletions
|
@ -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| {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue