Skip to content

Commit

Permalink
Disable AST unused mut check when using MIR borrowck
Browse files Browse the repository at this point in the history
  • Loading branch information
KiChjang committed Apr 28, 2018
1 parent 2338adf commit 3e423d0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/librustc_borrowck/borrowck/mod.rs
Expand Up @@ -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(),
Expand Down

0 comments on commit 3e423d0

Please sign in to comment.