]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-25700.rs
Rollup merge of #92942 - Xaeroxe:raw_arg, r=dtolnay
[rust.git] / src / test / ui / issues / issue-25700.rs
1 struct S<T: 'static>(Option<&'static T>);
2
3 trait Tr { type Out; }
4 impl<T> Tr for T { type Out = T; }
5
6 impl<T: 'static> Copy for S<T> where S<T>: Tr<Out=T> {}
7 impl<T: 'static> Clone for S<T> where S<T>: Tr<Out=T> {
8     fn clone(&self) -> Self { *self }
9 }
10 fn main() {
11     let t = S::<()>(None);
12     drop(t);
13     drop(t); //~ ERROR use of moved value
14 }