about summary refs log tree commit diff
path: root/tests/ui/unboxed-closures
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/unboxed-closures
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/unboxed-closures')
-rw-r--r--tests/ui/unboxed-closures/unboxed-closures-static-call-wrong-trait.stderr2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/ui/unboxed-closures/unboxed-closures-static-call-wrong-trait.stderr b/tests/ui/unboxed-closures/unboxed-closures-static-call-wrong-trait.stderr
index 4d5e6f47965..db5a49d2b34 100644
--- a/tests/ui/unboxed-closures/unboxed-closures-static-call-wrong-trait.stderr
+++ b/tests/ui/unboxed-closures/unboxed-closures-static-call-wrong-trait.stderr
@@ -2,7 +2,7 @@ error[E0599]: no method named `call` found for closure `{closure@$DIR/unboxed-cl
   --> $DIR/unboxed-closures-static-call-wrong-trait.rs:7:10
    |
 LL |     mut_.call((0, ));
-   |          ^^^^ method not found in `{closure@unboxed-closures-static-call-wrong-trait.rs:6:26}`
+   |          ^^^^ method not found in `{closure@$DIR/unboxed-closures-static-call-wrong-trait.rs:6:26: 6:29}`
 
 error: aborting due to 1 previous error