Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
b3827e4f3728b77bd3e60587487ebfc3cc8d901b
rust/tests/ui/trait-bounds/false-span-in-trait-bound-label.rs

11 lines
242 B
Rust
Raw Normal View History

Add test tests/ui/trait-bounds/false-span-in-trait-bound-label.rs Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-07-07 16:30:14 +08:00
// In this test, the span of the trait bound label should point to `1`, not `""`.
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:43:30 +08:00
// See issue #143336
Add test tests/ui/trait-bounds/false-span-in-trait-bound-label.rs Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-07-07 16:30:14 +08:00
trait A<T> {
fn f(self, x: T);
}
fn main() {
A::f(1, ""); //~ ERROR the trait bound `{integer}: A<_>` is not satisfied [E0277]
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:43:30 +08:00
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 125ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API