Skip to content

Commit 37e44c5

Browse files
author
Tage Johansson
committed
fix Clippy warning about cloning reference counted pointers
1 parent 1bfbc9f commit 37e44c5

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

compiler/rustc_borrowck/src/nll.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ pub(crate) fn compute_regions<'a, 'tcx>(
124124
infcx,
125125
constraints,
126126
universal_region_relations,
127-
location_map.clone(),
127+
Rc::clone(&location_map),
128128
);
129129

130130
// If requested: dump NLL facts, and run legacy polonius analysis.

compiler/rustc_borrowck/src/region_infer/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,11 @@ impl<'tcx> RegionInferenceContext<'tcx> {
487487
sccs_info(infcx, &constraint_sccs);
488488
}
489489

490-
let mut scc_values =
491-
RegionValues::new(location_map.clone(), universal_regions.len(), placeholder_indices);
490+
let mut scc_values = RegionValues::new(
491+
Rc::clone(&location_map),
492+
universal_regions.len(),
493+
placeholder_indices,
494+
);
492495

493496
for region in liveness_constraints.regions() {
494497
let scc = constraint_sccs.scc(region);

0 commit comments

Comments
 (0)