diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/adjust_fulfillment_errors.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/adjust_fulfillment_errors.rs index 2bc007b3ad4b5..4e4bf8a5562e3 100644 --- a/compiler/rustc_hir_typeck/src/fn_ctxt/adjust_fulfillment_errors.rs +++ b/compiler/rustc_hir_typeck/src/fn_ctxt/adjust_fulfillment_errors.rs @@ -184,9 +184,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { return true; } - for param in [param_to_point_at, fallback_param_to_point_at, self_param_to_point_at] - .into_iter() - .flatten() + for param in [ + predicate_self_type_to_point_at, + param_to_point_at, + fallback_param_to_point_at, + self_param_to_point_at, + ] + .into_iter() + .flatten() { if self.blame_specific_arg_if_possible( error, diff --git a/tests/ui/associated-type-bounds/dedup-normalized-2-higher-ranked.current.stderr b/tests/ui/associated-type-bounds/dedup-normalized-2-higher-ranked.current.stderr index 64304be9d6b15..eaa212c6ce8e3 100644 --- a/tests/ui/associated-type-bounds/dedup-normalized-2-higher-ranked.current.stderr +++ b/tests/ui/associated-type-bounds/dedup-normalized-2-higher-ranked.current.stderr @@ -2,7 +2,9 @@ error[E0283]: type annotations needed --> $DIR/dedup-normalized-2-higher-ranked.rs:28:5 | LL | impls(rigid); - | ^^^^^ cannot infer type of the type parameter `U` declared on the function `impls` + | ^^^^^ ----- type must be known at this point + | | + | cannot infer type of the type parameter `U` declared on the function `impls` | = note: cannot satisfy `for<'b>
::Rigid: Bound<'b, _>`
note: required by a bound in `impls`
diff --git a/tests/ui/const-generics/infer/issue-77092.stderr b/tests/ui/const-generics/infer/issue-77092.stderr
index 4ab80cec58d8d..3763cd738a861 100644
--- a/tests/ui/const-generics/infer/issue-77092.stderr
+++ b/tests/ui/const-generics/infer/issue-77092.stderr
@@ -20,7 +20,7 @@ error[E0284]: type annotations needed
LL | println!("{:?}", take_array_from_mut(&mut arr, i));
| ---- ^^^^^^^^^^^^^^^^^^^ cannot infer the value of the const parameter `N` declared on the function `take_array_from_mut`
| |
- | type must be known at this point
+ | required by this formatting parameter
|
= note: required for `[i32; _]` to implement `Debug`
= note: 1 redundant requirement hidden
diff --git a/tests/ui/impl-trait/auto-trait-selection-freeze.old.stderr b/tests/ui/impl-trait/auto-trait-selection-freeze.old.stderr
index b4d2229d408d2..b6c6e74f26052 100644
--- a/tests/ui/impl-trait/auto-trait-selection-freeze.old.stderr
+++ b/tests/ui/impl-trait/auto-trait-selection-freeze.old.stderr
@@ -2,7 +2,9 @@ error[E0283]: type annotations needed
--> $DIR/auto-trait-selection-freeze.rs:19:16
|
LL | if false { is_trait(foo()) } else { Default::default() }
- | ^^^^^^^^ cannot infer type of the type parameter `U` declared on the function `is_trait`
+ | ^^^^^^^^ ----- type must be known at this point
+ | |
+ | cannot infer type of the type parameter `U` declared on the function `is_trait`
|
note: multiple `impl`s satisfying `impl Sized: Trait<_>` found
--> $DIR/auto-trait-selection-freeze.rs:16:1
diff --git a/tests/ui/impl-trait/auto-trait-selection.old.stderr b/tests/ui/impl-trait/auto-trait-selection.old.stderr
index 1b5fd95fdf903..8e44100177154 100644
--- a/tests/ui/impl-trait/auto-trait-selection.old.stderr
+++ b/tests/ui/impl-trait/auto-trait-selection.old.stderr
@@ -2,7 +2,9 @@ error[E0283]: type annotations needed
--> $DIR/auto-trait-selection.rs:15:16
|
LL | if false { is_trait(foo()) } else { Default::default() }
- | ^^^^^^^^ cannot infer type of the type parameter `U` declared on the function `is_trait`
+ | ^^^^^^^^ ----- type must be known at this point
+ | |
+ | cannot infer type of the type parameter `U` declared on the function `is_trait`
|
note: multiple `impl`s satisfying `impl Sized: Trait<_>` found
--> $DIR/auto-trait-selection.rs:12:1
diff --git a/tests/ui/trait-bounds/false-span-in-trait-bound-label.rs b/tests/ui/trait-bounds/false-span-in-trait-bound-label.rs
new file mode 100644
index 0000000000000..0e30730986023
--- /dev/null
+++ b/tests/ui/trait-bounds/false-span-in-trait-bound-label.rs
@@ -0,0 +1,10 @@
+// In this test, the span of the trait bound label should point to `1`, not `""`.
+// See issue #143336
+
+trait A