Change:
This seems to be an incremental error‽ We need an external crate for this to work. Haven't managed it to work in an internal mod only :/ Also this only happens with . Haven't managed to get it running with sadly extern crate (let's call it f) code Then just remove and add afterwards again (or the other way round, it doesn't matter). This script does it for you: <!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<pand with RUST_BACKTRACE=full the LLVMing assert vanishes </p</details
searched nightlies: from nightly-2020-12-08 to nightly-2020-12-10 regressed nightly: nightly-2020-12-10 searched commits: from to regressed commit: <details<summarybisected with <a href=''cargo-bisect-rustc</av0.6.0</summaryHost triple: x86_64-unknown-linux-gnu Reproduce with: </detailscc
Assigning as discussed as part of the and removing .
I've fixed the issue locally, and I'm working on a PR.
Opened

Discussion:
fn register_reused_dep_path_hash(&self, hash: DefPathHash) { if let Some(cache) = self.queries.on_disk_cache.as_ref() { <del> cache.register_reused_dep_path_hash(hash) </del> <ins> cache.register_reused_dep_path_hash(*self, hash) </ins> } }

fn try_remap_cnum(&self, tcx: TyCtxt<'_>, cnum: u32) -> Option<CrateNum> { let cnum_map = self.cnum_map.get_or_init(|| Self::compute_cnum_map(tcx, &self.prev_cnums[..])); <ins> debug!("try_remap_cnum({}): cnum_map={:?}", cnum, cnum_map); </ins> cnum_map[CrateNum::from_u32(cnum)] }

.insert(hash, RawDefId { krate: def_id.krate.as_u32(), index: def_id.index.as_u32() }); } <del> pub fn register_reused_dep_path_hash(&self, hash: DefPathHash) { if let Some(old_id) = self.foreign_def_path_hashes.get(&hash) { self.latest_foreign_def_path_hashes.lock().insert(hash, *old_id); </del> <ins> /// If the given `hash` still exists in the current compilation, /// calls `store_foreign_def_id` with its current `DefId`. /// /// Normally, `store_foreign_def_id_hash` can be called directly by /// the dependency graph when we construct a `DepNode`. However, /// when we re-use a deserialized `DepNode` from the previous compilation /// session, we only have the `DefPathHash` available. This method is used /// to that any `DepNode` that we re-use has a `DefPathHash` -> `RawId` written /// out for usage in the next compilation session. pub fn register_reused_dep_path_hash(&self, tcx: TyCtxt<'tcx>, hash: DefPathHash) { // We can't simply copy the `RawDefId` from `foreign_def_path_hashes` to // `latest_foreign_def_path_hashes`, since the `RawDefId` might have // changed in the current compilation session (e.g. we've added/removed crates, // or added/removed definitions before/after the target definition). if let Some(def_id) = self.def_path_hash_to_def_id(tcx, hash) { self.store_foreign_def_id_hash(def_id, hash); </ins> } }

match cache.entry(hash) { Entry::Occupied(e) => *e.get(), Entry::Vacant(e) => { <ins> debug!("def_path_hash_to_def_id({:?})", hash); </ins> // Check if the `DefPathHash` corresponds to a definition in the current // crate if let Some(def_id) = self.local_def_path_hash_to_def_id.get(&hash).cloned() {

// current compilation session, the crate is guaranteed to be the same // (otherwise, we would compute a different `DefPathHash`). let raw_def_id = self.get_raw_def_id(&hash)?; <ins> debug!("def_path_hash_to_def_id({:?}): raw_def_id = {:?}", hash, raw_def_id); </ins> // If the owning crate no longer exists, the corresponding definition definitely // no longer exists. let krate = self.try_remap_cnum(tcx, raw_def_id.krate)?; <ins> debug!("def_path_hash_to_def_id({:?}): krate = {:?}", hash, krate); </ins> // If our `DefPathHash` corresponded to a definition in the local crate, // we should have either found it in `local_def_path_hash_to_def_id`, or // never attempted to load it in the first place. Any query result or `DepNode`

// Try to find a definition in the current session, using the previous `DefIndex` // as an initial guess. let opt_def_id = tcx.cstore.def_path_hash_to_def_id(krate, raw_def_id.index, hash); <ins> debug!("def_path_to_def_id({:?}): opt_def_id = {:?}", hash, opt_def_id); </ins> e.insert(opt_def_id); opt_def_id }

// an eval_always node, let's try to mark it green recursively. if !dep_dep_node.kind.is_eval_always() { debug!( <del> "try_mark_previous_green({:?}) --- state of dependency {:?}  </del> <ins> "try_mark_previous_green({:?}) --- state of dependency {:?} ({})  </ins> is unknown, trying to mark it green", <del> dep_node, dep_dep_node </del> <ins> dep_node, dep_dep_node, dep_dep_node.hash, </ins> ); let node_index = self.try_mark_previous_green(

<ins> // aux-build:issue-79890.rs // revisions:rpass1 rpass2 rpass3 // compile-flags:--extern issue_79890 --test // edition:2018 // Tests that we don't ICE when the set of imported crates changes #[cfg(rpass2)] use issue_79890::MyTrait; </ins>