Skip to content

Theoretical breaking change from a combination of frontmatter and include! #145945

@mattheww

Description

@mattheww

With rustc 1.87, compiling the following pair of files succeeds:

main.rs:

fn main() {
    let _ = include!("expression.inc");
}

expression.inc:

---1

With rustc 1.88 or 1.89 (or rustc 1.91.0-nightly (160e7623e 2025-08-26)), compilation fails.

With 1.89 the first error message is

error: invalid infostring for frontmatter
 --> src/expression.inc:1:4
  |
1 | ---1
  |    ^
  |
  = note: frontmatter infostrings must be a single identifier immediately following the opening

See #145520 for a similar issue with TokenStream::from_str.

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.F-frontmatter`#![feature(frontmatter)]`P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions