Skip to content
This repository was archived by the owner on Oct 31, 2025. It is now read-only.

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

Merged
eddyb merged 6 commits intoEmbarkStudios:mainfrom
LykenSol:check-attrs
Mar 2, 2021
Merged

Add a #[spirv(...)] attribute checking pass and remove #[allow(unused_attributes)].#461
eddyb merged 6 commits intoEmbarkStudios:mainfrom
LykenSol:check-attrs

Conversation

@eddyb
Copy link
Copy Markdown
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 XAMPPRocky and khyperia March 2, 2021 04:10
@eddyb eddyb requested review from VZout and fu5ha 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 subscribe to this conversation on GitHub. Already have an account? Sign in.

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