1
Fork 0
rust/compiler/rustc_resolve/src
Yuki Okushi 57e38dd4fb
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.
2020-10-18 04:11:11 +09:00
..
late resolve: improve "try using tuple struct" message 2020-10-15 18:01:47 +01:00
build_reduced_graph.rs use matches!() macro for simple if let conditions 2020-09-18 20:28:35 +02:00
check_unused.rs Attach TokenStream to ast::Visibility 2020-09-10 17:33:06 -04:00
def_collector.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
diagnostics.rs Rollup merge of #75209 - Hirrolot:suggest-macro-imports, r=estebank 2020-10-17 05:36:32 +09:00
imports.rs Revert "resolve: Avoid "self-confirming" import resolutions in one more case" 2020-10-02 00:58:37 +03:00
late.rs Suggest correct place to add self parameter when inside closure 2020-10-17 13:36:59 +02:00
lib.rs resolve: Do not put nonexistent crate meta into prelude 2020-10-17 14:04:49 +03:00
macros.rs Give a better error message for duplicate built-in macros 2020-09-01 08:34:17 -04:00