Skip to content

Rust warns pub glob export is unused #160691

Description

@orlp

I tried this code:

#[cfg(feature = "dtype-categorical")]
pub use crate::chunked_array::logical::categorical::*;

I expected to see this happen: no warning, since it is a pub export in a pub module.

Instead, a warning is raised:

warning: unused import: `crate::chunked_array::logical::categorical::*`
  --> crates/polars-core/src/prelude.rs:30:9
   |
30 | pub use crate::chunked_array::logical::categorical::*;

Reproduces in orlp/polars@0626047, with the command

cargo check -p polars-core --features dtype-categorical 2>&1 | rg "pub use" --before-context=3

There are other warnings due to an incomplete set of features, but the specific warning here is invalid regardless of features.

Meta

rustc --version --verbose:

rustc 1.99.0-nightly (7608eb7b0 2026-08-05)
binary: rustc
commit-hash: 7608eb7b07eaf93f16d7cf5bcb2098eca87503df
commit-date: 2026-08-05
host: aarch64-apple-darwin
release: 1.99.0-nightly
LLVM version: 23.1.0
Backtrace

<backtrace>

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.L-unused_importsLint: unused_importsP-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions