Closed RReverser closed 11 months ago
This was an unavoidable regression in 0.3. This release fixed a soundness problem which previously allowed us to retrieve classes by reference, however this reference could outlive the lifetime of the class, and was therefore unsound.
The bind
attribute didn't do any special code generation for different types of self
arguments. This, together with the SelfMethod
object I added to make self references somewhat working again, resulted in it no longer being possible to take self by value. Fixing that would have required a pretty big rewrite of the macros, so I opted to just fix the soundness issue and rewrite the macros in the next version.
0.4 once again allows taking self by value, reference and mutable reference with the new methods
attribute macro.
Ah ok. Can't use 0.4 yet due to unstable status + lack of docs for new macros, but good to hear it will be fixed again - closing this issue then.
Prior to 0.3, I could take structs by value where it made sense by using
quickjs(cloneable)
:With 0.3.0, this no longer compiles regardless of whether I have
cloneable
or not: