Skip to content

Commit 544d7e2

Browse files
committed
rebase: remove tcx from associated_item
1 parent 2d858a0 commit 544d7e2

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

src/librustc/middle/cstore.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,7 @@ pub trait CrateStore<'tcx> {
298298

299299
// trait/impl-item info
300300
fn trait_of_item(&self, def_id: DefId) -> Option<DefId>;
301-
fn associated_item<'a>(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>, def: DefId)
302-
-> Option<ty::AssociatedItem>;
301+
fn associated_item(&self, def: DefId) -> Option<ty::AssociatedItem>;
303302

304303
// flags
305304
fn is_const_fn(&self, did: DefId) -> bool;
@@ -462,7 +461,7 @@ impl<'tcx> CrateStore<'tcx> for DummyCrateStore {
462461

463462
// trait/impl-item info
464463
fn trait_of_item(&self, def_id: DefId) -> Option<DefId> { bug!("trait_of_item") }
465-
fn associated_item<'a>(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>, def: DefId)
464+
fn associated_item<'a>(&self, def: DefId)
466465
-> Option<ty::AssociatedItem> { bug!("associated_item") }
467466

468467
// flags

src/librustc/middle/stability.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
462462
// these are not visible outside crate; therefore
463463
// stability markers are irrelevant, if even present.
464464
ty::Visibility::Restricted(..) |
465-
ty::Visibility::Invisible => true,
465+
ty::Visibility::PrivateExternal => true,
466466
}
467467
}
468468

src/librustc/ty/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2062,7 +2062,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
20622062
pub fn associated_item(self, def_id: DefId) -> AssociatedItem {
20632063
self.associated_items.memoize(def_id, || {
20642064
if !def_id.is_local() {
2065-
return self.sess.cstore.associated_item(self.global_tcx(), def_id)
2065+
return self.sess.cstore.associated_item(def_id)
20662066
.expect("missing AssociatedItem in metadata");
20672067
}
20682068

@@ -2540,7 +2540,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
25402540
/// ID of the impl that the method belongs to. Otherwise, return `None`.
25412541
pub fn impl_of_method(self, def_id: DefId) -> Option<DefId> {
25422542
if def_id.krate != LOCAL_CRATE {
2543-
return self.sess.cstore.associated_item(self.global_tcx(), def_id)
2543+
return self.sess.cstore.associated_item(def_id)
25442544
.and_then(|item| {
25452545
match item.container {
25462546
TraitContainer(_) => None,

src/librustc_metadata/cstore_impl.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,7 @@ impl<'tcx> CrateStore<'tcx> for cstore::CStore {
189189
self.get_crate_data(def_id.krate).get_trait_of_item(def_id.index)
190190
}
191191

192-
fn associated_item<'a>(&self, _tcx: TyCtxt<'a, 'tcx, 'tcx>, def: DefId)
193-
-> Option<ty::AssociatedItem>
192+
fn associated_item<'a>(&self, def: DefId) -> Option<ty::AssociatedItem>
194193
{
195194
self.dep_graph.read(DepNode::MetaData(def));
196195
self.get_crate_data(def.krate).get_associated_item(def.index)

0 commit comments

Comments
 (0)