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

Emit a "manual" implementation of Debug when it cannot be derived #875

Closed
fitzgen opened this issue Aug 1, 2017 · 9 comments
Closed

Emit a "manual" implementation of Debug when it cannot be derived #875

fitzgen opened this issue Aug 1, 2017 · 9 comments

Comments

@fitzgen
Copy link
Member

fitzgen commented Aug 1, 2017

Could initially just print the type's name as a placeholder.

Could eventually print the fields within the type that are Debug and placeholders for the fields that aren't.

Should be behind a new option.

@bkchr
Copy link
Contributor

bkchr commented Aug 2, 2017

Can you point a place where to start looking?

@bkchr
Copy link
Contributor

bkchr commented Aug 2, 2017

Ahh, I think I found it :)

@fitzgen
Copy link
Member Author

fitzgen commented Aug 3, 2017

@bkchr yep! Let me know if you have any other questions :)

@bkchr
Copy link
Contributor

bkchr commented Aug 5, 2017

I use cargo test --features testing_only_libclang_4 to run the tests. Is it normal that the expectation files are modified by the test case?
Are there also some tests that try to compile the generated rust files?

@bkchr
Copy link
Contributor

bkchr commented Aug 6, 2017

Okay, I answered the question myself. ^^
Using cd tests/expectations && cargo test, compiles and tests the generated files.

@fitzgen
Copy link
Member Author

fitzgen commented Aug 8, 2017

Is it normal that the expectation files are modified by the test case?

Yes, this is to make it easier to update test expectations when making changes that modify their output, and its easy enough to git checkout -- tests/expectations to remove the modifications if they're undesired.

Are there also some tests that try to compile the generated rust files?

Yeah, I had thought this was documented in CONTRIBUTING.md, but it doesn't seem to be. I need to fix that.

@bkchr
Copy link
Contributor

bkchr commented Aug 8, 2017

It is documented in the Contribution.md, but the command, written there, does not work. Or at least did not worked for me ^^

bors-servo pushed a commit that referenced this issue Aug 10, 2017
Implements Debug trait for types which do not support derive Debug

For types that do not support derive Debug be implemented automatically by rust,
we know can generate implementations of the Debug trait. This code generation is
hidden behind the '--force-derive-debug' command-line flag.

Should solve: #875

Sorry for the extra noise in lib.rs, codegen/mod.rs etc, that was rustfmt.
@bkchr
Copy link
Contributor

bkchr commented Aug 16, 2017

I think that can now be closed @fitzgen ?

@fitzgen
Copy link
Member Author

fitzgen commented Aug 16, 2017

Yes, thanks! Were you interested in hacking on some other bindgen issues? We have plenty, if you're looking :)

@fitzgen fitzgen closed this as completed Aug 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants