-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Macro that expands into string holding function name (or module path, etc) #1743
Copy link
Copy link
Open
Labels
A-macrosMacro related proposals and issuesMacro related proposals and issuesA-macros-libstdProposals that introduce new standard library macrosProposals that introduce new standard library macrosT-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.T-libs-apiRelevant to the library API team, which will review and decide on the RFC.Relevant to the library API team, which will review and decide on the RFC.
Metadata
Metadata
Assignees
Labels
A-macrosMacro related proposals and issuesMacro related proposals and issuesA-macros-libstdProposals that introduce new standard library macrosProposals that introduce new standard library macrosT-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.T-libs-apiRelevant to the library API team, which will review and decide on the RFC.Relevant to the library API team, which will review and decide on the RFC.
Type
Fields
Give feedbackNo fields configured for issues without a type.
RFC #466 was closed back in the days before we had a protocol for opening up follow-up issues to use to gather links to related discussion.
The idea is that we already have some macros (
file!andline!) that are useful for reporting source code context, and it might be nice to expand that collection with macros that include other information, such as the current function name, which I believe was the suggestion of thefunction!macro that was at one point described in RFC #466 (whose draft contents have now been lost, apparently).Here is my attempt to retrieve the Motivation from that original draft text. (I don't think we need the detailed design in the description of an issue like this.)
module_path!macro that expands into a string representing the path to the current module; such a macro would be usable outside offndefinitions, e.g. instaticitems.