-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Implement more precise binary op return type heuristic #8457
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
r? @flodiebold |
crates/hir_ty/src/tests/traits.rs
Outdated
98..99 'g': |u64| -> i32 | ||
102..111 '|v| v + 1': |u64| -> i32 | ||
98..99 'g': |u64| -> {unknown} | ||
102..111 '|v| v + 1': |u64| -> {unknown} | ||
103..104 'v': u64 | ||
106..107 'v': u64 | ||
106..111 'v + 1': i32 | ||
106..111 'v + 1': {unknown} | ||
110..111 '1': i32 | ||
117..118 'g': |u64| -> i32 | ||
117..124 'g(1u64)': i32 | ||
117..118 'g': |u64| -> {unknown} | ||
117..124 'g(1u64)': {unknown} |
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.
This involves a general InferenceVar
which results in these not resolving anymore since we can't make assumptions for those as well as not having std's ops implementation in scope in the tests
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.
Hm. Can we add the necessary impls to the test to make this work?
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.
Oops, ye should've done that from the start. Resolves with those impls added.
r=me, though it'd also be nice to add a test for #7150. |
bors r=flodiebold |
changelog fix Don't assume wrong binary operator return type when primitives are involved |
Should fix #7150