I’m in the final stages of writing an IDL -> Rust autogenerator. The last issue I’m facing is one where the following code autogen code results in a compiler error about generics, specifically: “expected &mut _, found type parameter”. I can’t understand why the code as written won’t work. Any ideas?
OMG. It was as simple as adding an
&mut. I totally blanked on that. For some reason I interpreted the error as a type error, not a mutability error.
As Rust encodes mutability in the type system, mutability errors are type errors, in a way.