Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c81fffa

Browse files
Rollup merge of #146161 - GuillaumeGomez:loaded-paths-scraped-examples, r=lolbinarycat
[rustdoc] Uncomment code to add scraped rustdoc examples in loaded paths Since the bug was fixed in #146091, we can now uncomment the code. :) r? lolbinarycat
2 parents 8b2a64f + a5f52a9 commit c81fffa

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

‎src/librustdoc/config.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,8 @@ impl Options {
821821

822822
let scrape_examples_options = ScrapeExamplesOptions::new(matches, dcx);
823823
let with_examples = matches.opt_strs("with-examples");
824-
let call_locations = crate::scrape_examples::load_call_locations(with_examples, dcx);
824+
let call_locations =
825+
crate::scrape_examples::load_call_locations(with_examples, dcx, &mut loaded_paths);
825826
let doctest_build_args = matches.opt_strs("doctest-build-arg");
826827

827828
let unstable_features =

‎src/librustdoc/scrape_examples.rs‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,14 +333,11 @@ pub(crate) fn run(
333333
pub(crate) fn load_call_locations(
334334
with_examples: Vec<String>,
335335
dcx: DiagCtxtHandle<'_>,
336+
loaded_paths: &mut Vec<PathBuf>,
336337
) -> AllCallLocations {
337338
let mut all_calls: AllCallLocations = FxIndexMap::default();
338339
for path in with_examples {
339-
// FIXME: Figure out why this line is causing this feature to crash in specific contexts.
340-
// Full issue backlog is available here: <https://github.com/rust-lang/rust/pull/144600>.
341-
//
342-
// Can be checked with `tests/run-make/rustdoc-scrape-examples-paths`.
343-
// loaded_paths.push(path.clone().into());
340+
loaded_paths.push(path.clone().into());
344341
let bytes = match fs::read(&path) {
345342
Ok(bytes) => bytes,
346343
Err(e) => dcx.fatal(format!("failed to load examples: {e}")),

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /