Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/doc/style-guide/src/nightly.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,29 @@ This chapter documents style and formatting for nightly-only syntax. The rest of
Style and formatting for nightly-only syntax should be removed from this chapter and integrated into the appropriate sections of the style guide at the time of stabilization.

There is no guarantee of the stability of this chapter in contrast to the rest of the style guide. Refer to the style team policy for nightly formatting procedure regarding breaking changes to this chapter.

### Frontmatter

*Location: Placed before comments and attributes in the [root](index.html).*

*Tracking issue: [#136889](https://github.com/rust-lang/rust/issues/136889)*

*Feature gate: `frontmatter`*

There should be no blank lines between the frontmatter and either the start of the file or a shebang.
There can be zero or one line between the frontmatter and any following content.

The frontmatter fences should use the minimum number of dashes necessary for the contained content (one more than the longest series of initial dashes in the
content, with a minimum of 3 to be recognized as frontmatter delimiters).
If an infostring is present after the opening fence, there should be one space separating them.
The frontmatter fence lines should not have trailing whitespace.
Comment on lines +17 to +23
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the style guide is consistently wrapped at 80 columns. The remainder of this chapter, though, is not hard wrapped at all. It seems we should do one of the two.

@joshtriplett, do you have thoughts about the style guide for the style guide?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's ever anything that's been enforced (once upon a time before the style guide was in this repo I'd merge text and modify it after versus asking the author).

If we are going to try to maintain consistency then maybe it could be incorporated into the tidy checks someday?

For now my .02 would be to proceed and circle back to it if/when we make that decision

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(once upon a time before the style guide was in this repo I'd merge text and modify it after versus asking the author).

Similarly to that, we could push a commit ourselves to this branch doing it, then merge it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's ever anything that's been enforced...

I had looked through all the chapters before asking. They're mostly wrapped at 80, with a handful of sections wrapped closer to 90 or 95, and then there's the types chapter where two sections are unwrapped and the nightly chapter that is unwrapped.

Copy link
Member

@joshtriplett joshtriplett Oct 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that we should merge for now and attempt to apply consistency later.

Broadly speaking I think the style guide should be wrapped the way other markdown files are typically wrapped: at 80 columns.

The primary exception would be code examples, which might extend to 100 columns to match normal Rust style, and conversely might be wrapped oddly to demonstrate something.


```rust
#!/usr/bin/env cargo
--- cargo
[dependencies]
regex = "1"
---

fn main() {}
```
Loading