Skip to content

Don't include headings in search summary #91077

@jsha

Description

@jsha

A search for "add" includes these results:

std::time::Instant::add    Panics
std::time::SystemTime::add    Panics

This gives the impression that those functions unconditionally panic, which they don't. I think the fix here is that the summary for search purposes should only be taken from text that appears before the first heading in the docblock. If there is no text before a heading, there should be no summary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rustdoc-searchArea: Rustdoc's search featureC-enhancementCategory: An issue proposing an enhancement or a PR with one.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