Skip to content

Commit

Permalink
Test type checking
Browse files Browse the repository at this point in the history
  • Loading branch information
expenses committed Oct 18, 2021
1 parent 0f0d13d commit a76222b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crates/spirv-std/macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ fn debug_printf_inner(input: DebugPrintfInput) -> TokenStream {
variable_idents.push_str(&format!("%{} ", ident));

input_registers.push(quote::quote! {
#ident = in(reg) &{#variable},
#ident = in(reg) &spirv_std::debug_printf_assert_is_type::<f32>(#variable),
});

let op_load = format!("%{ident} = OpLoad _ {{{ident}}}", ident = ident);
Expand Down
5 changes: 5 additions & 0 deletions crates/spirv-std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,8 @@ extern "C" fn rust_eh_personality() {}
#[doc(hidden)]
/// [spirv_types]
pub fn workaround_rustdoc_ice_84738() {}

#[doc(hidden)]
pub fn debug_printf_assert_is_type<T>(ty: T) -> T {
ty
}

0 comments on commit a76222b

Please sign in to comment.