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

Allow doc tests to run on proc macro crates #3552

Merged
merged 2 commits into from
Jan 18, 2017

Conversation

keeperofdakeys
Copy link
Contributor

Fixes #3545

Since --test works for rustc, doctests should also work. Currently cargo isn't setup to run doctests for proc macro crates, this PR adds them to the list.

Currently rustdoc can run doctests for proc-macro crates, but the phase_2_configure_and_expand call` triggers the following warning:

the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro` crate type

So perhaps this PR should wait until I've finished creating/testing the PR for rustc.

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@alexcrichton
Copy link
Member

Thanks! Can you also add a test for this?

@alexcrichton
Copy link
Member

@bors: r+

Thanks!

@bors
Copy link
Contributor

bors commented Jan 17, 2017

📌 Commit b3b8b7e has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Jan 18, 2017

⌛ Testing commit b3b8b7e with merge 493abf5...

bors added a commit that referenced this pull request Jan 18, 2017
Allow doc tests to run on proc macro crates

Fixes #3545

Since `--test` works for rustc, doctests should also work. Currently cargo isn't setup to run doctests for proc macro crates, this PR adds them to the list.

Currently rustdoc can run doctests for proc-macro crates, but the `phase_2_configure_and_expand` call` triggers the following warning:

```
the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro` crate type
```

So perhaps this PR should wait until I've finished creating/testing the PR for rustc.
@bors
Copy link
Contributor

bors commented Jan 18, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing 493abf5 to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

doc-tests don't work with macros 1.1
5 participants