Created
May 23, 2017 00:18
-
-
Save Nashenas88/7ae2cc6b9a0baa4e361a80d39a238ab7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, save_analysis: bool) -> Option<HashMap<DefId, AnalysisResult<'a, 'tcx>>> { | |
if save_analysis { | |
info!("Performing save_analysis borrowck"); | |
let mut map = HashMap::new(); | |
for body_owner_def_id in tcx.body_owners() { | |
info!("Borrow checking {:?}", body_owner_def_id); | |
let result = borrowck(tcx, body_owner_def_id, save_analysis).unwrap(); | |
map.insert(body_owner_def_id, result); | |
} | |
Some(map) | |
} else { | |
info!("Performing non-save_analysis borrowck"); | |
for body_owner_def_id in tcx.body_owners() { | |
info!("Borrow checking {:?}", body_owner_def_id); | |
tcx.borrowck(body_owner_def_id); | |
} | |
None | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment