Skip to content

Commit 09eede7

Browse files
committed
Update the tests/ui/explicit-tail-calls/caller_is_track_caller.rs test with a case of a default trait method.
1 parent 0be85ec commit 09eede7

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

tests/ui/explicit-tail-calls/caller_is_track_caller.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,13 @@ fn c() {
1313
become a(); //~ error: a function marked with `#[track_caller]` cannot perform a tail-call
1414
}
1515

16+
trait Trait {
17+
fn d(&self);
18+
19+
#[track_caller]
20+
fn e(&self) {
21+
become self.d(); //~ error: a function marked with `#[track_caller]` cannot perform a tail-call
22+
}
23+
}
24+
1625
fn main() {}

tests/ui/explicit-tail-calls/caller_is_track_caller.stderr

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,11 @@ error: a function marked with `#[track_caller]` cannot perform a tail-call
1010
LL | become a();
1111
| ^^^^^^^^^^
1212

13-
error: aborting due to 2 previous errors
13+
error: a function marked with `#[track_caller]` cannot perform a tail-call
14+
--> $DIR/caller_is_track_caller.rs:21:9
15+
|
16+
LL | become self.d();
17+
| ^^^^^^^^^^^^^^^
18+
19+
error: aborting due to 3 previous errors
1420

0 commit comments

Comments
 (0)