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

Linter: unused_appexit #184

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

Linter: unused_appexit #184

wants to merge 17 commits into from

Conversation

BD103
Copy link
Member

@BD103 BD103 commented Nov 26, 2024

Closes #87.

This is a more generic form of main_return_without_appexit that checks if the AppExit returned from App::run() is handled at all, no matter the context. Please check out the module documentation for unused_appexit.rs for more info!

@BD103 BD103 added A-Linter Related to the linter and custom lints C-Feature Make something new possible C-Breaking-Change A breaking change of the public API labels Nov 26, 2024
@BD103 BD103 mentioned this pull request Nov 29, 2024
3 tasks
@musjj
Copy link

musjj commented Dec 5, 2024

Actually, is there a reason this is a custom lint? Why not just add a #[must_use] attribute upstream?

@BD103
Copy link
Member Author

BD103 commented Dec 5, 2024

Actually, is there a reason this is a custom lint? Why not just add a #[must_use] attribute upstream?

The reason we use a lint is because you cannot opt-out of #[must_use]. In the end, handling the AppExit isn't all that important in the grand scheme of things. That's why the lint is pedantic, and off by default. This lint is a "nice-to-have", but not a must.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Linter Related to the linter and custom lints C-Breaking-Change A breaking change of the public API C-Feature Make something new possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bevy::main_return_without_appexit is emitted when AppExit is stored in a variable
2 participants