Skip to content

Conversation

@petrochenkov
Copy link
Contributor

An alternative solution for #147992.

We now basically desugar

use module::*; // import `Trait`

into

use module::*; // import `Trait`
use module::Trait as _;

This change also fixes #144993, I'm not sure how to make these two changes separately, that would be significantly more complex.

@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 Nov 14, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 14, 2025

r? @jackh726

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

@petrochenkov
Copy link
Contributor Author

@bors try

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Nov 14, 2025
resolve: Consider all traits from ambiguous glob imports to be in scope
@petrochenkov petrochenkov added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 14, 2025
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
tests/ui/should_impl_trait/method_list_1.rs (revision `edition2021`) ... ok
tests/ui/size_of_in_element_count/functions.rs ... ok

FAILED TEST: tests/ui/wildcard_imports.rs
command: CLIPPY_CONF_DIR="tests" RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/0/tests/ui" "tests/ui/wildcard_imports.rs" "--extern" "wildcard_imports_helper=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/0/tests/ui/auxiliary/libwildcard_imports_helper.rlib" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/0/tests/ui/auxiliary" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libfutures-a8bf6f69c9b80e37.rlib" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libfutures-a8bf6f69c9b80e37.rmeta" "--extern" "itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libitertools-2d82d3ce68d9c3ee.rlib" "--extern" "itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libitertools-2d82d3ce68d9c3ee.rmeta" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/liblibc-e86cd1a7c22fc60c.rlib" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/liblibc-e86cd1a7c22fc60c.rmeta" "--extern" "parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libparking_lot-a94abfa769f04e5d.rlib" "--extern" "parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libparking_lot-a94abfa769f04e5d.rmeta" "--extern" "quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libquote-22b65b7753b00e23.rlib" "--extern" "quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libquote-22b65b7753b00e23.rmeta" "--extern" "regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libregex-4368476ea091f8ef.rlib" "--extern" "regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libregex-4368476ea091f8ef.rmeta" "--extern" "serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libserde-978a92b8a77cdf3d.rlib" "--extern" "serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libserde-978a92b8a77cdf3d.rmeta" "--extern" "syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libsyn-fdddf18d670fbd00.rlib" "--extern" "syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libsyn-fdddf18d670fbd00.rmeta" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtokio-1fc6a815de90452d.rlib" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtokio-1fc6a815de90452d.rmeta" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/debug/deps" "--edition" "2015"

error: actual output differed from expected
Execute `./x test src/tools/clippy --bless` to update `tests/ui/wildcard_imports.stderr` to the actual output
--- tests/ui/wildcard_imports.stderr
+++ <stderr output>
 error: usage of wildcard import
   --> tests/ui/wildcard_imports.rs:15:5
... 36 lines skipped ...
 
 error: usage of wildcard import
-  --> tests/ui/wildcard_imports.rs:100:13
-   |
-LL |         use self::exports_underscore_ish::*;
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self::exports_underscore_ish::{_Deref, dummy}`
-
-error: usage of wildcard import
   --> tests/ui/wildcard_imports.rs:132:13
    |
... 88 lines skipped ...
---

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports.rs:17:5
   |
LL | use crate::mod_mod::*;
   |     ^^^^^^^^^^^^^^^^^ help: try: `crate::mod_mod::inner_mod`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports.rs:19:5
   |
LL | use crate::multi_fn_mod::*;
   |     ^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::multi_fn_mod::{multi_foo, multi_bar, multi_inner_mod}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports.rs:22:5
   |
LL | use crate::struct_mod::*;
   |     ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::struct_mod::{A, inner_struct_mod}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports.rs:27:5
   |
LL | use wildcard_imports_helper::inner::inner_for_self_import::*;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::inner::inner_for_self_import::inner_extern_bar`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports.rs:29:5
   |
LL | use wildcard_imports_helper::*;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_foo, ExternA}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports.rs:132:13
   |
LL |         use crate::fn_mod::*;
---
error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports.rs:141:13
   |
LL |         use wildcard_imports_helper::*;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_foo, ExternA}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports.rs:154:20
   |
LL |         use self::{inner::*, inner2::*};
---
error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports.rs:163:13
   |
LL |         use wildcard_imports_helper::*;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_exported, ExternExportedStruct, ExternExportedEnum}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports.rs:193:9
   |
LL |     use crate::in_fn_test::*;
   |         ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::in_fn_test::{exported, ExportedStruct, ExportedEnum}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports.rs:203:9
   |
