-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Return spans out of is_doc_comment
to reduce reliance on .span()
on attributes
#147676
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
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
if let Some((doc_str, comment_kind)) = attr.doc_str_and_comment_kind() { | ||
let doc = beautify_doc_string(doc_str, comment_kind); | ||
let (span, kind, from_expansion) = if attr.is_doc_comment() { | ||
let span = attr.span(); |
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 change specifically addresses this span call here on AttributeExt
which is quite annoying otherwise. We want to start merging doc comments in the future, just like other attributes. Before, we needed an exception in the .span()
function just for doc comments.
Thanks! @bors r+ rollup |
Rollup of 11 pull requests Successful merges: - #143191 (Stabilize `rwlock_downgrade` library feature) - #147444 (Allow printing a fully-qualified path in `def_path_str`) - #147527 (Update t-compiler beta nomination Zulip msg) - #147670 (some `ErrorGuaranteed` cleanups) - #147676 (Return spans out of `is_doc_comment` to reduce reliance on `.span()` on attributes) - #147708 (const `mem::drop`) - #147710 (Fix ICE when using contracts on async functions) - #147716 (Fix some comments) - #147718 (miri: use allocator_shim_contents codegen helper) - #147729 (ignore boring locals when explaining why a borrow contains a point due to drop of a live local under polonius) - #147742 (Revert unintentional whitespace changes to rustfmt-excluded file) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #147676 - jdonszelmann:span-is-doc-comment, r=GuillaumeGomez Return spans out of `is_doc_comment` to reduce reliance on `.span()` on attributes r? `@GuillaumeGomez`
Rollup of 11 pull requests Successful merges: - rust-lang/rust#143191 (Stabilize `rwlock_downgrade` library feature) - rust-lang/rust#147444 (Allow printing a fully-qualified path in `def_path_str`) - rust-lang/rust#147527 (Update t-compiler beta nomination Zulip msg) - rust-lang/rust#147670 (some `ErrorGuaranteed` cleanups) - rust-lang/rust#147676 (Return spans out of `is_doc_comment` to reduce reliance on `.span()` on attributes) - rust-lang/rust#147708 (const `mem::drop`) - rust-lang/rust#147710 (Fix ICE when using contracts on async functions) - rust-lang/rust#147716 (Fix some comments) - rust-lang/rust#147718 (miri: use allocator_shim_contents codegen helper) - rust-lang/rust#147729 (ignore boring locals when explaining why a borrow contains a point due to drop of a live local under polonius) - rust-lang/rust#147742 (Revert unintentional whitespace changes to rustfmt-excluded file) r? `@ghost` `@rustbot` modify labels: rollup
r? @GuillaumeGomez