Skip to content

Mute unreachable patterns/code warnings#16012

Merged
alice-i-cecile merged 1 commit intobevyengine:mainfrom
stepancheg:unreachable
Oct 20, 2024
Merged

Mute unreachable patterns/code warnings#16012
alice-i-cecile merged 1 commit intobevyengine:mainfrom
stepancheg:unreachable

Conversation

@stepancheg
Copy link
Copy Markdown
Contributor

Objective

Make compiler output more helpful when running cargo check -p bevy_mesh. Currently it contains a lot of unreachable patterns/code warnings due to features disabled by default.

Solution

Mute the warnings.

Testing

CI

@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen C-Code-Quality A section of code that is hard to understand or change S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Oct 19, 2024
Copy link
Copy Markdown
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

Can you swap these for an expect statement with a reason? These have recently landed and they're a bit easier to maintain :)

@alice-i-cecile alice-i-cecile added D-Trivial Nice and easy! A great choice to get started with Bevy S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Oct 20, 2024
When all image features are disabled, do not emit warnings.

Warnings pop up when running

```
cargo check -p bevy_mesh
```
@stepancheg
Copy link
Copy Markdown
Contributor Author

@alice-i-cecile if you mean #[expect], it cannot be used here, because code is reachable when some features are enabled.

(Updated the PR to remove a couple incorrect/unnecessary allows).

@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Oct 20, 2024
Copy link
Copy Markdown
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

Ah, that makes sense. Thanks!

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Oct 20, 2024
Merged via the queue into bevyengine:main with commit 34c9a64 Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen C-Code-Quality A section of code that is hard to understand or change D-Trivial Nice and easy! A great choice to get started with Bevy S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants