Skip to content

1.97 beta regression: Rust claims import is unused but crate doesn't compile with it removed #157420

@orlp

Description

@orlp

I don't have a minimal reproducer, but I do have a reproducer.

  1. Check out polars at commit 133a52633ba7b0dc08c70a2662abf5d7547df06f.

  2. Run make build. Rust will give the following warning (among others):

warning: unused import: `crate::prelude`
 --> crates/polars-core/src/chunked_array/ops/sort/options.rs:5:5
  |
5 | use crate::prelude::*;
  |     ^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default

However, if we remove this line, the project will fail to compile.

Meta

rustc --version --verbose:

rustc 1.98.0-nightly (d595fce01 2026-06-02)

Metadata

Metadata

Assignees

Labels

A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameA-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_importsS-has-bisectionStatus: A bisection has been found for this issueS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-rustdocRelevant to the rustdoc 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
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions