-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-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!P-Compile-FailureA failure to compile Bevy appsA failure to compile Bevy appsS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!
Milestone
Description
Bevy version
[Optional] Relevant system information
Rust 1.86.0, 2024 edition.
What you did
fn test() {
let mut app = App::new();
app.add_observer(|_: Trigger<TestEvent>| {
panic!();
});
}
#[derive(Event)]
struct TestEvent;
What went wrong
The code no longer compiles, though it worked in Bevy 0.15.0 (which used the 2021 edition).
It also compiles when I explicitly specify the return type ()
:
fn test() {
let mut app = App::new();
app.add_observer(|_: Trigger<TestEvent>| -> () {
panic!();
});
}
#[derive(Event)]
struct TestEvent;
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-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!P-Compile-FailureA failure to compile Bevy appsA failure to compile Bevy appsS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!