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

Deduplicate OnDisk Corpus #2827

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

BAGUVIX456
Copy link
Contributor

@BAGUVIX456 BAGUVIX456 commented Jan 11, 2025

addresses #2434

Original PR (now closed) #2802

Cargo.toml Show resolved Hide resolved
/// An input for the target
#[cfg(not(feature = "std"))]
pub trait Input: Clone + Serialize + serde::de::DeserializeOwned + Debug {
pub trait Input: Clone + Serialize + serde::de::DeserializeOwned + Debug + Hash {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't add this. We want to keep the trait bounds as minimal as possible

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic behind this is that people just need to implement Hash to their custom inputs now instead of generate_name(). The name of the testcase will then be the hash of the contents of the input, which is one of the things proposed in #2434

Copy link
Member

@tokatoka tokatoka Jan 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. but we just want to avoid any other traits bounds being added to this pub trait Input.
(unless it is really really really necessary)
what you can do is remove generate_name() from this trait
then make a public

pub fn generate_name<I: Hash>(input: I) -> String {
 // do your stuff
}

then call it from other places.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants