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

proc_macro and no_std #47342

Closed
nhynes opened this issue Jan 11, 2018 · 2 comments
Closed

proc_macro and no_std #47342

nhynes opened this issue Jan 11, 2018 · 2 comments

Comments

@nhynes
Copy link
Contributor

nhynes commented Jan 11, 2018

tl;dr: Trying to port serde to a no_std environment requires proc_macro to also be no_std. The straightforward approach of subbing out the std types in the compiler internals doesn't work.

The specific use case is Intel SGX via rust-sgx-sdk, which provides an alternative std. extern crate sgx_tstd as std; doesn't work in the compiler for some reason. Is this a particularly unreasonable goal?

The most related issue I could find is rust-lang/rfcs#1184 but it looks like there ended up being no easy way to inject no_std into everything!

@sfackler
Copy link
Member

Isn't proc_macro only going to be used by the host for the compiler plugin?

@nhynes
Copy link
Contributor Author

nhynes commented Jan 11, 2018

@sfackler that's a good point. I changed the dependency to vanilla serde_derive and it seemed to work. Thanks for your help!

@nhynes nhynes closed this as completed Jan 11, 2018
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

No branches or pull requests

2 participants