Skip to content

Lint idea: unlinked symbol in doc comment #2031

Description

@smoelius

Consider this program:

/// Calls `bar`.
pub fn foo() {
    bar();
}

fn bar() {}

In the doc comment, bar could be linked:

/// Calls [`bar`].
pub fn foo() {
    bar();
}

fn bar() {}

I'm not sure how difficult this would be to implement. I think Clippy has utilities for parsing doc comments. Perhaps the lint could walk the enclosing module and look for symbols with names that appear in the doc comments.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    new-lintNew lint or lint enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions