(&self, s: &str)
| 168 | } |
| 169 | |
| 170 | fn const_str(&self, s: &str) -> (Self::Value, Self::Value) { |
| 171 | let len = s.len(); |
| 172 | let str_ty = self |
| 173 | .layout_of(self.tcx.types.str_) |
| 174 | .spirv_type(DUMMY_SP, self); |
| 175 | ( |
| 176 | self.def_constant( |
| 177 | self.type_ptr_to(str_ty), |
| 178 | SpirvConst::PtrTo { |
| 179 | pointee: self |
| 180 | .constant_composite( |
| 181 | str_ty, |
| 182 | s.bytes().map(|b| self.const_u8(b).def_cx(self)), |
| 183 | ) |
| 184 | .def_cx(self), |
| 185 | }, |
| 186 | ), |
| 187 | self.const_usize(len as u64), |
| 188 | ) |
| 189 | } |
| 190 | fn const_struct(&self, elts: &[Self::Value], _packed: bool) -> Self::Value { |
| 191 | // Presumably this will get bitcasted to the right type? |
| 192 | // FIXME(eddyb) use `AccumulateVec`s just like `rustc` itself does. |
nothing calls this directly
no test coverage detected