Skip to content

Lint rustdoc::bare_urls suggests turning [URL] into [<URL>] instead of <URL> #146162

Description

@fmease

Seen in #146159 (comment).

Reproducer:

//! [https://github.com]
warning: this URL is not a hyperlink
 --> <anon>:1:6
  |
1 | //! [https://github.com]
  |      ^^^^^^^^^^^^^^^^^^
  |
  = note: bare URLs are not automatically turned into clickable links
  = note: `#[warn(rustdoc::bare_urls)]` on by default
help: use an automatic link instead
  |
1 | //! [<https://github.com>]
  |      +                  +

Of course, [<URL>] does turn the URL into a hyperlink but it results in extra verbatim [ ] in the rendered output which is likely not what the user wants.

Activity

  1. added
    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.
    A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`
    D-papercutDiagnostics: An error or lint that needs small tweaks.
    on Sep 3, 2025
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Sep 3, 2025
  3. added
    C-enhancementCategory: An issue proposing an enhancement or a PR with one.
    and removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Sep 3, 2025
  4. relaxcn commented on Sep 4, 2025

    @relaxcn
    Contributor

    @rustbot claim

  5. GuillaumeGomez commented on Sep 10, 2025

    @GuillaumeGomez
    Member

    @relaxcn Still working on it?

  6. relaxcn commented on Sep 10, 2025

    @relaxcn
    Contributor

    @relaxcn Still working on it?

    Sorry, I'm busy recently. I have released this issue.
    Sorry again.

    @rustbot release-assignment

  7. added 3 commits that reference this issue on Sep 12, 2025
  8. added a commit that references this issue on Sep 12, 2025
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

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`C-enhancementCategory: An issue proposing an enhancement or a PR with one.D-papercutDiagnostics: An error or lint that needs small tweaks.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