-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Rustdoc: Test fails on "unresolved import" though test doesn't use any crate #103775
Comments
If I use qualified name for /// ```
/// assert!(true)
/// ```
fn main() {
println!("Hello, world!");
let regex = regex::Regex::new("^Hello").unwrap();
println!("{}", regex);
} $ rustdoc --test src/main.rs
|
You are invoking The @rustbot label invalid |
Regarding your comment:
This is due to an unrelated reason (what I said about fn main() {
i_do_not_exist;
} |
Thanks for your report! However, none of this is a bug. The issues you are seeing a due to the incorrect use of the provided Rust tools. The issue with rustdoc accepting several semantically malformed programs is well-known and a won't-fix. |
But it doesn't run docs tests in my case: #50784 |
Ah, I see. That's bothersome :( So essentially, this issue then becomes a duplicate of #50784, right? |
Duplicate of #50784 |
I tried this code (
src/main.rs
):with
Cargo.toml
I run
rustdoc --test src/main.rs
I expected to see this happen:
Instead, this happened:
Note that
cargo run
works wellMeta
rustc --version --verbose
:rustdoc --version
I'm running Ubuntu 22.04
The text was updated successfully, but these errors were encountered: