Confusing trait bounds on MaterialPlugin
#17165
Labels
A-Rendering
Drawing game state to the screen
C-Docs
An addition or correction to our documentation
D-Straightforward
Simple bug fixes and API improvements, docs, test and examples
S-Needs-Design
This issue requires design work to think about how it would best be accomplished
Does not compile, with the error:
Uncommenting
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
fixes the error.The reason this does not work, is that
impl Plugin for MaterialPlugin
requires<M as AsBindGroup>::Data: PartialEq + Eq + Hash + Clone
however this is a pretty sneaky trait bound that is very easy to look over. I think that it should be a trait bound onMaterialPlugin
too so that when a user attempts to do this they get a much more useful error. Failing that, I think more attention should be drawn to this in the docs because currently it's very easy to assume that anyMaterialPlugin
you are allowed to construct would implementPlugin
. It's in the name after all.The text was updated successfully, but these errors were encountered: