From adba4691f6577b35b2d48ebbe6c8e993eea09978 Mon Sep 17 00:00:00 2001 From: klensy Date: Sun, 3 Jul 2022 19:18:53 +0300 Subject: cache strings while encoding/decoding to compiler artifacts --- compiler/rustc_span/src/symbol.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_span/src') 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 Encodable for Symbol { - fn encode(&self, s: &mut S) { + default fn encode(&self, s: &mut S) { s.emit_str(self.as_str()); } } impl Decodable for Symbol { #[inline] - fn decode(d: &mut D) -> Symbol { + default fn decode(d: &mut D) -> Symbol { Symbol::intern(&d.read_str()) } } -- cgit 1.4.1-3-g733a5