2023-09-22 20:59:22 -05:00
|
|
|
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
|
|
|
|
}
|
2023-09-22 23:45:17 -05:00
|
|
|
fn clone(&self) -> Foo {
|
|
|
|
Foo { field } //~ ERROR cannot find value `field` in this scope
|
|
|
|
}
|
2023-09-22 20:59:22 -05:00
|
|
|
}
|
|
|
|
fn main() {}
|