From 01f32ace0302373fb69ef9e2d0e21cc841981eba Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Thu, 17 Sep 2015 14:29:59 -0400 Subject: Convert DefId to use DefIndex, which is an index into a list of paths, and construct paths for all definitions. Also, stop rewriting DefIds for closures, and instead just load the closure data from the original def-id, which may be in another crate. --- src/libsyntax/ast.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 45e1d005863..d186918f44a 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -167,13 +167,13 @@ impl fmt::Display for Ident { impl Encodable for Ident { fn encode(&self, s: &mut S) -> Result<(), S::Error> { - s.emit_str(&self.name.as_str()) + self.name.encode(s) } } impl Decodable for Ident { fn decode(d: &mut D) -> Result { - Ok(str_to_ident(&try!(d.read_str())[..])) + Ok(Ident::with_empty_ctxt(try!(Name::decode(d)))) } } -- cgit 1.4.1-3-g733a5