Skip to content

Commit 2e68244

Browse files
committed
fix(future): Loosen infostring requirements
1 parent f9be5d4 commit 2e68244

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
@@ -81,7 +81,7 @@ an info-string is allowed after the opening `---` for use by the command interpr
8181

8282
When parsing Rust source, after stripping the shebang (`#!`), rustc will strip the frontmatter:
8383
- May include 0+ blank lines (whitespace + newline)
84-
- Opens with 3+ dashes followed by 0+ whitespace, an optional identifier, 0+ whitespace, and a newline
84+
- Opens with 3+ dashes followed by 0+ whitespace, an optional term (one or more characters excluding whitespace and commas), non-comma characters), 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.
@@ -142,6 +142,9 @@ Can it also be deferred out?
142142
Possibly, but we are leaving them in for unpredictable exception cases and in case users want to make the syntax explicit for their editor (especially if its not `cargo` which more trivial editor implementations will likely assume).
143143
We may at least defer stabilization of infostrings.
144144

145+
The infostring syntax was selected to allow file names (e.g. `Cargo.lock`).
146+
Additional attributes are left to a future possibility.
147+
145148
## Syntax
146149

147150
[RFC 3502] lays out some design principles, including

0 commit comments

Comments
 (0)