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

Use #[expect(…)] instead of #[allow(…)], remove unnecessary allows #2784

Open
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

riesentoaster
Copy link
Contributor

#[expect(…)] returns a lint warning (configured to be an error) if the lint warning is not present without the attribute.

This also means I was able to remove a lot of allow statements.

I suggest in the future, expect is used wherever possible. The only exceptions I've stumbled across are when they are used in a macro and only appear for some macro calls (think trivial_numeric_casts of a u64 to a type passed to the struct, and it is called for u64 among others) and if the warning only appears in certain cfgs.

@domenukk
Copy link
Member

Feel free to fix this for all build targets - but it might be a world of pain :)

@riesentoaster
Copy link
Contributor Author

I did some more, but I'll leave the rest to someone else.

@riesentoaster
Copy link
Contributor Author

Also: I cannot guarantee that I haven't broken anything. I've manually checked as much as possible and the CI found stuff as well, but I may have still missed some cfg-dependent stuff (there's a lot in there lol). On the upside, I've only touched linting-related things. So if anyone's computer starts complaining, it's easy to just re-add the warning or change it back from an expect to an allow.

Comment on lines +114 to +117

# start manager in background, then start one client
timeout 32s ./${FUZZER_NAME} --cores 0 --input ./corpus 2>/dev/null &
timeout 31s ./${FUZZER_NAME} --cores 1 --input ./corpus | tee fuzz_stdout.log 2>/dev/null || true
Copy link
Contributor Author

@riesentoaster riesentoaster Dec 20, 2024

Choose a reason for hiding this comment

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

I added this, otherwise the test doesn't pass. Doesn't either on main btw.

And a few other very small tidbits here and there. Just tidying things with as little change to the logic as possible.

@riesentoaster
Copy link
Contributor Author

Not quite sure why I did this. But it's done.

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