about summary refs log tree commit diff
path: root/tests/ui/frontmatter
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/frontmatter')
-rw-r--r--tests/ui/frontmatter/proc-macro-observer.rs1
-rw-r--r--tests/ui/frontmatter/unclosed-6.rs12
-rw-r--r--tests/ui/frontmatter/unclosed-6.stderr19
3 files changed, 32 insertions, 0 deletions
diff --git a/tests/ui/frontmatter/proc-macro-observer.rs b/tests/ui/frontmatter/proc-macro-observer.rs
index 6c4c8c57289..5237a0e982a 100644
--- a/tests/ui/frontmatter/proc-macro-observer.rs
+++ b/tests/ui/frontmatter/proc-macro-observer.rs
@@ -1,6 +1,7 @@
 //@ check-pass
 //@ proc-macro: makro.rs
 //@ edition: 2021
+//@ ignore-backends: gcc
 
 // Check that a proc-macro doesn't try to parse frontmatter and instead treats
 // it as a regular Rust token sequence. See `auxiliary/makro.rs` for details.
diff --git a/tests/ui/frontmatter/unclosed-6.rs b/tests/ui/frontmatter/unclosed-6.rs
new file mode 100644
index 00000000000..ea8d4702f63
--- /dev/null
+++ b/tests/ui/frontmatter/unclosed-6.rs
@@ -0,0 +1,12 @@
+---
+//~^ ERROR unclosed frontmatter
+🦀---
+ ---
+
+// This test checks the location of the --- recovered by the parser is not
+// incorrectly tracked during the less fortunate recovery case and multiple
+// candidates are found, as seen with #146847
+
+#![feature(frontmatter)]
+
+fn main() {}
diff --git a/tests/ui/frontmatter/unclosed-6.stderr b/tests/ui/frontmatter/unclosed-6.stderr
new file mode 100644
index 00000000000..01a13e87268
--- /dev/null
+++ b/tests/ui/frontmatter/unclosed-6.stderr
@@ -0,0 +1,19 @@
+error: unclosed frontmatter
+  --> $DIR/unclosed-6.rs:1:1
+   |
+LL | / ---
+LL | |
+LL | | 🦀---
+LL | |  ---
+...  |
+LL | |
+   | |_^
+   |
+note: frontmatter opening here was not closed
+  --> $DIR/unclosed-6.rs:1:1
+   |
+LL | ---
+   | ^^^
+
+error: aborting due to 1 previous error
+