rust/compiler/rustc_trait_selection/src
Esteban Küber d12ecaed55 Teach structured errors to display short Ty
Make it so that every structured error annotated with `#[derive(Diagnostic)]` that has a field of type `Ty<'_>`, the printing of that value into a `String` will look at the thread-local storage `TyCtxt` in order to shorten to a length appropriate with the terminal width. When this happen, the resulting error will have a note with the file where the full type name was written to.

```
error[E0618]: expected function, found `((..., ..., ..., ...), ..., ..., ...)``
 --> long.rs:7:5
  |
6 | fn foo(x: D) { //~ `x` has type `(...
  |        - `x` has type `((..., ..., ..., ...), ..., ..., ...)`
7 |     x(); //~ ERROR expected function, found `(...
  |     ^--
  |     |
  |     call expression requires function
  |
  = note: the full name for the type has been written to 'long.long-type-14182675702747116984.txt'
  = note: consider using `--verbose` to print the full type name to the console
```
2025-02-25 16:56:03 +00:00
..
error_reporting Teach structured errors to display short Ty 2025-02-25 16:56:03 +00:00
errors Teach structured errors to display short Ty 2025-02-25 16:56:03 +00:00
solve Greatly simplify lifetime captures in edition 2024 2025-02-22 22:24:52 +00:00
traits Remove dyn_compatible_for_dispatch 2025-02-24 18:48:40 +00:00
errors.rs Teach structured errors to display short Ty 2025-02-25 16:56:03 +00:00
infer.rs Suggest Semicolon in Incorrect Repeat Expressions 2024-12-21 02:30:50 +00:00
lib.rs stabilize extract_if 2025-02-23 21:11:12 +07:00
regions.rs Move param env bound deep normalization to OutlivesEnvironment building 2025-01-28 19:11:05 +00:00
solve.rs impossible obligations check fast path 2024-10-10 06:09:50 -04:00