mirror of
https://github.com/rust-lang/rust.git
synced 2025-09-30 16:26:10 +00:00

`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.
24 lines
1.1 KiB
Plaintext
24 lines
1.1 KiB
Plaintext
error[E0055]: reached the recursion limit while auto-dereferencing `Wrap<Wrap<Wrap<Wrap<Wrap<Wrap<Wrap<Wrap<Wrap<Wrap<Wrap<...>>>>>>>>>>>`
|
|
--> $DIR/probe-error-on-infinite-deref.rs:14:13
|
|
|
|
|
LL | Wrap(1).lmao();
|
|
| ^^^^ deref recursion limit reached
|
|
|
|
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`probe_error_on_infinite_deref`)
|
|
= note: the full name for the type has been written to '$TEST_BUILD_DIR/probe-error-on-infinite-deref.long-type-$LONG_TYPE_HASH.txt'
|
|
= note: consider using `--verbose` to print the full type name to the console
|
|
|
|
error[E0599]: no method named `lmao` found for struct `Wrap<{integer}>` in the current scope
|
|
--> $DIR/probe-error-on-infinite-deref.rs:14:13
|
|
|
|
|
LL | struct Wrap<T>(T);
|
|
| -------------- method `lmao` not found for this struct
|
|
...
|
|
LL | Wrap(1).lmao();
|
|
| ^^^^ method not found in `Wrap<{integer}>`
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
Some errors have detailed explanations: E0055, E0599.
|
|
For more information about an error, try `rustc --explain E0055`.
|