-
Notifications
You must be signed in to change notification settings - Fork 13.3k
[incremental] skip type-checking #45208
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
Comments
I have implemented ensure on a branch. I'll make a PR |
@theotherjimmy great, see #45210 too =) |
@nikomatsakis for markdown working under spoilers, please also use
|
Added #45214, another step along the way. |
The PR I promised is #45228 |
For my next trick: Isolate the "used trait imports" part of typeck tables into a distinct query |
Status of the issue:
About usage of
I think making |
I .. think this is fixed? |
But maybe there's room to do better |
@cjgillot it seems like it'd be good to have some concrete examples of cases where we don't get re-use, but should/could? (Not sure if you had some you were using for analysis.) |
This is a kind of meta-bug aimed at skipping type-checking, which is (to some extent) the "holy grail" of incremental compilation. This bug only contains a list of issues and a task breakdown. For background on the general approach we have in mind, see this gist.
Substeps:
ensure()
operation #45210: Introduce theensure
operation first described here and use it on thetypeck_tables_of
invocations. -- @theotherjimmy is on itVec<DefId>
. It wouldn't hurt to support()
while we're at it.Ultimately, all of the the uses of
typeck_tables_of
must be analyzed and eliminated. These uses are listed here in order to mine for producing more subtasks. =)src/librustc_passes/consts.rs:142: self.tables = self.tcx.typeck_tables_of(item_def_id);
src/librustc_typeck/check_unused.rs:69: let tables = tcx.typeck_tables_of(item_def_id);
src/librustc_save_analysis/dump_visitor.rs:109: let tables = self.tcx.typeck_tables_of(item_def_id);
src/librustc_typeck/collect.rs:1155: return tcx.typeck_tables_of(def_id).node_id_to_type(hir_id);
src/librustc_typeck/collect.rs:1192: tcx.typeck_tables_of(owner).node_id_to_type(hir_id)
src/librustc_typeck/collect.rs:1244: tcx.typeck_tables_of(def_id).closure_tys()[hir_id]
src/librustc_privacy/lib.rs:503: replace(tables, tcx.typeck_tables_of(def_id))
src/librustc_const_eval/pattern.rs:606: self.tables = self.tcx.typeck_tables_of(def_id);
src/librustc_const_eval/eval.rs:381: tables: tcx.typeck_tables_of(def_id),
src/librustc_const_eval/eval.rs:770: let tables = tcx.typeck_tables_of(def_id);
src/librustc_borrowck/borrowck/mod.rs:100: let tables = tcx.typeck_tables_of(owner_def_id);
src/librustc_borrowck/borrowck/mod.rs:198: let tables = tcx.typeck_tables_of(owner_def_id);
src/librustc/cfg/construct.rs:57: let tables = tcx.typeck_tables_of(owner_def_id);
src/librustc/ty/mod.rs:2108: self.typeck_tables_of(self.hir.body_owner_def_id(body))
body_tables()
belowsrc/librustc/middle/intrinsicck.rs:136: let tables = self.tcx.typeck_tables_of(owner_def_id);
src/librustc_typeck/check/mod.rs:734: tcx.typeck_tables_of(body_owner_def_id);
src/librustc_typeck/check/mod.rs:756: tcx.typeck_tables_of(def_id).generator_sigs()[hir_id].map(|s| ty::Binder(s))
src/librustc_typeck/check/mod.rs:764: tcx.typeck_tables_of(def_id).closure_kinds()[hir_id].0
src/librustc_typeck/check/mod.rs:857: return tcx.typeck_tables_of(outer_def_id);
src/librustc_typeck/check/mod.rs:1152: tcx.typeck_tables_of(tcx.hir.local_def_id(it.id));
src/librustc_typeck/check/mod.rs:1574: tcx.typeck_tables_of(tcx.hir.local_def_id(e.node_id));
src/librustc_mir/transform/generator.rs:712: let interior = *tcx.typeck_tables_of(def_id).generator_interiors().get(hir_id).unwrap();
src/librustc_mir/hair/cx/mod.rs:96: tables: tcx.typeck_tables_of(src_def_id),
src/tools/clippy/clippy_lints/src/consts.rs:302: tables: self.tcx.typeck_tables_of(def_id),
src/librustc_privacy/lib.rs:518: let orig_tables = replace(&mut self.tables, self.tcx.body_tables(body));
src/librustc_privacy/lib.rs:672: let orig_tables = replace(&mut self.tables, self.tcx.body_tables(body));
src/librustc_driver/pretty.rs:505: self.tables.set(self.tcx.body_tables(id));
src/librustc_const_eval/check_match.rs:53: tables: self.tcx.body_tables(b),
src/librustc/lint/context.rs:636: self.tables = self.tcx.body_tables(body);
src/librustc/lint/context.rs:696: self.tables = self.tcx.body_tables(body_id);
src/librustc/middle/liveness.rs:530: let tables = ir.tcx.body_tables(body);
src/librustc/middle/reachable.rs:101: self.tables = self.tcx.body_tables(body);
src/librustc/middle/dead.rs:218: self.tables = self.tcx.body_tables(body);
src/librustc_mir/build/mod.rs:106: let gen_ty = tcx.body_tables(body_id).node_id_to_type(fn_hir_id);
src/librustc_mir/build/mod.rs:247: let closure_ty = tcx.body_tables(body_id).node_id_to_type(closure_expr_hir_id);
src/tools/clippy/clippy_lints/src/attrs.rs:172: is_relevant_expr(tcx, tcx.body_tables(eid), &tcx.hir.body(eid).value)
src/tools/clippy/clippy_lints/src/attrs.rs:180: ImplItemKind::Method(_, eid) => is_relevant_expr(tcx, tcx.body_tables(eid), &tcx.hir.body(eid).value),
src/tools/clippy/clippy_lints/src/attrs.rs:189: is_relevant_expr(tcx, tcx.body_tables(eid), &tcx.hir.body(eid).value)
src/tools/clippy/clippy_lints/src/functions.rs:154: let tables = cx.tcx.body_tables(body.id());
The text was updated successfully, but these errors were encountered: