From bd24b4006c98425aa994763acf7f7e18607c7df1 Mon Sep 17 00:00:00 2001 From: ouz-a Date: Thu, 28 Jul 2022 13:52:49 +0300 Subject: [PATCH] type alias covers whole return --- compiler/rustc_mir_dataflow/src/move_paths/builder.rs | 11 ++++++----- compiler/rustc_mir_dataflow/src/move_paths/mod.rs | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/compiler/rustc_mir_dataflow/src/move_paths/builder.rs b/compiler/rustc_mir_dataflow/src/move_paths/builder.rs index b8634fd568b..116e5c1f3ce 100644 --- a/compiler/rustc_mir_dataflow/src/move_paths/builder.rs +++ b/compiler/rustc_mir_dataflow/src/move_paths/builder.rs @@ -207,12 +207,13 @@ impl<'b, 'a, 'tcx> Gatherer<'b, 'a, 'tcx> { } } -pub type MoveDat<'tcx> = (FxHashMap>, MoveData<'tcx>); +pub type MoveDat<'tcx> = Result< + (FxHashMap>, MoveData<'tcx>), + (MoveData<'tcx>, Vec<(Place<'tcx>, MoveError<'tcx>)>), +>; impl<'a, 'tcx> MoveDataBuilder<'a, 'tcx> { - fn finalize( - self, - ) -> Result, (MoveData<'tcx>, Vec<(Place<'tcx>, MoveError<'tcx>)>)> { + fn finalize(self) -> MoveDat<'tcx> { debug!("{}", { debug!("moves for {:?}:", self.body.span); for (j, mo) in self.data.moves.iter_enumerated() { @@ -237,7 +238,7 @@ pub(super) fn gather_moves<'tcx>( body: &Body<'tcx>, tcx: TyCtxt<'tcx>, param_env: ty::ParamEnv<'tcx>, -) -> Result, (MoveData<'tcx>, Vec<(Place<'tcx>, MoveError<'tcx>)>)> { +) -> MoveDat<'tcx> { let mut builder = MoveDataBuilder::new(body, tcx, param_env); builder.gather_args(); diff --git a/compiler/rustc_mir_dataflow/src/move_paths/mod.rs b/compiler/rustc_mir_dataflow/src/move_paths/mod.rs index aeb985143fd..a951c5b0b1c 100644 --- a/compiler/rustc_mir_dataflow/src/move_paths/mod.rs +++ b/compiler/rustc_mir_dataflow/src/move_paths/mod.rs @@ -387,7 +387,7 @@ impl<'tcx> MoveData<'tcx> { body: &Body<'tcx>, tcx: TyCtxt<'tcx>, param_env: ParamEnv<'tcx>, - ) -> Result, (MoveData<'tcx>, Vec<(Place<'tcx>, MoveError<'tcx>)>)> { + ) -> MoveDat<'tcx> { builder::gather_moves(body, tcx, param_env) }