rust/compiler
Robin Schroer a3cf3822d2
Emit a hint for bad call return types due to generic arguments
When the return type of a function call depends on the type of an
argument, e.g.

```
fn foo<T>(x: T) -> T {
    x
}
```

and the expected type is set due to either an explicitly typed
binding, or because the call to the function is in a tail position
without semicolon, the current error implies that the argument in the
call has the wrong type.

This new hint highlights that the expected type doesn't match the
returned type, which matches the argument type, and that that's why
we're flagging the argument type.

Fixes #43608.
2023-01-13 13:34:55 +09:00
..
rustc
rustc_abi Auto merge of #105446 - erikdesjardins:vt-size, r=nikic 2022-12-18 22:01:39 +00:00
rustc_apfloat compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_arena compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_ast Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
rustc_ast_lowering Change src/test to tests in source files, fix tidy and tests 2023-01-11 09:32:13 +00:00
rustc_ast_passes Allow impl ~const Trait opaque types 2022-12-15 11:26:15 +00:00
rustc_ast_pretty Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
rustc_attr Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
rustc_baked_icu_data Update crate documentation of rustc_baked_icu_data crate 2022-11-18 14:46:36 -08:00
rustc_borrowck Change src/test to tests in source files, fix tidy and tests 2023-01-11 09:32:13 +00:00
rustc_builtin_macros Update format.rs 2023-01-02 15:51:54 +05:30
rustc_codegen_cranelift Change src/test to tests in source files, fix tidy and tests 2023-01-11 09:32:13 +00:00
rustc_codegen_gcc Change src/test to tests in source files, fix tidy and tests 2023-01-11 09:32:13 +00:00
rustc_codegen_llvm Rollup merge of #104543 - JhonnyBillM:migrate-codegen-ssa-to-diagnostics-structs-pt3, r=davidtwco 2023-01-07 20:43:19 +01:00
rustc_codegen_ssa Fix some typos in code comments. 2023-01-11 16:46:14 +01:00
rustc_const_eval Rollup merge of #106648 - Nilstrieb:poly-cleanup, r=compiler-errors 2023-01-11 17:30:55 +01:00
rustc_data_structures Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
rustc_driver Collect backtraces for delayed span-bugs too 2023-01-09 22:04:00 +00:00
rustc_error_codes remove E0280 and ICE instead 2023-01-10 03:04:28 +01:00
rustc_error_messages Rollup merge of #106622 - estebank:issue-68972, r=davidtwco 2023-01-11 21:08:07 +01:00
rustc_errors Rollup merge of #106427 - mejrs:translation_errors, r=davidtwco 2023-01-11 17:30:54 +01:00
rustc_expand Shrink ParseResult in the hot path. 2023-01-05 20:42:26 +01:00
rustc_feature [RFC 2397] Initial implementation 2023-01-09 20:51:01 -03:00
rustc_fs_util Remove useless borrows and derefs 2022-12-01 17:34:43 +00:00
rustc_graphviz Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
rustc_hir fix typo LocalItemId -> ItemLocalId 2023-01-11 15:45:52 +03:00
rustc_hir_analysis Change src/test to tests in source files, fix tidy and tests 2023-01-11 09:32:13 +00:00
rustc_hir_pretty Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
rustc_hir_typeck Emit a hint for bad call return types due to generic arguments 2023-01-13 13:34:55 +09:00
rustc_incremental rustc: Remove needless lifetimes 2022-12-20 22:10:40 +01:00
rustc_index Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
rustc_infer Change src/test to tests in source files, fix tidy and tests 2023-01-11 09:32:13 +00:00
rustc_interface Change type of box_noalias to bool 2023-01-10 10:14:59 +01:00
rustc_lexer Recover fn keyword as Fn trait in bounds 2022-12-27 06:14:46 +00:00
rustc_lint Auto merge of #105919 - uweigand:s390x-stack-overflow, r=Nilstrieb 2023-01-11 08:50:38 +00:00
rustc_lint_defs create helper function for rustc_lint_defs::Level and remove it's duplicated code r=ozkanonur 2023-01-10 10:56:17 +03:00
rustc_llvm Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
rustc_log Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
rustc_macros Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
rustc_metadata Use newtype for unused generic parameters 2023-01-09 19:10:00 +01:00
rustc_middle Rollup merge of #106648 - Nilstrieb:poly-cleanup, r=compiler-errors 2023-01-11 17:30:55 +01:00
rustc_mir_build Detect out of bounds range pattern value 2023-01-11 16:50:55 +00:00
rustc_mir_dataflow Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
rustc_mir_transform Change src/test to tests in source files, fix tidy and tests 2023-01-11 09:32:13 +00:00
rustc_monomorphize Delete unused polymorphization code 2023-01-09 19:10:00 +01:00
rustc_parse Detect struct literal needing parentheses 2023-01-11 16:53:21 +00:00
rustc_parse_format Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
rustc_passes Rename Rptr to Ref in AST and HIR 2022-12-28 18:52:36 +01:00
rustc_plugin_impl
rustc_privacy Change src/test to tests in source files, fix tidy and tests 2023-01-11 09:32:13 +00:00
rustc_query_impl Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
rustc_query_system Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
rustc_resolve Change src/test to tests in source files, fix tidy and tests 2023-01-11 09:32:13 +00:00
rustc_save_analysis rename get_parent_node to parent_id 2023-01-04 00:43:13 +00:00
rustc_serialize compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_session Rollup merge of #106709 - khuey:disable_split_dwarf_inlining_by_default, r=davidtwco 2023-01-11 17:30:56 +01:00
rustc_smir
rustc_span [RFC 2397] Initial implementation 2023-01-09 20:51:01 -03:00
rustc_symbol_mangling Add type flags support for Ty and Const late-bound regions 2023-01-08 03:37:20 +00:00
rustc_target Rollup merge of #106636 - djkoloski:accept_old_fuchsia_triple, r=tmandry 2023-01-10 08:05:35 +09:00
rustc_trait_selection Rollup merge of #106705 - compiler-errors:new-solver-err-properly, r=lcnr 2023-01-11 21:08:09 +01:00
rustc_traits Rollup merge of #106204 - compiler-errors:no-take-opaques-in-compare, r=oli-obk 2023-01-10 08:05:34 +09:00
rustc_transmute Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
rustc_ty_utils Change src/test to tests in source files, fix tidy and tests 2023-01-11 09:32:13 +00:00
rustc_type_ir Add type flags support for Ty and Const late-bound regions 2023-01-08 03:37:20 +00:00