Skip to content

Commit 6f43a02

Browse files
authored
Rollup merge of #127309 - its-the-shrimp:jsondocck_add_file_var, r=aDotInTheVoid
jsondocck: add `$FILE` built-in variable This built-in variable will allow accessing the full path to the currently tested file and allow to test things like source code spans generated by rustdoc-json, and that is exactly the reason why I've come up with the idea to add this [futher discussion on zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/rustdoc-json.20test.20help/near/449039819)
2 parents c091d09 + 12f29e9 commit 6f43a02

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tools/jsondocck/src/cache.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ impl Cache {
2323

2424
Cache {
2525
value: serde_json::from_str::<Value>(&content).expect("failed to convert from JSON"),
26-
variables: HashMap::new(),
26+
variables: HashMap::from([("FILE".to_owned(), config.template.clone().into())]),
2727
}
2828
}
2929

0 commit comments

Comments
 (0)