-
Notifications
You must be signed in to change notification settings - Fork 13k
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 2015 regression: doc test fails (unresolved import) if it contains a doc comment #56727
Labels
A-doctests
Area: Documentation tests, run by rustdoc
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Comments
japaric
added a commit
to rust-embedded/embedded-hal
that referenced
this issue
Dec 11, 2018
fixes nightly builds
bors bot
added a commit
to rust-embedded/embedded-hal
that referenced
this issue
Dec 11, 2018
116: work around rust-lang/rust#56727 r=ryankurte a=japaric fixes nightly builds Co-authored-by: Jorge Aparicio <jorge@japaric.io>
japaric
changed the title
rustdoc 2015: doc test fails (unresolved import) if it contains a doc comment
rustdoc 2015 regression: doc test fails (unresolved import) if it contains a doc comment
Dec 11, 2018
QuietMisdreavus
added
the
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
label
Dec 13, 2018
I almost have a PR ready for this. Here's the basic structure of what's happening:
EDIT: (submitted too early, oops) So, the solution is to make sure rustdoc can handle comments when splitting up doctests. Like i said, i almost have this ready. |
That PR is now live: #56793 |
Centril
added a commit
to Centril/rust
that referenced
this issue
Dec 16, 2018
…GuillaumeGomez rustdoc: look for comments when scraping attributes/crates from doctests Fixes rust-lang#56727 When scraping out crate-level attributes and `extern crate` statements, we wouldn't look for comments, so any presence of comments would shunt it and everything after it into "everything else". This could cause parsing issues when looking for `fn main` and `extern crate my_crate` later on, which would in turn cause rustdoc to incorrectly wrap a test with `fn main` when it already had one declared. I took the opportunity to clean up the logic a little bit, but it would still benefit from a libsyntax-based loop like the `fn main` detection.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-doctests
Area: Documentation tests, run by rustdoc
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
STR
Cargo.toml
src/lib.rs
Ways to "fix" the error:
edition = "2018"
to Cargo.toml, OR//!
), ORThe text was updated successfully, but these errors were encountered: