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

bevy_utils::default abbreviation lacks warning #8879

Open
Leonss23 opened this issue Jun 18, 2023 · 4 comments
Open

bevy_utils::default abbreviation lacks warning #8879

Leonss23 opened this issue Jun 18, 2023 · 4 comments
Labels
A-Utils Utility functions and types C-Bug An unexpected or incorrect behavior S-Blocked This cannot more forward until something else changes

Comments

@Leonss23
Copy link

Bevy version

0.10.1

What you did

struct SomeStruct;
impl Default for SomeStruct {
    fn default() -> Self {
        Self {
            // ...fields,
            ..default()
        }
    }
}

What went wrong

The previous code overflows the stack without warning.

Additional information

If ..Default::default() is used instead of ..default(), the function gives a warning function cannot return without recursing.

@Leonss23 Leonss23 added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jun 18, 2023
@alice-i-cecile alice-i-cecile added A-Utils Utility functions and types and removed S-Needs-Triage This issue needs to be labelled labels Jun 19, 2023
@alice-i-cecile
Copy link
Member

Hmm, I wonder if this is something we can fix ourselves. I suspect that this is ultimately blocked on changes upstream in rustc to how these warnings are generated.

@alice-i-cecile alice-i-cecile added the S-Blocked This cannot more forward until something else changes label Jun 19, 2023
@alice-i-cecile
Copy link
Member

Still very useful to have this issue: it'll show up in the search results!

@mockersf
Copy link
Member

@harudagondi
Copy link
Member

This is known as a Rust issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Utils Utility functions and types C-Bug An unexpected or incorrect behavior S-Blocked This cannot more forward until something else changes
Projects
None yet
Development

No branches or pull requests

4 participants