Skip to content

Comments

resolve: do not suggest _ for unresolved imports#152861

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
ozankenangungor:fix-underscore-import-suggestion
Feb 20, 2026
Merged

resolve: do not suggest _ for unresolved imports#152861
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
ozankenangungor:fix-underscore-import-suggestion

Conversation

@ozankenangungor
Copy link
Contributor

@ozankenangungor ozankenangungor commented Feb 19, 2026

Fix invalid unresolved-import suggestion when a module contains an item named _.

use _ is never valid syntax, so _ should not be suggested as a similar name.

Closes #152812

`use _` is never valid, so it should not be suggested as a similar name.
@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 Feb 19, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 19, 2026

r? @nnethercote

rustbot has assigned @nnethercote.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 68 candidates
  • Random selection from 15 candidates

@Kivooeo Kivooeo assigned Kivooeo and unassigned nnethercote Feb 19, 2026
@Kivooeo
Copy link
Member

Kivooeo commented Feb 19, 2026

nice, thanks for your contribution!

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 19, 2026

📌 Commit aebafba has been approved by Kivooeo

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 Feb 19, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Feb 20, 2026
…ort-suggestion, r=Kivooeo

resolve: do not suggest `_` for unresolved imports

Fix invalid unresolved-import suggestion when a module contains an item named `_`.

`use _` is never valid syntax, so `_` should not be suggested as a similar name.

Closes rust-lang#152812
rust-bors bot pushed a commit that referenced this pull request Feb 20, 2026
Rollup of 7 pull requests

Successful merges:

 - #152057 (bootstrap: respect POSIX jobserver)
 - #152818 (DOC: do not link to "nightly" in Iterator::by_ref() docstring)
 - #152840 (Add bootstrap snapshot tests for {`install`, `install src`})
 - #152846 (Clarify some variable names in the query proc-macro)
 - #152858 (Fix typo in doc for core::mem::type_info::Struct)
 - #152861 (resolve: do not suggest `_` for unresolved imports)
 - #152873 (std::ops::ControlFlow - use "a" before `Result`)
jhpratt added a commit to jhpratt/rust that referenced this pull request Feb 20, 2026
…ort-suggestion, r=Kivooeo

resolve: do not suggest `_` for unresolved imports

Fix invalid unresolved-import suggestion when a module contains an item named `_`.

`use _` is never valid syntax, so `_` should not be suggested as a similar name.

Closes rust-lang#152812
rust-bors bot pushed a commit that referenced this pull request Feb 20, 2026
Rollup of 8 pull requests

Successful merges:

 - #152057 (bootstrap: respect POSIX jobserver)
 - #152527 (Remove -Zemit-thin-lto flag)
 - #152818 (DOC: do not link to "nightly" in Iterator::by_ref() docstring)
 - #152840 (Add bootstrap snapshot tests for {`install`, `install src`})
 - #152846 (Clarify some variable names in the query proc-macro)
 - #152858 (Fix typo in doc for core::mem::type_info::Struct)
 - #152861 (resolve: do not suggest `_` for unresolved imports)
 - #152873 (std::ops::ControlFlow - use "a" before `Result`)
rust-bors bot pushed a commit that referenced this pull request Feb 20, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - #152759 (Simpler `find_attr!()`)
 - #152057 (bootstrap: respect POSIX jobserver)
 - #152818 (DOC: do not link to "nightly" in Iterator::by_ref() docstring)
 - #152840 (Add bootstrap snapshot tests for {`install`, `install src`})
 - #152844 (Rename `DepGraphQuery` to `RetainedDepGraph`)
 - #152846 (Clarify some variable names in the query proc-macro)
 - #152858 (Fix typo in doc for core::mem::type_info::Struct)
 - #152861 (resolve: do not suggest `_` for unresolved imports)
 - #152873 (std::ops::ControlFlow - use "a" before `Result`)
 - #152877 (std::ops::ControlFlow - use normal comment for internal methods)
 - #152883 (Deny final not followed by item)
@rust-bors rust-bors bot merged commit c013bcc into rust-lang:main Feb 20, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 20, 2026
rust-timer added a commit that referenced this pull request Feb 20, 2026
Rollup merge of #152861 - ozankenangungor:fix-underscore-import-suggestion, r=Kivooeo

resolve: do not suggest `_` for unresolved imports

Fix invalid unresolved-import suggestion when a module contains an item named `_`.

`use _` is never valid syntax, so `_` should not be suggested as a similar name.

Closes #152812
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.

Do not suggets use _ when an item named _ exists

4 participants