]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-14254.rs
Rollup merge of #92942 - Xaeroxe:raw_arg, r=dtolnay
[rust.git] / src / test / ui / issues / issue-14254.rs
1 // check-pass
2 // pretty-expanded FIXME #23616
3
4 trait Foo: Sized {
5     fn bar(&self);
6     fn baz(&self) { }
7     fn bah(_: Option<Self>) { }
8 }
9
10 struct BarTy {
11     x : isize,
12     y : f64,
13 }
14
15 impl BarTy {
16     fn a() {}
17     fn b(&self) {}
18 }
19
20 // If these fail, it's necessary to update rustc_resolve and the cfail tests.
21 impl Foo for *const BarTy {
22     fn bar(&self) {
23         self.baz();
24         BarTy::a();
25         Foo::bah(None::<*const BarTy>);
26     }
27 }
28
29 // If these fail, it's necessary to update rustc_resolve and the cfail tests.
30 impl<'a> Foo for &'a BarTy {
31     fn bar(&self) {
32         self.baz();
33         self.x;
34         self.y;
35         BarTy::a();
36         Foo::bah(None::<&BarTy>);
37         self.b();
38     }
39 }
40
41 // If these fail, it's necessary to update rustc_resolve and the cfail tests.
42 impl<'a> Foo for &'a mut BarTy {
43     fn bar(&self) {
44         self.baz();
45         self.x;
46         self.y;
47         BarTy::a();
48         Foo::bah(None::<&mut BarTy>);
49         self.b();
50     }
51 }
52
53 // If these fail, it's necessary to update rustc_resolve and the cfail tests.
54 impl Foo for Box<BarTy> {
55     fn bar(&self) {
56         self.baz();
57         Foo::bah(None::<Box<BarTy>>);
58     }
59 }
60
61 // If these fail, it's necessary to update rustc_resolve and the cfail tests.
62 impl Foo for *const isize {
63     fn bar(&self) {
64         self.baz();
65         Foo::bah(None::<*const isize>);
66     }
67 }
68
69 // If these fail, it's necessary to update rustc_resolve and the cfail tests.
70 impl<'a> Foo for &'a isize {
71     fn bar(&self) {
72         self.baz();
73         Foo::bah(None::<&isize>);
74     }
75 }
76
77 // If these fail, it's necessary to update rustc_resolve and the cfail tests.
78 impl<'a> Foo for &'a mut isize {
79     fn bar(&self) {
80         self.baz();
81         Foo::bah(None::<&mut isize>);
82     }
83 }
84
85 // If these fail, it's necessary to update rustc_resolve and the cfail tests.
86 impl Foo for Box<isize> {
87     fn bar(&self) {
88         self.baz();
89         Foo::bah(None::<Box<isize>>);
90     }
91 }
92
93 fn main() {}