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

Show a better error when using --test with #[proc_macro_derive] #37826

Merged
merged 2 commits into from
Nov 19, 2016

Conversation

keeperofdakeys
Copy link
Contributor

Fixes #37480

Currently using --test with a crate that contains a #[proc_macro_derive] attribute causes an error. This PR doesn't attempt to fix the issue itself, or determine what tesing of a proc_macro_derive crate should be - just to provide a better error message.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @aturon (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 for the PR! I do think though that cargo test should work out of the box for proc-macro crates somehow at least. One option was to make it work in the compiler but otherwise we'll need to add knowledge to Cargo to not test the library of proc-macro crates.

This to me seems like the most conservative option with respect to the compiler, however, so seems reasonable to me.

@rust-lang/compiler thoughts about taking this strategy? (erroring on --test in the compiler and not testing in Cargo by default)

@keeperofdakeys
Copy link
Contributor Author

I agree that it should work, but there are probably a few questions that need answering first. Fixing the misleading errors is probably a good start.

@alexcrichton
Copy link
Member

True yeah, I'll go ahead and r+ and we can discuss further strategies in parallel.

@bors: r+

@bors
Copy link
Contributor

bors commented Nov 17, 2016

📌 Commit 3254fab has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Nov 19, 2016

⌛ Testing commit 3254fab with merge bfa709a...

bors added a commit that referenced this pull request Nov 19, 2016
Show a better error when using --test with #[proc_macro_derive]

Fixes #37480

Currently using `--test` with a crate that contains a `#[proc_macro_derive]` attribute causes an error. This PR doesn't attempt to fix the issue itself, or determine what tesing of a proc_macro_derive crate should be - just to provide a better error message.
@bors bors merged commit 3254fab into rust-lang:master Nov 19, 2016
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.

'cargo test' with proc_macro_derive fails
5 participants