Closed
Description
Given the following code (playground):
fn main() {
std::process::abort!();
}
The current output is:
error[E0433]: failed to resolve: could not find `abort` in `process`
--> src/main.rs:2:19
|
2 | std::process::abort!();
| ^^^^^ could not find `abort` in `process`
For more information about this error, try `rustc --explain E0433`.
Ideally the output should include:
std::process::abort is not a macro
help: remove `!` to call the function
Motivation
Note that the opposite mistake, trying to use a macro without the !
:
fn main() {
println("Hello")
}
gives:
error[E0423]: expected function, found macro `println`
--> src/main.rs:2:5
|
2 | println("Hello")
| ^^^^^^^ not a function
|
help: use `!` to invoke the macro
|
2 | println!("Hello")
| +
For more information about this error, try `rustc --explain E0423`.
Related issues
This would complement #102601 (suggesting alternative paths when a macro isn't found)