Skip to content

Commit 7ff8980

Browse files
committed
put the RegionConstraintData into an Rc
1 parent 8825f42 commit 7ff8980

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/librustc_mir/borrow_check/nll/subtype_constraint_generation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl<'cx, 'tcx> SubtypeConstraintGenerator<'cx, 'tcx> {
8888
constraints,
8989
verifys,
9090
givens,
91-
} = data;
91+
} = &**data;
9292

9393
let span = self.mir
9494
.source_info(locations.from_location().unwrap_or(Location::START))

src/librustc_mir/borrow_check/nll/type_check/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ use rustc::ty::error::TypeError;
3030
use rustc::ty::fold::TypeFoldable;
3131
use rustc::ty::{self, ToPolyTraitRef, Ty, TyCtxt, TypeVariants};
3232
use std::fmt;
33+
use std::rc::Rc;
3334
use syntax::ast;
3435
use syntax_pos::{Span, DUMMY_SP};
3536
use transform::{MirPass, MirSource};
@@ -616,7 +617,7 @@ pub struct OutlivesSet<'tcx> {
616617
/// Constraints generated. In terms of the NLL RFC, when you have
617618
/// a constraint `R1: R2 @ P`, the data in there specifies things
618619
/// like `R1: R2`.
619-
pub data: RegionConstraintData<'tcx>,
620+
pub data: Rc<RegionConstraintData<'tcx>>,
620621
}
621622

622623
/// The `Locations` type summarizes *where* region constraints are
@@ -749,6 +750,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
749750
"fully_perform_op: constraints generated at {:?} are {:#?}",
750751
locations, data
751752
);
753+
let data = Rc::new(data);
752754
self.constraints
753755
.outlives_sets
754756
.push(OutlivesSet { locations, data });

0 commit comments

Comments
 (0)