LL |     use crate:: in_fn_test::  * ;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate:: in_fn_test::exported`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports.rs:205:9
   |
LL |       use crate:: fn_mod::
   |  _________^
LL | |
LL | |         *;
   | |_________^ help: try: `crate:: fn_mod::foo`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports.rs:217:13
   |
LL |         use super::*;
---

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports.rs:17:5
   |
LL | use crate::mod_mod::*;
   |     ^^^^^^^^^^^^^^^^^ help: try: `crate::mod_mod::inner_mod`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports.rs:19:5
   |
LL | use crate::multi_fn_mod::*;
   |     ^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::multi_fn_mod::{multi_foo, multi_bar, multi_inner_mod}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports.rs:22:5
   |
LL | use crate::struct_mod::*;
   |     ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::struct_mod::{A, inner_struct_mod}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports.rs:27:5
   |
LL | use wildcard_imports_helper::inner::inner_for_self_import::*;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::inner::inner_for_self_import::inner_extern_bar`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports.rs:29:5
   |
LL | use wildcard_imports_helper::*;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_foo, ExternA}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports.rs:132:13
   |
LL |         use crate::fn_mod::*;
---
error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports.rs:141:13
   |
LL |         use wildcard_imports_helper::*;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_foo, ExternA}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports.rs:154:20
   |
LL |         use self::{inner::*, inner2::*};
---
error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports.rs:163:13
   |
LL |         use wildcard_imports_helper::*;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_exported, ExternExportedStruct, ExternExportedEnum}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports.rs:193:9
   |
LL |     use crate::in_fn_test::*;
   |         ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::in_fn_test::{exported, ExportedStruct, ExportedEnum}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports.rs:203:9
   |
LL |     use crate:: in_fn_test::  * ;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate:: in_fn_test::exported`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports.rs:205:9
   |
LL |       use crate:: fn_mod::
   |  _________^
LL | |
LL | |         *;
   | |_________^ help: try: `crate:: fn_mod::foo`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports.rs:217:13
   |
LL |         use super::*;
---



FAILED TEST: tests/ui/wildcard_imports_2021.rs (revision `edition2018`)
command: CLIPPY_CONF_DIR="tests" RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/0/tests/ui" "tests/ui/wildcard_imports_2021.rs" "--extern" "wildcard_imports_helper=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/0/tests/ui/auxiliary/libwildcard_imports_helper.rlib" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/0/tests/ui/auxiliary" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libfutures-a8bf6f69c9b80e37.rlib" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libfutures-a8bf6f69c9b80e37.rmeta" "--extern" "itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libitertools-2d82d3ce68d9c3ee.rlib" "--extern" "itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libitertools-2d82d3ce68d9c3ee.rmeta" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/liblibc-e86cd1a7c22fc60c.rlib" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/liblibc-e86cd1a7c22fc60c.rmeta" "--extern" "parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libparking_lot-a94abfa769f04e5d.rlib" "--extern" "parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libparking_lot-a94abfa769f04e5d.rmeta" "--extern" "quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libquote-22b65b7753b00e23.rlib" "--extern" "quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libquote-22b65b7753b00e23.rmeta" "--extern" "regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libregex-4368476ea091f8ef.rlib" "--extern" "regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libregex-4368476ea091f8ef.rmeta" "--extern" "serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libserde-978a92b8a77cdf3d.rlib" "--extern" "serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libserde-978a92b8a77cdf3d.rmeta" "--extern" "syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libsyn-fdddf18d670fbd00.rlib" "--extern" "syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libsyn-fdddf18d670fbd00.rmeta" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtokio-1fc6a815de90452d.rlib" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtokio-1fc6a815de90452d.rmeta" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/debug/deps" "--edition" "2018" "--cfg=edition2018" "-Cextra-filename=edition2018"

error: actual output differed from expected
Execute `./x test src/tools/clippy --bless` to update `tests/ui/wildcard_imports_2021.edition2018.stderr` to the actual output
--- tests/ui/wildcard_imports_2021.edition2018.stderr
+++ <stderr output>
 error: usage of wildcard import
   --> tests/ui/wildcard_imports_2021.rs:13:5
... 36 lines skipped ...
 
 error: usage of wildcard import
-  --> tests/ui/wildcard_imports_2021.rs:95:13
-   |
-LL |         use exports_underscore_ish::*;
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `exports_underscore_ish::{_Deref, dummy}`
-
-error: usage of wildcard import
   --> tests/ui/wildcard_imports_2021.rs:126:13
    |
... 88 lines skipped ...
---

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:15:5
   |
LL | use crate::mod_mod::*;
   |     ^^^^^^^^^^^^^^^^^ help: try: `crate::mod_mod::inner_mod`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:17:5
   |
LL | use crate::multi_fn_mod::*;
   |     ^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::multi_fn_mod::{multi_foo, multi_bar, multi_inner_mod}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:19:5
   |
LL | use crate::struct_mod::*;
   |     ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::struct_mod::{A, inner_struct_mod}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:23:5
   |
LL | use wildcard_imports_helper::inner::inner_for_self_import::*;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::inner::inner_for_self_import::inner_extern_bar`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:26:5
   |
