File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed
tests/ui/explicit-tail-calls Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments