You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error: argument patterns are not supported by #[auto-impl]
--> tests/compile-pass/self_by_value_mut.rs:9:19
|
9 | fn foo(&self, mut data: Data) {
| ^^^^^^^^
|
= help: please use a simple name like "foo" (but not `_`)
error[E0057]: this function takes 1 argument but 0 arguments were supplied
--> tests/compile-pass/self_by_value_mut.rs:7:1
|
7 | #[auto_impl(Fn)]
| ^^^^^^^^^^^^^^^^ an argument of type `Data` is missing
|
note: associated function defined here
--> $RUST/core/src/ops/function.rs
|
| extern "rust-call" fn call(&self, args: Args) -> Self::Output;
| ^^^^
= note: this error originates in the attribute macro `auto_impl` (in Nightly builds, run with -Z macro-backtrace for more info)
help: provide the argument
|
7 | #[auto_impl(Fn)]({Data})
|
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
This is just a limitation we could work around for this style of simple pattern. In the meantime, you can write:
fnfoo(&self,data:Data){letmut data = data;
data.id += 1;}
auto_impl
should support trait methods of the formThe text was updated successfully, but these errors were encountered: