]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-2487-a.rs
point at private fields in struct literal
[rust.git] / src / test / ui / issues / issue-2487-a.rs
1 // build-pass
2 #![allow(dead_code)]
3 #![allow(non_camel_case_types)]
4
5 // pretty-expanded FIXME #23616
6
7 struct socket {
8     sock: isize,
9
10 }
11
12 impl Drop for socket {
13     fn drop(&mut self) {}
14 }
15
16 impl socket {
17     pub fn set_identity(&self)  {
18         closure(|| setsockopt_bytes(self.sock.clone()))
19     }
20 }
21
22 fn socket() -> socket {
23     socket {
24         sock: 1
25     }
26 }
27
28 fn closure<F>(f: F) where F: FnOnce() { f() }
29
30 fn setsockopt_bytes(_sock: isize) { }
31
32 pub fn main() {}