rust/tests/ui/resolve/field-and-method-in-self-not-available-in-assoc-fn.rs
Esteban Küber 7d8559ac90 Add test
2023-09-23 01:59:22 +00:00

16 lines
278 B
Rust

struct Foo {
field: u32,
}
impl Foo {
fn field(&self) -> u32 {
self.field
}
fn new() -> Foo {
field; //~ ERROR cannot find value `field` in this scope
Foo { field } //~ ERROR cannot find value `field` in this scope
}
}
fn main() {}