-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Meeting a terrible fate when calling debug! macro from C #17559
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
Comments
Investigating a bit more, it looks like the assertion
Of course it makes sense now, but is this is the recommended way to do it? It also means many rust libraries will require some kind of |
As I see it, the solution is to compile with |
I see - thanks for your reply! I tried using |
You need to use |
Encode ident rawness and literal kind separately in tt::Leaf
I have a C program using a rust library that calls the debug! macro. Here is the setup:
system: OS X Mavericks 10.9.4
bar.rs
bar.h
test.c
I'm able to compile it using
rustc --crate-type staticlib bar.rs gcc -Wall -o test test.c -L. -lbar
but it crashes at runtime:
I don't think the problem is specific to the
debug!
macro, because I've seen the exact same error in other situations. However this is the simplest example I've found. Note that I've been able to run other C programs using Rust libraries successfully (for example if I replacedebug!
withprintln!
in the example, then everything is fine).Maybe I'm missing a step somewhere, but it looks like a bug to me.
The text was updated successfully, but these errors were encountered: