mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-22 20:47:48 +00:00
16 lines
278 B
Rust
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() {}
|