rust/tests/ui/resolve/field-and-method-in-self-no...

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
385 B
Rust
Raw Normal View History

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