rust/compiler/rustc_borrowck/src/diagnostics
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
..
bound_region_errors.rs Deeply normalize signature in new solver 2025-02-11 19:24:07 +00:00
conflict_errors.rs Teach structured errors to display short Ty 2025-02-25 16:56:03 +00:00
explain_borrow.rs Fix binding mode problems 2025-02-22 00:13:19 +00:00
find_all_local_uses.rs Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
find_use.rs Remove MirVisitable. 2025-02-19 19:42:17 +11:00
mod.rs Fix binding mode problems 2025-02-22 00:13:19 +00:00
move_errors.rs Teach structured errors to display short Ty 2025-02-25 16:56:03 +00:00
mutability_errors.rs Move methods from Map to TyCtxt, part 3. 2025-02-21 14:31:09 +11:00
opaque_suggestions.rs Fix typos 2024-12-27 21:35:57 +08:00
outlives_suggestion.rs Remove unnecessary lifetimes in dataflow structs. 2024-09-09 16:14:18 +10:00
region_errors.rs Move methods from Map to TyCtxt, part 2. 2025-02-18 10:17:44 +11:00
region_name.rs Teach structured errors to display short Ty 2025-02-25 16:56:03 +00:00
var_name.rs Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00