Skip to content

Regression: missing_debug_implementations linting on private items when used as parameter in trait impl #111359

Closed
@Manishearth

Description

@Manishearth

(As a lint regression it is not a true "breaking" regression, but it's still strange behavior, categorizing as a regression.)

Code

(Also reproducible with cargo check --no-default-features in https://github.com/unicode-org/icu4x/tree/3a00b1efc12d8fac2aa84b04f85508e3b75bca4c/provider/datagen)

#[deny(missing_debug_implementations)]
#[allow(unused)]

pub mod foo {
    struct Bar;

    impl<'a> TryFrom<Bar> for u8 {
        type Error = ();
        fn try_from(o: Bar) -> Result<Self, ()> {
            unimplemented!()
        }
    }
}
[09:57:34] मanishearth@manishearth-glaptop2 ~/sand/crates/bar O_o 
$ cargo +nightly c
    Checking bar v0.1.0 (/home/manishearth/sand/crates/bar)
error: type does not implement `Debug`; consider adding `#[derive(Debug)]` or a manual implementation
 --> src/lib.rs:5:5
  |
5 |     struct Bar;
  |     ^^^^^^^^^^^
  |
note: the lint level is defined here
 --> src/lib.rs:1:8
  |
1 | #[deny(missing_debug_implementations)]
  |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: could not compile `bar` (lib) due to previous error

Version it worked on

It most recently worked on: nightly-2023-05-06

Version with regression

rustc --version: nightly-2023-05-07

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions