Skip to content

Commit

Permalink
Unrolled build for rust-lang#127309
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#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)
  • Loading branch information
rust-timer authored Jul 4, 2024
2 parents 9f877c9 + 12f29e9 commit 2e310b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tools/jsondocck/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl Cache {

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

Expand Down

0 comments on commit 2e310b6

Please sign in to comment.