]>
git.proxmox.com Git - rustc.git/blob - src/test/compile-fail/unique-vec-res.rs
1 // Copyright 2012 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.
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.
18 impl<'a
> Drop
for r
<'a
> {
21 self.i
.set(self.i
.get() + 1);
26 fn f
<T
>(__isize
: Vec
<T
> , _j
: Vec
<T
> ) {
29 fn clone
<T
: Clone
>(t
: &T
) -> T { t.clone() }
32 let i1
= &Cell
::new(0);
33 let i2
= &Cell
::new(1);
34 // FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
35 let r1
= vec
!(Box
::new(r { i: i1 }
));
36 let r2
= vec
!(Box
::new(r { i: i2 }
));
37 f(clone(&r1
), clone(&r2
));
38 //~^ ERROR the trait `core::clone::Clone` is not implemented for the type
39 //~^^ ERROR the trait `core::clone::Clone` is not implemented for the type
40 println
!("{:?}", (r2
, i1
.get()));
41 println
!("{:?}", (r1
, i2
.get()));