-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Improve handling of rustdoc lints when used with raw doc fragments. #136400
base: master
Are you sure you want to change the base?
Improve handling of rustdoc lints when used with raw doc fragments. #136400
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
a9a435b
to
c6d7696
Compare
sp = sp.with_lo(sp.lo() + BytePos(match_start as u32)); | ||
sp = sp.with_hi(sp.lo() + BytePos((md_range.end - md_range.start) as u32)); | ||
return Some(sp); | ||
} |
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.
This logic is run on a compiler's happy path, when rustdoc and its lints are not involved.
Could you do a perf run before merging this?
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.
source_span_to_markdown_range
is? for what purpose?
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 just checked every usage of this function in this repo, and they're all in rustdoc lints
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.
Huh, that's odd. source_span_to_markdown_range
is indeed not used in the compiler. It should be part of rustdoc instead (it doesn't rely on any compiler-internal APIs, so that would technically work) — except that this situation is slightly suspicious. Maybe it used to be used by the compiler in the past, we need to check the history. Also, it might indicate that whoever uses that function doesn't handle cross-crate intra-doc links correctly.
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 feel like i'm missing something, i don't see how intra-doc lints are relevant 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 just checked every usage of this function in this repo, and they're all in rustdoc lints
If something is not used in the compiler, then it should not live in compiler/rustc_resolve
.
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.
do you want me to move it in this PR, or can it be done in a followup?
@fmease what module do you want me to move |
@fmease reminder to look at this. |
@fmease it's been a week, are you going to get to this, or should I reroll reviewers? |
rustdoc::bare_urls
no longer outputs incoherent suggestions ifsource_span_for_markdown_range
returns None, instead outputting no suggestionsource_span_for_markdown_range
has one more heuristic, so it will returnNone
less often.fixes #135851