diff options
Diffstat (limited to 'crates/ra_proc_macro_srv/src/proc_macro/bridge/client.rs')
-rw-r--r-- | crates/ra_proc_macro_srv/src/proc_macro/bridge/client.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/crates/ra_proc_macro_srv/src/proc_macro/bridge/client.rs b/crates/ra_proc_macro_srv/src/proc_macro/bridge/client.rs index 4b5dc7fd0..cb4b3bdb0 100644 --- a/crates/ra_proc_macro_srv/src/proc_macro/bridge/client.rs +++ b/crates/ra_proc_macro_srv/src/proc_macro/bridge/client.rs | |||
@@ -18,7 +18,7 @@ macro_rules! define_handles { | |||
18 | } | 18 | } |
19 | 19 | ||
20 | impl HandleCounters { | 20 | impl HandleCounters { |
21 | // FIXME(eddyb) use a reference to the `static COUNTERS`, intead of | 21 | // FIXME(eddyb) use a reference to the `static COUNTERS`, instead of |
22 | // a wrapper `fn` pointer, once `const fn` can reference `static`s. | 22 | // a wrapper `fn` pointer, once `const fn` can reference `static`s. |
23 | extern "C" fn get() -> &'static Self { | 23 | extern "C" fn get() -> &'static Self { |
24 | static COUNTERS: HandleCounters = HandleCounters { | 24 | static COUNTERS: HandleCounters = HandleCounters { |
@@ -205,10 +205,16 @@ impl Clone for Literal { | |||
205 | } | 205 | } |
206 | } | 206 | } |
207 | 207 | ||
208 | // FIXME(eddyb) `Literal` should not expose internal `Debug` impls. | ||
209 | impl fmt::Debug for Literal { | 208 | impl fmt::Debug for Literal { |
210 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | 209 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
211 | f.write_str(&self.debug()) | 210 | f.debug_struct("Literal") |
211 | // format the kind without quotes, as in `kind: Float` | ||
212 | // .field("kind", &format_args!("{}", &self.debug_kind())) | ||
213 | .field("symbol", &self.symbol()) | ||
214 | // format `Some("...")` on one line even in {:#?} mode | ||
215 | // .field("suffix", &format_args!("{:?}", &self.suffix())) | ||
216 | .field("span", &self.span()) | ||
217 | .finish() | ||
212 | } | 218 | } |
213 | } | 219 | } |
214 | 220 | ||
@@ -339,7 +345,7 @@ impl Bridge<'_> { | |||
339 | #[repr(C)] | 345 | #[repr(C)] |
340 | #[derive(Copy, Clone)] | 346 | #[derive(Copy, Clone)] |
341 | pub struct Client<F> { | 347 | pub struct Client<F> { |
342 | // FIXME(eddyb) use a reference to the `static COUNTERS`, intead of | 348 | // FIXME(eddyb) use a reference to the `static COUNTERS`, instead of |
343 | // a wrapper `fn` pointer, once `const fn` can reference `static`s. | 349 | // a wrapper `fn` pointer, once `const fn` can reference `static`s. |
344 | pub(super) get_handle_counters: extern "C" fn() -> &'static HandleCounters, | 350 | pub(super) get_handle_counters: extern "C" fn() -> &'static HandleCounters, |
345 | pub(super) run: extern "C" fn(Bridge<'_>, F) -> Buffer<u8>, | 351 | pub(super) run: extern "C" fn(Bridge<'_>, F) -> Buffer<u8>, |