about summary refs log tree commit diff
path: root/tests/ui/empty/empty-struct-braces-expr.stderr
diff options
context:
space:
mode:
authorNoratrieb <48135649+Noratrieb@users.noreply.github.com>2025-05-24 20:22:58 +0200
committerNoratrieb <48135649+Noratrieb@users.noreply.github.com>2025-05-24 23:31:07 +0200
commit01503d0c1e43a23de92ad1577cbdceb7afe47dab (patch)
tree385cbd3fd816a26a8a7cc4eed1458b38ccbfc004 /tests/ui/empty/empty-struct-braces-expr.stderr
parente88e85463468ce5d5ce468414eb69e3b15fa8d42 (diff)
downloadrust-01503d0c1e43a23de92ad1577cbdceb7afe47dab.tar.gz
rust-01503d0c1e43a23de92ad1577cbdceb7afe47dab.zip
Avoid extra path trimming in method not found error
Method errors have an extra check that force trim paths whenever the
normal string is longer than 10 characters, which can be quite unhelpful
when multiple items have the same name (for example an `Error`).

A user reported this force trimming as being quite unhelpful when they
had a method error where the precise path of the `Error` mattered.

The code uses `tcx.short_string` already to get the normal path, which
tries to be clever around trimming paths if necessary, so there is no
reason for this extra force trimming.
Diffstat (limited to 'tests/ui/empty/empty-struct-braces-expr.stderr')
-rw-r--r--tests/ui/empty/empty-struct-braces-expr.stderr4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/ui/empty/empty-struct-braces-expr.stderr b/tests/ui/empty/empty-struct-braces-expr.stderr
index 8ec8ecf46bf..a176107a06e 100644
--- a/tests/ui/empty/empty-struct-braces-expr.stderr
+++ b/tests/ui/empty/empty-struct-braces-expr.stderr
@@ -121,7 +121,7 @@ error[E0599]: no variant or associated item named `Empty3` found for enum `empty
   --> $DIR/empty-struct-braces-expr.rs:25:19
    |
 LL |     let xe3 = XE::Empty3;
-   |                   ^^^^^^ variant or associated item not found in `XE`
+   |                   ^^^^^^ variant or associated item not found in `empty_struct::XE`
    |
 help: there is a variant with a similar name
    |
@@ -132,7 +132,7 @@ error[E0599]: no variant or associated item named `Empty3` found for enum `empty
   --> $DIR/empty-struct-braces-expr.rs:26:19
    |
 LL |     let xe3 = XE::Empty3();
-   |                   ^^^^^^ variant or associated item not found in `XE`
+   |                   ^^^^^^ variant or associated item not found in `empty_struct::XE`
    |
 help: there is a variant with a similar name
    |