Skip to content

syntax: Always pretty print a newline after doc comments #31746

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

Merged
merged 1 commit into from
Mar 16, 2016

Conversation

erickt
Copy link
Contributor

@erickt erickt commented Feb 18, 2016

Before this patch, code that had a doc comment as the first
line, as in:

/// Foo
struct Foo;

Was pretty printed into:

///Foostruct Foo;

This makes sure that that there is always a trailing newline
after a doc comment.

Closes #31722

@rust-highfive
Copy link
Contributor

r? @sfackler

(rust_highfive has picked a reviewer for you, use r? to override)

@sfackler
Copy link
Member

@erickt
Copy link
Contributor Author

erickt commented Feb 18, 2016

I was afraid of that. This bug only shows up when the doc comment is the very first line. Any comments or even whitespace doesn't trip the problem. Does anyone know how to get tidy to ignore this file?

@sfackler
Copy link
Member

Yeah there's some way of whitelisting files but I can't remember exactly how.

@sfackler
Copy link
Member

@sfackler
Copy link
Member

Actually probably just // ignore-license.

Before this patch, code that had a doc comment as the first
line, as in:

```rust
/// Foo
struct Foo;
```

Was pretty printed into:

```rust
///Foostruct Foo;
```

This makes sure that that there is always a trailing newline
after a doc comment.

Closes rust-lang#31722
@erickt
Copy link
Contributor Author

erickt commented Mar 7, 2016

@sfackler: Updated!

@sfackler
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Mar 16, 2016

📌 Commit 0e3334e has been approved by sfackler

@bors
Copy link
Collaborator

bors commented Mar 16, 2016

⌛ Testing commit 0e3334e with merge 362fb6b...

@alexcrichton
Copy link
Member

@bors: retry force clean

@bors
Copy link
Collaborator

bors commented Mar 16, 2016

⌛ Testing commit 0e3334e with merge 255a3e6...

@bors
Copy link
Collaborator

bors commented Mar 16, 2016

💔 Test failed - auto-win-gnu-64-nopt-t

@alexcrichton
Copy link
Member

@bors: retry

On Wed, Mar 16, 2016 at 2:14 PM, bors notifications@github.com wrote:

[image: 💔] Test failed - auto-win-gnu-64-nopt-t
http://buildbot.rust-lang.org/builders/auto-win-gnu-64-nopt-t/builds/3455


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#31746 (comment)

@bors
Copy link
Collaborator

bors commented Mar 16, 2016

⌛ Testing commit 0e3334e with merge eeb062b...

bors added a commit that referenced this pull request Mar 16, 2016
syntax: Always pretty print a newline after doc comments

Before this patch, code that had a doc comment as the first
line, as in:

```rust
/// Foo
struct Foo;
```

Was pretty printed into:

```rust
///Foostruct Foo;
```

This makes sure that that there is always a trailing newline
after a doc comment.

Closes #31722
@bors bors merged commit 0e3334e into rust-lang:master Mar 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants