rust/tests
Matthias Krüger f75a1954eb
Rollup merge of #127692 - veera-sivarajan:bugfix-125139, r=estebank
Suggest `impl Trait` for References to Bare Trait in Function Header

Fixes #125139

This PR suggests `impl Trait` when `&Trait` is found as a function parameter type or return type. This makes use of existing diagnostics by adding `peel_refs()` when checking for type equality.

Additionaly, it makes a few other improvements:
1. Checks if functions inside impl blocks have bare trait in their headers.
2. Introduces a trait `NextLifetimeParamName` similar to the existing `NextTypeParamName` for suggesting a lifetime name. Also, abstracts out the common logic between the two trait impls.

### Related Issues
I ran into a bunch of related diagnostic issues but couldn't fix them within the scope of this PR. So, I have created the following issues:
1. [Misleading Suggestion when Returning a Reference to a Bare Trait from a Function](https://github.com/rust-lang/rust/issues/127689)
2. [Verbose Error When a Function Takes a Bare Trait as Parameter](https://github.com/rust-lang/rust/issues/127690)
3. [Incorrect Suggestion when Returning a Bare Trait from a Function](https://github.com/rust-lang/rust/issues/127691)

r​? ```@estebank``` since you implemented  #119148
2024-09-03 19:13:23 +02:00
..
assembly Revert "Auto merge of #127537 - veluca93:struct_tf, r=BoxyUwU" 2024-09-01 16:35:53 +02:00
auxiliary
codegen Rollup merge of #129316 - dingxiangfei2009:riscv64-imac-scs, r=nnethercote 2024-08-29 16:21:47 +02:00
codegen-units
coverage
coverage-run-rustdoc
crashes Rollup merge of #129780 - cyrgani:master, r=compiler-errors 2024-09-01 03:58:05 +02:00
debuginfo Make option-like-enum.rs UB-free and portable 2024-08-27 19:12:14 -04:00
incremental Rollup merge of #127279 - bvanjoi:fix-112680, r=petrochenkov 2024-08-21 19:35:10 +02:00
mir-opt Rollup merge of #129493 - cjgillot:early-opaque-def, r=petrochenkov 2024-09-01 03:58:04 +02:00
pretty
run-make Rollup merge of #129837 - aDotInTheVoid:test-better-json, r=jieyouxu 2024-09-02 04:19:30 +02:00
run-pass-valgrind
rustdoc Rollup merge of #129560 - GuillaumeGomez:impl-assoc-type-source-link, r=notriddle 2024-08-27 00:42:01 +02:00
rustdoc-gui Rollup merge of #127474 - tesuji:foldable-inline-derefs, r=t-rustdoc 2024-09-02 04:19:27 +02:00
rustdoc-js
rustdoc-js-std rustdoc: show exact case-sensitive matches first 2024-08-23 13:05:24 -04:00
rustdoc-json Rollup merge of #129123 - aDotInTheVoid:rustdoc-json-self, r=fmease 2024-08-31 10:08:52 +02:00
rustdoc-ui
ui Rollup merge of #127692 - veera-sivarajan:bugfix-125139, r=estebank 2024-09-03 19:13:23 +02:00
ui-fulldeps Deny imports of rustc_type_ir::inherent outside of type ir + new trait solver 2024-09-01 12:16:18 -04:00
COMPILER_TESTS.md