Skip to content

Commit 11e738b

Browse files
rustdoc: rewrite a few comments
Co-authored-by: Guillaume Gomez <[email protected]>
1 parent cea63a6 commit 11e738b

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

src/librustdoc/passes/collect_intra_doc_links.rs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2232,9 +2232,8 @@ fn ambiguity_error(
22322232
emit_error: bool,
22332233
) -> bool {
22342234
let mut descrs = FxHashSet::default();
2235-
// proc macros can exist in multiple namespaces at once,
2236-
// so we need to compare DefIds to remove
2237-
// the candidite in the fn namespace
2235+
// proc macro can exist in multiple namespaces at once, so we need to compare `DefIds`
2236+
// to remove the candidate in the fn namespace.
22382237
let mut possible_proc_macro_id = None;
22392238
let is_proc_macro_crate = cx.tcx.crate_types() == &[CrateType::ProcMacro];
22402239
let mut kinds = candidates
@@ -2248,16 +2247,13 @@ fn ambiguity_error(
22482247
r
22492248
})
22502249
.collect::<Vec<_>>();
2251-
// in order to properly dedup proc macros,
2252-
// we have to do it in two passes,
2253-
// completing the full traversal to find
2254-
// the possible duplicate in the macro namespace,
2255-
// then another full traversal to eliminate the
2256-
// candidite in the fn namespace.
2257-
// thus, we have to do an iteration after
2258-
// collection is finished.
2250+
// In order to properly dedup proc macros, we have to do it in two passes:
2251+
// 1. Completing the full traversal to find the possible duplicate in the macro namespace,
2252+
// 2. Another full traversal to eliminate the candidate in the fn namespace.
22592253
//
2260-
// as an optimization, we only deduplicate if we're in a proc-macro crate,
2254+
// Thus, we have to do an iteration after collection is finished.
2255+
//
2256+
// As an optimization, we only deduplicate if we're in a proc-macro crate,
22612257
// and only if we already found something that looks like a proc macro.
22622258
if is_proc_macro_crate && let Some(macro_id) = possible_proc_macro_id {
22632259
kinds.retain(|res| {

0 commit comments

Comments
 (0)