You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// If this unit is needed for doc-scraping, then we generate a diagnostic that
286
+
// describes the set of reverse-dependencies that cause the unit to be needed.
287
+
let target_desc = unit.target.description_named();
288
+
letmut for_scrape_units = cx
289
+
.bcx
290
+
.scrape_units_have_dep_on(unit)
291
+
.into_iter()
292
+
.map(|unit| unit.target.description_named())
293
+
.collect::<Vec<_>>();
294
+
for_scrape_units.sort();
295
+
let for_scrape_units = for_scrape_units.join(", ");
296
+
let failed_scrape_diagnostic = make_failed_scrape_diagnostic(cx, unit,format!("failed to check {target_desc} in package `{name}` as a prerequisite for scraping examples from: {for_scrape_units}"));
297
+
298
+
let hide_diagnostics_for_scrape_unit = cx.bcx.unit_can_fail_for_docscraping(unit)
warning: failed to scan lib in package `foo` for example code usage
343
346
Try running with `--verbose` to see the error message.
344
-
If this example should not be scanned, consider adding `doc-scrape-examples = false` to the `[[example]]` definition in Cargo.toml
347
+
If an example or library should not be scanned, then consider adding `doc-scrape-examples = false` to its `[[example]]` or `[lib]` definition in Cargo.toml
345
348
warning: `foo` (lib) generated 1 warning
349
+
warning: failed to check lib in package `foo` as a prerequisite for scraping examples from: example \"ex\", example \"ex2\"
350
+
Try running with `--verbose` to see the error message.
351
+
If an example or library should not be scanned, then consider adding `doc-scrape-examples = false` to its `[[example]]` or `[lib]` definition in Cargo.toml
352
+
warning: `foo` (lib) generated 1 warning
353
+
warning: failed to scan example \"ex\" in package `foo` for example code usage
354
+
Try running with `--verbose` to see the error message.
355
+
If an example or library should not be scanned, then consider adding `doc-scrape-examples = false` to its `[[example]]` or `[lib]` definition in Cargo.toml
warning: failed to scan example \"ex2\" in package `foo` for example code usage
358
+
Try running with `--verbose` to see the error message.
359
+
If an example or library should not be scanned, then consider adding `doc-scrape-examples = false` to its `[[example]]` or `[lib]` definition in Cargo.toml
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]",
348
363
)
@@ -374,7 +389,7 @@ fn no_fail_bad_example() {
374
389
[SCRAPING] foo v0.0.1 ([CWD])
375
390
warning: failed to scan example \"ex1\" in package `foo` for example code usage
376
391
Try running with `--verbose` to see the error message.
377
-
If this example should not be scanned, consider adding `doc-scrape-examples = false` to the `[[example]]` definition in Cargo.toml
392
+
If an example or library should not be scanned, then consider adding `doc-scrape-examples = false` to its `[[example]]` or `[lib]` definition in Cargo.toml
0 commit comments