mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-17 02:54:26 +00:00
5c3504799d
They are still present as part of the borrow check.
17 lines
288 B
Rust
17 lines
288 B
Rust
struct SpeechMaker {
|
|
speeches: uint
|
|
}
|
|
|
|
impl SpeechMaker {
|
|
pub fn how_many(&self) -> uint { self.speeches }
|
|
}
|
|
|
|
fn foo(speaker: &SpeechMaker) -> uint {
|
|
speaker.how_many() + 33
|
|
}
|
|
|
|
pub fn main() {
|
|
let lincoln = SpeechMaker {speeches: 22};
|
|
assert_eq!(foo(&lincoln), 55);
|
|
}
|