Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate metadata by iterating on DefId instead of traversing the HIR tree #80347

Closed
wants to merge 16 commits into from
8 changes: 4 additions & 4 deletions compiler/rustc_incremental/src/persist/dirty_clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ const CFG: Symbol = sym::cfg;
// Base and Extra labels to build up the labels

/// For typedef, constants, and statics
const BASE_CONST: &[&str] = &[label_strs::type_of];
const BASE_CONST: &[&str] = &[label_strs::try_type_of];

/// DepNodes for functions + methods
const BASE_FN: &[&str] = &[
// Callers will depend on the signature of these items, so we better test
label_strs::fn_sig,
label_strs::try_fn_sig,
label_strs::generics_of,
label_strs::predicates_of,
label_strs::type_of,
label_strs::try_type_of,
// And a big part of compilation (that we eventually want to cache) is type inference
// information:
label_strs::typeck,
Expand All @@ -71,7 +71,7 @@ const BASE_MIR: &[&str] = &[label_strs::optimized_mir, label_strs::promoted_mir]
/// Note that changing the type of a field does not change the type of the struct or enum, but
/// adding/removing fields or changing a fields name or visibility does.
const BASE_STRUCT: &[&str] =
&[label_strs::generics_of, label_strs::predicates_of, label_strs::type_of];
&[label_strs::generics_of, label_strs::predicates_of, label_strs::try_type_of];

/// Trait definition `DepNode`s.
const BASE_TRAIT_DEF: &[&str] = &[
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl IntoArgs for (CrateNum, DefId) {
}

provide! { <'tcx> tcx, def_id, other, cdata,
type_of => { cdata.get_type(def_id.index, tcx) }
try_type_of => { Ok(cdata.get_type(def_id.index, tcx)) }
generics_of => { cdata.get_generics(def_id.index, tcx.sess) }
explicit_predicates_of => { cdata.get_explicit_predicates(def_id.index, tcx) }
inferred_outlives_of => { cdata.get_inferred_outlives(def_id.index, tcx) }
Expand Down Expand Up @@ -123,7 +123,7 @@ provide! { <'tcx> tcx, def_id, other, cdata,
mir_abstract_const => { cdata.get_mir_abstract_const(tcx, def_id.index) }
unused_generic_params => { cdata.get_unused_generic_params(def_id.index) }
mir_const_qualif => { cdata.mir_const_qualif(def_id.index) }
fn_sig => { cdata.fn_sig(def_id.index, tcx) }
try_fn_sig => { Ok(cdata.fn_sig(def_id.index, tcx)) }
inherent_impls => { cdata.get_inherent_implementations_for_type(tcx, def_id.index) }
is_const_fn_raw => { cdata.is_const_fn_raw(def_id.index) }
asyncness => { cdata.asyncness(def_id.index) }
Expand Down
Loading