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
structWelp<T>(pubT);traitBleh{fnfoo(Welp(i):Welp<int>){}// ^ expected `` but found `(`fnbar(&&&x:&&&int){}// ^~ expected `,` but found `&&`fnbaz(():()){}// ^ expected `,` but found `:`}
Edit: Rereading the parser code, it looks like currently the only valid patterns in trait method parameter position are a single identifier optionally prefixed with &, && or mut, and rereading the manual, the bit I quoted is in the description of functions, not trait methods, so I guess I don't have a real case here. ;)
The text was updated successfully, but these errors were encountered:
I'd expect these method declarations to work:
The manual says "As with let bindings, function arguments are irrefutable patterns, so any pattern that is valid in a let binding is also valid as an argument." Yet these aren't, and it seems like it would require a ton of lookahead given that newtype struct constructors can be named with arbitrarily long paths and you can have lots of
&
s prefixed, or deeply nested tuples, ...Edit: Rereading the parser code, it looks like currently the only valid patterns in trait method parameter position are a single identifier optionally prefixed with
&
,&&
ormut
, and rereading the manual, the bit I quoted is in the description of functions, not trait methods, so I guess I don't have a real case here. ;)The text was updated successfully, but these errors were encountered: