Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mouseover doc rendering doesn't handle doc attr that uses concat. #12945

Closed
Lokathor opened this issue Aug 5, 2022 · 2 comments
Closed

Mouseover doc rendering doesn't handle doc attr that uses concat. #12945

Lokathor opened this issue Aug 5, 2022 · 2 comments

Comments

@Lokathor
Copy link

Lokathor commented Aug 5, 2022

I wrote some functions via macro like this:

macro_rules! impl_get_bit {
  ($fn_name:ident, $t:ty) => {
    /// Determines if the `b` bit is set in `u`.
    ///
    /// ## Panics
    #[doc = concat!("* `b` must be less than `",stringify!($t),"::BITS`.")]
    #[inline]
    #[must_use]
    pub const fn $fn_name(b: u32, u: $t) -> bool {
      assert!(b < <$t>::BITS);
      let mask = 1 << b;
      (x & mask) != 0
    }
  };
}

impl_get_bit!(u8_get_bit, u8);
impl_get_bit!(u16_get_bit, u16);
impl_get_bit!(u32_get_bit, u32);
impl_get_bit!(u64_get_bit, u64);
impl_get_bit!(u128_get_bit, u128);

And the rustdoc generated docs will show the bullet point with the type concat'd into the line:

  • b must be less than u8::BITS.

but the RA generated mouseover rendering of the docs just cuts off the last line entirely.

rust-analyzer version: rust-analyzer version: 0.3.1148-standalone (2b472f6 2022-07-31)

rustc version: rustc 1.64.0-nightly (0f4bcadb4 2022-07-30)

relevant settings: I don't believe there's any settings at play here, probably the document renderer just doesn't know how to handle doc=$expression stuff.

@Veykril
Copy link
Member

Veykril commented Aug 5, 2022

We don't yet expand macros in attribute inputs #8092

@Lokathor
Copy link
Author

Lokathor commented Aug 5, 2022

fair, closing this one

@Lokathor Lokathor closed this as completed Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants