From 19d952c603344d853567aeac42dcfa6fe40ba04b Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Thu, 9 Apr 2020 23:48:08 +0800 Subject: Improve tt::Subtree debug print --- crates/ra_hir_expand/src/quote.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_hir_expand') diff --git a/crates/ra_hir_expand/src/quote.rs b/crates/ra_hir_expand/src/quote.rs index 3fd4233da..219bc2097 100644 --- a/crates/ra_hir_expand/src/quote.rs +++ b/crates/ra_hir_expand/src/quote.rs @@ -232,7 +232,7 @@ mod tests { let quoted = quote!(#a); assert_eq!(quoted.to_string(), "hello"); let t = format!("{:?}", quoted); - assert_eq!(t, "Subtree { delimiter: None, token_trees: [Leaf(Ident(Ident { text: \"hello\", id: TokenId(4294967295) }))] }"); + assert_eq!(t, "SUBTREE $\n IDENT hello 4294967295"); } #[test] -- cgit v1.2.3 From c1244c853c6bdc42bf91a77768963c0d287093ff Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 11 Apr 2020 00:27:00 +0200 Subject: Forward compat --- crates/ra_hir_expand/src/ast_id_map.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_hir_expand') diff --git a/crates/ra_hir_expand/src/ast_id_map.rs b/crates/ra_hir_expand/src/ast_id_map.rs index 5643ecdce..a3ca302c2 100644 --- a/crates/ra_hir_expand/src/ast_id_map.rs +++ b/crates/ra_hir_expand/src/ast_id_map.rs @@ -90,7 +90,7 @@ impl AstIdMap { } pub(crate) fn get(&self, id: FileAstId) -> AstPtr { - self.arena[id.raw].cast::().unwrap() + self.arena[id.raw].clone().cast::().unwrap() } fn alloc(&mut self, item: &SyntaxNode) -> ErasedFileAstId { -- cgit v1.2.3