-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Silent failure if app.run() is left out #5386
Copy link
Copy link
Open
Labels
A-AppBevy apps and pluginsBevy apps and pluginsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-ComplexQuite challenging from either a design or technical perspective. Ask for help!Quite challenging from either a design or technical perspective. Ask for help!S-Needs-DesignThis issue requires design work to think about how it would best be accomplishedThis issue requires design work to think about how it would best be accomplished
Metadata
Metadata
Assignees
Labels
A-AppBevy apps and pluginsBevy apps and pluginsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-ComplexQuite challenging from either a design or technical perspective. Ask for help!Quite challenging from either a design or technical perspective. Ask for help!S-Needs-DesignThis issue requires design work to think about how it would best be accomplishedThis issue requires design work to think about how it would best be accomplished
Bevy version
Bevy 0.7.0.
System information
Running Rust stable 1.62.0 on Windows 10.
What you did
I accidentally deleted
.run()from the end of a long chain of systems and plugins being set up inmain(), but without deleting the semicolon after (therefore producing no errors).What went wrong
The game ran, but instantly exited without problems. This is technically expected behavior, but feels extremely unintuitive that a game engine might not provide an explicit warning if you don't activate a main loop of some sort. This would prevent, say, 15 minutes of debugging with impossible results before a programmer remembers it would be quicker to check the diff from the last git commit. Hypothetically, I mean.
Suggested fix
A
#[must_use]on the functions that return what.run()uses seems like a reasonable idea. (Thanks to @BoxyUwU for the idea.)