]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-2288.rs
Enable full revision in const generics ui tests
[rust.git] / src / test / ui / issues / issue-2288.rs
1 // run-pass
2 #![allow(non_camel_case_types)]
3
4 #![feature(box_syntax)]
5
6 trait clam<A> {
7   fn chowder(&self, y: A);
8 }
9
10 #[derive(Copy, Clone)]
11 struct foo<A> {
12   x: A,
13 }
14
15 impl<A> clam<A> for foo<A> {
16   fn chowder(&self, _y: A) {
17   }
18 }
19
20 fn foo<A>(b: A) -> foo<A> {
21     foo {
22         x: b
23     }
24 }
25
26 fn f<A>(x: Box<dyn clam<A>>, a: A) {
27   x.chowder(a);
28 }
29
30 pub fn main() {
31
32   let c = foo(42);
33   let d: Box<dyn clam<isize>> = box c as Box<dyn clam<isize>>;
34   f(d, c.x);
35 }