diff --git a/crates/rustc_codegen_spirv/src/codegen_cx/declare.rs b/crates/rustc_codegen_spirv/src/codegen_cx/declare.rs index d898e78ae7..847c22f28a 100644 --- a/crates/rustc_codegen_spirv/src/codegen_cx/declare.rs +++ b/crates/rustc_codegen_spirv/src/codegen_cx/declare.rs @@ -114,7 +114,11 @@ impl<'tcx> CodegenCx<'tcx> { for attr in parse_attrs(self, self.tcx.get_attrs(instance.def_id())) { match attr { SpirvAttribute::Entry(entry) => { - let entry_name = entry.name.as_ref().map(ToString::to_string).unwrap_or_else(|| instance.to_string()); + let entry_name = entry + .name + .as_ref() + .map(ToString::to_string) + .unwrap_or_else(|| instance.to_string()); self.entry_stub(&instance, &fn_abi, declared, entry_name, entry) } SpirvAttribute::UnrollLoops => { diff --git a/crates/spirv-builder/src/test/basic.rs b/crates/spirv-builder/src/test/basic.rs index ccd61a7f1f..066b53e37a 100644 --- a/crates/spirv-builder/src/test/basic.rs +++ b/crates/spirv-builder/src/test/basic.rs @@ -31,12 +31,13 @@ pub fn main() { #[test] fn custom_entry_point() { - dis_globals(r#" + dis_globals( + r#" #[allow(unused_attributes)] #[spirv(fragment(entry_point_name="hello_world"))] pub fn main() { } "#, -r#"OpCapability Shader + r#"OpCapability Shader OpCapability VulkanMemoryModel OpCapability VariablePointers OpExtension "SPV_KHR_vulkan_memory_model" @@ -45,7 +46,8 @@ OpEntryPoint Fragment %1 "hello_world" OpExecutionMode %1 OriginUpperLeft OpName %2 "test_project::main" %3 = OpTypeVoid -%4 = OpTypeFunction %3"#); +%4 = OpTypeFunction %3"#, + ); } #[test]