Skip to content

fix clippy::default_constructed_unit_structs and trybuild errors#9144

Merged
cart merged 3 commits intobevyengine:mainfrom
tguichaoua:lint/fix_default_constructed_unit_structs
Jul 13, 2023
Merged

fix clippy::default_constructed_unit_structs and trybuild errors#9144
cart merged 3 commits intobevyengine:mainfrom
tguichaoua:lint/fix_default_constructed_unit_structs

Conversation

@tguichaoua
Copy link
Copy Markdown
Contributor

@tguichaoua tguichaoua commented Jul 13, 2023

Objective

With Rust 1.71.0 (released a few minutes ago), clippy introduced a new lint (default_constructed_unit_structs) wich prevent calling default() on unit structs (e.g. PhantomData::default()).

Solution

Apply the lint suggestion.

@mockersf
Copy link
Copy Markdown
Member

could you also fix the check-compiles job? it seems there has been a small change in one of the error message we test

@mockersf mockersf added the C-Code-Quality A section of code that is hard to understand or change label Jul 13, 2023
@tguichaoua
Copy link
Copy Markdown
Contributor Author

could you also fix the check-compiles job? it seems there has been a small change in one of the error message we test

I'm not available for the next hours. It would be faster to do it in another PR.

@cart cart changed the title fix clippy::default_constructed_unit_structs fix clippy::default_constructed_unit_structs and trybuild errors Jul 13, 2023
@cart cart enabled auto-merge July 13, 2023 21:20
@cart cart added this pull request to the merge queue Jul 13, 2023
Merged via the queue into bevyengine:main with commit 30d897a Jul 13, 2023
@tguichaoua tguichaoua deleted the lint/fix_default_constructed_unit_structs branch July 13, 2023 22:52
salixsalicaceae pushed a commit to fslabs/bevy that referenced this pull request Mar 26, 2026
…evyengine#9144)

# Objective

With Rust `1.71.0` ([released a few minutes
ago](https://github.com/rust-lang/rust/releases/tag/1.71.0)), clippy
introduced a new lint
([`default_constructed_unit_structs`](https://rust-lang.github.io/rust-clippy/master/index.html#/default_constructed_unit_structs))
wich prevent calling `default()` on unit structs (e.g.
`PhantomData::default()`).

## Solution

Apply the lint suggestion.

---------

Co-authored-by: Carter Anderson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-Code-Quality A section of code that is hard to understand or change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants