#[ allow( unused_imports ) ]
use clone_dyn::clone_dyn;

fn main()
{

  #[ cfg( any( feature = "use_std", feature = "use_alloc" ) ) ]
  {
    #[ clone_dyn ]
    trait Trait1
    {
    }

    let vec = Vec::< Box< dyn Trait1 > >::new();
    let _vec2 = vec.clone(); /* <- it does not work without `clone_dyn` */
  }

}

#[ allow( unused_imports ) ]
use clone_dyn::clone_dyn;

fn main()
{

  #[ clone_dyn ]
  trait Trait1
  {
  }

  let vec = Vec::< Box< dyn Trait1 > >::new();
  let _vec2 = vec.clone(); /* <- it does not work without `clone_dyn` */

}

--- 
+++ 
@@ -4,12 +4,15 @@
 fn main()
 {
 
-  #[ clone_dyn ]
-  trait Trait1
+  #[ cfg( any( feature = "use_std", feature = "use_alloc" ) ) ]
   {
+    #[ clone_dyn ]
+    trait Trait1
+    {
+    }
+
+    let vec = Vec::< Box< dyn Trait1 > >::new();
+    let _vec2 = vec.clone(); /* <- it does not work without `clone_dyn` */
   }
 
-  let vec = Vec::< Box< dyn Trait1 > >::new();
-  let _vec2 = vec.clone(); /* <- it does not work without `clone_dyn` */
-
 }
Fix sample `clone_dyn_trivial_sample`, add condition
