Skip to content

Commit 768f977

Browse files
Fix rustdoc scrape-examples feature crash
1 parent dc0bae1 commit 768f977

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/librustdoc/config.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -804,8 +804,7 @@ impl Options {
804804

805805
let scrape_examples_options = ScrapeExamplesOptions::new(matches, dcx);
806806
let with_examples = matches.opt_strs("with-examples");
807-
let call_locations =
808-
crate::scrape_examples::load_call_locations(with_examples, dcx, &mut loaded_paths);
807+
let call_locations = crate::scrape_examples::load_call_locations(with_examples, dcx);
809808
let doctest_build_args = matches.opt_strs("doctest-build-arg");
810809

811810
let unstable_features =

src/librustdoc/scrape_examples.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,14 @@ 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>,
337336
) -> AllCallLocations {
338337
let mut all_calls: AllCallLocations = FxIndexMap::default();
339338
for path in with_examples {
340-
loaded_paths.push(path.clone().into());
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());
341344
let bytes = match fs::read(&path) {
342345
Ok(bytes) => bytes,
343346
Err(e) => dcx.fatal(format!("failed to load examples: {e}")),

0 commit comments

Comments
 (0)