diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2024-10-31 14:23:38 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2024-11-09 17:55:39 +0000 |
| commit | 8e9bbc899c7a1913ff04d9af516efee900aeffd1 (patch) | |
| tree | ffae6ca1f59575e32ac1f07bef1ba77966952899 /compiler/rustc_middle/src/ty/context.rs | |
| parent | bec24a25cd61c5d252701b9119e4fe887b274937 (diff) | |
| download | rust-8e9bbc899c7a1913ff04d9af516efee900aeffd1.tar.gz rust-8e9bbc899c7a1913ff04d9af516efee900aeffd1.zip | |
Move some code from Compiler::enter to GlobalCtxt::finish
Diffstat (limited to 'compiler/rustc_middle/src/ty/context.rs')
| -rw-r--r-- | compiler/rustc_middle/src/ty/context.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index c55733da7b3..e1a360a1b1e 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -1365,8 +1365,17 @@ impl<'tcx> GlobalCtxt<'tcx> { tls::enter_context(&icx, || f(icx.tcx)) } - pub fn finish(&self) -> FileEncodeResult { - self.dep_graph.finish_encoding() + pub fn finish(&'tcx self) { + // We assume that no queries are run past here. If there are new queries + // after this point, they'll show up as "<unknown>" in self-profiling data. + self.enter(|tcx| tcx.alloc_self_profile_query_strings()); + + self.enter(|tcx| tcx.save_dep_graph()); + self.enter(|tcx| tcx.query_key_hash_verify_all()); + + if let Err((path, error)) = self.dep_graph.finish_encoding() { + self.sess.dcx().emit_fatal(crate::error::FailedWritingFile { path: &path, error }); + } } } |
