Reduce $crate usage (local
and private
for macros)
#1630
Labels
T-lang
Relevant to the language team, which will review and decide on the RFC.
Proposal
Macros can define traits, but not local and private traits. Local traits would be local to the macro invocation, private traits would be private to the macro.
E.g.
Before:
RwLockEvent
ispub
and can be manually implemented.After:
RwLockEvent
is macro-local and an implementation detail. Other invocations of the same macro cannot see the impl, and the trait doesn't pollute the invocation context.For
private
, multiple invocations of the same macro would be able to see eachother, but the invocation context wouldn't.Benefits
Significantly reduces dependency on
$crate
.private
could be extended toextern crate
anduse
for maximum$crate
reduction.The text was updated successfully, but these errors were encountered: