Closed
Description
Given the following code:
struct A {
foo: u32
}
impl A {
fn func(&self) -> String {
format!("{foo}")
}
}
The current output is:
error[[E0425]](https://doc.rust-lang.org/nightly/error-index.html#E0425): cannot find value `foo` in this scope
--> src/lib.rs:7:19
|
7 | format!("{foo}")
| ^^^ help: you might have meant to use the available field: `self.foo`
For more information about this error, try `rustc --explain E0425`.
error: could not compile `playground` due to previous error
Ideally the output should look like:
Note that {self.foo}
is not accepted (yet..?) by the compiler, so we should suggest something like format!("{}", self.foo)
I guess?