Skip to content

stack overflow in nursery lints #14336

@matthiaskrgr

Description

@matthiaskrgr

Summary

.

Reproducer

I tried this code:
clippy-driver -Wclippy::nursery

//@ check-pass

#[derive(Debug)]
struct S<T> {
    t: T,
    s: Box<S<fn(u: T)>>,
}

fn main() {}
warning: struct `S` is never constructed
 --> ./src/tools/clippy/tests/ui/crashes/ice-10508c.rs:4:8
  |
4 | struct S<T> {
  |        ^
  |
  = note: `#[warn(dead_code)]` on by default


thread 'rustc' has overflowed its stack
fatal runtime error: stack overflow
Aborted (core dumped)

Version

rustc 1.87.0-nightly (351686bcf 2025-03-01)
binary: rustc
commit-hash: 351686bcfd18dd0f652aba69a806bfa68c57234d
commit-date: 2025-03-01
host: x86_64-unknown-linux-gnu
release: 1.87.0-nightly
LLVM version: 20.1.0

Additional Labels

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions