Skip to content

Doc tests #19237

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

Merged
merged 4 commits into from
Feb 27, 2025
Merged

Doc tests #19237

merged 4 commits into from
Feb 27, 2025

Conversation

BenjaminBrienen
Copy link
Contributor

cargo test does not test code snippets in documentation because of how Cargo.toml is configured, so this ensures that documentation is written correctly. If this is detrimental, feel free to close this. I do think it would be a good enhancement, though. rustdoc expects code snippets to work unless told otherwise. Also note how many syntax errors were caught, such as fn main { or ($x:expr + $y:expr).

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 26, 2025
@ChayimFriedman2
Copy link
Contributor

If we decide this is worth it, we should remove doctest = false from Cargo.tomls, not add another CI job for cargo test --doc,

@Veykril
Copy link
Member

Veykril commented Feb 27, 2025

CI failure is #19214, given the proc-macro library changes CI runs nightly which hits that now

@lnicola
Copy link
Member

lnicola commented Feb 27, 2025

You can rebase on top of master now.

@BenjaminBrienen
Copy link
Contributor Author

The paths doc test fails on windows because /a/../../ is determined to be a relative path. I think this is incorrect. If I cd /sources on Windows, it changes the cwd to C:\sources.

@lnicola lnicola added this pull request to the merge queue Feb 27, 2025
Merged via the queue into rust-lang:master with commit 2fa819c Feb 27, 2025
9 checks passed
@BenjaminBrienen BenjaminBrienen deleted the doc-tests branch February 27, 2025 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants