Skip to content

Paragraphs in block doc comments are broken #62552

Closed
@Cldfire

Description

@Cldfire

I returned to a crate of mine for the first time in quite a while and was perplexed to see that all of the paragraphs in my doc comments were gone, and instead had been turned into line breaks (so all of the paragraphs were squashed together).

Upon investigation I discovered that this was due to my usage of block doc comments (/** */) rather than the more common /// style. It occurs on both the current stable and nightly release.

Source comment:

    /**
    Gets the checksum of the config stored in this `Device`'s infoROM.
    
    Can be used to make sure that two GPUs have the exact same configuration.
    The current checksum takes into account configuration stored in PWR and ECC
    infoROM objects. The checksum can change between driver released or when the
    user changes the configuration (e.g. disabling/enabling ECC).
    
    # Errors

    * `CorruptedInfoROM`, if this `Device`'s checksum couldn't be retrieved due to infoROM corruption
    * `Uninitialized`, if the library has not been successfully initialized
    * `NotSupported`, if this `Device` does not support this feature
    * `GpuLost`, if this `Device` has fallen off the bus or is otherwise inaccessible
    * `Unknown`, on any unexpected error
    
    # Device Support

    Supports all devices with an infoROM.
    */

Output when using block doc comments:
image

And the HTML:
image

Output after deleting the block doc comment start / end syntax and placing /// in front of each line (this is the expected output for both):
image

And the HTML for that:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions