-
Notifications
You must be signed in to change notification settings - Fork 36
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
Warn (or error) on a non-pub entrypoint #155
Comments
From discord eddyb says:
|
Hi! Interested in helping here, but looking for some guidance if possible, because I'm a bit unsure. let input = syn::parse_macro_input!(item as ItemFn);
if !matches!(input.vis, Visibility::Public(_)) {
panic!("The `spirv` macro can only be applied to public functions.");
}
error: custom attribute panicked
--> src/main.rs:5:1
|
5 | #[spirv(fragment)]
| ^^^^^^^^^^^^^^^^^^
|
= help: message: The `spirv` macro can only be applied to public functions. right? However, if warning is preferred over panic, then we might want to wait until this feature is stable. If this is fine, I can get a PR in today, but unsure if this is exactly what is wanted here. Thanks in advance for any feedback! |
Just wanted to note that I hit this error too, but it was on a public |
(originally filed at EmbarkStudios/rust-gpu#1140)
When setting
#[spirv(fragment)]
on a non-pub function, rust-gpu errors with an obtuse error:This case should be detected and warned or even made an error if it is not supported. Further, the error message should be fixed as suggested in EmbarkStudios/rust-gpu#1139.
The text was updated successfully, but these errors were encountered: