-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Find more invalid doc attributes #83098
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
Merged
+195
−55
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9613a88
Refactor `check_doc_attrs` body
camelid 7189c05
Lint non-meta doc attributes
camelid 7e972a3
Report error for each invalid nested attribute
camelid fe64970
Add another test case
camelid 5134047
Add hyphen to "crate level"
camelid 13884dc
Update `rustdoc-ui` versions of the `doc-attr` test
camelid 13076f9
Tweak diagnostics
camelid 8f40e11
Use pretty-printer instead of `span_to_snippet`
camelid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add another test case
- 1.86.0
- 1.85.1
- 1.85.0
- 1.84.1
- 1.84.0
- 1.83.0
- 1.82.0
- 1.81.0
- 1.80.1
- 1.80.0
- 1.79.0
- 1.78.0
- 1.77.2
- 1.77.1
- 1.77.0
- 1.76.0
- 1.75.0
- 1.74.1
- 1.74.0
- 1.73.0
- 1.72.1
- 1.72.0
- 1.71.1
- 1.71.0
- 1.70.0
- 1.69.0
- 1.68.2
- 1.68.1
- 1.68.0
- 1.67.1
- 1.67.0
- 1.66.1
- 1.66.0
- 1.65.0
- 1.64.0
- 1.63.0
- 1.62.1
- 1.62.0
- 1.61.0
- 1.60.0
- 1.59.0
- 1.58.1
- 1.58.0
- 1.57.0
- 1.56.1
- 1.56.0
- 1.55.0
- 1.54.0
- 1.53.0
- 1.52.1
- 1.52.0
commit fe64970ed10230376b08c5d4187f9d204295383f
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
How do I display the
Path
? There doesn't seem to be a Display impl.Note that this is not a regression; this test is just exposing the previous behavior.
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.
Instead of
name_or_empty
, could usename_value_literal_span
and then get the snippet for thatSpan
? Or ispath_to_string
accessible here?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.
I don't think
rustc_ast_pretty
is accessible here, though I could add it as a dependency. I'm trying out thespan_to_snippet
approach now.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.
Both
span_to_snippet
andpath_to_string
worked. I'm leaning towardspath_to_string
because I think it will handlefoo :: bar:: baz
gracefully asfoo::bar::baz
, but which one would you prefer I use? You can see what the code looks like withspan_to_snippet
vspath_to_string
here: 8f40e11There 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.
I'd normally want to lean against introducing more dependencies between our crates, but depending on
rust_ast_pretty
when we already depend onrust_ast
is probably fine. Let's stick withpath_to_string
.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.
It looks like
rustc_passes
already depends transitively onrustc_ast_pretty
anyway.