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