resolve: do not suggest _ for unresolved imports#152861
Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom Feb 20, 2026
Merged
resolve: do not suggest _ for unresolved imports#152861rust-bors[bot] merged 1 commit intorust-lang:mainfrom
_ for unresolved imports#152861rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Conversation
`use _` is never valid, so it should not be suggested as a similar name.
Collaborator
|
r? @nnethercote rustbot has assigned @nnethercote. Use Why was this reviewer chosen?The reviewer was selected based on:
|
Member
|
nice, thanks for your contribution! @bors r+ rollup |
Contributor
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-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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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