diff options
| author | dylan_DPC <dylan.dpc@gmail.com> | 2018-07-13 16:40:24 +0530 |
|---|---|---|
| committer | dylan_DPC <dylan.dpc@gmail.com> | 2018-07-19 23:15:25 +0530 |
| commit | 4b5f0ba8c260d7c2e40c152bee11e8f329867c80 (patch) | |
| tree | b8b7aed3ec4deb8bb85061060a9d286e474d8d5d /src | |
| parent | d25231f84ad3d95d70d86a71739f309f299ec1e3 (diff) | |
generic shuffle continues
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_mir/borrow_check/nll/type_check/liveness.rs | 8 | ||||
| -rw-r--r-- | src/librustc_mir/util/liveness.rs | 12 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/librustc_mir/borrow_check/nll/type_check/liveness.rs b/src/librustc_mir/borrow_check/nll/type_check/liveness.rs index 972e92de77e..97f3b1a1c96 100644 --- a/src/librustc_mir/borrow_check/nll/type_check/liveness.rs +++ b/src/librustc_mir/borrow_check/nll/type_check/liveness.rs @@ -34,10 +34,10 @@ use super::TypeChecker; /// /// NB. This computation requires normalization; therefore, it must be /// performed before -pub(super) fn generate<'gcx, 'tcx, V: LiveVariableMap>( +pub(super) fn generate<'gcx, 'tcx>( cx: &mut TypeChecker<'_, 'gcx, 'tcx>, mir: &Mir<'tcx>, - liveness: &LivenessResults<V>, + liveness: &LivenessResults<Local>, flow_inits: &mut FlowAtLocation<MaybeInitializedPlaces<'_, 'gcx, 'tcx>>, move_data: &MoveData<'tcx>, ) { @@ -55,7 +55,7 @@ pub(super) fn generate<'gcx, 'tcx, V: LiveVariableMap>( } } -struct TypeLivenessGenerator<'gen, 'typeck, 'flow, 'gcx, 'tcx, V: LiveVariableMap> +struct TypeLivenessGenerator<'gen, 'typeck, 'flow, 'gcx, 'tcx> where 'typeck: 'gen, 'flow: 'gen, @@ -65,7 +65,7 @@ where { cx: &'gen mut TypeChecker<'typeck, 'gcx, 'tcx>, mir: &'gen Mir<'tcx>, - liveness: &'gen LivenessResults<V>, + liveness: &'gen LivenessResults<Local>, flow_inits: &'gen mut FlowAtLocation<MaybeInitializedPlaces<'flow, 'gcx, 'tcx>>, move_data: &'gen MoveData<'tcx>, drop_data: FxHashMap<Ty<'tcx>, DropData<'tcx>>, diff --git a/src/librustc_mir/util/liveness.rs b/src/librustc_mir/util/liveness.rs index 5bd81f332e6..4e78be76b61 100644 --- a/src/librustc_mir/util/liveness.rs +++ b/src/librustc_mir/util/liveness.rs @@ -103,18 +103,18 @@ pub struct LivenessMode { } /// A combination of liveness results, used in NLL. -pub struct LivenessResults<V: LiveVariableMap> { +pub struct LivenessResults<V> { /// Liveness results where a regular use makes a variable X live, /// but not a drop. - pub regular: LivenessResult<V::LiveVar>, + pub regular: LivenessResult<V>, /// Liveness results where a drop makes a variable X live, /// but not a regular use. - pub drop: LivenessResult<V::LiveVar>, + pub drop: LivenessResult<V>, } -impl<V: LiveVariableMap> LivenessResults<V> { - pub fn compute<'tcx>(mir: &Mir<'tcx>, map: &dyn LiveVariableMap<LiveVar = V>) -> LivenessResults<V::LiveVar> { +impl<V, M: LiveVariableMap<LiveVar = V>> LivenessResults<V> { + pub fn compute<'tcx>(mir: &Mir<'tcx>, map: &M) -> LivenessResults<V> { LivenessResults { regular: liveness_of_locals( &mir, @@ -138,7 +138,7 @@ impl<V: LiveVariableMap> LivenessResults<V> { /// Compute which local variables are live within the given function /// `mir`. The liveness mode `mode` determines what sorts of uses are /// considered to make a variable live (e.g., do drops count?). -pub fn liveness_of_locals<'tcx, V: LiveVariableMap>(mir: &Mir<'tcx>, mode: LivenessMode) -> LivenessResult<V::LiveVar> { +pub fn liveness_of_locals<'tcx, V>(mir: &Mir<'tcx>, mode: LivenessMode) -> LivenessResult<V> { let locals = mir.local_decls.len(); let def_use: IndexVec<_, _> = mir.basic_blocks() .iter() |
