Closed
Description
We already translate from C-style formatting strings to Rust formatting strings when passed to the format!
family of macros. We should also detect invalid fn
calls from other languages that were meant to be macro calls:
fn main() {
let x = 4;
printf("%d", x);
}
currently emits the dry
error[E0425]: cannot find function `printf` in this scope
--> <source>:3:5
|
3 | printf("%d", x);
| ^^^^^^ not found in this scope
while it could be
error[E0425]: cannot find function `printf` in this scope
--> <source>:3:5
|
3 | printf("%d", x);
| ^^^^^^ not found in this scope
help: you might have meant to use the `print!` macro
--> <source>:3:5
|
3 | print!("{}", x);
| ~~~~~~ ~~
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: Suggestions generated by the compiler applied by `cargo fix`Diagnostics: An error or lint that doesn't give enough information about the problem at hand.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Low priorityRelevant to the compiler team, which will review and decide on the PR/issue.