3 #![feature(const_trait_impl)]
5 use std::marker::PhantomData;
7 struct S<T>(PhantomData<T>);
9 impl<T> Copy for S<T> {}
10 impl<T> Clone for S<T> {
11 fn clone(&self) -> Self {
16 impl<T> const std::ops::Add for S<T> {
19 fn add(self, _: Self) -> Self {
20 S(std::marker::PhantomData)
24 const fn twice<T: std::ops::Add>(arg: S<T>) -> S<T> {
29 let _ = twice(S(PhantomData::<i32>));