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)
| 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 | } |
no test coverage detected