-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
mismatched types when dereferencing T where T : Deref #20502
Comments
That error seems fine to me. The impl where |
Afaict it is not complaining about the addition, but the deference into the integer. let a : uint = *self.var;
let a : uint = self.var.deref(); you get the same result. |
Right. There's no constraint on what type let x = DerefExample { value: "foobar" };
let y = MyStruct::<DerefExample<&'static str>> { var: x };
y.dosomething(); |
I see your point. In addition, the error that I was seeing that caused me to try to repo seems to have gone away. So I'm going to go ahead and close this. |
When deref'ing values which impl Deref from other trait impls, I get this mismatch:
The basic trait implementation and test case works, such as what is in the example for std::ops::Deref.
The (not so small) reproduction is here:
The text was updated successfully, but these errors were encountered: