gtk-rs / gir

Tool to generate rust bindings and user API for glib-based libraries
https://gtk-rs.org/gir/book/
MIT License
238 stars 107 forks source link

Doesn't create correct bounds for optional RefMut parameters #440

Open sdroege opened 7 years ago

sdroege commented 7 years ago

They end up Into<&'a Bla> instead of Into<&'a mut Bla>. Example here: https://github.com/sdroege/gstreamer-rs/blob/50a1535771d711b419eee499fb6b7c48d72edd86/gstreamer/src/functions.rs#L18

When generating that automatically, it ends up without the mut and also let context = context.into() instead of let mut context = context.into()

EPashkin commented 7 years ago

For me by documentation this case (and most others) just don't need mut at all as it Boxed, so just const=true for this parameter.

EPashkin commented 7 years ago

OOps, mistaken Boxed and Shared, now not fully sure for this case.

sdroege commented 7 years ago

For Boxed it should be mut, and without Option it also does that correctly already. bound_rust_type() seems to forget that information, the RefMode.