Skip to content

Emit error for unused target expression in glob delegations#157601

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

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

Conversation

@aerooneqq
Copy link
Copy Markdown
Contributor

@aerooneqq aerooneqq commented Jun 8, 2026

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
tcx.ensure_done().lower_delayed_owner(id);
}

tcx.check_unused_target_exprs_in_glob_delegations(&krate.delayed_ids);
Copy link
Copy Markdown
Contributor Author

@aerooneqq aerooneqq Jun 8, 2026

Choose a reason for hiding this comment

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

Considering that this function (force_delayed_owners_lowering) may not exist after possible incremental lowering PR merge maybe there is a better place for this diagnostic (maybe there is a better place regardless incremental lowering PR). The only benefit of the current placement that I see is that delegation-related errors are mostly grouped together in rustc_ast_lowering::errors, but we can move it to rustc_hir_analysis for example where it belongs more naturally?

View changes since the review

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

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants