-
Notifications
You must be signed in to change notification settings - Fork 23
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
Expose AutoCfg::probe
#24
Comments
Another use case is checking if the user is able to supply Rust feature gates (like |
It's a conservative API choice, not having to worry about how that function looks. Right now it takes
You don't have to return ac.emit_expression_cfg("{ #[non_exhaustive] struct Foo; }", "supports_non_exhaustive"); Rustc will warn of dead code, that
I think this might deserve a dedicated |
Something like what anyhow does would probably also be best exposed via custom probes. autocfg gets a lot of details right regarding how to invoke rustc (propagating rustc flags and |
Another issue that could have been prevented if other crates could use autocfg for their probes: eyre-rs/eyre#84 |
Judging from rust-lang/cargo#11138, doing build probes correctly looks like it is actually going to become even more subtle than it already is. It would be really useful if that functionality could be exposed so it doesn't need to be duplicated everywhere. |
Please take a look at #59! |
Thanks a lot. :-) |
Is there any particular reason why this is private?
Right now, I'm doing
It would be nice to be able to check if
#[non_exhaustive] struct Foo
is supported without having to return a zero-sized type to make an expression.The text was updated successfully, but these errors were encountered: