mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 14:01:51 +00:00
20 lines
333 B
Rust
20 lines
333 B
Rust
struct A {
|
|
banana: u8,
|
|
}
|
|
|
|
impl A {
|
|
fn new(peach: u8) -> A {
|
|
A {
|
|
banana: banana //~ ERROR cannot find value `banana` in this scope
|
|
}
|
|
}
|
|
|
|
fn foo(&self, peach: u8) -> A {
|
|
A {
|
|
banana: banana //~ ERROR cannot find value `banana` in this scope
|
|
}
|
|
}
|
|
}
|
|
|
|
fn main() {}
|