Skip to content

Commit 7d60bde

Browse files
committed
---
yaml --- r: 118194 b: refs/heads/try c: e1e8db7 h: refs/heads/master v: v3
1 parent c359124 commit 7d60bde

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 3770c42a4959cbabc73da52abc7e3db96657974e
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: d6736a1440d42f6af967a8a20ab8d73522112b72
5-
refs/heads/try: 890754794c02615310781bc006149dddeb2770bc
5+
refs/heads/try: e1e8db7e4a69825720fb1ae4478b6d29b447d994
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

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

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ fn build_impls(cx: &core::DocContext,
207207
match tcx.inherent_impls.borrow().find(&did) {
208208
None => {}
209209
Some(i) => {
210-
impls.extend(i.borrow().iter().map(|&did| { build_impl(tcx, did) }));
210+
impls.extend(i.borrow().iter().map(|&did| { build_impl(cx, tcx, did) }));
211211
}
212212
}
213213

@@ -223,30 +223,37 @@ fn build_impls(cx: &core::DocContext,
223223
csearch::each_top_level_item_of_crate(&tcx.sess.cstore,
224224
did.krate,
225225
|def, _, _| {
226-
populate_impls(tcx, def, &mut impls)
226+
populate_impls(cx, tcx, def, &mut impls)
227227
});
228228

229-
fn populate_impls(tcx: &ty::ctxt,
229+
fn populate_impls(cx: &core::DocContext,
230+
tcx: &ty::ctxt,
230231
def: decoder::DefLike,
231-
impls: &mut Vec<clean::Item>) {
232+
impls: &mut Vec<Option<clean::Item>>) {
232233
match def {
233-
decoder::DlImpl(did) => impls.push(build_impl(tcx, did)),
234+
decoder::DlImpl(did) => impls.push(build_impl(cx, tcx, did)),
234235
decoder::DlDef(ast::DefMod(did)) => {
235236
csearch::each_child_of_item(&tcx.sess.cstore,
236237
did,
237238
|def, _, _| {
238-
populate_impls(tcx, def, impls)
239+
populate_impls(cx, tcx, def, impls)
239240
})
240241
}
241242
_ => {}
242243
}
243244
}
244245
}
245246

246-
impls
247+
impls.move_iter().filter_map(|a| a).collect()
247248
}
248249

249-
fn build_impl(tcx: &ty::ctxt, did: ast::DefId) -> clean::Item {
250+
fn build_impl(cx: &core::DocContext,
251+
tcx: &ty::ctxt,
252+
did: ast::DefId) -> Option<clean::Item> {
253+
if !cx.inlined.borrow_mut().get_mut_ref().insert(did) {
254+
return None
255+
}
256+
250257
let associated_trait = csearch::get_impl_trait(tcx, did);
251258
let attrs = load_attrs(tcx, did);
252259
let ty = ty::lookup_item_type(tcx, did);
@@ -275,7 +282,7 @@ fn build_impl(tcx: &ty::ctxt, did: ast::DefId) -> clean::Item {
275282
};
276283
Some(item)
277284
}).collect();
278-
clean::Item {
285+
Some(clean::Item {
279286
inner: clean::ImplItem(clean::Impl {
280287
derived: clean::detect_derived(attrs.as_slice()),
281288
trait_: associated_trait.clean().map(|bound| {
@@ -293,7 +300,7 @@ fn build_impl(tcx: &ty::ctxt, did: ast::DefId) -> clean::Item {
293300
attrs: attrs,
294301
visibility: Some(ast::Inherited),
295302
def_id: did,
296-
}
303+
})
297304
}
298305

299306
fn build_module(cx: &core::DocContext, tcx: &ty::ctxt,

0 commit comments

Comments
 (0)