Skip to content

non-exhaustive patterns: ReflectMut::Function(_) not covered #237

@shanecelis

Description

@shanecelis

I've been getting these errors recently on macOS 14.7.1 x86.

   Compiling bevy-inspector-egui v0.29.1
error[E0004]: non-exhaustive patterns: `ReflectMut::Function(_)` not covered
   --> /Users/shane/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy-inspector-egui-0.29.1/src/reflect_inspector/mod.rs:254:15
    |
254 |         match value.reflect_mut() {
    |               ^^^^^^^^^^^^^^^^^^^ pattern `ReflectMut::Function(_)` not covered
    |
note: `ReflectMut<'_>` defined here
   --> /Users/shane/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_reflect-0.15.1/src/kind.rs:212:1
    |
212 | pub enum ReflectMut<'a> {
    | ^^^^^^^^^^^^^^^^^^^^^^^
...
222 |     Function(&'a mut dyn Function),
    |     -------- not covered
    = note: the matched value is of type `ReflectMut<'_>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
263 ~             ReflectMut::Set(value) => self.ui_for_set(value, ui, id, options),
264 ~             ReflectMut::Function(_) => todo!(),
    |

error[E0004]: non-exhaustive patterns: `ReflectRef::Function(_)` not covered
   --> /Users/shane/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy-inspector-egui-0.29.1/src/reflect_inspector/mod.rs:307:15
    |
307 |         match value.reflect_ref() {
    |               ^^^^^^^^^^^^^^^^^^^ pattern `ReflectRef::Function(_)` not covered
    |
note: `ReflectRef<'_>` defined here
   --> /Users/shane/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_reflect-0.15.1/src/kind.rs:177:1
    |
177 | pub enum ReflectRef<'a> {
    | ^^^^^^^^^^^^^^^^^^^^^^^
...
187 |     Function(&'a dyn Function),
    |     -------- not covered
    = note: the matched value is of type `ReflectRef<'_>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
318 ~             ReflectRef::Set(value) => self.ui_for_set_readonly(value, ui, id, options),
319 ~             ReflectRef::Function(_) => todo!(),
    |

For more information about this error, try `rustc --explain E0004`.
error: could not compile `bevy-inspector-egui` (lib) due to 2 previous errors

I patched them with some todos, but I don't what should actually go in the todos place.

diff --git a/crates/bevy-inspector-egui/src/reflect_inspector/mod.rs b/crates/bevy-inspector-egui/src/reflect_inspector/mod.rs
index d9573e0..c0f5962 100644
--- a/crates/bevy-inspector-egui/src/reflect_inspector/mod.rs
+++ b/crates/bevy-inspector-egui/src/reflect_inspector/mod.rs
@@ -261,6 +261,7 @@ impl InspectorUi<'_, '_> {
             ReflectMut::Enum(value) => self.ui_for_enum(value, ui, id, options),
             ReflectMut::Opaque(value) => self.ui_for_value(value, ui, id, options),
             ReflectMut::Set(value) => self.ui_for_set(value, ui, id, options),
+            ReflectMut::Function(_value) => todo!("Handle ReflectMut::Function"),
         }
     }
 
@@ -316,6 +317,7 @@ impl InspectorUi<'_, '_> {
             ReflectRef::Enum(value) => self.ui_for_enum_readonly(value, ui, id, options),
             ReflectRef::Opaque(value) => self.ui_for_value_readonly(value, ui, id, options),
             ReflectRef::Set(value) => self.ui_for_set_readonly(value, ui, id, options),
+            ReflectRef::Function(_value) => todo!("Handle ReflectMut::Function"),
         }
     }
 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions