diff options
| author | bors <bors@rust-lang.org> | 2022-08-18 23:53:22 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-08-18 23:53:22 +0000 |
| commit | 71ecf5d359bf750cc171e124779a46985633439d (patch) | |
| tree | d0c3e7aeea857d9dfddc1456d714b87c26750c9c /compiler/rustc_span | |
| parent | 0b79f758c9aa6646606662a6d623a0752286cd17 (diff) | |
| parent | adba4691f6577b35b2d48ebbe6c8e993eea09978 (diff) | |
| download | rust-71ecf5d359bf750cc171e124779a46985633439d.tar.gz rust-71ecf5d359bf750cc171e124779a46985633439d.zip | |
Auto merge of #98851 - klensy:encode_symbols, r=cjgillot
rustc_metadata: dedupe strings to prevent multiple copies in rmeta/query cache blow file size r? `@cjgillot` Encodes strings in rmeta/query cache so duplicated ones will be encoded as offsets to first strings, reducing file size.
Diffstat (limited to 'compiler/rustc_span')
| -rw-r--r-- | compiler/rustc_span/src/symbol.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 2f3519e3edd..156f53ac486 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -1852,14 +1852,14 @@ impl fmt::Display for Symbol { } impl<S: Encoder> Encodable<S> for Symbol { - fn encode(&self, s: &mut S) { + default fn encode(&self, s: &mut S) { s.emit_str(self.as_str()); } } impl<D: Decoder> Decodable<D> for Symbol { #[inline] - fn decode(d: &mut D) -> Symbol { + default fn decode(d: &mut D) -> Symbol { Symbol::intern(&d.read_str()) } } |
