Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: target filter specified, but no targets matched; this is a no-op #15155

Open
dtolnay opened this issue Feb 8, 2025 · 1 comment
Open
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage. Z-scrape-examples Nightly: rustdoc scrape examples

Comments

@dtolnay
Copy link
Member

dtolnay commented Feb 8, 2025

Problem

In a crate that contains no examples, or for which every example has [[example]] doc-scrape-examples = false in Cargo.toml, running cargo +nightly rustdoc -Zrustdoc-scrape-examples --lib prints this mysterious warning.

Steps

# Cargo.toml

[package]
name = "repro"
edition = "2021"
// src/lib.rs (empty)

cargo +nightly rustdoc -Zrustdoc-scrape-examples --lib

warning: target filter specified, but no targets matched; this is a no-op
 Documenting repro v0.0.0
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.04s
   Generated target/doc/repro/index.html

Possible Solution(s)

A clearer warning that explains example scraping is enabled but the package contains no targets to scrape examples from.

Notes

No response

Version

cargo 1.86.0-nightly (0e3d73849 2025-02-01)
release: 1.86.0-nightly
commit-hash: 0e3d73849ab8cbbab3ec5c65cbd555586cb21339
commit-date: 2025-02-01
host: x86_64-unknown-linux-gnu
libgit2: 1.9.0 (sys:0.20.0 vendored)
libcurl: 8.9.0-DEV (sys:0.4.74+curl-8.9.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w  11 Sep 2023
os: Ubuntu 24.4.0 (noble) [64-bit]
@dtolnay dtolnay added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels Feb 8, 2025
@dtolnay
Copy link
Member Author

dtolnay commented Feb 8, 2025

@rustbot label +Z-scrape-examples

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage. Z-scrape-examples Nightly: rustdoc scrape examples
Projects
None yet
Development

No branches or pull requests

2 participants