]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/issue-25700.rs
Rollup merge of #106499 - lyming2007:issue-105946-fix, r=estebank
[rust.git] / src / test / ui / associated-types / issue-25700.rs
1 struct S<T: 'static>(#[allow(unused_tuple_struct_fields)] 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 }