From 09ded918c492821d5b7a69004738c38ff4a0624d Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 31 May 2020 21:22:08 +0200 Subject: proc_macro: fix current nightly/future stable ABI incompatibility --- crates/ra_proc_macro_srv/src/rustc_server.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'crates/ra_proc_macro_srv/src/rustc_server.rs') diff --git a/crates/ra_proc_macro_srv/src/rustc_server.rs b/crates/ra_proc_macro_srv/src/rustc_server.rs index f481d70b2..cc32d5a6d 100644 --- a/crates/ra_proc_macro_srv/src/rustc_server.rs +++ b/crates/ra_proc_macro_srv/src/rustc_server.rs @@ -463,9 +463,16 @@ impl server::Ident for Rustc { } impl server::Literal for Rustc { - // FIXME(eddyb) `Literal` should not expose internal `Debug` impls. - fn debug(&mut self, literal: &Self::Literal) -> String { - format!("{:?}", literal) + fn debug_kind(&mut self, _literal: &Self::Literal) -> String { + // r-a: debug_kind and suffix are unsupported; corresponding client code has been changed to not call these. + // They must still be present to be ABI-compatible and work with upstream proc_macro. + "".to_owned() + } + fn symbol(&mut self, literal: &Self::Literal) -> String { + literal.text.to_string() + } + fn suffix(&mut self, _literal: &Self::Literal) -> Option { + None } fn integer(&mut self, n: &str) -> Self::Literal { -- cgit v1.2.3