Skip to content

Commit dc6053d

Browse files
committed
---
yaml --- r: 206747 b: refs/heads/beta c: aeb92ba h: refs/heads/master i: 206745: 84dc021 206743: 2699331 v: v3
1 parent 9ef3141 commit dc6053d

File tree

6 files changed

+22
-43
lines changed

6 files changed

+22
-43
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2929
refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3030
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3131
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
32-
refs/heads/beta: 8bcb3cb475f0e5223ac63274d229fcbd866f7fe6
32+
refs/heads/beta: aeb92bab5d63313455e4bfd079ce84712a1a4bac
3333
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3434
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3535
refs/heads/tmp: 579e31929feff51dcaf8d444648eff8de735f91a

branches/beta/src/librustc/metadata/csearch.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,13 +313,13 @@ pub fn each_impl<F>(cstore: &cstore::CStore,
313313
decoder::each_impl(&*cdata, callback)
314314
}
315315

316-
pub fn each_implementation_for_type<F>(cstore: &cstore::CStore,
317-
def_id: ast::DefId,
318-
callback: F) where
316+
pub fn each_inherent_implementation_for_type<F>(cstore: &cstore::CStore,
317+
def_id: ast::DefId,
318+
callback: F) where
319319
F: FnMut(ast::DefId),
320320
{
321321
let cdata = cstore.get_crate_data(def_id.krate);
322-
decoder::each_implementation_for_type(&*cdata, def_id.node, callback)
322+
decoder::each_inherent_implementation_for_type(&*cdata, def_id.node, callback)
323323
}
324324

325325
pub fn each_implementation_for_trait<F>(cstore: &cstore::CStore,

branches/beta/src/librustc/metadata/decoder.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,17 +1338,18 @@ pub fn each_impl<F>(cdata: Cmd, mut callback: F) where
13381338
});
13391339
}
13401340

1341-
pub fn each_implementation_for_type<F>(cdata: Cmd,
1342-
id: ast::NodeId,
1343-
mut callback: F)
1341+
pub fn each_inherent_implementation_for_type<F>(cdata: Cmd,
1342+
id: ast::NodeId,
1343+
mut callback: F)
13441344
where F: FnMut(ast::DefId),
13451345
{
13461346
let item_doc = lookup_item(id, cdata.data());
13471347
reader::tagged_docs(item_doc,
13481348
tag_items_data_item_inherent_impl,
13491349
|impl_doc| {
1350-
let implementation_def_id = item_def_id(impl_doc, cdata);
1351-
callback(implementation_def_id);
1350+
if reader::maybe_get_doc(impl_doc, tag_item_trait_ref).is_none() {
1351+
callback(item_def_id(impl_doc, cdata));
1352+
}
13521353
true
13531354
});
13541355
}

branches/beta/src/librustc/middle/ty.rs

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6336,10 +6336,10 @@ pub fn populate_implementations_for_primitive_if_necessary(tcx: &ctxt,
63366336
tcx.populated_external_primitive_impls.borrow_mut().insert(primitive_def_id);
63376337
}
63386338

6339-
/// Populates the type context with all the implementations for the given type
6340-
/// if necessary.
6341-
pub fn populate_implementations_for_type_if_necessary(tcx: &ctxt,
6342-
type_id: ast::DefId) {
6339+
/// Populates the type context with all the inherent implementations for
6340+
/// the given type if necessary.
6341+
pub fn populate_inherent_implementations_for_type_if_necessary(tcx: &ctxt,
6342+
type_id: ast::DefId) {
63436343
if type_id.krate == LOCAL_CRATE {
63446344
return
63456345
}
@@ -6348,37 +6348,15 @@ pub fn populate_implementations_for_type_if_necessary(tcx: &ctxt,
63486348
return
63496349
}
63506350

6351-
debug!("populate_implementations_for_type_if_necessary: searching for {:?}", type_id);
6351+
debug!("populate_inherent_implementations_for_type_if_necessary: searching for {:?}", type_id);
63526352

63536353
let mut inherent_impls = Vec::new();
6354-
csearch::each_implementation_for_type(&tcx.sess.cstore, type_id, |impl_def_id| {
6355-
let impl_items = csearch::get_impl_items(&tcx.sess.cstore, impl_def_id);
6356-
6357-
// Record the implementation, if needed
6358-
if let Some(trait_ref) = csearch::get_impl_trait(tcx, impl_def_id) {
6359-
let trait_def = lookup_trait_def(tcx, trait_ref.def_id);
6360-
trait_def.record_impl(tcx, impl_def_id, trait_ref);
6361-
} else {
6362-
inherent_impls.push(impl_def_id);
6363-
}
6364-
6365-
// For any methods that use a default implementation, add them to
6366-
// the map. This is a bit unfortunate.
6367-
for impl_item_def_id in &impl_items {
6368-
let method_def_id = impl_item_def_id.def_id();
6369-
match impl_or_trait_item(tcx, method_def_id) {
6370-
MethodTraitItem(method) => {
6371-
if let Some(source) = method.provided_source {
6372-
tcx.provided_method_sources
6373-
.borrow_mut()
6374-
.insert(method_def_id, source);
6375-
}
6376-
}
6377-
_ => {}
6378-
}
6379-
}
6354+
csearch::each_inherent_implementation_for_type(&tcx.sess.cstore, type_id, |impl_def_id| {
6355+
// Record the implementation.
6356+
inherent_impls.push(impl_def_id);
63806357

63816358
// Store the implementation info.
6359+
let impl_items = csearch::get_impl_items(&tcx.sess.cstore, impl_def_id);
63826360
tcx.impl_items.borrow_mut().insert(impl_def_id, impl_items);
63836361
});
63846362

branches/beta/src/librustc_typeck/check/method/probe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ impl<'a,'tcx> ProbeContext<'a,'tcx> {
371371
fn assemble_inherent_impl_candidates_for_type(&mut self, def_id: ast::DefId) {
372372
// Read the inherent implementation candidates for this type from the
373373
// metadata if necessary.
374-
ty::populate_implementations_for_type_if_necessary(self.tcx(), def_id);
374+
ty::populate_inherent_implementations_for_type_if_necessary(self.tcx(), def_id);
375375

376376
if let Some(impl_infos) = self.tcx().inherent_impls.borrow().get(&def_id) {
377377
for &impl_def_id in &***impl_infos {

branches/beta/src/librustdoc/clean/inline.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ fn build_type(cx: &DocContext, tcx: &ty::ctxt, did: ast::DefId) -> clean::ItemEn
221221

222222
pub fn build_impls(cx: &DocContext, tcx: &ty::ctxt,
223223
did: ast::DefId) -> Vec<clean::Item> {
224-
ty::populate_implementations_for_type_if_necessary(tcx, did);
224+
ty::populate_inherent_implementations_for_type_if_necessary(tcx, did);
225225
let mut impls = Vec::new();
226226

227227
match tcx.inherent_impls.borrow().get(&did) {

0 commit comments

Comments
 (0)