-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Make impl consts ConstantItems not AssocConstItems, to match typedefs #83665
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
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The expected failures from HTML, I see where the problem is and think I know how to fix it |
This comment has been minimized.
This comment has been minimized.
Added test for JSON but not HTML, as HTML tests seem to already thoroughly cover this. Wasn't too bad once I just sat down and worked on it for a bit. So, assuming tests pass here as they did locally... r? @jyn514 |
@rustbot label: +A-rustdoc-json +A-rustdoc +S-waiting-on-review |
This comment has been minimized.
This comment has been minimized.
The job Click to see the possible cause of the failure (guessed by this bot)
|
Hm, the failing test is actually kind of weird, looking at it: It expects the trait impl const to be in the search index, and the method, but not the typedef. Which would have the same issue as the const is now having: There doesn't seem to be a way to have the index link to a different type than the impl actually is |
I don't have time to review this. |
👍, for status: I need advice on what to do with the test. The current tests seem to not have the same issue with impl types being typedefs because they just don't add those to the index, or at least don't test it. So it looks like I'll have to make changes to how indexing works, unless we accept losing indexing of const impls |
} | ||
hir::ImplItemKind::Const(ref ty, expr) => ConstantItem(Constant { | ||
type_: ty.clean(cx), | ||
kind: ConstantKind::Local { def_id: local_did, body: expr }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue with this way of doing it is that it doesn't differentiate between "normal" constants and associated ones, which is why I think you have the issue in the search index generation.
@CraftSpider Ping from triage, any updates on this? |
I haven't really had time to work on it, feel free to close and I'll re-open if I make progress |
triage: @CraftSpider closing PR on request Please feel free to reopen when you're ready to continue |
Fixes #81340. Draft as I'm not sure all tests will pass, running some of them locally isn't yet easy for me.
r? @ghost