]> git.proxmox.com Git - rustc.git/blame - src/librustc_error_codes/error_codes/E0618.md
New upstream version 1.42.0+dfsg0+pve1
[rustc.git] / src / librustc_error_codes / error_codes / E0618.md
CommitLineData
d9bb1a4e
FG
1Attempted to call something which isn't a function nor a method.
2
3Erroneous code examples:
4
5```compile_fail,E0618
6enum X {
7 Entry,
8}
9
10X::Entry(); // error: expected function, tuple struct or tuple variant,
11 // found `X::Entry`
12
13// Or even simpler:
14let x = 0i32;
15x(); // error: expected function, tuple struct or tuple variant, found `i32`
16```
17
18Only functions and methods can be called using `()`. Example:
19
20```
21// We declare a function:
22fn i_am_a_function() {}
23
24// And we call it:
25i_am_a_function();
26```