2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2018-09-25 23:51:35 +02:00
|
|
|
#![allow(unused_variables)]
|
2015-03-22 13:13:15 -07:00
|
|
|
//@ pretty-expanded FIXME #23616
|
|
|
|
|
2015-03-25 17:06:52 -07:00
|
|
|
struct X { pub x: usize }
|
2014-10-21 03:40:10 +02:00
|
|
|
impl Default for X {
|
|
|
|
fn default() -> X {
|
2015-03-03 10:42:26 +02:00
|
|
|
X { x: 42 }
|
2014-10-21 03:40:10 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Y<T> { pub y: T }
|
|
|
|
impl<T: Default> Default for Y<T> {
|
|
|
|
fn default() -> Y<T> {
|
|
|
|
Y { y: Default::default() }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let X { x: _ } = Default::default();
|
|
|
|
let Y { y: X { x } } = Default::default();
|
|
|
|
}
|