We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 442fe55 commit bf2c85dCopy full SHA for bf2c85d
tests/codegen/tail-call-musttail.rs
@@ -12,11 +12,7 @@
12
pub fn simple_tail_call(n: i32) -> i32 {
13
// CHECK: musttail call {{.*}}@simple_tail_call(
14
// CHECK-NEXT: ret i32
15
- if n <= 0 {
16
- 0
17
- } else {
18
- become simple_tail_call(n - 1)
19
- }
+ if n <= 0 { 0 } else { become simple_tail_call(n - 1) }
20
}
21
22
// CHECK-LABEL: define {{.*}}@tail_call_with_args(
@@ -25,9 +21,5 @@ pub fn simple_tail_call(n: i32) -> i32 {
25
pub fn tail_call_with_args(a: i32, b: i32, c: i32) -> i32 {
26
// CHECK: musttail call {{.*}}@tail_call_with_args(
27
23
28
- if a == 0 {
29
- b + c
30
31
- become tail_call_with_args(a - 1, b + 1, c)
32
24
+ if a == 0 { b + c } else { become tail_call_with_args(a - 1, b + 1, c) }
33
0 commit comments