about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/tools/jsondocck/src/main.rs1
-rw-r--r--tests/rustdoc-json/fns/return_type_alias.rs2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/tools/jsondocck/src/main.rs b/src/tools/jsondocck/src/main.rs
index 79e419884c6..65ad38da98b 100644
--- a/src/tools/jsondocck/src/main.rs
+++ b/src/tools/jsondocck/src/main.rs
@@ -154,6 +154,7 @@ impl CommandKind {
 static LINE_PATTERN: LazyLock<Regex> = LazyLock::new(|| {
     RegexBuilder::new(
         r#"
+        ^\s*
         //@\s+
         (?P<negated>!?)
         (?P<cmd>[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)
diff --git a/tests/rustdoc-json/fns/return_type_alias.rs b/tests/rustdoc-json/fns/return_type_alias.rs
index 0aa1db47b7f..c39abc75894 100644
--- a/tests/rustdoc-json/fns/return_type_alias.rs
+++ b/tests/rustdoc-json/fns/return_type_alias.rs
@@ -1,6 +1,6 @@
 // Regression test for <https://github.com/rust-lang/rust/issues/104851>
 
-///@ set foo = "$.index[?(@.name=='Foo')].id"
+//@ set foo = "$.index[?(@.name=='Foo')].id"
 pub type Foo = i32;
 
 //@ is "$.index[?(@.name=='demo')].inner.function.sig.output.resolved_path.id" $foo