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

Add a #[spirv(...)] attribute checking pass and remove #[allow(unused_attributes)]. #461

Merged
merged 6 commits into from
Mar 2, 2021

Conversation

eddyb
Copy link
Contributor

@eddyb eddyb commented Mar 2, 2021

By hooking the check_mod_attrs query, we can effectively expand rustc_passes::check_attr to also check #[spirv(...)] attributes, which is an improvement over only validating attributes when they happen to be relevant.

In particular, this means that now we shouldn't have any latent "we allowed some attribute on an obviously wrong thing" bugs.

It also allows us to mark the attributes as used, and therefore remove the need for #[allow(unused_attributes)] altogether.

Fixes #386 (specifically as suggested in #386 (comment)), to get spirv_std::storage_class::Image to compile again.

cc @XAMPPRocky It would be nice to get this in the next release, but I understand if we want to wait.

@eddyb eddyb requested review from khyperia and XAMPPRocky March 2, 2021 04:10
@eddyb eddyb requested review from fu5ha and VZout as code owners March 2, 2021 04:10
@eddyb eddyb enabled auto-merge (rebase) March 2, 2021 04:10
@eddyb eddyb merged commit 6571f45 into EmbarkStudios:main Mar 2, 2021
@khyperia khyperia removed their request for review March 2, 2021 08:34
@eddyb eddyb deleted the check-attrs branch March 2, 2021 11:25
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

Successfully merging this pull request may close these issues.

image attribute has no arguments in storage_class.rs
2 participants