MCPcopy Create free account
hub / github.com/Rust-GPU/rust-gpu / create_zst

Function create_zst

crates/rustc_codegen_spirv/src/abi.rs:601–611  ·  view source on GitHub ↗
(cx: &CodegenCx<'tcx>, span: Span, ty: TyAndLayout<'tcx>)

Source from the content-addressed store, hash-verified

599// the type is really more "Layout with Ty" (`.ty` field + `Deref`s to `Layout`).
600fn trans_aggregate<'tcx>(cx: &CodegenCx<'tcx>, span: Span, ty: TyAndLayout<'tcx>) -> Word {
601 fn create_zst<'tcx>(cx: &CodegenCx<'tcx>, span: Span, ty: TyAndLayout<'tcx>) -> Word {
602 SpirvType::Adt {
603 def_id: def_id_for_spirv_type_adt(ty),
604 size: Some(Size::ZERO),
605 align: Align::from_bytes(0).unwrap(),
606 field_types: &[],
607 field_offsets: &[],
608 field_names: None,
609 }
610 .def_with_name(cx, span, TyLayoutNameKey::from(ty))
611 }
612 match ty.fields {
613 FieldsShape::Primitive => span_bug!(
614 span,

Callers 1

trans_aggregateFunction · 0.85

Calls 2

def_with_nameMethod · 0.80

Tested by

no test coverage detected