about summary refs log tree commit diff
path: root/compiler/rustc_mir/src/transform/coverage/debug.rs
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2020-10-18 04:11:11 +0900
committerGitHub <noreply@github.com>2020-10-18 04:11:11 +0900
commit57e38dd4fbd45483c0bb0a7569c97a7031114664 (patch)
tree15048e0a1d8d1d3c5d697df8557a36c5cb593a98 /compiler/rustc_mir/src/transform/coverage/debug.rs
parent407bba4676064e726acf006235134c849de2e328 (diff)
parente701ae376a040d9f5614cda3be6fabffe884b432 (diff)
downloadrust-57e38dd4fbd45483c0bb0a7569c97a7031114664.tar.gz
rust-57e38dd4fbd45483c0bb0a7569c97a7031114664.zip
Rollup merge of #78048 - blyxxyz:e0424-improve-self-placement, r=lcnr
Suggest correct place to add `self` parameter when inside closure

It would incorrectly suggest adding it as a parameter to the closure instead of the containing function.

[For example](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=1936bcd1e5f981573386e0cee985c3c0):
```
help: add a `self` receiver parameter to make the associated `fn` a method
  |
5 |         let _ = || self&self;
  |                        ^^^^^
```

`DiagnosticMetadata.current_function` is only used for these messages so tweaking its behavior should be ok.
Diffstat (limited to 'compiler/rustc_mir/src/transform/coverage/debug.rs')
0 files changed, 0 insertions, 0 deletions