Skip to content

Commit 82352ed

Browse files
committed
fix: Cover include macro
1 parent eab2309 commit 82352ed

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

text/3503-frontmatter.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,17 @@ an info-string is allowed after the opening `---` for use by the command interpr
7979
# Reference-level explanation
8080
[reference-level-explanation]: #reference-level-explanation
8181

82-
When parsing Rust code, after stripping the shebang (`#!`), rustc will strip the frontmatter:
82+
When parsing Rust source, after stripping the shebang (`#!`), rustc will strip the frontmatter:
8383
- May include 0+ blank lines (whitespace + newline)
8484
- Opens with 3+ dashes followed by 0+ whitespace, an optional identifier, 0+ whitespace, and a newline
8585
- The variable number of dashes is an escaping mechanism in case `---` shows up in the content
8686
- All content is ignored by `rustc` until the same number of dashes is found at the start of a line.
8787
The line must terminate by 0+ whitespace and then a newline.
8888
- Unlike commonmark, it is an error to not close the frontmatter seeing to detect problems earlier in the process seeing as the primary content is what comes after the frontmatter
8989

90+
This applies anywhere shebang stripping is performed.
91+
For example, if [`include!`](https://doc.rust-lang.org/std/macro.include.html) strips shebangs, then it will also frontmatter.
92+
9093
As cargo will be the first step in the process to parse this,
9194
the responsibility for high quality error messages will largely fall on cargo.
9295

0 commit comments

Comments
 (0)