Skip to content

Commit d6c4723

Browse files
committed
Review: add comment about empty generic args <>
1 parent 8979526 commit d6c4723

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

compiler/rustc_ast_lowering/src/delegation/generics.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,9 @@ impl<'hir> LoweringContext<'_, 'hir> {
316316
return None;
317317
};
318318

319+
// Treat empty args `reuse foo::<> as bar` as `reuse foo as bar`,
320+
// the same logic applied when we call function `fn f<T>(t: T)`
321+
// like that `f::<>(())`, in HIR no `<>` will be generated.
319322
(!args.args.is_empty()).then(|| args)
320323
};
321324

0 commit comments

Comments
 (0)