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
Confusing error message: dereference of &-pointer #17561
Comments
|
I don't know how this one will be handled but I wanted to say that, in the case we discussed, it was even more complicated: In the error message, (parenthesizes could do also, I think) |
let mut foo: T;
func(&foo);
Eventually I've figured out that
|
|
I have a change related to this. For the original test case, do you think this is an improvement? |
|
@sanxiyn and I were discussing this on IRC and both of us have seen a lot of people tripped up by it, possibly even the most common beginner mistake in Rust. |
This is caught in borrowck now, but catching in typeck is faster and improves diagnostics. CC rust-lang#17561. r? @nikomatsakis
|
With #21424 merged, this is the error: Seems good! |
This code:
Gives this error message:
This error is correct, but is really complicated. First of all,
&pointershould probably use 'reference,' the term we've settled on for&T. More importantly, it's just a very dense sentence. This came up in IRC this morning.The text was updated successfully, but these errors were encountered: