don't clone types that are copy

This commit is contained in:
Matthias Krüger
2023-02-15 23:18:40 +01:00
parent 2d14db321b
commit e087f61075
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| {