Skip to content
/ rust Public
forked from rust-lang/rust

Commit adc0473

Browse files
authored
Rollup merge of rust-lang#140076 - aDotInTheVoid:jsondocline, r=GuillaumeGomez
jsondocck: Require command is at start of line In one place we use `///`@`` instead of `//`@`.` The test-runner allowed it, but it probably shouldn't. Ran into by `@lolbinarycat` in rust-lang#132748 (comment): ``` error: unknown disambiguator `?(` ##[error] --> /checkout/tests/rustdoc-json/fns/return_type_alias.rs:3:25 | 3 | ///@ set foo = "$.index[?(`@.name=='Foo')].id"` | ^^ | ``` Maybe it's also worth erroring on this like we added in rust-lang#137103 r? `@GuillaumeGomez`
2 parents 064187b + fd4a093 commit adc0473

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/tools/jsondocck/src/main.rs

+1
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ impl CommandKind {
154154
static LINE_PATTERN: LazyLock<Regex> = LazyLock::new(|| {
155155
RegexBuilder::new(
156156
r#"
157+
^\s*
157158
//@\s+
158159
(?P<negated>!?)
159160
(?P<cmd>[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)

tests/rustdoc-json/fns/return_type_alias.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Regression test for <https://github.com/rust-lang/rust/issues/104851>
22

3-
///@ set foo = "$.index[?(@.name=='Foo')].id"
3+
//@ set foo = "$.index[?(@.name=='Foo')].id"
44
pub type Foo = i32;
55

66
//@ is "$.index[?(@.name=='demo')].inner.function.sig.output.resolved_path.id" $foo

0 commit comments

Comments
 (0)