about summary refs log tree commit diff
path: root/src/test/rustdoc-ui/coverage/json.rs
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2020-08-16 18:33:30 -0700
committerEsteban Küber <esteban@kuber.com.ar>2020-08-16 18:33:30 -0700
commitac73474c7db65e49d3fd17906b7d34d984a88172 (patch)
tree5428acdf9993ec6a7ac028624d2eaab10deb2aa9 /src/test/rustdoc-ui/coverage/json.rs
parent3df25ae186e89c885d9a71cd37fbd7a37e39fc85 (diff)
downloadrust-ac73474c7db65e49d3fd17906b7d34d984a88172.tar.gz
rust-ac73474c7db65e49d3fd17906b7d34d984a88172.zip
Add explanation for `&mut self` method call when expecting `-> Self`
When a user tries to use a method as if it returned a new value of the
same type as its receiver, we will emit a type error. Try to detect this
and provide extra explanation that the method modifies the receiver
in-place.

This has confused people in the wild, like in
https://users.rust-lang.org/t/newbie-why-the-commented-line-stops-the-snippet-from-compiling/47322
Diffstat (limited to 'src/test/rustdoc-ui/coverage/json.rs')
0 files changed, 0 insertions, 0 deletions