diff options
| author | Ed Page <eopage@gmail.com> | 2025-08-22 09:17:41 -0500 |
|---|---|---|
| committer | Ed Page <eopage@gmail.com> | 2025-08-22 09:17:41 -0500 |
| commit | 9b0ddec2a8f3ed9a72df14921b3aa164993dd83b (patch) | |
| tree | 9e604fd935cf71f6a899a813f155b80c1c986fc4 | |
| parent | 8c32e313cccf7df531e2d49ffb8227bb92304aee (diff) | |
| download | rust-9b0ddec2a8f3ed9a72df14921b3aa164993dd83b.tar.gz rust-9b0ddec2a8f3ed9a72df14921b3aa164993dd83b.zip | |
test(frontmatter): Show current hyphen behavior
4 files changed, 38 insertions, 0 deletions
diff --git a/tests/ui/frontmatter/hyphen-in-infostring-leading.rs b/tests/ui/frontmatter/hyphen-in-infostring-leading.rs new file mode 100644 index 00000000000..8652fd76ad5 --- /dev/null +++ b/tests/ui/frontmatter/hyphen-in-infostring-leading.rs @@ -0,0 +1,9 @@ +--- -toml +//~^ ERROR: invalid infostring for frontmatter +--- + +// infostrings cannot have leading hyphens + +#![feature(frontmatter)] + +fn main() {} diff --git a/tests/ui/frontmatter/hyphen-in-infostring-leading.stderr b/tests/ui/frontmatter/hyphen-in-infostring-leading.stderr new file mode 100644 index 00000000000..167b537d62b --- /dev/null +++ b/tests/ui/frontmatter/hyphen-in-infostring-leading.stderr @@ -0,0 +1,10 @@ +error: invalid infostring for frontmatter + --> $DIR/hyphen-in-infostring-leading.rs:1:4 + | +LL | --- -toml + | ^^^^^^ + | + = note: frontmatter infostrings must be a single identifier immediately following the opening + +error: aborting due to 1 previous error + diff --git a/tests/ui/frontmatter/hyphen-in-infostring-non-leading.rs b/tests/ui/frontmatter/hyphen-in-infostring-non-leading.rs new file mode 100644 index 00000000000..ccb80d8799a --- /dev/null +++ b/tests/ui/frontmatter/hyphen-in-infostring-non-leading.rs @@ -0,0 +1,9 @@ +--- Cargo-toml +//~^ ERROR: invalid infostring for frontmatter +--- + +// infostrings cannot have hyphens + +#![feature(frontmatter)] + +fn main() {} diff --git a/tests/ui/frontmatter/hyphen-in-infostring-non-leading.stderr b/tests/ui/frontmatter/hyphen-in-infostring-non-leading.stderr new file mode 100644 index 00000000000..959cf74e327 --- /dev/null +++ b/tests/ui/frontmatter/hyphen-in-infostring-non-leading.stderr @@ -0,0 +1,10 @@ +error: invalid infostring for frontmatter + --> $DIR/hyphen-in-infostring-non-leading.rs:1:4 + | +LL | --- Cargo-toml + | ^^^^^^^^^^^ + | + = note: frontmatter infostrings must be a single identifier immediately following the opening + +error: aborting due to 1 previous error + |