LL | use wildcard_imports_helper::*;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_foo, ExternA}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:126:13
   |
LL |         use crate::fn_mod::*;
---
error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:135:13
   |
LL |         use wildcard_imports_helper::*;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_foo, ExternA}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:148:20
   |
LL |         use self::{inner::*, inner2::*};
---
error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:157:13
   |
LL |         use wildcard_imports_helper::*;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_exported, ExternExportedStruct, ExternExportedEnum}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:187:9
   |
LL |     use crate::in_fn_test::*;
   |         ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::in_fn_test::{exported, ExportedStruct, ExportedEnum}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:197:9
   |
LL |     use crate:: in_fn_test::  * ;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate:: in_fn_test::exported`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:199:9
   |
LL |       use crate:: fn_mod::
   |  _________^
LL | |
LL | |         *;
   | |_________^ help: try: `crate:: fn_mod::foo`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:211:13
   |
LL |         use super::*;
---

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:15:5
   |
LL | use crate::mod_mod::*;
   |     ^^^^^^^^^^^^^^^^^ help: try: `crate::mod_mod::inner_mod`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:17:5
   |
LL | use crate::multi_fn_mod::*;
   |     ^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::multi_fn_mod::{multi_foo, multi_bar, multi_inner_mod}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:19:5
   |
LL | use crate::struct_mod::*;
   |     ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::struct_mod::{A, inner_struct_mod}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:23:5
   |
LL | use wildcard_imports_helper::inner::inner_for_self_import::*;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::inner::inner_for_self_import::inner_extern_bar`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:26:5
   |
LL | use wildcard_imports_helper::*;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_foo, ExternA}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:126:13
   |
LL |         use crate::fn_mod::*;
---
error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:135:13
   |
LL |         use wildcard_imports_helper::*;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_foo, ExternA}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:148:20
   |
LL |         use self::{inner::*, inner2::*};
---
error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:157:13
   |
LL |         use wildcard_imports_helper::*;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_exported, ExternExportedStruct, ExternExportedEnum}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:187:9
   |
LL |     use crate::in_fn_test::*;
   |         ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::in_fn_test::{exported, ExportedStruct, ExportedEnum}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:197:9
   |
LL |     use crate:: in_fn_test::  * ;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate:: in_fn_test::exported`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:199:9
   |
LL |       use crate:: fn_mod::
   |  _________^
LL | |
LL | |         *;
   | |_________^ help: try: `crate:: fn_mod::foo`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:211:13
   |
LL |         use super::*;
---



FAILED TEST: tests/ui/wildcard_imports_2021.rs (revision `edition2021`)
command: CLIPPY_CONF_DIR="tests" RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/0/tests/ui" "tests/ui/wildcard_imports_2021.rs" "--extern" "wildcard_imports_helper=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/0/tests/ui/auxiliary/libwildcard_imports_helper.rlib" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/0/tests/ui/auxiliary" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libfutures-a8bf6f69c9b80e37.rlib" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libfutures-a8bf6f69c9b80e37.rmeta" "--extern" "itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libitertools-2d82d3ce68d9c3ee.rlib" "--extern" "itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libitertools-2d82d3ce68d9c3ee.rmeta" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/liblibc-e86cd1a7c22fc60c.rlib" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/liblibc-e86cd1a7c22fc60c.rmeta" "--extern" "parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libparking_lot-a94abfa769f04e5d.rlib" "--extern" "parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libparking_lot-a94abfa769f04e5d.rmeta" "--extern" "quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libquote-22b65b7753b00e23.rlib" "--extern" "quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libquote-22b65b7753b00e23.rmeta" "--extern" "regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libregex-4368476ea091f8ef.rlib" "--extern" "regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libregex-4368476ea091f8ef.rmeta" "--extern" "serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libserde-978a92b8a77cdf3d.rlib" "--extern" "serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libserde-978a92b8a77cdf3d.rmeta" "--extern" "syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libsyn-fdddf18d670fbd00.rlib" "--extern" "syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libsyn-fdddf18d670fbd00.rmeta" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtokio-1fc6a815de90452d.rlib" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtokio-1fc6a815de90452d.rmeta" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/debug/deps" "--edition" "2021" "--cfg=edition2021" "-Cextra-filename=edition2021"

error: actual output differed from expected
Execute `./x test src/tools/clippy --bless` to update `tests/ui/wildcard_imports_2021.edition2021.stderr` to the actual output
--- tests/ui/wildcard_imports_2021.edition2021.stderr
+++ <stderr output>
 error: usage of wildcard import
   --> tests/ui/wildcard_imports_2021.rs:13:5
... 36 lines skipped ...
 
 error: usage of wildcard import
-  --> tests/ui/wildcard_imports_2021.rs:95:13
-   |
-LL |         use exports_underscore_ish::*;
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `exports_underscore_ish::{_Deref, dummy}`
-
-error: usage of wildcard import
   --> tests/ui/wildcard_imports_2021.rs:126:13
    |
... 88 lines skipped ...
---

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:15:5
   |
LL | use crate::mod_mod::*;
   |     ^^^^^^^^^^^^^^^^^ help: try: `crate::mod_mod::inner_mod`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:17:5
   |
LL | use crate::multi_fn_mod::*;
   |     ^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::multi_fn_mod::{multi_foo, multi_bar, multi_inner_mod}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:19:5
   |
LL | use crate::struct_mod::*;
   |     ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::struct_mod::{A, inner_struct_mod}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:23:5
   |
LL | use wildcard_imports_helper::inner::inner_for_self_import::*;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::inner::inner_for_self_import::inner_extern_bar`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:26:5
   |
