mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-25 08:14:20 +00:00
Disabled broken Clone impl for unsized buffers
This commit is contained in:
parent
dc27941fe4
commit
9cda522d13
@ -175,14 +175,19 @@ fn write_struct(doc: &parse::Spirv, struct_id: u32, members: &[u32]) -> String {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
format!("#[repr(C)]\n\
|
// We can only implement Clone if there's no unsized member in the struct.
|
||||||
pub struct {name} {{\n{members}\n}} /* total_size: {t:?} */\n\n\
|
let impl_text = if current_rust_offset.is_some() {
|
||||||
impl Clone for {name} {{\n fn clone(&self) -> Self {{\n \
|
format!("\nimpl Clone for {name} {{\n fn clone(&self) -> Self {{\n \
|
||||||
{name} {{\n{copies}\n }}\n }}\n}}\n\n",
|
{name} {{\n{copies}\n }}\n }}\n}}\n", name = name,
|
||||||
|
copies = rust_members.iter().map(Member::copy_text).collect::<Vec<_>>().join(",\n"))
|
||||||
|
} else {
|
||||||
|
"".to_owned()
|
||||||
|
};
|
||||||
|
|
||||||
|
format!("#[repr(C)]\npub struct {name} {{\n{members}\n}} /* total_size: {t:?} */\n{impl_text}",
|
||||||
name = name,
|
name = name,
|
||||||
members = rust_members.iter().map(Member::declaration_text).collect::<Vec<_>>().join(",\n"),
|
members = rust_members.iter().map(Member::declaration_text).collect::<Vec<_>>().join(",\n"),
|
||||||
t = spirv_req_total_size,
|
t = spirv_req_total_size, impl_text=impl_text)
|
||||||
copies = rust_members.iter().map(Member::copy_text).collect::<Vec<_>>().join(",\n"))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns true if a `BuiltIn` decorator is applied on a struct member.
|
/// Returns true if a `BuiltIn` decorator is applied on a struct member.
|
||||||
|
Loading…
Reference in New Issue
Block a user