mozilla / cbindgen

A project for generating C bindings from Rust code
Mozilla Public License 2.0
2.29k stars 294 forks source link

`parse.expand` should use nightly compiler when available like upstream `cargo-expand` #919

Closed segevfiner closed 3 months ago

segevfiner commented 5 months ago

parse.expand currently only works on the nightly toolchain, which means this repos test also only work in the nightly toolchain and anyone that wants to use this feature needs to use nightly. Instead, it should use the nightly toolchain when available like upstream cargo-expand does, which will allow it work on stable, with only the expand process using the nightly toolchain.

P.S. Might be nicer to have a way to specify to expand the current crate without listing its name, e.g. expand = true.

Is there any workaround to not use expand if I have some struct generated by a derive macro (e.g. derive_builder) that I want to export?

emilio commented 3 months ago

We intentionally don't make using nightly-only features easy, that kinda defeats the point of them not being stable. You can achieve what you want with RUSTC_BOOTSTRAP or what not, too, right?