Skip to content

Emit error for unused target expression in glob and list delegations#157601

Open
aerooneqq wants to merge 7 commits into
rust-lang:mainfrom
aerooneqq:delegation-glob-useless-target-expr-error
Open

Emit error for unused target expression in glob and list delegations#157601
aerooneqq wants to merge 7 commits into
rust-lang:mainfrom
aerooneqq:delegation-glob-useless-target-expr-error

Conversation

@aerooneqq

@aerooneqq aerooneqq commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

View all comments

This PR emits error if unuse target expression is specified for glob delegation. Second part of #156798.

Part of #118212.
r? @petrochenkov

@rustbot rustbot added 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 8, 2026
@rust-log-analyzer

This comment has been minimized.

@aerooneqq aerooneqq force-pushed the delegation-glob-useless-target-expr-error branch from e6b6c5e to c967907 Compare June 8, 2026 08:36
Comment thread compiler/rustc_middle/src/hir/map.rs Outdated
Comment thread compiler/rustc_ast_lowering/src/delegation.rs Outdated
Comment thread compiler/rustc_ast_lowering/src/delegation.rs Outdated
@petrochenkov petrochenkov 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 9, 2026
@aerooneqq

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 9, 2026
Comment thread compiler/rustc_ast_lowering/src/delegation.rs Outdated
Comment thread compiler/rustc_passes/src/delegation.rs
Comment thread compiler/rustc_passes/src/delegation.rs Outdated
Comment thread compiler/rustc_passes/src/delegation.rs Outdated
Comment thread compiler/rustc_passes/src/delegation.rs Outdated
Comment thread compiler/rustc_hir/src/hir.rs Outdated
@petrochenkov petrochenkov 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 9, 2026
@aerooneqq

Copy link
Copy Markdown
Contributor Author

@rustbot ready

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

Copy link
Copy Markdown
Contributor Author

Added support for list delegations too, changes are not that big and connected to this PR (I've used LocalExpnId to track list delegations), if you think that it should go as separate PR I can remove this commit.

Comment thread compiler/rustc_hir/src/hir.rs Outdated
Comment thread compiler/rustc_ast_lowering/src/delegation.rs Outdated
Comment thread compiler/rustc_ast_lowering/src/delegation.rs Outdated
Comment thread compiler/rustc_ast_lowering/src/delegation.rs Outdated
@petrochenkov petrochenkov 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 10, 2026
@aerooneqq

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 10, 2026
@aerooneqq aerooneqq changed the title Emit error for unused target expression in glob delegations Emit error for unused target expression in glob and list delegations Jun 10, 2026
Comment thread compiler/rustc_passes/src/delegation.rs
Comment thread compiler/rustc_passes/src/delegation.rs
@petrochenkov

Copy link
Copy Markdown
Contributor

r=me after squashing commits.
@rustbot author
@bors delegate+

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 10, 2026
@rust-bors

rust-bors Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

✌️ @aerooneqq, you can now approve this pull request!

If @petrochenkov told you to "r=me" after making some further change, then please make that change and post @bors r=petrochenkov.

View changes since this delegation.

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jun 10, 2026
@rustbot

rustbot commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-fn_delegation `#![feature(fn_delegation)]` S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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