]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-8783.rs
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-8783.rs
1 // run-pass
2 #![allow(unused_variables)]
3 // pretty-expanded FIXME #23616
4
5 use std::default::Default;
6
7 struct X { pub x: usize }
8 impl Default for X {
9 fn default() -> X {
10 X { x: 42 }
11 }
12 }
13
14 struct Y<T> { pub y: T }
15 impl<T: Default> Default for Y<T> {
16 fn default() -> Y<T> {
17 Y { y: Default::default() }
18 }
19 }
20
21 fn main() {
22 let X { x: _ } = Default::default();
23 let Y { y: X { x } } = Default::default();
24 }