summary refs log tree commit diff
path: root/src/test/ui/issues/issue-25700.rs
blob: 45c452d618d84b88b81143281f17c7cca8d66a01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
struct S<T: 'static>(Option<&'static T>);

trait Tr { type Out; }
impl<T> Tr for T { type Out = T; }

impl<T: 'static> Copy for S<T> where S<T>: Tr<Out=T> {}
impl<T: 'static> Clone for S<T> where S<T>: Tr<Out=T> {
    fn clone(&self) -> Self { *self }
}
fn main() {
    let t = S::<()>(None);
    drop(t);
    drop(t); //~ ERROR use of moved value
}