-
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
The note about missing implementation is absent for some operators #50151
Comments
Relevant code seems to be rust/src/librustc_typeck/check/op.rs Lines 284 to 298 in d5616e1
|
ishitatsuyuki
changed the title
The note about miising implementation is missing for some operators
The note about missing implementation is absent for some operators
Apr 22, 2018
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
May 10, 2018
added missing implementation hint Fixes [rust-lang#50151](rust-lang#50151). Actually, i don't know, should following code `let x = |ref x: isize| { x += 1; };` emit `note: an implementation of std::ops::AddAssign might be missing for &isize` or `note: this is a reference to a type that + can be applied to; you need to dereference this variable once for this operation to work` or both
bors
added a commit
that referenced
this issue
May 11, 2018
added missing implementation hint Fixes [#50151](#50151). Actually, i don't know, should following code `let x = |ref x: isize| { x += 1; };` emit `note: an implementation of std::ops::AddAssign might be missing for &isize` or `note: this is a reference to a type that + can be applied to; you need to dereference this variable once for this operation to work` or both
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you try to use an operator on a type that doesn't implement it, the error include an note similar to this one:
But for three operator, this note is missing:
^
,BitXor
-
,Neg
(the unary negation)!
,Not
This note is also missing for all the
*Assign
version of the operators.I've made a minimal example with the playground:
https://play.rust-lang.org/?gist=1df2a3964559faed35efb8427d9c3608&version=nightly
The text was updated successfully, but these errors were encountered: