Disable AST unused mut check when using MIR borrowck

This commit is contained in:
Keith Yeung 2018-03-01 21:14:36 -08:00
parent 2338adf48c
commit 3e423d0586

View File

@ -144,7 +144,10 @@ fn borrowck<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, owner_def_id: DefId)
{
check_loans::check_loans(&mut bccx, &loan_dfcx, &flowed_moves, &all_loans, body);
}
unused::check(&mut bccx, body);
if !tcx.use_mir_borrowck() {
unused::check(&mut bccx, body);
}
Lrc::new(BorrowCheckResult {
used_mut_nodes: bccx.used_mut_nodes.into_inner(),