-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Implement numeric fallback #20189
Implement numeric fallback #20189
Conversation
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
@@ -33,7 +33,7 @@ where T : Convert<U> | |||
} | |||
|
|||
fn a() { | |||
test(22_i32, 44); //~ ERROR unable to infer | |||
test(22_i32, 44); //~ ERROR is not implemented for the type `i32` |
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.
shouldn't this be changed to something that actually tests multidispatch & ambiguous destination ?
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.
Maybe, I don't really know what that means or what the test would be though :)
CC me |
Doesn't yet converge on a fixed point, but generally works. A better algorithm will come with the implementation of default type parameter fallback. If inference fails to determine an exact integral or floating point type, it will set the type to i32 or f64, respectively. Closes #16968
@nikomatsakis there are now failures:
|
Doesn't yet converge on a fixed point, but generally works. A better algorithm will come with the implementation of default type parameter fallback. If inference fails to determine an exact integral or floating point type, it will set the type to i32 or f64, respectively. Closes #16968
Doesn't yet converge on a fixed point, but generally works. A better algorithm will come with the implementation of default type parameter fallback. If inference fails to determine an exact integral or floating point type, it will set the type to i32 or f64, respectively. Closes #16968
Doesn't yet converge on a fixed point, but generally works. A better algorithm will come with the implementation of default type parameter fallback. If inference fails to determine an exact integral or floating point type, it will set the type to i32 or f64, respectively. Closes #16968
If ok, it'd be nice to not jump the queue for backwards compatible changes like this. For example I've been trying to land the prelude stabilization for over a week now but it conflicts with just about everything. With only a week left until the alpha, we need to prioritize backwards-incompatible changes first. Thanks! |
Yes, sure. I've been manually scheduling PRs that had a priority above this one, didn't notice that that one was huge. |
(on the plus side, I've been waiting for this to land forever, because it impacts docs very heavily, so I appreciate the jump) |
Doesn't yet converge on a fixed point, but generally works. A better algorithm
will come with the implementation of default type parameter fallback.
If inference fails to determine an exact integral or floating point type, it
will set the type to i32 or f64, respectively.
Closes #16968