-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
rustdoc: generic constant expressions not displayed (and where clauses using said gces) #120994
Comments
Right, I've anonymized most const exprs in #988141 as a hot fix for #97933 to prevent private/internal const exprs getting leaked, so this is kind of intentional although the heuristic is super conservative (and buggy as it doesn't work in cross-crate scenarios). However, this doesn't mean that this will never change. I originally (roughtly 2 years ago) set out to improve rustdoc's const story (cc #99688). This has stalled a bit but only because I'm super involved in different rustc projects at the moment and I definitely want to pick this up again. For context, I plan on writing a rustdoc RFC at some point (target date: mid 2024) for richer const “support” in rustdoc (cc #98929, #99630, #102456). Since everything (the Footnotes
|
The empty bound not getting displayed I would indeed consider a bug since there's a semantic difference between |
If you have
Whats wrong with it displaying the function name without any link? |
Your linked issue seems to be about associated constants, not about types. |
Right and the fix was for all (local) const exprs since back then I tarred all with the same brush. |
Because it's kind of hard to come up with a good heuristic when to show and when not to show complex const exprs. For example should we display the whole const expr in So I've assigned myself to this issue but I can't just remove this heuristic (due to cases like #97933 (comment) (this is in an assoc const but this applies to all const exprs)) only tweak it and make it more liberal if we have a const arg. And I'm not sure if t-rustdoc is happy about further complicating existing heuristics inside rustdoc. |
So this is largely a design problem, yes? |
Yes, the implementation is straightforward (unless we want to take extra stuff into consideration like the visibility of the functions used inside the const exprs but that's also solvable). |
This code
Produces this documentation
This is what i want
Meta
rustdoc 1.78.0-nightly (1a648b3 2024-02-11)
@GuillaumeGomez @fmease
The text was updated successfully, but these errors were encountered: