1 // run-rustfix 2 3 pub trait Foo { zero(self) -> Self4 fn zero(self) -> Self; 5 } 6 7 impl Foo for u32 { zero(self) -> u328 fn zero(self) -> u32 { 0u32 } 9 } 10 11 pub mod bar { 12 pub use Foo; bar<T: Foo>(x: T) -> T13 pub fn bar<T: Foo>(x: T) -> T { 14 x.zero() 15 } 16 } 17 18 mod baz { 19 use bar; 20 use Foo; baz<T: Foo>(x: T) -> T21 pub fn baz<T: Foo>(x: T) -> T { 22 if 0 == 1 { 23 bar::bar(x.zero()) 24 } else { 25 x.zero() 26 }; 27 x.zero() 28 //~^ ERROR use of moved value 29 } 30 } 31 main()32fn main() { 33 let _ = baz::baz(0u32); 34 } 35