@@ -2232,9 +2232,8 @@ fn ambiguity_error(
2232
2232
emit_error : bool ,
2233
2233
) -> bool {
2234
2234
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.
2238
2237
let mut possible_proc_macro_id = None ;
2239
2238
let is_proc_macro_crate = cx. tcx . crate_types ( ) == & [ CrateType :: ProcMacro ] ;
2240
2239
let mut kinds = candidates
@@ -2248,16 +2247,13 @@ fn ambiguity_error(
2248
2247
r
2249
2248
} )
2250
2249
. 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.
2259
2253
//
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,
2261
2257
// and only if we already found something that looks like a proc macro.
2262
2258
if is_proc_macro_crate && let Some ( macro_id) = possible_proc_macro_id {
2263
2259
kinds. retain ( |res| {
0 commit comments