Skip to content

Port #[may_dangle] to the new attribute system#142539

Merged
bors merged 1 commit into
rust-lang:masterfrom
GrigorenkoPV:attributes/may_dangle
Jun 21, 2025
Merged

Port #[may_dangle] to the new attribute system#142539
bors merged 1 commit into
rust-lang:masterfrom
GrigorenkoPV:attributes/may_dangle

Conversation

@GrigorenkoPV

@GrigorenkoPV GrigorenkoPV commented Jun 15, 2025

Copy link
Copy Markdown
Contributor

Very similar to #142498.

This is a part of #131229, so
r? @jdonszelmann

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 15, 2025
@rustbot

rustbot commented Jun 15, 2025

Copy link
Copy Markdown
Collaborator

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann

Some changes occurred in compiler/rustc_attr_data_structures

cc @jdonszelmann

Some changes occurred in compiler/rustc_passes/src/check_attr.rs

cc @jdonszelmann

// FIXME: should not be needed anymore when all attrs are parsed
Attribute::Parsed(AttributeKind::Deprecation { span, .. }) => *span,
Attribute::Parsed(AttributeKind::DocComment { span, .. }) => *span,
Attribute::Parsed(AttributeKind::MayDangle(span)) => *span,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same feedback as on the other PR. This list should be kept as small as possible and was only introduced for migration purposes. I expect this entire function to be removed.

@jdonszelmann

Copy link
Copy Markdown
Contributor

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 15, 2025
@rustbot

rustbot commented Jun 15, 2025

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot rustbot added the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Jun 15, 2025
@GrigorenkoPV GrigorenkoPV force-pushed the attributes/may_dangle branch from f2ffea0 to d4006e4 Compare June 16, 2025 15:34
@GrigorenkoPV

GrigorenkoPV commented Jun 16, 2025

Copy link
Copy Markdown
Contributor Author

@rustbot label -S-blocked
@rustbot ready
@rustbot label +S-waiting-on-review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-blocked Status: Blocked on something else such as an RFC or other implementation work. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 16, 2025
@GrigorenkoPV GrigorenkoPV force-pushed the attributes/may_dangle branch from d4006e4 to 76dfb1c Compare June 16, 2025 21:53
@bors

bors commented Jun 18, 2025

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #138165) made this pull request unmergeable. Please resolve the merge conflicts.

@jdonszelmann

Copy link
Copy Markdown
Contributor

@GrigorenkoPV could you rebase? Then I'll give it one more pass and we can merge

@GrigorenkoPV GrigorenkoPV force-pushed the attributes/may_dangle branch from 76dfb1c to 1ddede1 Compare June 18, 2025 17:02
@bors

bors commented Jun 19, 2025

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #142697) made this pull request unmergeable. Please resolve the merge conflicts.

@GrigorenkoPV GrigorenkoPV force-pushed the attributes/may_dangle branch from 1ddede1 to 37bc3f6 Compare June 19, 2025 14:36
Comment thread compiler/rustc_passes/src/check_attr.rs Outdated
self.check_applied_to_fn_or_method(hir_id, *attr_span, span, target)
}
&Attribute::Parsed(AttributeKind::MayDangle(attr_span)) => {
// Check if `#[may_dangle]` is applied to a lifetime or type generic parameter in `Drop` impl.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be in its own function, not here, just like other validation logic usually isn't

@bors

bors commented Jun 20, 2025

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #142770) made this pull request unmergeable. Please resolve the merge conflicts.

@GrigorenkoPV GrigorenkoPV force-pushed the attributes/may_dangle branch from 37bc3f6 to 045faa8 Compare June 20, 2025 19:39
@jdonszelmann

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@bors

bors commented Jun 21, 2025

Copy link
Copy Markdown
Collaborator

📌 Commit 045faa8 has been approved by jdonszelmann

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 21, 2025
bors added a commit that referenced this pull request Jun 21, 2025
Rollup of 3 pull requests

Successful merges:

 - #142539 (Port `#[may_dangle]` to the new attribute system)
 - #142690 (expand: Remove some unnecessary generic parameters)
 - #142698 (Improve diagnostics for `concat_bytes!` with C string  literals)

Failed merges:

 - #142600 (Port `#[rustc_pub_transparent]` to the new attribute system)
 - #142776 (All HIR attributes are outer)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit cd857f4 into rust-lang:master Jun 21, 2025
10 checks passed
@rustbot rustbot added this to the 1.89.0 milestone Jun 21, 2025
rust-timer added a commit that referenced this pull request Jun 21, 2025
Rollup merge of #142539 - GrigorenkoPV:attributes/may_dangle, r=jdonszelmann

Port `#[may_dangle]` to the new attribute system

Very similar to #142498.

This is a part of #131229, so
r? `@jdonszelmann`
@GrigorenkoPV GrigorenkoPV deleted the attributes/may_dangle branch June 21, 2025 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants