-
Notifications
You must be signed in to change notification settings - Fork 13.3k
On type mismatch error highlight &
when type matches
#46349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When the only difference between the two types in a type error is that one is a reference to the other type (`T` vs `&T`) or both are references differing only in their mutability (`&T` vs `&mut T`), don't highlight the type (`T`).
(rust_highfive has picked a reviewer for you, use r? to override) |
(&ty::TyFloat(_), &ty::TyInfer(ty::InferTy::FloatVar(_))) | | ||
(&ty::TyInfer(ty::InferTy::FloatVar(_)), &ty::TyFloat(_)) | | ||
(&ty::TyInfer(ty::InferTy::FloatVar(_)), | ||
&ty::TyInfer(ty::InferTy::FloatVar(_))) => true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to do some sort of cannonical sorting here to get rid of duplicate cases?
EDIT: By "duplicate" I mean mirrored.
I like it but maybe someone with more type-checking involvement can review? r? @nikomatsakis for dispatch |
@bors r+ |
📌 Commit 677381a has been approved by |
Umm test failure @bors r-
|
📌 Commit 02808f1 has been approved by |
On type mismatch error highlight `&` when type matches When the only difference between the two types in a type error is that one is a reference to the other type (`T` vs `&T`) or both are references differing only in their mutability (`&T` vs `&mut T`), don't highlight the type (`T`).
On type mismatch error highlight `&` when type matches When the only difference between the two types in a type error is that one is a reference to the other type (`T` vs `&T`) or both are references differing only in their mutability (`&T` vs `&mut T`), don't highlight the type (`T`).
On type mismatch error highlight `&` when type matches When the only difference between the two types in a type error is that one is a reference to the other type (`T` vs `&T`) or both are references differing only in their mutability (`&T` vs `&mut T`), don't highlight the type (`T`).
On type mismatch error highlight `&` when type matches When the only difference between the two types in a type error is that one is a reference to the other type (`T` vs `&T`) or both are references differing only in their mutability (`&T` vs `&mut T`), don't highlight the type (`T`).
On type mismatch error highlight `&` when type matches When the only difference between the two types in a type error is that one is a reference to the other type (`T` vs `&T`) or both are references differing only in their mutability (`&T` vs `&mut T`), don't highlight the type (`T`).
☀️ Test successful - status-appveyor, status-travis |
When the only difference between the two types in a type error is that
one is a reference to the other type (
T
vs&T
) or both arereferences differing only in their mutability (
&T
vs&mut T
), don'thighlight the type (
T
).