3 #![feature(const_trait_impl)]
4 #![feature(const_fn_trait_bound)]
6 use std::marker::PhantomData;
8 struct S<T>(PhantomData<T>);
10 impl<T> Copy for S<T> {}
11 impl<T> Clone for S<T> {
12 fn clone(&self) -> Self {
17 impl<T> const std::ops::Add for S<T> {
20 fn add(self, _: Self) -> Self {
21 S(std::marker::PhantomData)
25 const fn twice<T: std::ops::Add>(arg: S<T>) -> S<T> {
30 let _ = twice(S(PhantomData::<i32>));