<p dir="auto"><code class="notranslate">rustdoc</code> unusually repeats a doc comment twice when it is outside an external module. Check out <a href="https://github.com/alxgnon/docrepeat">alxgnon/docrepeat</a> for an example of the bug in action.</p>
<p dir="auto">I previously fixed this issue for Rust's documentation with <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="32329603" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/13812" data-hovercard-type="pull_request" data-hovercard-url="/rust-lang/rust/pull/13812/hovercard" href="https://github.com/rust-lang/rust/pull/13812">#13812</a>, by simply moving the problematic doc comments.</p>
<p dir="auto">However, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="32329603" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/13812" data-hovercard-type="pull_request" data-hovercard-url="/rust-lang/rust/pull/13812/hovercard" href="https://github.com/rust-lang/rust/pull/13812">#13812</a> does not fix the issue with <code class="notranslate">rustdoc</code> itself. I am therefore opening this as a separate issue.</p>
<p dir="auto">This should generate at least a warning. <code class="notranslate">warn(type_limits)</code> might be appropriate.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="pub fn main() {
    let x: u64 = -1;
    println!(&quot;x = {}&quot;, x);
}"><pre class="notranslate"><code class="notranslate">pub fn main() {
    let x: u64 = -1;
    println!("x = {}", x);
}
</code></pre></div>