Skip to content

Commit cf7e896

Browse files
committed
Add test tests/ui/trait-bounds/false-span-in-trait-bound-label.rs
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
1 parent 0d11be5 commit cf7e896

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// In this test, the span of the trait bound label should point to `1`, not `""`.
2+
// See issue #1433376
3+
4+
trait A<T> {
5+
fn f(self, x: T);
6+
}
7+
8+
fn main() {
9+
A::f(1, ""); //~ ERROR the trait bound `{integer}: A<_>` is not satisfied [E0277]
10+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
error[E0277]: the trait bound `{integer}: A<_>` is not satisfied
2+
--> $DIR/false-span-in-trait-bound-label.rs:9:13
3+
|
4+
LL | A::f(1, "");
5+
| ---- ^^ the trait `A<_>` is not implemented for `{integer}`
6+
| |
7+
| required by a bound introduced by this call
8+
|
9+
help: this trait has no implementations, consider adding one
10+
--> $DIR/false-span-in-trait-bound-label.rs:4:1
11+
|
12+
LL | trait A<T> {
13+
| ^^^^^^^^^^
14+
15+
error: aborting due to 1 previous error
16+
17+
For more information about this error, try `rustc --explain E0277`.

0 commit comments

Comments
 (0)