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

Method display

crates/rustc_codegen_spirv/src/linker/specializer.rs:342–361  ·  view source on GitHub ↗

FIXME(eddyb) implement `Step` for `Param` and `InferVar` instead.

(
        &'a self,
        f: impl FnOnce(&'a GA) -> GAI,
    )

Source from the content-addressed store, hash-verified

340
341 // FIXME(eddyb) implement `Step` for `Param` and `InferVar` instead.
342 fn display<'a, T: fmt::Display, GAI: Iterator<Item = T> + Clone>(
343 &'a self,
344 f: impl FnOnce(&'a GA) -> GAI,
345 ) -> impl fmt::Display {
346 let &Self {
347 generic_id,
348 ref generic_args,
349 } = self;
350 let generic_args_iter = f(generic_args);
351 FmtBy(move |f| {
352 write!(f, "%{generic_id}<")?;
353 for (i, arg) in generic_args_iter.clone().enumerate() {
354 if i != 0 {
355 write!(f, ", ")?;
356 }
357 write!(f, "{arg}")?;
358 }
359 write!(f, ">")
360 })
361 }
362}
363
364#[derive(Copy, Clone, Debug, PartialEq, Eq)]

Callers

nothing calls this directly

Calls 2

FmtByClass · 0.85
fFunction · 0.50

Tested by

no test coverage detected