Closed yaymukund closed 2 years ago
This could potentially break proc macros. Doc comments become doc attributes that proc macros can process, and thus order matters.
In most cases, this won't matter, but we can't know that.
@joshtriplett Thank you for taking a look. That makes sense. I've added it to the RFC.
I was wondering what's the right way to move this forward?
Thanks for the suggestion, but I'm going to close. We don't want to add options that have breaking paths, especially ones like this that can be a source of subtle bugs (including ones that may not be detected until runtime).
Currently, we do not enforce ordering of doc comments. This RFC proposes a new option:
reorder_doc_comments
Reorder doc comments to be above or below attributes and regular comments.
"Prepend"
"Prepend"
,"Append"
,"Off"
"Prepend"
(default)"Append"
Advantages
Concerns
Details
In the case where there are multiple doc comments, each on their own lines, they would be grouped.
This would also affect ordering relative to doc attributes:
Related issues
I tried to read through the docs & follow the process, but please let me know if I missed anything 😊