rust/tests
Matthias Krüger 890c4d2e26
Rollup merge of #137245 - estebank:from-residual-note-2, r=oli-obk
Tweak E0277 when predicate comes indirectly from ?

When a `?` operation requires an `Into` conversion with additional bounds (like having a concrete error but wanting to convert to a trait object), we handle it speficically and provide the same kind of information we give other `?` related errors.

```
error[E0277]: `?` couldn't convert the error: `E: std::error::Error` is not satisfied
  --> $DIR/bad-question-mark-on-trait-object.rs:7:13
   |
LL | fn foo() -> Result<(), Box<dyn std::error::Error>> {
   |             -------------------------------------- required `E: std::error::Error` because of this
LL |     Ok(bar()?)
   |        -----^ the trait `std::error::Error` is not implemented for `E`
   |        |
   |        this has type `Result<_, E>`
   |
note: `E` needs to implement `std::error::Error`
  --> $DIR/bad-question-mark-on-trait-object.rs:1:1
   |
LL | struct E;
   | ^^^^^^^^
   = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
   = note: required for `Box<dyn std::error::Error>` to implement `From<E>`
```

Avoid talking about `FromResidual` when other more relevant information is being given, particularly from `rust_on_unimplemented`.

Fix #137238.

-----

CC #137232, which was a smaller step related to this.
2025-02-22 01:01:41 +01:00
..
assembly Rollup merge of #137324 - flba-eb:rename_qnx_target_name_i586, r=workingjubilee 2025-02-20 14:58:21 -08:00
auxiliary use add-core-stubs / minicore for a few more tests 2025-02-16 18:37:50 +01:00
codegen Rollup merge of #136089 - jwong101:box-default-debug-stack-usage, r=Amanieu 2025-02-21 12:45:22 +01:00
codegen-units Remove -Zinline-in-all-cgus and clean up CGU partitioning tests 2025-01-27 23:48:47 -05:00
coverage coverage: Add some more cases to tests/coverage/holes.rs 2025-02-19 13:56:20 +11:00
coverage-run-rustdoc
crashes Do not deduplicate list of associated types provided by dyn principal 2025-02-21 19:32:45 +00:00
debuginfo Revert "Remove the Arc rt::init allocation for thread info" 2025-01-14 13:37:25 +01:00
incremental tests: error strings for ABI stability now match 2025-02-09 20:45:47 -08:00
mir-opt Auto merge of #136771 - scottmcm:poke-slice-iter-next, r=joboet 2025-02-20 18:20:40 +00:00
pretty
run-make avr-rjmp-offset: Explain .target_cpu() 2025-02-20 15:05:06 +01:00
rustdoc Add regression test for source line numbers 2025-02-11 14:29:58 +01:00
rustdoc-gui Add custom sort for link in rustdoc 2025-02-19 08:35:51 +08:00
rustdoc-js Rollup merge of #134277 - notriddle:notriddle/inline-into, r=GuillaumeGomez 2024-12-16 20:00:20 +01:00
rustdoc-js-std Remove the common prelude module 2025-02-11 13:04:27 -08:00
rustdoc-json Add missing lang items in no_core tests in rustdoc 2025-02-04 01:05:31 +00:00
rustdoc-ui Rollup merge of #137120 - ChrisDenton:its-all-relative, r=GuillaumeGomez 2025-02-17 06:38:15 +01:00
ui Rollup merge of #137245 - estebank:from-residual-note-2, r=oli-obk 2025-02-22 01:01:41 +01:00
ui-fulldeps Auto merge of #137164 - matthiaskrgr:rollup-dj5826k, r=matthiaskrgr 2025-02-17 11:18:33 +00:00
COMPILER_TESTS.md