mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 06:22:00 +00:00
19 lines
269 B
Rust
19 lines
269 B
Rust
struct Obj {
|
|
member: usize
|
|
}
|
|
|
|
impl Obj {
|
|
pub fn boom() -> bool {
|
|
return 1+1 == 2
|
|
}
|
|
pub fn chirp(&self) {
|
|
self.boom(); //~ ERROR no method named `boom` found
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
let o = Obj { member: 0 };
|
|
o.chirp();
|
|
1 + 1;
|
|
}
|