rust/tests
Matthias Krüger bc0dfaa048
Rollup merge of #144801 - estebank:issue-144734, r=spastorino
Suggest bounds in more cases, accounting for type parameters referenced in predicate

Use a `ty::Visitor` to see if the failed predicate references a type parameter. If it does, then we only suggest adding a bound to an (associated) item only if the referenced parameter is present in its generics.

Provide adding bound suggestion in trait and impl associated functions in cases we previously weren't:

```
error[E0277]: `?` couldn't convert the error to `ApplicationError`
  --> $DIR/suggest-complex-bound-on-method.rs:18:16
   |
LL |         t.run()?;
   |           -----^ the trait `From<<T as Trait>::Error>` is not implemented for `ApplicationError`
   |           |
   |           this can't be annotated with `?` because it has type `Result<_, <T as Trait>::Error>`
   |
note: `ApplicationError` needs to implement `From<<T as Trait>::Error>`
  --> $DIR/suggest-complex-bound-on-method.rs:12:1
   |
LL | enum ApplicationError {
   | ^^^^^^^^^^^^^^^^^^^^^
   = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
   |
LL |     fn thing<T: Trait>(&self, t: T) -> Result<(), ApplicationError> where ApplicationError: From<<T as Trait>::Error> {
   |                                                                     +++++++++++++++++++++++++++++++++++++++++++++++++
```

Fix rust-lang/rust#144734.
2025-09-06 13:03:15 +02:00
..
assembly-llvm Rollup merge of #145709 - heiher:issue-145692-1, r=jackh726 2025-09-05 01:53:20 -04:00
auxiliary Set NumRegisterParameters LLVM module flag to N when -Zregparm=N is 2025-08-13 17:37:30 +02:00
codegen-llvm Rollup merge of #145709 - heiher:issue-145692-1, r=jackh726 2025-09-05 01:53:20 -04:00
codegen-units pub async fn implementation coroutine (func::{closure#0}) is monomorphized, when func itself is monomorphized 2025-09-01 13:45:00 +07:00
coverage Auto merge of #143290 - azhogin:azhogin/link-pub-async-impls, r=oli-obk 2025-09-01 10:54:40 +00:00
coverage-run-rustdoc
crashes Add compiler error when trying to use concat metavar expr in repetitions 2025-09-01 08:27:30 +02:00
debuginfo tests: Ignore basic-stepping.rs on riscv64 2025-08-29 08:11:48 +00:00
incremental Bless incremental tests. 2025-07-13 13:50:01 +00:00
mir-opt Auto merge of #144783 - folkertdev:loop-match-diverging-loop, r=SparrowLii 2025-09-01 14:42:07 +00:00
pretty Update autodiff tests for the new intrinsics impl 2025-08-14 18:33:43 +00:00
run-make Rollup merge of #138944 - madsmtm:apple_os_version_check, r=tgross35 2025-09-05 22:47:17 +02:00
rustdoc Auto merge of #138736 - azhogin:azhogin/sanitizers-target-modificators, r=rcvalle 2025-09-04 22:51:33 +00:00
rustdoc-gui Ensure that --html-after-content option is used to check scrape_examples_ice rustdoc GUI test 2025-09-05 15:13:08 +02:00
rustdoc-js rustdoc: add tests for raw pointers in type-based search 2025-08-21 17:50:12 -05:00
rustdoc-js-std tests/rustdoc-js-std/parser-errors.js: remove syntax that is now valid 2025-08-21 20:50:33 -05:00
rustdoc-json Add tests for doc(attribute = "...") attribute 2025-08-28 15:56:30 +02:00
rustdoc-ui Add ui test for unsupported doc(attribute = "...") case for attributes with namespace 2025-08-28 18:24:58 +02:00
ui Rollup merge of #144801 - estebank:issue-144734, r=spastorino 2025-09-06 13:03:15 +02:00
ui-fulldeps Switch next solver to use a specific associated type for trait def id 2025-08-25 16:52:08 +03:00
COMPILER_TESTS.md