diff options
| author | Noratrieb <48135649+Noratrieb@users.noreply.github.com> | 2025-05-24 20:22:58 +0200 |
|---|---|---|
| committer | Noratrieb <48135649+Noratrieb@users.noreply.github.com> | 2025-05-24 23:31:07 +0200 |
| commit | 01503d0c1e43a23de92ad1577cbdceb7afe47dab (patch) | |
| tree | 385cbd3fd816a26a8a7cc4eed1458b38ccbfc004 /tests/ui/higher-ranked | |
| parent | e88e85463468ce5d5ce468414eb69e3b15fa8d42 (diff) | |
| download | rust-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/higher-ranked')
| -rw-r--r-- | tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-1.stderr | 2 | ||||
| -rw-r--r-- | tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-2.stderr | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-1.stderr b/tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-1.stderr index 240e1c3dde1..21dc5c66adf 100644 --- a/tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-1.stderr +++ b/tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-1.stderr @@ -1,4 +1,4 @@ -error[E0599]: the method `filterx` exists for struct `Map<Repeat, {closure@hrtb-doesnt-borrow-self-1.rs:113:27}>`, but its trait bounds were not satisfied +error[E0599]: the method `filterx` exists for struct `Map<Repeat, {closure@$DIR/hrtb-doesnt-borrow-self-1.rs:113:27: 113:34}>`, but its trait bounds were not satisfied --> $DIR/hrtb-doesnt-borrow-self-1.rs:114:22 | LL | pub struct Map<S, F> { diff --git a/tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-2.stderr b/tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-2.stderr index 13041ea2bb0..23b979e2ef0 100644 --- a/tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-2.stderr +++ b/tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-2.stderr @@ -1,4 +1,4 @@ -error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, fn(&u64) -> &u64 {identity::<u64>}>, {closure@hrtb-doesnt-borrow-self-2.rs:109:30}>`, but its trait bounds were not satisfied +error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, for<'a> fn(&'a u64) -> &'a u64 {identity::<u64>}>, {closure@$DIR/hrtb-doesnt-borrow-self-2.rs:109:30: 109:37}>`, but its trait bounds were not satisfied --> $DIR/hrtb-doesnt-borrow-self-2.rs:110:24 | LL | pub struct Filter<S, F> { |
