2019-07-26 21:54:25 +00:00
|
|
|
//@ run-pass
|
|
|
|
|
2018-09-14 10:20:28 +00:00
|
|
|
#![allow(non_camel_case_types)]
|
2015-03-22 20:13:15 +00:00
|
|
|
|
2013-02-02 03:43:17 +00:00
|
|
|
pub fn main() {
|
2013-05-03 23:25:04 +00:00
|
|
|
struct b {
|
2015-03-26 00:06:52 +00:00
|
|
|
i: isize,
|
2013-05-03 23:25:04 +00:00
|
|
|
}
|
2012-09-08 02:04:40 +00:00
|
|
|
|
2013-05-31 22:17:22 +00:00
|
|
|
impl b {
|
2015-03-26 00:06:52 +00:00
|
|
|
fn do_stuff(&self) -> isize { return 37; }
|
2013-05-03 23:25:04 +00:00
|
|
|
}
|
2012-06-19 19:00:09 +00:00
|
|
|
|
2015-03-26 00:06:52 +00:00
|
|
|
fn b(i:isize) -> b {
|
2012-09-05 22:58:43 +00:00
|
|
|
b {
|
|
|
|
i: i
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-03-26 00:06:52 +00:00
|
|
|
// fn b(x:isize) -> isize { panic!(); }
|
2012-06-19 19:00:09 +00:00
|
|
|
|
2013-05-03 23:25:04 +00:00
|
|
|
let z = b(42);
|
2013-05-19 02:02:45 +00:00
|
|
|
assert_eq!(z.i, 42);
|
|
|
|
assert_eq!(z.do_stuff(), 37);
|
2013-02-01 01:51:01 +00:00
|
|
|
}
|