-
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
Can I probe for const generics support? #31
Comments
This seems to work: fn main() {
let ac = autocfg::new();
ac.emit_expression_cfg(
r#"{ struct A<const N: usize>([(); N]); A([]) }"#,
"have_const_generics",
);
} But if there's a nicer way I'd love to know about it! (Otherwise feel free to close this.) |
There's no direct support for item definitions, which is what you'd need to test this, but I think a block expression is reasonable. You could also do that with Did you add |
No, it was just a reflex :P (I wasn't thinking about implicit |
I'd like to probe support for (minimal) const generics by checking this code:
But this can't be done with
probe_type
and I'm not sure how else to do it (other than maybeprobe_rustc_version
which seems kind of awkward). Any workarounds?The text was updated successfully, but these errors were encountered: