]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_driver/driver.rs
Auto merge of #33450 - SiegeLord:dep_info_no_analysis, r=nrc
[rust.git] / src / librustc_driver / driver.rs
index 96aa0bb5de57900a3bcc08b4266dce0c69502fb4..6837c23e41467c1651f3453589b3915addad5d52 100644 (file)
@@ -379,7 +379,7 @@ pub struct CompileState<'a, 'b, 'ast: 'a, 'tcx: 'b> where 'ast: 'tcx {
     pub resolutions: Option<&'a Resolutions>,
     pub mir_map: Option<&'b MirMap<'tcx>>,
     pub analysis: Option<&'a ty::CrateAnalysis<'a>>,
-    pub tcx: Option<&'b TyCtxt<'tcx>>,
+    pub tcx: Option<TyCtxt<'b, 'tcx, 'tcx>>,
     pub trans: Option<&'a trans::CrateTranslation>,
 }
 
@@ -493,7 +493,7 @@ fn state_after_analysis(input: &'a Input,
                             hir_crate: &'a hir::Crate,
                             analysis: &'a ty::CrateAnalysis<'a>,
                             mir_map: Option<&'b MirMap<'tcx>>,
-                            tcx: &'b TyCtxt<'tcx>,
+                            tcx: TyCtxt<'b, 'tcx, 'tcx>,
                             crate_name: &'a str)
                             -> CompileState<'a, 'b, 'ast, 'tcx> {
         CompileState {
@@ -846,7 +846,10 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session,
                                                name: &str,
                                                f: F)
                                                -> Result<R, usize>
-    where F: FnOnce(&TyCtxt<'tcx>, Option<MirMap<'tcx>>, ty::CrateAnalysis, CompileResult) -> R
+    where F: for<'a> FnOnce(TyCtxt<'a, 'tcx, 'tcx>,
+                            Option<MirMap<'tcx>>,
+                            ty::CrateAnalysis,
+                            CompileResult) -> R
 {
     macro_rules! try_with_f {
         ($e: expr, ($t: expr, $m: expr, $a: expr)) => {
@@ -1018,9 +1021,10 @@ macro_rules! try_with_f {
 }
 
 /// Run the translation phase to LLVM, after which the AST and analysis can
-pub fn phase_4_translate_to_llvm<'tcx>(tcx: &TyCtxt<'tcx>,
-                                       mut mir_map: MirMap<'tcx>,
-                                       analysis: ty::CrateAnalysis) -> trans::CrateTranslation {
+pub fn phase_4_translate_to_llvm<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
+                                           mut mir_map: MirMap<'tcx>,
+                                           analysis: ty::CrateAnalysis)
+                                           -> trans::CrateTranslation {
     let time_passes = tcx.sess.time_passes();
 
     time(time_passes,