-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Ice with rustdoc scrape_examples #90567
Labels
A-rustdoc-scrape-examples
Area: The (unstable) rustdoc scrape-examples feature described in RFC 3123
C-bug
Category: This is a bug.
requires-nightly
This issue requires a nightly compiler in some way.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Comments
GuillaumeGomez
added
the
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
label
Nov 4, 2021
@mejrs can you do two things for me:
|
camelid
added
A-rustdoc-scrape-examples
Area: The (unstable) rustdoc scrape-examples feature described in RFC 3123
requires-nightly
This issue requires a nightly compiler in some way.
labels
Nov 4, 2021
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Nov 4, 2021
…n514 Fix ICE when rustdoc is scraping examples inside of a proc macro This PR provides a clearer semantics for how --scrape-examples interacts with macros. If an expression's span AND it's enclosing item's span both are not `from_expansion`, then the example will be scraped. The added test case `rustdoc-scrape-examples-macros` shows a variety of situations. * A macro-rules macro that takes a function call as input: good * A macro-rules macro that generates a function call as output: bad * A proc-macro that generates a function call as output: bad * An attribute macro that generates a function call as output: bad * An attribute macro that takes a function call as input: good, if the proc macro is designed to propagate the input spans I ran this updated rustdoc on pyo3 and confirmed that it successfully scrapes examples from inside a proc macro, eg <img width="1013" alt="Screen Shot 2021-11-04 at 1 11 28 PM" src="https://user-images.githubusercontent.com/663326/140412691-81a3bb6b-a448-4a1b-a293-f7a795553634.png"> (cc `@mejrs)` Additionally, this PR fixes an ordering bug in the highlighting logic. Fixes rust-lang#90567. r? `@jyn514`
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Nov 4, 2021
…n514 Fix ICE when rustdoc is scraping examples inside of a proc macro This PR provides a clearer semantics for how --scrape-examples interacts with macros. If an expression's span AND it's enclosing item's span both are not `from_expansion`, then the example will be scraped. The added test case `rustdoc-scrape-examples-macros` shows a variety of situations. * A macro-rules macro that takes a function call as input: good * A macro-rules macro that generates a function call as output: bad * A proc-macro that generates a function call as output: bad * An attribute macro that generates a function call as output: bad * An attribute macro that takes a function call as input: good, if the proc macro is designed to propagate the input spans I ran this updated rustdoc on pyo3 and confirmed that it successfully scrapes examples from inside a proc macro, eg <img width="1013" alt="Screen Shot 2021-11-04 at 1 11 28 PM" src="https://user-images.githubusercontent.com/663326/140412691-81a3bb6b-a448-4a1b-a293-f7a795553634.png"> (cc `@mejrs)` Additionally, this PR fixes an ordering bug in the highlighting logic. Fixes rust-lang#90567. r? `@jyn514`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-rustdoc-scrape-examples
Area: The (unstable) rustdoc scrape-examples feature described in RFC 3123
C-bug
Category: This is a bug.
requires-nightly
This issue requires a nightly compiler in some way.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
When running
on the
ice
branch of https://github.com/mejrs/pyo3/tree/ice , I get the following error:(this is quite a big library and I couldn't figure out a minimal example in the time I had)
The text was updated successfully, but these errors were encountered: