2025-05-18 15:53:03 +08:00
|
|
|
struct Foo {
|
|
|
|
|
x: i32
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl Foo {
|
|
|
|
|
fn foo(&self) {
|
|
|
|
|
let _ = format!("{x}"); //~ ERROR cannot find value `x` in this scope [E0425]
|
|
|
|
|
let _ = format!("{x }"); //~ ERROR cannot find value `x` in this scope [E0425]
|
|
|
|
|
let _ = format!("{ x}"); //~ ERROR invalid format string: expected `}`, found `x`
|
|
|
|
|
let _ = format!("{}", x); //~ ERROR cannot find value `x` in this scope [E0425]
|
2025-05-20 14:10:17 +08:00
|
|
|
println!("{x}"); //~ ERROR cannot find value `x` in this scope [E0425]
|
2025-05-18 15:53:03 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main(){}
|