Skip to content

resolve: Remove force parameter from resolve_ident_in_scope#151873

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
petrochenkov:resrefact
Jan 31, 2026
Merged

resolve: Remove force parameter from resolve_ident_in_scope#151873
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
petrochenkov:resrefact

Conversation

@petrochenkov
Copy link
Contributor

force == true is used for turning Determinacy::Undetermined into Determinacy::Determined during error recovery.
It's only needed in two places:

  • resolve_macro_or_delegation_path - the normal case
  • resolve_path_with_ribs - obscure case, only when resolving visibilities and only for improving diagnostics in tests\ui\resolve\visibility-indeterminate.rs, I'm not actually sure if we should keep it

In other cases Determinacy::Undetermined is just ignored or can be propagated.

@rustbot rustbot added 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. labels Jan 30, 2026
@petrochenkov petrochenkov marked this pull request as ready for review January 30, 2026 18:53
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 30, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jan 30, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 30, 2026

r? @chenyukang

rustbot has assigned @chenyukang.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

}
Err(Undetermined) => return PathResult::Indeterminate,
Err(Determined) => {
Err(Undetermined) if finalize.is_none() => return PathResult::Indeterminate,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The obscure case.

derive,
parent_scope,
force,
false,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change is responsible for the test change in tests/ui/macros/macro-rules-as-derive-or-attr-issue-132928.rs.
It's ok, the resolution here is a speculative intermediate step and it doesn't need to leave traces.

Copy link
Member

Choose a reason for hiding this comment

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

Agreed

@lqd
Copy link
Member

lqd commented Jan 30, 2026

Nice little cleanup, r=me when green

@Kivooeo
Copy link
Member

Kivooeo commented Jan 30, 2026

@bors r=lqd,estebank rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 30, 2026

📌 Commit ea0ee49 has been approved by lqd,estebank

It is now in the queue for this repository.

@rust-bors rust-bors bot 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 Jan 30, 2026
rust-bors bot pushed a commit that referenced this pull request Jan 30, 2026
…uwer

Rollup of 2 pull requests

Successful merges:

 - #151281 (constify `Iterator`, take IV)
 - #151873 (resolve: Remove `force` parameter from `resolve_ident_in_scope`)
@rust-bors rust-bors bot merged commit 4884de4 into rust-lang:main Jan 31, 2026
11 checks passed
rust-timer added a commit that referenced this pull request Jan 31, 2026
Rollup merge of #151873 - petrochenkov:resrefact, r=lqd,estebank

resolve: Remove `force` parameter from `resolve_ident_in_scope`

`force == true` is used for turning `Determinacy::Undetermined` into `Determinacy::Determined` during error recovery.
It's only needed in two places:
- `resolve_macro_or_delegation_path` - the normal case
- `resolve_path_with_ribs` - obscure case, only when resolving visibilities and only for improving diagnostics in `tests\ui\resolve\visibility-indeterminate.rs`, I'm not actually sure if we should keep it

In other cases `Determinacy::Undetermined` is just ignored or can be propagated.
@rustbot rustbot added this to the 1.95.0 milestone Jan 31, 2026
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Jan 31, 2026
…uwer

Rollup of 2 pull requests

Successful merges:

 - rust-lang/rust#151281 (constify `Iterator`, take IV)
 - rust-lang/rust#151873 (resolve: Remove `force` parameter from `resolve_ident_in_scope`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

6 participants