bevy/crates
Alice Cecile 033f29de74 Use never_say_never hack to work around Rust 2024 regression for fn traits (#18804)
# Objective

After #17967, closures which always panic no longer satisfy various Bevy
traits. Principally, this affects observers, systems and commands.

While this may seem pointless (systems which always panic are kind of
useless), it is distinctly annoying when using the `todo!` macro, or
when writing tests that should panic.

Fixes #18778.

## Solution

- Add failing tests to demonstrate the problem
- Add the trick from
[`never_say_never`](https://docs.rs/never-say-never/latest/never_say_never/)
to name the `!` type on stable Rust
- Write looots of docs explaining what the heck is going on and why
we've done this terrible thing

## To do

Unfortunately I couldn't figure out how to avoid conflicting impls, and
I am out of time for today, the week and uh the week after that.
Vacation! If you feel like finishing this for me, please submit PRs to
my branch and I can review and press the button for it while I'm off.

Unless you're Cart, in which case you have write permissions to my
branch!

- [ ] fix for commands
- [ ] fix for systems
- [ ] fix for observers
- [ ] revert https://github.com/bevyengine/bevy-website/pull/2092/

## Testing

I've added a compile test for these failure cases and a few adjacent
non-failing cases (with explicit return types).

---------

Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2025-04-14 22:46:29 +02:00
..
bevy_a11y Release 0.16.0-rc.4 2025-04-11 09:12:55 +02:00
bevy_animation Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00
bevy_app Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00
bevy_asset Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00
bevy_audio Release 0.16.0-rc.4 2025-04-11 09:12:55 +02:00
bevy_color Release 0.16.0-rc.4 2025-04-11 09:12:55 +02:00
bevy_core_pipeline Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00
bevy_derive Release 0.16.0-rc.4 2025-04-11 09:12:55 +02:00
bevy_dev_tools Release 0.16.0-rc.4 2025-04-11 09:12:55 +02:00
bevy_diagnostic Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00
bevy_dylib don't disable std in bevy_dylib (#18807) 2025-04-12 01:01:22 +02:00
bevy_ecs Use never_say_never hack to work around Rust 2024 regression for fn traits (#18804) 2025-04-14 22:46:29 +02:00
bevy_encase_derive Release 0.16.0-rc.4 2025-04-11 09:12:55 +02:00
bevy_gilrs Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00
bevy_gizmos Release 0.16.0-rc.4 2025-04-11 09:12:55 +02:00
bevy_gltf Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00
bevy_image Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00
bevy_input Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00
bevy_input_focus Release 0.16.0-rc.4 2025-04-11 09:12:55 +02:00
bevy_internal Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00
bevy_log Release 0.16.0-rc.4 2025-04-11 09:12:55 +02:00
bevy_macro_utils Release 0.16.0-rc.4 2025-04-11 09:12:55 +02:00
bevy_math Release 0.16.0-rc.4 2025-04-11 09:12:55 +02:00
bevy_mesh Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00
bevy_mikktspace Release 0.16.0-rc.4 2025-04-11 09:12:55 +02:00
bevy_pbr Make sure the mesh actually exists before we try to specialize. (#18836) 2025-04-14 22:45:49 +02:00
bevy_picking Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00
bevy_platform Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00
bevy_ptr Release 0.16.0-rc.4 2025-04-11 09:12:55 +02:00
bevy_reflect Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00
bevy_remote Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00
bevy_render Mark render assets as modified when removed from the asset server (#18814) 2025-04-14 22:45:49 +02:00
bevy_scene Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00
bevy_sprite Make sure the mesh actually exists before we try to specialize. (#18836) 2025-04-14 22:45:49 +02:00
bevy_state Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00
bevy_tasks Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00
bevy_text Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00
bevy_time Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00
bevy_transform Release 0.16.0-rc.4 2025-04-11 09:12:55 +02:00
bevy_ui Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00
bevy_utils Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00
bevy_window Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00
bevy_winit Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00