Invalid `dead_code` warning for submodule in integration test

I was following the advice about Test Organization for submodules in integration tests and was surprised to see warnings for unused code when I added another test file.

Here's a minimal reproduction:

// file: tests/common/mod.rs
pub struct A;
// file: tests/a.rs
mod common;

#[test]
fn a() {
    todo!()
}
// file: tests/b.rs
mod common;

#[test]
fn b() {
    let _value = common::A {};
}

The compiler protests and says that A is never constructed, but the error disappears when I delete a.rs. Am I missing something?

warning: struct `A` is never constructed
 --> tests/common/mod.rs:1:12
  |
1 | pub struct A;
  |            ^
  |
  = note: `#[warn(dead_code)]` on by default

Each test has its own duplicate of the common module. If you use pub mod common, then the compiler will stop complaining because the warning doesn't apply to public items accessible from the crate root.