Add comments about a timer.
This commit is contained in:
parent
fec80b4475
commit
cf561904db
@ -304,6 +304,7 @@ impl Compiler {
|
|||||||
where
|
where
|
||||||
F: for<'tcx> FnOnce(&'tcx Queries<'tcx>) -> T,
|
F: for<'tcx> FnOnce(&'tcx Queries<'tcx>) -> T,
|
||||||
{
|
{
|
||||||
|
// Must declare `_timer` first so that it is dropped after `queries`.
|
||||||
let mut _timer = None;
|
let mut _timer = None;
|
||||||
let queries = Queries::new(self);
|
let queries = Queries::new(self);
|
||||||
let ret = f(&queries);
|
let ret = f(&queries);
|
||||||
@ -324,6 +325,8 @@ impl Compiler {
|
|||||||
.time("serialize_dep_graph", || gcx.enter(rustc_incremental::save_dep_graph));
|
.time("serialize_dep_graph", || gcx.enter(rustc_incremental::save_dep_graph));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The timer's lifetime spans the dropping of `queries`, which contains
|
||||||
|
// the global context.
|
||||||
_timer = Some(self.session().timer("free_global_ctxt"));
|
_timer = Some(self.session().timer("free_global_ctxt"));
|
||||||
|
|
||||||
ret
|
ret
|
||||||
|
Loading…
x
Reference in New Issue
Block a user