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

Update spirv-std-macros to syn 2 #1135

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ spirv-std-macros = { path = "./crates/spirv-std/macros", version = "=0.9.0" }
spirv-tools = { version = "0.10", default-features = false }
rustc_codegen_spirv = { path = "./crates/rustc_codegen_spirv", version = "=0.9.0", default-features = false }
rustc_codegen_spirv-types = { path = "./crates/rustc_codegen_spirv-types", version = "=0.9.0" }
# Avoid https://github.com/rust-lang/rust/issues/113152
proc-macro2 = ">=1.0.60"

# Enable incremental by default in release mode.
[profile.release]
Expand Down
4 changes: 3 additions & 1 deletion crates/rustc_codegen_spirv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ skip-toolchain-check = []
# a proc macro crate to do that through), for the same reasons as the list at
# the start of `[dependencies]` (avoiding unnecessary rebuilds).
[build-dependencies]
syn = { version = "1", features = ["extra-traits", "full"] }
syn = { version = "2.0.50", features = ["extra-traits", "full"] }
# Avoid https://github.com/rust-lang/rust/issues/113152
proc-macro2.workspace = true

[dependencies]
# HACK(eddyb) these only exist to unify features across dependency trees,
Expand Down
8 changes: 6 additions & 2 deletions crates/spirv-std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ repository.workspace = true
spirv-std-types.workspace = true
spirv-std-macros.workspace = true
bitflags = "1.2.1"
num-traits = { version = "0.2.15", default-features = false, features = ["libm"] }
glam = { version = ">=0.22, <=0.24", default-features = false, features = ["libm"] }
num-traits = { version = "0.2.15", default-features = false, features = [
"libm",
] }
glam = { version = ">=0.22, <=0.24", default-features = false, features = [
"libm",
] }

[features]
default = []
4 changes: 2 additions & 2 deletions crates/spirv-std/macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ proc-macro = true

[dependencies]
spirv-std-types.workspace = true
proc-macro2 = "1.0.24"
proc-macro2.workspace = true
quote = "1.0.8"
syn = { version = "1.0.85", features = ["full", "visit-mut"] }
syn = { version = "2.0", features = ["full", "visit-mut"] }
4 changes: 2 additions & 2 deletions crates/spirv-std/macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -757,12 +757,12 @@ impl SampleImplRewriter {
}

impl VisitMut for SampleImplRewriter {
fn visit_impl_item_method_mut(&mut self, item: &mut syn::ImplItemMethod) {
fn visit_impl_item_fn_mut(&mut self, item: &mut syn::ImplItemFn) {
// rewrite the last parameter of this method to be of type `SampleParams<...>` we generated earlier
if let Some(syn::FnArg::Typed(p)) = item.sig.inputs.last_mut() {
*p.ty.as_mut() = self.1.clone();
}
syn::visit_mut::visit_impl_item_method_mut(self, item);
syn::visit_mut::visit_impl_item_fn_mut(self, item);
}

fn visit_macro_mut(&mut self, m: &mut syn::Macro) {
Expand Down