Skip to content

module_name_repetitions no longer lints grouped re-exports #17786

Description

@kpreid

Summary

module_name_repetitions no longer lints when the name that is repetitive is in a re-export group.

Lint Name

module_name_repetitions

Reproducer

I tried this code:

#![warn(clippy::module_name_repetitions)]

pub mod space {
    mod happening {
        pub struct SpaceTime {}
        pub struct SpaceWedgie {}
        pub struct NegativeSpaceWedgie {}
    }
    
    pub use happening::SpaceTime;
    pub use happening::{NegativeSpaceWedgie, SpaceWedgie};
}

I expected to see this happen: Lint on SpaceTime and SpaceWedgie re-exports, as on stable 1.98.1:

warning: item name starts with its containing module's name
  --> src/lib.rs:10:24
   |
10 |     pub use happening::SpaceTime;
   |                        ^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#module_name_repetitions
note: the lint level is defined here
  --> src/lib.rs:1:9
   |
 1 | #![warn(clippy::module_name_repetitions)]
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: item name starts with its containing module's name
  --> src/lib.rs:11:46
   |
11 |     pub use happening::{NegativeSpaceWedgie, SpaceWedgie};
   |                                              ^^^^^^^^^^^

Instead, only one lint appeared, from the ungrouped import:

warning: item name starts with its containing module's name
  --> src/lib.rs:10:24
   |
10 |     pub use happening::SpaceTime;
   |                        ^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/main/index.html#module_name_repetitions

I believe this change happened within the past day or two, but I have not bisected to be sure.

Version

rustc 1.100.0-nightly (5ceaf6608 2026-09-25)
binary: rustc
commit-hash: 5ceaf6608eb354c2f5bbb3b8d974caa367dac81c
commit-date: 2026-09-25
host: aarch64-apple-darwin
release: 1.100.0-nightly
LLVM version: 23.1.1

Activity

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

Metadata

Metadata

Labels

C-bugCategory: Clippy is not doing the correct thingI-false-negativeIssue: The lint should have been triggered on code, but wasn'tgood first issueThese issues are a good way to get started with Clippy

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions