Rollup merge of #103140 - chenyukang:yukang/fix-103112, r=estebank

Add diagnostic for calling a function with the same name with unresolved Macro

Fixes #103112
This commit is contained in:
Michael Howell 2022-10-23 14:48:15 -07:00 committed by GitHub
commit 3df030d441
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 2 deletions

View file

@ -0,0 +1,4 @@
fn main() {
std::process::abort!();
//~^ ERROR: failed to resolve
}

View file

@ -0,0 +1,15 @@
error[E0433]: failed to resolve: could not find `abort` in `process`
--> $DIR/issue-103112.rs:2:19
|
LL | std::process::abort!();
| ^^^^^ could not find `abort` in `process`
|
help: std::process::abort is not a macro, but a function, try to remove `!`
|
LL - std::process::abort!();
LL + std::process::abort();
|
error: aborting due to previous error
For more information about this error, try `rustc --explain E0433`.