Skip to content

Commit 3e423d0

Browse files
committed
Disable AST unused mut check when using MIR borrowck
1 parent 2338adf commit 3e423d0

File tree

1 file changed

+4
-1
lines changed
  • src/librustc_borrowck/borrowck

1 file changed

+4
-1
lines changed

src/librustc_borrowck/borrowck/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,10 @@ fn borrowck<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, owner_def_id: DefId)
144144
{
145145
check_loans::check_loans(&mut bccx, &loan_dfcx, &flowed_moves, &all_loans, body);
146146
}
147-
unused::check(&mut bccx, body);
147+
148+
if !tcx.use_mir_borrowck() {
149+
unused::check(&mut bccx, body);
150+
}
148151

149152
Lrc::new(BorrowCheckResult {
150153
used_mut_nodes: bccx.used_mut_nodes.into_inner(),

0 commit comments

Comments
 (0)