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
Yes, it's already the case with opt-level=1 as stated in the drawbacks.
It would only be interesting in term of performance for debug builds.
But I feel like the most interesting benefit is to have a unique way to compare variables with references across the code base.
What it does
There are two possibilities for comparing a variable and a reference
either making a reference to the variable
&variable == reference
or dereferencing the reference
variable == *reference
Since dereferencing generates better assembly it should be recommended instead of its counterpart
Here is the assembly I get with the compiler explorer with the following source code
Lint Name
unnecessary_reference_in_comparison
Category
perf
Advantage
Drawbacks
Example
Could be written as:
The text was updated successfully, but these errors were encountered: