Skip to content

Commit e744f7e

Browse files
committed
Auto merge of #49004 - wesleywiser:incr_specialization_graph_query, r=<try>
Cache the specialization_graph query Fixes #48987 r? @michaelwoerister
2 parents fab632f + 311bb10 commit e744f7e

File tree

5 files changed

+6
-1
lines changed

5 files changed

+6
-1
lines changed

src/librustc/traits/specialize/specialization_graph.rs

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ use util::nodemap::{DefIdMap, FxHashMap};
3636
/// parents of a given specializing impl, which is needed for extracting
3737
/// default items amongst other things. In the simple "chain" rule, every impl
3838
/// has at most one parent.
39+
#[derive(RustcEncodable, RustcDecodable)]
3940
pub struct Graph {
4041
// all impls have a parent; the "root" impls have as their parent the def_id
4142
// of the trait
@@ -47,6 +48,7 @@ pub struct Graph {
4748

4849
/// Children of a given impl, grouped into blanket/non-blanket varieties as is
4950
/// done in `TraitDef`.
51+
#[derive(RustcEncodable, RustcDecodable)]
5052
struct Children {
5153
// Impls of a trait (or specializations of a given impl). To allow for
5254
// quicker lookup, the impls are indexed by a simplified version of their

src/librustc/ty/fast_reject.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub type SimplifiedType = SimplifiedTypeGen<DefId>;
2828
/// because we sometimes need to use SimplifiedTypeGen values as stable sorting
2929
/// keys (in which case we use a DefPathHash as id-type) but in the general case
3030
/// the non-stable but fast to construct DefId-version is the better choice.
31-
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
31+
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, RustcEncodable, RustcDecodable)]
3232
pub enum SimplifiedTypeGen<D>
3333
where D: Copy + Debug + Ord + Eq + Hash
3434
{

src/librustc/ty/maps/config.rs

+1
Original file line numberDiff line numberDiff line change
@@ -709,3 +709,4 @@ impl_disk_cacheable_query!(type_of, |def_id| def_id.is_local());
709709
impl_disk_cacheable_query!(predicates_of, |def_id| def_id.is_local());
710710
impl_disk_cacheable_query!(used_trait_imports, |def_id| def_id.is_local());
711711
impl_disk_cacheable_query!(trans_fn_attrs, |_| true);
712+
impl_disk_cacheable_query!(specialization_graph_of, |_| true);

src/librustc/ty/maps/on_disk_cache.rs

+1
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ impl<'sess> OnDiskCache<'sess> {
221221
encode_query_results::<symbol_name, _>(tcx, enc, qri)?;
222222
encode_query_results::<check_match, _>(tcx, enc, qri)?;
223223
encode_query_results::<trans_fn_attrs, _>(tcx, enc, qri)?;
224+
encode_query_results::<specialization_graph_of, _>(tcx, enc, qri)?;
224225
}
225226

226227
// Encode diagnostics

src/librustc/ty/maps/plumbing.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1001,4 +1001,5 @@ impl_load_from_cache!(
10011001
PredicatesOfItem => predicates_of,
10021002
UsedTraitImports => used_trait_imports,
10031003
TransFnAttrs => trans_fn_attrs,
1004+
SpecializationGraph => specialization_graph_of,
10041005
);

0 commit comments

Comments
 (0)