Previously we required that the enable extension be declared and that
the capability be present if the functionality was used, but allowed the
extension to be declared if the functionality was not used.
I noticed that when I force-updated the toolchain being used for wgpu,
I got an error about the `cargo` binary not being available after
redirecting a naive `cargo` invocation to the set of binaries for the
1.93 toolchain. This fixes that issue.
This avoids `rustc` errors new to Rust 1.93. These errors are because
`Recyclable::recycle` triggers the `unstable_name_collisions` lint on
use, detecting a collision with the unstable `vec_recycle` Nightly
feature.
In `naga::front::wgsl::lower::Lowerer::call_builtin`, consolidate the
cases for `bitcast`, `coopLoad`, and `coopLoadT` with the other
miscellaneous builtin functions.
Move the code for handling calls to WGSL builtin functions out of
`Lowerer::call` and into its own new function,
`Lowerer::call_builtin`, for clarity. Do template parameter list
finalization in the caller.
Rearrange `naga::front::wgsl::lower::Lowerer::call` to check
for construction expressions for predeclared types before checking for
any builtin function names, including those that take template
parameter lists like `bitcast` and `coopLoad`.
Rather than passing `call_impl` an `ignore_builtin_identifiers` flag
and plumbing that through from its points of use, extend
`Namer::namespace` to suspend the `builtin_identifiers` table, as it
does for `unique` already. The resulting behavior is the same.
Avoid adding entries to `ExpressionContext::unresolved` for
identifiers that `ExpressionContext::ident_expr` has already
processed.
At the moment, there is no way these could cause a bug: they only
occur after we've recognized a call/construction expression, and those
can never refer to function-local definitions, so the string in
question is certain to have already been added to `unresolved` by
`ExpressionContext::ident_expr`. But they're redundant, and if Naga
ever supported nested functions or local type aliases, these could end
up adding extraneous dependencies.
In `naga::front::wgsl::parse::Parser::component_or_swizzle_specifier`,
since `span_start` sounds like the start of a span, rename that
argument to `expr_start`, since it is the span of the start of the
expression that ends with the component or swizzle specifier.