Rollup merge of #89476 - cjgillot:expn-id, r=petrochenkov
Correct decoding of foreign expansions during incr. comp. Fixes https://github.com/rust-lang/rust/issues/74946 The original issue was due to a wrong assertion in `expn_hash_to_expn_id`. The secondary issue was due to a mismatch between the encoding and decoding paths for expansions that are created after the TyCtxt is created.
This commit is contained in:
commit
aed1801841
5 changed files with 51 additions and 19 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
use crate::search_paths::PathKind;
|
||||
use crate::utils::NativeLibKind;
|
||||
use crate::Session;
|
||||
use rustc_ast as ast;
|
||||
use rustc_data_structures::sync::{self, MetadataRef};
|
||||
use rustc_hir::def_id::{CrateNum, DefId, StableCrateId, LOCAL_CRATE};
|
||||
|
@ -193,7 +194,13 @@ pub trait CrateStore: std::fmt::Debug {
|
|||
|
||||
/// Fetch a DefId from a DefPathHash for a foreign crate.
|
||||
fn def_path_hash_to_def_id(&self, cnum: CrateNum, hash: DefPathHash) -> DefId;
|
||||
fn expn_hash_to_expn_id(&self, cnum: CrateNum, index_guess: u32, hash: ExpnHash) -> ExpnId;
|
||||
fn expn_hash_to_expn_id(
|
||||
&self,
|
||||
sess: &Session,
|
||||
cnum: CrateNum,
|
||||
index_guess: u32,
|
||||
hash: ExpnHash,
|
||||
) -> ExpnId;
|
||||
}
|
||||
|
||||
pub type CrateStoreDyn = dyn CrateStore + sync::Sync;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue