rust/compiler/rustc_errors/src
Matthias Krüger b8b2f88a04
Rollup merge of #101100 - compiler-errors:generalize-call-suggestions, r=petrochenkov
Make call suggestions more general and more accurate

Cleans up some suggestions that have to do with adding `()` to make typeck happy.

1. Drive-by rename of `expr_t` to `base_ty` since it's the type of the `base_expr`
1. Autoderef until we get to a callable type in `suggest_fn_call`.
1. Don't erroneously suggest calling constructor when a method/field does not exist on it.
1. Suggest calling a method receiver if its function output has a method (e.g. `fn.method()` => `fn().method()`)
1. Extend call suggestions to type parameters, fn pointers, trait objects where possible
1. Suggest calling in operators too (fixes #101054)
1. Use `/* {ty} */` as argument placeholder instead of just `_`, which is confusing and makes suggestions look less like `if let` syntax.
2022-08-31 07:58:00 +02:00
..
json Use serde_json for json error messages 2022-06-03 16:46:19 +00:00
annotate_snippet_emitter_writer.rs errors: move translation logic into module 2022-08-15 12:26:35 +01:00
diagnostic.rs Code deduplication in tool_only_multipart_suggestion 2022-08-30 09:46:42 +02:00
diagnostic_builder.rs Add Handler::struct_diagnostic() 2022-08-21 09:17:43 +02:00
emitter.rs errors: move translation logic into module 2022-08-15 12:26:35 +01:00
json.rs errors: move translation logic into module 2022-08-15 12:26:35 +01:00
lib.rs Rollup merge of #101100 - compiler-errors:generalize-call-suggestions, r=petrochenkov 2022-08-31 07:58:00 +02:00
lock.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
registry.rs Remove (lots of) dead code 2021-03-27 22:16:33 -04:00
snippet.rs Compute most of Public/Exported access level in rustc_resolve 2022-01-09 21:33:14 +00:00
styled_buffer.rs Spellchecking some comments 2022-03-30 01:39:38 -04:00
translation.rs errors: move translation logic into module 2022-08-15 12:26:35 +01:00