rust/tests/ui/trait-bounds/false-span-in-trait-bound-label.rs
xizheyin 796b4d1fb4
Point to correct argument in Func Call when Self type fails trait bound
When a trait bound fails due to the Self type parameter, adjust_fulfillment_errors
now correctly points to the corresponding function argument instead of incorrectly
pointing to other arguments.

Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-07-07 16:47:15 +08:00

11 lines
242 B
Rust

// In this test, the span of the trait bound label should point to `1`, not `""`.
// See issue #143336
trait A<T> {
fn f(self, x: T);
}
fn main() {
A::f(1, ""); //~ ERROR the trait bound `{integer}: A<_>` is not satisfied [E0277]
}