You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
traitA{fnk(&self,x:i32) -> i32;}pubstructO{}pubstructP{}implAforO{#[inline(never)]fnk(&self,x:i32) -> i32{
x
}}pubstructM{}implAforM{#[inline(never)]fnk(&self,x:i32) -> i32{
x
}}pubstructN{}implAforN{#[inline(never)]fnk(&self,x:i32) -> i32{
x
}}pubstructQ{}implAforQ{#[inline(never)]fnk(&self,x:i32) -> i32{
x
}}implAforP{#[inline(never)]fnk(&self,x:i32) -> i32{
x
}}pubenumR{P(P),O(O),M(M),N(N),Q(Q),}implR{pubfnk(&self,x:i32) -> i32{matchself{&R::P(ref p) => p.k(x),&R::O(ref o) => o.k(x),&R::M(ref o) => o.k(x),&R::N(ref o) => o.k(x),&R::Q(ref o) => o.k(x),}}}
compiles to:
<example::O as example::A>::k:pushrbpmovrbp,rspmoveax,esipoprbpret<example::M as example::A>::k:pushrbpmovrbp,rspmoveax,esipoprbpret<example::N as example::A>::k:pushrbpmovrbp,rspmoveax,esipoprbpret<example::Q as example::A>::k:pushrbpmovrbp,rspmoveax,esipoprbpret<example::P as example::A>::k:pushrbpmovrbp,rspmoveax,esipoprbpretexample::R::k:pushrbpmovrbp,rspmovzxeax, byte ptr [rdi]movecx,eaxshlcl,5sarcl,5 js .LBB5_6learcx,[rip+ .LJTI5_0]movsxdrax, dword ptr [rcx+4*rax]addrax,rcxjmprax.LBB5_2:poprbpjmp <example::P as example::A>::k@PLT.LBB5_6:poprbpjmp <example::Q as example::A>::k@PLT.LBB5_3:poprbpjmp <example::O as example::A>::k@PLT.LBB5_4:poprbpjmp <example::M as example::A>::k@PLT.LBB5_5:poprbpjmp <example::N as example::A>::k@PLT.LJTI5_0: .long .LBB5_2-.LJTI5_0 .long .LBB5_3-.LJTI5_0 .long .LBB5_4-.LJTI5_0 .long .LBB5_5-.LJTI5_0
compiles to:
Notice this set of instructions:
It seems like these could be dropped.
The corresponding llvm ir is here:
The text was updated successfully, but these errors were encountered: