-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Type-directed method resolution does not work through pointers #4270
Comments
The problem here is that, currently, method resolution does not attempt to do full trait resolution. That is, |
Not critical for 0.6; removing milestone |
cc #5527 |
Reproduced with 0252c30 . Nominating for milestone 5, production-ready. |
Reproduces with use std::io::WriterUtil;
struct NotAWriter {x: int}
impl NotAWriter {
fn write_be_u32(y: u32) {}
}
fn main() {
let x = &(NotAWriter {x: 1});
x.write_be_u32(0);
} I think this is #5898. @nikomatsakis? |
accepted for well-defined milestone |
I don't believe this is backwards incompatible. Nominating. |
Not a 1.0 issue; now P-high. Possibly linked / solvable via trait reform (#5527) |
Importing
Seems good! |
* Adds query param for version no This adds support for using a query parameter for selecting the version no * Adds error handling to configuration request Catch request exception in case fetching the configuration from the url fails, this can happen either if non existent version number is passed in or because of server issues. * Makes version selection better Covers a few common cases in which the version number can be specified.
I think that the following code should work, but it does not compile:
The error from rustc is:
I don't think there should be an error here. NotAWriter is not a Writer, it just shares a method name with WriterUtil (which is defined for all Writers).
If x is not a pointer then rustc works fine, i.e.:
The text was updated successfully, but these errors were encountered: