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

rustdoc reports issues against lib.rs rather than an include_str!'d file #130470

Closed
fasterthanlime opened this issue Sep 17, 2024 · 8 comments · Fixed by #130582
Closed

rustdoc reports issues against lib.rs rather than an include_str!'d file #130470

fasterthanlime opened this issue Sep 17, 2024 · 8 comments · Fixed by #130582
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@fasterthanlime
Copy link
Contributor

The repro repository has everything: https://github.com/fasterthanlime/readme-md-error-reporting

Expected behavior is that the diagnostics have: --> README.md:7:16, but they currently have --> src/lib.rs:7:16.

@fasterthanlime fasterthanlime added the C-bug Category: This is a bug. label Sep 17, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 17, 2024
@fasterthanlime
Copy link
Contributor Author

fasterthanlime commented Sep 17, 2024

cc @GuillaumeGomez (as per Mastodon discussion)

@saethlin saethlin added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-diagnostics Area: Messages for errors, warnings, and lints and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Sep 18, 2024
@GuillaumeGomez
Copy link
Member

GuillaumeGomez commented Sep 18, 2024

Thanks for opening the issue! I'm surprised since it's an issue that was supposed to be fixed in #123204. Just to confirm: which rustc version do you use?

Also cc @notriddle since you're the one who fixed this bug.

@fasterthanlime
Copy link
Contributor Author

This happened with 1.81 most likely — I would take the few secs to check but I’m on a phone right now.

@notriddle
Copy link
Contributor

The doctest system needs to use the same infrastructure as the rest of rustdoc.

@bors bors closed this as completed in ee4afa3 Sep 20, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Sep 20, 2024
Rollup merge of rust-lang#130582 - notriddle:notriddle/doctest-span, r=GuillaumeGomez

rustdoc: use the correct span for doctests

Fixes rust-lang#130470
@fasterthanlime
Copy link
Contributor Author

I can confirm this does fix my repro:

Image

Would you like a separate issue for the part where it says src/../README.md when really it could normalize the path and just say README.md ?

@GuillaumeGomez
Copy link
Member

Yes please!

@fasterthanlime
Copy link
Contributor Author

Yes please!

@GuillaumeGomez filed as #130626

@GuillaumeGomez
Copy link
Member

Thanks! Gonna take a look in the next days if someone else didn't do it before then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants