Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable coverage for derived traits #222

Closed
zbraniecki opened this issue Oct 1, 2022 · 2 comments
Closed

Disable coverage for derived traits #222

zbraniecki opened this issue Oct 1, 2022 · 2 comments
Labels
C-question Category: A question C-upstream-bug Category: This is a bug of compiler or dependencies (the fix may require action in the upstream)

Comments

@zbraniecki
Copy link

In a library I work on, we add Derive traits on public structs so that our clients can use them, we fairly often don't need them in our internal work, and we don't want to keep adding tests just to verify that default trait works.

The result is that a lot of our coverage for code like this:

#[derive(Debug, PartialEq, Eq, Clone, Hash, PartialOrd, Ord, Copy)]
#[non_exhaustive]
pub enum ExtensionType {
    /// Transform Extension Type marked as `t`.
    Transform,
    /// Unicode Extension Type marked as `u`.
    Unicode,
    /// Private Extension Type marked as `x`.
    Private,
    /// All other extension types.
    Other(u8),
}

gets flagged with:

Unexecuted instantiation: <icu_locid::extensions::ExtensionType as core::fmt::Debug>::fmt
Unexecuted instantiation: <icu_locid::extensions::ExtensionType as core::fmt::Debug>::fmt
Unexecuted instantiation: <icu_locid::extensions::ExtensionType as core::cmp::PartialEq>::eq
Unexecuted instantiation: <icu_locid::extensions::ExtensionType as core::cmp::PartialEq>::eq
Unexecuted instantiation: <icu_locid::extensions::ExtensionType as core::clone::Clone>::clone
Unexecuted instantiation: <icu_locid::extensions::ExtensionType as core::clone::Clone>::clone
Unexecuted instantiation: <icu_locid::extensions::ExtensionType as core::hash::Hash>::hash::<>
Unexecuted instantiation: <icu_locid::extensions::ExtensionType as core::hash::Hash>::hash::<
>
Unexecuted instantiation: <icu_locid::extensions::ExtensionType as core::cmp::PartialOrd>::partial_cmp
Unexecuted instantiation: <icu_locid::extensions::ExtensionType as core::cmp::PartialOrd>::partial_cmp
Unexecuted instantiation: <icu_locid::extensions::ExtensionType as core::cmp::Ord>::cmp
Unexecuted instantiation: <icu_locid::extensions::ExtensionType as core::cmp::Ord>::cmp

which makes the coverage noisy and less useful to notice actual coverage gaps.

How can we disable coverage for default derived traits?

@taiki-e
Copy link
Owner

taiki-e commented Oct 2, 2022

This is the upstream issue: see rust-lang/rust#84605 (comment) and subsequent 3 comments.

@taiki-e taiki-e closed this as completed Oct 2, 2022
@taiki-e taiki-e added C-question Category: A question C-upstream-bug Category: This is a bug of compiler or dependencies (the fix may require action in the upstream) labels Oct 2, 2022
@taiki-e
Copy link
Owner

taiki-e commented Jan 21, 2024

This will be fixed in rust-lang/rust#120185.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-question Category: A question C-upstream-bug Category: This is a bug of compiler or dependencies (the fix may require action in the upstream)
Projects
None yet
Development

No branches or pull requests

2 participants