-
Notifications
You must be signed in to change notification settings - Fork 13.3k
The doc contents are incorrectly made bold under certain situation #101743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Transferred to rust-lang/rust as that is where rustdoc issues are tracked. |
@cmpute I cannot reproduce, can you post the definition of Word, Repr, etc.. When I try pub type Word = usize;
pub struct Repr<const B: usize>([i32; B]);
pub struct IBig(usize);
pub const fn base_as_ibig<const B: Word>() -> IBig {
IBig(B)
}
impl<const B: Word> Repr<B> {
/// The base of the representation. It's exposed as an [IBig] constant.
pub const BASE: IBig = base_as_ibig::<B>();
/// Create a [Repr] instance representing value zero
pub const fn zero() -> Self { todo!() }
} I get Which looks correct. It's also possible that I'm on a more recent version of rustdoc, and that this has been fixed, and needs a test rustdoc 1.65.0-nightly (1120c5e01 2022-09-08)
binary: rustdoc
commit-hash: 1120c5e01df508de64fe6642f22fadeb574afd6d
commit-date: 2022-09-08
host: x86_64-unknown-linux-gnu
release: 1.65.0-nightly
LLVM version: 15.0.0 |
I tried to use nightly locally and get the same result as yours. Thanks! Notice that your rendering output for pub const BASE: IBig = _ rather than my rendering: pub const BASE: IBig = base_as_ibig::() This actually avoid the problem of parsing the generic parameters |
Add test for rust-lang#101743 The issue was closes as we stopped rendering `const`s like this, but if we move back to doing that, make sure we don't accidently generate tags
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#100415 (Add BE8 support) - rust-lang#101559 (Adding "backtrace off" option for fuchsia targets) - rust-lang#101740 (Adding ignore-fuchsia arg to non-applicable compiler ui tests) - rust-lang#101778 (rustdoc: clean up DOM by removing `.dockblock-short p`) - rust-lang#101786 (Tidy will not check coding style in bootstrap/target) - rust-lang#101810 (Constify `PartialEq` for `Ordering`) - rust-lang#101812 (rustdoc: clean up CSS `#titles` using flexbox) - rust-lang#101820 (rustdoc: remove no-op rule `a { background: transparent }`) - rust-lang#101828 (Add test for rust-lang#101743) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Problem
This bug happens when an associated constant is generated from a generic const function. The brackets surrounding the generic parameters are interpreted as an HTML tag.
Steps
If the documentation is like this in the code:
The documentation looks like:

(the text becomes a link)
If the documentation is
The documentation looks like

(it even affects the documentation of other items in the same page
Possible Solution(s)
The generic brackets should be escaped
Notes
No response
Version
The text was updated successfully, but these errors were encountered: