Auto merge of #79729 - matthiaskrgr:clones_, r=jyn514

remove redundant clones
This commit is contained in:
bors 2020-12-06 03:38:56 +00:00
commit 4d26de6891
3 changed files with 3 additions and 3 deletions

View File

@ -505,7 +505,7 @@ fn canonicalize<V>(
let canon_value = Canonical {
max_universe: ty::UniverseIndex::ROOT,
variables: List::empty(),
value: value.clone(),
value,
};
return canon_value;
}

View File

@ -581,7 +581,7 @@ pub fn replace_escaping_bound_vars<T, F, G, H>(
let mut const_map = FxHashMap::default();
if !value.has_escaping_bound_vars() {
(value.clone(), region_map)
(value, region_map)
} else {
let mut real_fld_r = |br| *region_map.entry(br).or_insert_with(|| fld_r(br));

View File

@ -49,7 +49,7 @@ fn normalize<T>(&self, value: T) -> Result<Normalized<'tcx, T>, NoSolution>
self.param_env,
);
if !value.has_projections() {
return Ok(Normalized { value: value.clone(), obligations: vec![] });
return Ok(Normalized { value, obligations: vec![] });
}
let mut normalizer = QueryNormalizer {