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

[Question] Why does parse.expand use an unstable flag to rustc? #1015

Open
bavalpey opened this issue Oct 21, 2024 · 1 comment
Open

[Question] Why does parse.expand use an unstable flag to rustc? #1015

bavalpey opened this issue Oct 21, 2024 · 1 comment

Comments

@bavalpey
Copy link

Currently, [parse.expand] uses the -Z unstable pretty=expand option to rustc. This requires using the nightly rustc compiler. There is nothing in the documentation that mentions why this is required, and there isn't much discussion as to why. If macro expansion is needed, is there a reason that cbindgen can't just do cargo expand which does not require any nightly rustc options?

I think that macro expansion is a relatively common requirement, and gating it behind having to use a nightly toolchain is a big cost.

@bavalpey
Copy link
Author

I've been looking into this more and I think that cbindgen should set RUSTC_BOOTSTRAP in the command line where it invokes rustc. This is what cargo-expand does.
That way, we can avoid having needless error messages when using cbindgen without a nightly compiler.

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

1 participant