LL | use wildcard_imports_helper::*;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_foo, ExternA}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:126:13
   |
LL |         use crate::fn_mod::*;
---
error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:135:13
   |
LL |         use wildcard_imports_helper::*;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_foo, ExternA}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:148:20
   |
LL |         use self::{inner::*, inner2::*};
---
error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:157:13
   |
LL |         use wildcard_imports_helper::*;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_exported, ExternExportedStruct, ExternExportedEnum}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:187:9
   |
LL |     use crate::in_fn_test::*;
   |         ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::in_fn_test::{exported, ExportedStruct, ExportedEnum}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:197:9
   |
LL |     use crate:: in_fn_test::  * ;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate:: in_fn_test::exported`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:199:9
   |
LL |       use crate:: fn_mod::
   |  _________^
LL | |
LL | |         *;
   | |_________^ help: try: `crate:: fn_mod::foo`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:211:13
   |
LL |         use super::*;
---

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:15:5
   |
LL | use crate::mod_mod::*;
   |     ^^^^^^^^^^^^^^^^^ help: try: `crate::mod_mod::inner_mod`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:17:5
   |
LL | use crate::multi_fn_mod::*;
   |     ^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::multi_fn_mod::{multi_foo, multi_bar, multi_inner_mod}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:19:5
   |
LL | use crate::struct_mod::*;
   |     ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::struct_mod::{A, inner_struct_mod}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:23:5
   |
LL | use wildcard_imports_helper::inner::inner_for_self_import::*;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::inner::inner_for_self_import::inner_extern_bar`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:26:5
   |
LL | use wildcard_imports_helper::*;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_foo, ExternA}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:126:13
   |
LL |         use crate::fn_mod::*;
---
error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:135:13
   |
LL |         use wildcard_imports_helper::*;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_foo, ExternA}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:148:20
   |
LL |         use self::{inner::*, inner2::*};
---
error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:157:13
   |
LL |         use wildcard_imports_helper::*;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_exported, ExternExportedStruct, ExternExportedEnum}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:187:9
   |
LL |     use crate::in_fn_test::*;
   |         ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::in_fn_test::{exported, ExportedStruct, ExportedEnum}`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:197:9
   |
LL |     use crate:: in_fn_test::  * ;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate:: in_fn_test::exported`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:199:9
   |
LL |       use crate:: fn_mod::
   |  _________^
LL | |
LL | |         *;
   | |_________^ help: try: `crate:: fn_mod::foo`

error: usage of wildcard import
##[error]  --> tests/ui/wildcard_imports_2021.rs:211:13
   |
LL |         use super::*;

@rust-bors
Copy link

rust-bors bot commented Nov 14, 2025

☀️ Try build successful (CI)
Build commit: 9581360 (95813608313bff49cfc1afc393a946a3c085b772, parent: c8551d3c63c51f290cf1dc9dc4714249ea849fd1)

@petrochenkov
Copy link
Contributor Author

@craterbot check

@craterbot
Copy link
Collaborator

👌 Experiment pr-148946 created and queued.
🤖 Automatically detected try build 9581360
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

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

Labels

S-waiting-on-crater Status: Waiting on a crater run to be completed. 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.

shadowed traits from glob imports in the same scope get ignored

5 participants