-
Notifications
You must be signed in to change notification settings - Fork 13.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
First-class function can't call itself #7036
Comments
Found out you can use an
|
@thinkpad20 Hi, I know you solved your problem, but I would like to explain why the first code didn't work. Apologies if you already figured this out, but maybe it'll help somebody else that stumbles across this issue. For a start fn main() {
let foo = |x:int| x*x; // This creates a closure assigned to foo
let foo = |x,y| {
foo(x) + foo(y) // Which foo gets called?
}
} You can use Again, apologies if you already worked this out but it doesn't hurt to have another explanation floating around. |
consider mutability on useless_vec suggestions fixes rust-lang#7035 changelog: Now the suggested by `useless_vec` considers mutability to suggest either `&[]`, as before, or `&mut []` if the used reference is mutable.
I'm not sure if this is an issue, but it sure seems to be. The following code:
Produces the following error on compilation:
Why is the function not aware of its own name?
The text was updated successfully, but these errors were encountered: