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
As was brought up in this reddit post, Trait objects cannot call methods that take self by-value. Even worse, the error message erroneously claims the desired method does not exist.
It seems to me that trait objects of the form ~Trait should work with self-by-value methods. And trait objects of the form &Trait should produce an appropriate error message (just like calling the same method on a reference does).
…, r=Centri3
fix incorrect suggestion for `!(a >= b) as i32 == c`
fixesrust-lang#12761
The expression `!(a >= b) as i32 == c` got simplified to `a < b as i32 == c`, but this is a syntax error.
The result we want is `(a < b) as i32 == c`.
This is fixed by adding a parenthesis to the suggestion given in `check_simplify_not` when the boolean expression is casted.
changelog: [`nonminimal_bool`]: fix incorrect suggestion for `!(a >= b) as i32 == c`
As was brought up in this reddit post, Trait objects cannot call methods that take self by-value. Even worse, the error message erroneously claims the desired method does not exist.
It seems to me that trait objects of the form
~Trait
should work with self-by-value methods. And trait objects of the form&Trait
should produce an appropriate error message (just like calling the same method on a reference does).Example:
This produces:
The text was updated successfully, but these errors were encountered: