Auto merge of #85834 - cjgillot:save-sbi, r=michaelwoerister
Encode CrateNum using the StableCrateId for incr. comp.
This commit is contained in:
@@ -53,6 +53,7 @@ use rustc_serialize::opaque::{FileEncodeResult, FileEncoder};
|
||||
use rustc_session::config::{BorrowckMode, CrateType, OutputFilenames};
|
||||
use rustc_session::lint::{Level, Lint};
|
||||
use rustc_session::Session;
|
||||
use rustc_span::def_id::StableCrateId;
|
||||
use rustc_span::source_map::MultiSpan;
|
||||
use rustc_span::symbol::{kw, sym, Ident, Symbol};
|
||||
use rustc_span::{Span, DUMMY_SP};
|
||||
@@ -1264,6 +1265,11 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn stable_crate_id(self, cnum: CrateNum) -> StableCrateId {
|
||||
self.def_path_hash(cnum.as_def_id()).stable_crate_id()
|
||||
}
|
||||
|
||||
pub fn def_path_debug_str(self, def_id: DefId) -> String {
|
||||
// We are explicitly not going through queries here in order to get
|
||||
// crate name and disambiguator since this code is called from debug!()
|
||||
|
||||
Reference in New Issue
Block a user