about summary refs log tree commit diff
path: root/tests/ui/codegen/overflow-during-mono.rs
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2025-07-16 19:45:07 +0000
committerEsteban Küber <esteban@kuber.com.ar>2025-08-07 21:18:00 +0000
commit99196657fcb5c1e20c13e76166c7f52d35584e88 (patch)
treeebdcbf3a557a056fc26648ca21cb32555fd318a0 /tests/ui/codegen/overflow-during-mono.rs
parent2fd855fbfc8239285aa2d596f76a8cc75e17ce02 (diff)
downloadrust-99196657fcb5c1e20c13e76166c7f52d35584e88.tar.gz
rust-99196657fcb5c1e20c13e76166c7f52d35584e88.zip
Use `tcx.short_string()` in more diagnostics
`TyCtxt::short_string` ensures that user visible type paths aren't overwhelming on the terminal output, and properly saves the long name to disk as a side-channel. We already use these throughout the compiler and have been using them as needed when users find cases where the output is verbose. This is a proactive search of some cases to use `short_string`.

We add support for shortening the path of "trait path only".

Every manual use of `short_string` is a bright marker that that error should be using structured diagnostics instead (as they have proper handling of long types without the maintainer having to think abou tthem).

When we don't actually print out a shortened type we don't need the "use `--verbose`" note.

On E0599 show type identity to avoid expanding the receiver's generic parameters.

Unify wording on `long_ty_path` everywhere.
Diffstat (limited to 'tests/ui/codegen/overflow-during-mono.rs')
-rw-r--r--tests/ui/codegen/overflow-during-mono.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/ui/codegen/overflow-during-mono.rs b/tests/ui/codegen/overflow-during-mono.rs
index a9045840173..3aafe05ba05 100644
--- a/tests/ui/codegen/overflow-during-mono.rs
+++ b/tests/ui/codegen/overflow-during-mono.rs
@@ -1,5 +1,6 @@
-//~ ERROR overflow evaluating the requirement `for<'a> {closure@$DIR/overflow-during-mono.rs:13:41: 13:44}: FnMut(&'a _)`
+//~ ERROR overflow evaluating the requirement `for<'a> {closure@$DIR/overflow-during-mono.rs:14:41: 14:44}: FnMut(&'a _)`
 //@ build-fail
+//@ compile-flags: -Zwrite-long-types-to-disk=yes
 
 #![recursion_limit = "32"]