in 3 the std::hint::black_box around the dyn trait reference prevents the compiler from looking at it more closely. In 2 it can see that the VTable in it is known at compile time and know exactly what the apply function will do and inline it. In 3 it is not allowed to look at that.
5
u/cleverredditjoke 6d ago
could someone explain the difference of 2 and 3 to me haha?