rust/tests/ui/nested-class.rs

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

26 lines
370 B
Rust
Raw Normal View History

// run-pass
#![allow(non_camel_case_types)]
pub fn main() {
struct b {
i: isize,
}
impl b {
fn do_stuff(&self) -> isize { return 37; }
}
fn b(i:isize) -> b {
2012-09-05 22:58:43 +00:00
b {
i: i
}
}
// fn b(x:isize) -> isize { panic!(); }
let z = b(42);
assert_eq!(z.i, 42);
assert_eq!(z.do_stuff(), 37);
}