We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 290fc68 commit 26d4226Copy full SHA for 26d4226
compiler/rustc_interface/src/queries.rs
@@ -304,6 +304,7 @@ impl Compiler {
304
where
305
F: for<'tcx> FnOnce(&'tcx Queries<'tcx>) -> T,
306
{
307
+ // Must declare `_timer` first so that it is dropped after `queries`.
308
let mut _timer = None;
309
let queries = Queries::new(self);
310
let ret = f(&queries);
@@ -324,6 +325,8 @@ impl Compiler {
324
325
.time("serialize_dep_graph", || gcx.enter(rustc_incremental::save_dep_graph));
326
}
327
328
+ // The timer's lifetime spans the dropping of `queries`, which contains
329
+ // the global context.
330
_timer = Some(self.session().timer("free_global_ctxt"));
331
332
ret
0 commit comments