Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
dff0c07
rustc: Move a few more cstore methods to queries
alexcrichton Aug 28, 2017
ed6f868
rustc: Move `impl_defaultness` to a query
alexcrichton Aug 28, 2017
98b74c5
rustc: Migrate `CStore::expored_symbols` to a query
alexcrichton Aug 29, 2017
205bc9a
rustc: Migrate `CStore::native_libraries` to a query
alexcrichton Aug 29, 2017
2d4445f
rustc: Move {plugin,derive}_registrar_fn to queries
alexcrichton Aug 29, 2017
ebc1fd3
rustc: Move crate_disambiguator to queries
alexcrichton Aug 29, 2017
d6c88f4
rustc: Move crate_hash to a query
alexcrichton Aug 29, 2017
52b67f9
rustc: Move original_crate_name to a query
alexcrichton Aug 29, 2017
4af1284
Ignore failing incremental tests
alexcrichton Aug 29, 2017
4dec2a8
rustc: Fix a borrow mut error with debug assertions
alexcrichton Aug 30, 2017
1c7294e
rustc: Move implementations_of_trait to a query
alexcrichton Aug 30, 2017
87ea0a1
Ignore failing tests harder
alexcrichton Aug 30, 2017
64a7034
rustc: Remove a number of mutable fields in cstore
alexcrichton Aug 30, 2017
fd61fa5
rustc: Hide the `named_region_map` behind queries
alexcrichton Aug 30, 2017
43ae380
rustc: Flag some CrateStore methods as "untracked"
alexcrichton Aug 31, 2017
a2e2aba
rustc: Migrate lang items to a query
alexcrichton Aug 31, 2017
953490d
rustc: Remove lang item methods from CrateStore
alexcrichton Aug 31, 2017
84ae4b7
rustc: Migrate `CrateStore::item_body` to a query
alexcrichton Aug 31, 2017
88399a9
rustc: Migrate `visible_parent_map` to a query
alexcrichton Aug 31, 2017
0b7e0aa
rustc: Classify two more CrateStore methods untracked
alexcrichton Aug 31, 2017
490f34a
rustc: Remove `CrateStore::used_crate*`
alexcrichton Aug 31, 2017
bf5550b
rustc: Convert `freevars` to a query
alexcrichton Aug 31, 2017
7d9c98e
rustc: Hide `maybe_unused_*` fields in queries
alexcrichton Aug 31, 2017
0182c8b
rustc: Rename item_body query to extern_const_body
alexcrichton Aug 31, 2017
9a23196
rustc: Move stability functionality into queries
alexcrichton Aug 31, 2017
0cdc58a
rustc: Store InternedString in `DefPathData`
alexcrichton Sep 1, 2017
c6445ba
Clarify failure condition on tests
alexcrichton Sep 5, 2017
2ee7493
Add some more with_ignore to get tests passing
alexcrichton Sep 7, 2017
fd0aa64
rustc: Remove `CrateStore::crates` as a method
alexcrichton Sep 7, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rustc: Classify two more CrateStore methods untracked
These are only called pre-TyCtxt (e.g. lowering/resolve), so make it explicit in
the name that they're untracked and therefore unsuitable to called elsewhere.
  • Loading branch information
alexcrichton committed Sep 5, 2017
commit 0b7e0aaba5c140a4d7db0023e5f8a685bcaec9bd
2 changes: 1 addition & 1 deletion src/librustc/hir/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ impl<'a> LoweringContext<'a> {
return n;
}
assert!(!def_id.is_local());
let n = self.sess.cstore.item_generics_cloned(def_id).regions.len();
let n = self.sess.cstore.item_generics_cloned_untracked(def_id).regions.len();
self.type_def_lifetime_params.insert(def_id, n);
n
});
Expand Down
12 changes: 4 additions & 8 deletions src/librustc/middle/cstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,6 @@ pub trait CrateStore {
// access to the metadata loader
fn metadata_loader(&self) -> &MetadataLoader;

// item info
fn item_generics_cloned(&self, def: DefId) -> ty::Generics;

// trait/impl-item info
fn associated_item_cloned(&self, def: DefId) -> ty::AssociatedItem;

// resolve
fn def_key(&self, def: DefId) -> DefKey;
fn def_path(&self, def: DefId) -> hir_map::DefPath;
Expand All @@ -255,6 +249,8 @@ pub trait CrateStore {
fn item_children_untracked(&self, did: DefId, sess: &Session) -> Vec<def::Export>;
fn load_macro_untracked(&self, did: DefId, sess: &Session) -> LoadedMacro;
fn extern_mod_stmt_cnum_untracked(&self, emod_id: ast::NodeId) -> Option<CrateNum>;
fn item_generics_cloned_untracked(&self, def: DefId) -> ty::Generics;
fn associated_item_cloned_untracked(&self, def: DefId) -> ty::AssociatedItem;

// This is basically a 1-based range of ints, which is a little
// silly - I may fix that.
Expand Down Expand Up @@ -308,11 +304,11 @@ impl CrateStore for DummyCrateStore {
{ bug!("crate_data_as_rc_any") }
// item info
fn visibility_untracked(&self, def: DefId) -> ty::Visibility { bug!("visibility") }
fn item_generics_cloned(&self, def: DefId) -> ty::Generics
fn item_generics_cloned_untracked(&self, def: DefId) -> ty::Generics
{ bug!("item_generics_cloned") }

// trait/impl-item info
fn associated_item_cloned(&self, def: DefId) -> ty::AssociatedItem
fn associated_item_cloned_untracked(&self, def: DefId) -> ty::AssociatedItem
{ bug!("associated_item_cloned") }

// crate metadata
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/resolve_lifetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
} else {
let cstore = &self.sess.cstore;
self.xcrate_object_lifetime_defaults.entry(def_id).or_insert_with(|| {
cstore.item_generics_cloned(def_id).types.into_iter().map(|def| {
cstore.item_generics_cloned_untracked(def_id).types.into_iter().map(|def| {
def.object_lifetime_default
}).collect()
})
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_metadata/cstore_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,12 +350,12 @@ impl CrateStore for cstore::CStore {
self.get_crate_data(def.krate).get_visibility(def.index)
}

fn item_generics_cloned(&self, def: DefId) -> ty::Generics {
fn item_generics_cloned_untracked(&self, def: DefId) -> ty::Generics {
self.read_dep_node(def);
self.get_crate_data(def.krate).get_generics(def.index)
}

fn associated_item_cloned(&self, def: DefId) -> ty::AssociatedItem
fn associated_item_cloned_untracked(&self, def: DefId) -> ty::AssociatedItem
{
self.read_dep_node(def);
self.get_crate_data(def.krate).get_associated_item(def.index)
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_resolve/build_reduced_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ impl<'a> Resolver<'a> {
self.define(module, child.ident, ns,
(child.def, ty::Visibility::Public, DUMMY_SP, expansion));

if self.session.cstore.associated_item_cloned(child.def.def_id())
if self.session.cstore.associated_item_cloned_untracked(child.def.def_id())
.method_has_self_argument {
self.has_self.insert(child.def.def_id());
}
Expand Down