Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prettyprinter reorders comments to show before doc comments #6678

Closed
ben0x539 opened this issue May 22, 2013 · 9 comments
Closed

prettyprinter reorders comments to show before doc comments #6678

ben0x539 opened this issue May 22, 2013 · 9 comments
Labels
A-pretty Area: Pretty printing (including `-Z unpretty`) C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@ben0x539
Copy link
Contributor

$ echo '/** foo */ /* bar */ fn f() {}' | rustc - --pretty
/* bar */
/** foo */
fn f() { }

I'm not sure this is supposed to happen, but maybe it's prettier this way...

@steveklabnik
Copy link
Member

Doc comments need to be right before, don't they? I'm not sure, just wondering out loud. That'd make sense...

@emberian
Copy link
Member

Still reproduces

@metajack
Copy link
Contributor

triage bump. nothing to add.

@huonw
Copy link
Member

huonw commented Jan 26, 2014

Still reproduces.

(@steveklabnik it's okay to have normal comments between the doc comment and the function, since they're not seen by the parser at all.)

@steveklabnik
Copy link
Member

Triage: still here.

@mrhota
Copy link
Contributor

mrhota commented Apr 27, 2016

Triage: still here in nightly (using rustup)

@Mark-Simulacrum Mark-Simulacrum added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Jul 19, 2017
@steveklabnik
Copy link
Member

Triage: no change in behavior, though the flags have changed:

> rustc +nightly -Z unstable-options --pretty=normal .\foo.rs
/* bar */
/** foo */
fn f() { }

flip1995 pushed a commit to flip1995/rust that referenced this issue Feb 11, 2021
Fix typo

This patch fixes a typo.

changelog: none
@workingjubilee
Copy link
Member

Closing this on the hypothesis of "if this was unintended behavior, someone would have fixed it within the past 10 years". Seems harmless, but maybe I'm wrong? 🤷‍♀️

@workingjubilee workingjubilee closed this as not planned Won't fix, can't repro, duplicate, stale Mar 15, 2023
@varkor
Copy link
Member

varkor commented Mar 17, 2023

@workingjubilee: seems less likely this is intended behaviour and more likely this is just low priority compared to other issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-pretty Area: Pretty printing (including `-Z unpretty`) C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

9 participants