Skip to content

Commit c50bf73

Browse files
Add tests to demonstrate issue #148239
1 parent 907705a commit c50bf73

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//@ check-pass
2+
//@ known-bug: #148239
3+
//@ compile-flags: -Zno-codegen
4+
#![expect(incomplete_features)]
5+
#![feature(explicit_tail_calls)]
6+
7+
#[inline(never)]
8+
fn leaf(_: &Box<u8>) -> [u8; 1] {
9+
[1]
10+
}
11+
12+
#[inline(never)]
13+
fn dispatch(param: &Box<u8>) -> [u8; 1] {
14+
become leaf(param)
15+
}
16+
17+
fn main() {
18+
let data = Box::new(0);
19+
let out = dispatch(&data);
20+
assert_eq!(out, [1]);
21+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//@ run-pass
2+
//@ known-bug: #148239
3+
#![expect(incomplete_features)]
4+
#![feature(explicit_tail_calls)]
5+
6+
#[inline(never)]
7+
fn op_dummy(_param: &Box<u8>) -> [u8; 24] {
8+
[1; 24]
9+
}
10+
11+
#[inline(never)]
12+
fn dispatch(param: &Box<u8>) -> [u8; 24] {
13+
become op_dummy(param)
14+
}
15+
16+
fn main() {
17+
let param = Box::new(0);
18+
let result = dispatch(&param);
19+
assert_ne!(result, [1; 24]); // the data is not right!
20+
}

0 commit comments

Comments
 (0)