Macro that expands into string holding function name (or module path, etc)
Nobody has claimed this yet.
- Dominant language
- Markdown
- Stars
- 6.6k
- Forks
- 1.7k
- Avg merge
- 16h 14m
- Merged PRs (30d)
- 1
Description
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! and line!) 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 the function! 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.)
Motivation
For error reporting cases we already have
file!,line!,col!andmodule_path!
but there is no way yet to figure out in which function an error was reported. Python's
tracebacks are well received and for many people the function name information is much
more important than the line number.
- An alternative (or complement) would be to have a
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing RFC #466 and the existing file!, line!, col!, and module_path! macros described in the issue. Clarify whether the goal is a current-function-name macro, a module-path enhancement, or both, and document a settled design and scope before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100