bevyengine / bevyengine/bevy

Silent failure if app.run() is left out

Open
#5,386 4 comments 0 reactions 0 assignees View on GitHub
A-App C-Bug D-Complex S-Needs-Design
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## 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 in `main()`, 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.)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.