]>
Commit | Line | Data |
---|---|---|
1a4d82fc JJ |
1 | // Copyright 2014 The Rust Project Developers. See the COPYRIGHT |
2 | // file at the top-level directory of this distribution and at | |
3 | // http://rust-lang.org/COPYRIGHT. | |
4 | // | |
5 | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | |
6 | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | |
7 | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | |
8 | // option. This file may not be copied, modified, or distributed | |
9 | // except according to those terms. | |
10 | ||
c34b1796 AL |
11 | // pretty-expanded FIXME #23616 |
12 | ||
1a4d82fc JJ |
13 | trait Foo { |
14 | fn bar(&self); | |
15 | fn baz(&self) { } | |
16 | fn bah(_: Option<Self>) { } | |
17 | } | |
18 | ||
19 | struct BarTy { | |
c34b1796 | 20 | x : isize, |
1a4d82fc JJ |
21 | y : f64, |
22 | } | |
23 | ||
24 | impl BarTy { | |
25 | fn a() {} | |
26 | fn b(&self) {} | |
27 | } | |
28 | ||
29 | // If these fail, it's necessary to update rustc_resolve and the cfail tests. | |
30 | impl Foo for *const BarTy { | |
31 | fn bar(&self) { | |
32 | self.baz(); | |
33 | BarTy::a(); | |
34 | Foo::bah(None::<*const BarTy>); | |
35 | } | |
36 | } | |
37 | ||
38 | // If these fail, it's necessary to update rustc_resolve and the cfail tests. | |
39 | impl<'a> Foo for &'a BarTy { | |
40 | fn bar(&self) { | |
41 | self.baz(); | |
42 | self.x; | |
43 | self.y; | |
44 | BarTy::a(); | |
45 | Foo::bah(None::<&BarTy>); | |
46 | self.b(); | |
47 | } | |
48 | } | |
49 | ||
50 | // If these fail, it's necessary to update rustc_resolve and the cfail tests. | |
51 | impl<'a> Foo for &'a mut BarTy { | |
52 | fn bar(&self) { | |
53 | self.baz(); | |
54 | self.x; | |
55 | self.y; | |
56 | BarTy::a(); | |
57 | Foo::bah(None::<&mut BarTy>); | |
58 | self.b(); | |
59 | } | |
60 | } | |
61 | ||
62 | // If these fail, it's necessary to update rustc_resolve and the cfail tests. | |
63 | impl Foo for Box<BarTy> { | |
64 | fn bar(&self) { | |
65 | self.baz(); | |
66 | Foo::bah(None::<Box<BarTy>>); | |
67 | } | |
68 | } | |
69 | ||
70 | // If these fail, it's necessary to update rustc_resolve and the cfail tests. | |
c34b1796 | 71 | impl Foo for *const isize { |
1a4d82fc JJ |
72 | fn bar(&self) { |
73 | self.baz(); | |
c34b1796 | 74 | Foo::bah(None::<*const isize>); |
1a4d82fc JJ |
75 | } |
76 | } | |
77 | ||
78 | // If these fail, it's necessary to update rustc_resolve and the cfail tests. | |
c34b1796 | 79 | impl<'a> Foo for &'a isize { |
1a4d82fc JJ |
80 | fn bar(&self) { |
81 | self.baz(); | |
c34b1796 | 82 | Foo::bah(None::<&isize>); |
1a4d82fc JJ |
83 | } |
84 | } | |
85 | ||
86 | // If these fail, it's necessary to update rustc_resolve and the cfail tests. | |
c34b1796 | 87 | impl<'a> Foo for &'a mut isize { |
1a4d82fc JJ |
88 | fn bar(&self) { |
89 | self.baz(); | |
c34b1796 | 90 | Foo::bah(None::<&mut isize>); |
1a4d82fc JJ |
91 | } |
92 | } | |
93 | ||
94 | // If these fail, it's necessary to update rustc_resolve and the cfail tests. | |
c34b1796 | 95 | impl Foo for Box<isize> { |
1a4d82fc JJ |
96 | fn bar(&self) { |
97 | self.baz(); | |
c34b1796 | 98 | Foo::bah(None::<Box<isize>>); |
1a4d82fc JJ |
99 | } |
100 | } | |
101 | ||
102 | fn main() {} |