Open
Description
Summary
I have a bin crate that has at its source root a directory named lib/
for a module named, well, lib
.
When upgrading to Rust 1.65, I get a new lint warning telling me that there is a "module declaration for lib.rs" which is wrong because I have no lib.rs
.
I know that it's a bad name for a module, and I'll probably rename it, but I wanted to let you know!
Lint Name
special_module_name
Reproducer
I tried this code:
# main.rs
mod lib;
fn main() {
lib::foo();
}
# lib/mod.rs
pub fn foo() {
println!("foo!");
}
I saw this happen:
warning: found module declaration for lib.rs
--> api/src/main.rs:1:1
|
1 | mod lib;
| ^^^^^^^^
|
= note: `#[warn(special_module_name)]` on by default
= note: lib.rs is the root of this crate's library target
= help: to refer to it from other targets, use the library's name as the path
I expected to see this happen: no lint warning.
Version
rustc 1.65.0 (897e37553 2022-11-02)
binary: rustc
commit-hash: 897e37553bba8b42751c67658967889d11ecd120
commit-date: 2022-11-02
host: x86_64-unknown-linux-gnu
release: 1.65.0
LLVM version: 15.0.0
Additional Labels
No response