Repository navigation
Conversation
…e = ..)] Signed-off-by: Emmanuel Ugwu <emmanuelugwu121@gmail.com>
…e = ..)] Signed-off-by: Emmanuel Ugwu <emmanuelugwu121@gmail.com>
|
Some changes occurred in compiler/rustc_attr_parsing |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Can you add this to the existing doc attribute tests in rustdoc-ui, rustdoc-html etc? And can you also add tests for custom tool attributes (with the |
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Emmanuel Ugwu <emmanuelugwu121@gmail.com>
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Emmanuel Ugwu <emmanuelugwu121@gmail.com>
This comment has been minimized.
This comment has been minimized.
|
@rustbot ready |
|
Can you fix the CI errors? @rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
|
@rustbot ready |
|
Unfortunately this creates file names like |
|
Instead of :: maybe rustdoc could do a search and replace with _ or something else? |
|
@fmease, @GuillaumeGomez do you have any ideas on the best way forward here? |
|
The most proper solution would be something like |
|
This would mean stripping off the name before :: and prefixing with tool.diagnostic This would also mean each tool attr will have a seperate dir |
|
A tool attribute can also have more segments, like |
How should we move forward since this PR doesn't take that into account. My suggestion: In this case if there ever exist a tool attribute with more than one segment nothing has to change. |
|
In the short-term we can opt for a less principled approach, of course. |
|
We can also substitute with any token that isn't valid in an ident, for example |
|
(not sure how this interacts with doc search, searching |
Yes it should |
|
Hi @mejrs |
|
I'm not sure what the best solution is. I think some sort of substitution is probably the way to go but I'm not sure what followup changes are required to make everything work properly. You could go to zulip and ask the rustdoc people for advice. |
|
☔ The latest upstream changes (presumably #165234) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
View all comments
While documenting
diagnostic::do_not_recommendanddiagnostic::on_unimplemented, #[doc(attribute = "...")] errored cause the current implementation only support built-in attributes. #157604 (comment)This implementation splits the value at
::and check tool against registered_tools and that the other half is a valid identifier.This PR was tested by documenting namespace attribute and running
./x test library/core --docto be sure no error was encountered.Should close: #163543
Disclosure: I used LLM to help understand the attribute parsing code and for an initial sketch of the check, which I rewrote and tested myself
r? @mejrs