diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2020-08-16 18:33:30 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2020-08-16 18:33:30 -0700 |
| commit | ac73474c7db65e49d3fd17906b7d34d984a88172 (patch) | |
| tree | 5428acdf9993ec6a7ac028624d2eaab10deb2aa9 /src/test/rustdoc-ui/coverage/json.rs | |
| parent | 3df25ae186e89c885d9a71cd37fbd7a37e39fc85 (diff) | |
| download | rust-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
