-
-
Notifications
You must be signed in to change notification settings - Fork 16.5k
Add a macro to track a file #73921
Copy link
Copy link
Closed
Labels
A-proc-macrosArea: Procedural macrosArea: Procedural macrosC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-langRelevant to the language teamRelevant to the language team
Description
Activity
Metadata
Metadata
Assignees
Labels
A-proc-macrosArea: Procedural macrosArea: Procedural macrosC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-langRelevant to the language teamRelevant to the language team
I recently released
doc-comment0.4 which converted declarative macros to proc-macros. I encountered a "funny" issue though: I needed the compiler to track files that were included using my proc-macros. In order to do so, I generated anonymous constants which looked like this:However, I have no use for those constants and they make the source code heavier for just keeping track of a file. Therefore, I propose to add a
track!("file")macro which would allow to track files likeinclude_str!without requiring the usage of anonymous constants.I can make the implementation if the rust teams agree to add this feature. :)