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
// https://doc.rust-lang.org/error_codes/E0618.html#![allow(unused)]fnmain(){enumX{Entry,}X::Entry();// error: expected function, tuple struct or tuple variant,// found `X::Entry`// Or even simpler:let x = 0i32;x();// error: expected function, tuple struct or tuple variant, found `i32`}
I expected to see this happen:
Give error code similiar to rustc i.e. E0618,
➜ gccrs-build rustc ../mahad-testsuite/E0618.rs
error[E0618]: expected function, found enum variant `X::Entry`
--> ../mahad-testsuite/E0618.rs:8:1
|
5 | Entry,
| ----- enum variant `X::Entry` defined here
...
8 | X::Entry();// error: expected function, tuple struct or tuple variant,
| ^^^^^^^^--
| |
| call expression requires function
|
help: `X::Entry` is a unit enum variant, and does not take parentheses to be constructed
|
8 - X::Entry();// error: expected function, tuple struct or tuple variant,8 + X::Entry;// error: expected function, tuple struct or tuple variant,
|
error[E0618]:expected function, found `i32`
--> ../mahad-testsuite/E0618.rs:13:1
|
12 | let x = 0i32;
| - `x` has type `i32`
13 | x();// error: expected function, tuple struct or tuple variant, found `i32`
| ^--
| |
| call expression requires function
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0618`.
➜ gccrs-build gcc/crab1 ../mahad-testsuite/E0618.rs
../mahad-testsuite/E0618.rs:8:1: error: expected function, tuple struct or tuple variant, found struct ‘X’ [E0423]8 | X::Entry();// error: expected function, tuple struct or tuple variant,
| ^
../mahad-testsuite/E0618.rs:13:1: error:Failed to resolve expression of function call
13 | x();// error: expected function, tuple struct or tuple variant, found `i32`
| ^
Analyzing compilation unit
Time variable usr sys wall GGCTOTAL:0.000.000.00146k
Extra diagnostic checks enabled; compiler may run slowly.Configure with --enable-checking=release to disable checks.
Invalid Error Code for Attempted to call something which isn't a function nor a method. -
E0618
I tried this code from
E0618
:I expected to see this happen:
E0618
,Instead, this happened:
E0425
Originally posted by @MahadMuhammad in #2433 (comment)
The text was updated successfully, but these errors were encountered: