Skip to content

Incomplete Type Hover Information with Macro-Generated Types and Documentation #15930

Closed
@FuuuOverclocking

Description

@FuuuOverclocking

rust-analyzer version: 0.3.1730-standalone

rustc version: 1.73.0 (cc66ad468 2023-10-03)

The latter half of the type documentation disappears when hovering over types that are generated through macros.

To reproduce the bug, cargo new and

image

Its source: (~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/uint_macros.rs)

macro_rules! uint_impl {
    (
        // ...
    ) => {
        // ...

        /// Returns the number of trailing ones in the binary representation
        /// of `self`.
        ///
        /// # Examples
        ///
        /// Basic usage:
        ///
        /// ```
        #[doc = concat!("let n = 0b1010111", stringify!($SelfT), ";")]
        ///
        /// assert_eq!(n.trailing_ones(), 3);
        /// ```
        #[stable(feature = "leading_trailing_ones", since = "1.46.0")]
        #[rustc_const_stable(feature = "leading_trailing_ones", since = "1.46.0")]
        #[must_use = "this returns the result of the operation, \
                      without modifying the original"]
        #[inline(always)]
        pub const fn trailing_ones(self) -> u32 {
            (!self).trailing_zeros()
        }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions