type alias covers whole return
This commit is contained in:
parent
bd52f58e3b
commit
bd24b4006c
2 changed files with 7 additions and 6 deletions
|
@ -207,12 +207,13 @@ impl<'b, 'a, 'tcx> Gatherer<'b, 'a, 'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub type MoveDat<'tcx> = (FxHashMap<Local, Place<'tcx>>, MoveData<'tcx>);
|
pub type MoveDat<'tcx> = Result<
|
||||||
|
(FxHashMap<Local, Place<'tcx>>, MoveData<'tcx>),
|
||||||
|
(MoveData<'tcx>, Vec<(Place<'tcx>, MoveError<'tcx>)>),
|
||||||
|
>;
|
||||||
|
|
||||||
impl<'a, 'tcx> MoveDataBuilder<'a, 'tcx> {
|
impl<'a, 'tcx> MoveDataBuilder<'a, 'tcx> {
|
||||||
fn finalize(
|
fn finalize(self) -> MoveDat<'tcx> {
|
||||||
self,
|
|
||||||
) -> Result<MoveDat<'tcx>, (MoveData<'tcx>, Vec<(Place<'tcx>, MoveError<'tcx>)>)> {
|
|
||||||
debug!("{}", {
|
debug!("{}", {
|
||||||
debug!("moves for {:?}:", self.body.span);
|
debug!("moves for {:?}:", self.body.span);
|
||||||
for (j, mo) in self.data.moves.iter_enumerated() {
|
for (j, mo) in self.data.moves.iter_enumerated() {
|
||||||
|
@ -237,7 +238,7 @@ pub(super) fn gather_moves<'tcx>(
|
||||||
body: &Body<'tcx>,
|
body: &Body<'tcx>,
|
||||||
tcx: TyCtxt<'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
param_env: ty::ParamEnv<'tcx>,
|
param_env: ty::ParamEnv<'tcx>,
|
||||||
) -> Result<MoveDat<'tcx>, (MoveData<'tcx>, Vec<(Place<'tcx>, MoveError<'tcx>)>)> {
|
) -> MoveDat<'tcx> {
|
||||||
let mut builder = MoveDataBuilder::new(body, tcx, param_env);
|
let mut builder = MoveDataBuilder::new(body, tcx, param_env);
|
||||||
|
|
||||||
builder.gather_args();
|
builder.gather_args();
|
||||||
|
|
|
@ -387,7 +387,7 @@ impl<'tcx> MoveData<'tcx> {
|
||||||
body: &Body<'tcx>,
|
body: &Body<'tcx>,
|
||||||
tcx: TyCtxt<'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
param_env: ParamEnv<'tcx>,
|
param_env: ParamEnv<'tcx>,
|
||||||
) -> Result<MoveDat<'tcx>, (MoveData<'tcx>, Vec<(Place<'tcx>, MoveError<'tcx>)>)> {
|
) -> MoveDat<'tcx> {
|
||||||
builder::gather_moves(body, tcx, param_env)
|
builder::gather_moves(body, tcx, param_env)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue