2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2018-09-25 23:51:35 +02:00
|
|
|
#![allow(dead_code)]
|
2015-03-22 13:13:15 -07:00
|
|
|
|
2015-03-25 17:06:52 -07:00
|
|
|
struct S { f0: String, f1: isize }
|
2013-02-24 13:15:05 -08:00
|
|
|
|
|
|
|
pub fn main() {
|
2014-05-25 03:17:19 -07:00
|
|
|
let s = "Hello, world!".to_string();
|
2015-03-08 20:46:04 +01:00
|
|
|
let s = S {
|
2014-05-25 03:17:19 -07:00
|
|
|
f0: s.to_string(),
|
2014-05-12 17:56:43 -07:00
|
|
|
..S {
|
|
|
|
f0: s,
|
|
|
|
f1: 23
|
|
|
|
}
|
|
|
|
};
|
2015-03-08 20:46:04 +01:00
|
|
|
assert_eq!(s.f0, "Hello, world!");
|
2013-02-24 13:15:05 -08:00
|
|
|
}
|