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

Method zombie_with_span

crates/rustc_codegen_spirv/src/codegen_cx/mod.rs:177–189  ·  view source on GitHub ↗

Zombie system: If something unrepresentable is encountered, we don't want to fail the compilation. Instead, we emit something bogus (usually it's fairly faithful, though, e.g. `u128` emits `OpTypeInt 128 0`), and then mark the resulting ID as a "zombie". We continue compiling the rest of the crate, then, at the very end, anything that transitively references a zombie value is stripped from the bi

(&self, word: Word, span: Span, reason: &str)

Source from the content-addressed store, hash-verified

175 ///
176 /// Errors will only be emitted (by `linker::zombies`) for reachable zombies.
177 pub fn zombie_with_span(&self, word: Word, span: Span, reason: &str) {
178 self.zombie_decorations.borrow_mut().insert(
179 word,
180 (
181 ZombieDecoration {
182 // FIXME(eddyb) this could take advantage of `Cow` and use
183 // either `&'static str` or `String`, on a case-by-case basis.
184 reason: reason.to_string().into(),
185 },
186 SrcLocDecoration::from_rustc_span(span, &self.builder),
187 ),
188 );
189 }
190 pub fn zombie_no_span(&self, word: Word, reason: &str) {
191 self.zombie_with_span(word, DUMMY_SP, reason);
192 }

Callers 8

beginMethod · 0.80
defMethod · 0.80
def_with_idMethod · 0.80
def_with_spanMethod · 0.80
zombie_no_spanMethod · 0.80
declare_fn_extMethod · 0.80
declare_globalMethod · 0.80
zombieMethod · 0.80

Calls 1

insertMethod · 0.80

Tested by

no test coverage detected