Compiler suggests invalid syntax when identfier used in format is not available #121507
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
D-incorrect
Diagnostics: A diagnostic that is giving misleading or incorrect information.
S-has-mcve
Status: A Minimal Complete and Verifiable Example has been found for this issue
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
No response
Rationale and extra context
The hint
println!("foo = {self.foo:?}")
is not a valid code. In this case I'd expect to see eitherprintln("foo = {0:?}", self.foo)
or no hint at all.Other cases
No response
Rust Version
Anything else?
No response
The text was updated successfully, but these errors were encountered: