-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v: remove the automatic passing of structs with more than 8 fields by reference (too complex/unpredictable, with little benefit) #17159
base: master
Are you sure you want to change the base?
Conversation
@spytheman, thank you for your willingness to change complex and old features. Let's make less unpredictable behavior. |
I"m only asking: |
Well, no, it will just pass those complicated structs on the stack. You only need to change the code if you want them to be passed as references, instead of it "magically" being done for you. |
Or, in other words, it will always be "pass by value" now, instead of sometimes pass by value, and sometimes pass by reference. If you want pass by reference, you have to manually add the |
54c263c
to
151c1df
Compare
… reference (too complex/unpredictable, with little benefit)
151c1df
to
687fe2b
Compare
Any thoughts on finishing this one? |
Can the receiver of the method have only two modes, fn (mut f Foo) and fn (f Foo), and the second can only be passing by reference mode, canceling passing by value mode? |
|
Yes, I am working on it. |
Fix #17077 .