@@ -164,7 +164,7 @@ struct TranspileTest<'a> {
164164fn transpile ( c_file_name : & str ) -> TranspileTest {
165165 TranspileTest {
166166 c_file_name,
167- edition : Default :: default ( ) ,
167+ edition : RustEdition :: Rust2024 ,
168168 arch_specific : false ,
169169 os_specific : false ,
170170 expect_compile_error : false ,
@@ -281,218 +281,170 @@ fn generate_keywords_test() {
281281
282282#[ test]
283283fn test_alloca ( ) {
284- transpile ( "alloca.c" ) . edition ( RustEdition :: Rust2024 ) . run ( ) ;
284+ transpile ( "alloca.c" ) . run ( ) ;
285285}
286286
287287#[ test]
288288fn test_arrays ( ) {
289- transpile ( "arrays.c" ) . edition ( RustEdition :: Rust2024 ) . run ( ) ;
289+ transpile ( "arrays.c" ) . run ( ) ;
290290}
291291
292292#[ test]
293293fn test_atomics ( ) {
294- transpile ( "atomics.c" ) . run ( ) ;
294+ transpile ( "atomics.c" ) . edition ( RustEdition :: Rust2021 ) . run ( ) ;
295295}
296296
297297#[ test]
298298fn test_compound_literals ( ) {
299- transpile ( "compound_literals.c" )
300- . edition ( RustEdition :: Rust2024 )
301- . run ( ) ;
299+ transpile ( "compound_literals.c" ) . run ( ) ;
302300}
303301
304302#[ test]
305303fn test_empty_init ( ) {
306- transpile ( "empty_init.c" )
307- . edition ( RustEdition :: Rust2024 )
308- . run ( ) ;
304+ transpile ( "empty_init.c" ) . run ( ) ;
309305}
310306
311307#[ test]
312308fn test_exprs ( ) {
313- transpile ( "exprs.c" ) . edition ( RustEdition :: Rust2024 ) . run ( ) ;
309+ transpile ( "exprs.c" ) . run ( ) ;
314310}
315311
316312#[ test]
317313fn test_factorial ( ) {
318- transpile ( "factorial.c" )
319- . edition ( RustEdition :: Rust2024 )
320- . run ( ) ;
314+ transpile ( "factorial.c" ) . run ( ) ;
321315}
322316
323317#[ test]
324318fn test_gotos ( ) {
325- transpile ( "gotos.c" ) . edition ( RustEdition :: Rust2024 ) . run ( ) ;
319+ transpile ( "gotos.c" ) . run ( ) ;
326320}
327321
328322#[ test]
329323fn test_incomplete_arrays ( ) {
330- transpile ( "incomplete_arrays.c" )
331- . edition ( RustEdition :: Rust2024 )
332- . run ( ) ;
324+ transpile ( "incomplete_arrays.c" ) . run ( ) ;
333325}
334326
335327#[ test]
336328fn test_insertion ( ) {
337- transpile ( "insertion.c" )
338- . edition ( RustEdition :: Rust2024 )
339- . run ( ) ;
329+ transpile ( "insertion.c" ) . run ( ) ;
340330}
341331
342332#[ test]
343333fn test_keywords ( ) {
344334 generate_keywords_test ( ) ;
345- transpile ( "keywords.c" ) . run ( ) ;
335+ transpile ( "keywords.c" ) . edition ( RustEdition :: Rust2021 ) . run ( ) ;
346336}
347337
348338#[ test]
349339fn test_macrocase ( ) {
350- transpile ( "macrocase.c" )
351- . edition ( RustEdition :: Rust2024 )
352- . run ( ) ;
340+ transpile ( "macrocase.c" ) . run ( ) ;
353341}
354342
355343#[ test]
356344fn test_macros ( ) {
357- transpile ( "macros.c" ) . edition ( RustEdition :: Rust2024 ) . run ( ) ;
345+ transpile ( "macros.c" ) . run ( ) ;
358346}
359347
360348#[ test]
361349fn test_main_fn ( ) {
362- transpile ( "main_fn.c" ) . edition ( RustEdition :: Rust2024 ) . run ( ) ;
350+ transpile ( "main_fn.c" ) . run ( ) ;
363351}
364352
365353#[ test]
366354fn test_predefined ( ) {
367- transpile ( "predefined.c" )
368- . edition ( RustEdition :: Rust2024 )
369- . run ( ) ;
355+ transpile ( "predefined.c" ) . run ( ) ;
370356}
371357
372358#[ test]
373359fn test_records ( ) {
374- transpile ( "records.c" ) . edition ( RustEdition :: Rust2024 ) . run ( ) ;
360+ transpile ( "records.c" ) . run ( ) ;
375361}
376362
377363#[ test]
378364fn test_ref_ub ( ) {
379- transpile ( "ref_ub.c" ) . edition ( RustEdition :: Rust2024 ) . run ( ) ;
365+ transpile ( "ref_ub.c" ) . run ( ) ;
380366}
381367
382368#[ test]
383369fn test_rotate ( ) {
384- transpile ( "rotate.c" ) . edition ( RustEdition :: Rust2024 ) . run ( ) ;
370+ transpile ( "rotate.c" ) . run ( ) ;
385371}
386372
387373#[ test]
388374fn test_static_assert ( ) {
389- transpile ( "static_assert.c" )
390- . edition ( RustEdition :: Rust2024 )
391- . run ( ) ;
375+ transpile ( "static_assert.c" ) . run ( ) ;
392376}
393377
394378#[ test]
395379fn test_str_init ( ) {
396- transpile ( "str_init.c" ) . edition ( RustEdition :: Rust2024 ) . run ( ) ;
380+ transpile ( "str_init.c" ) . run ( ) ;
397381}
398382
399383// arch-specific
400384
401385#[ test]
402386fn test_spin ( ) {
403- transpile ( "spin.c" )
404- . edition ( RustEdition :: Rust2024 )
405- . arch_specific ( true )
406- . run ( ) ;
387+ transpile ( "spin.c" ) . arch_specific ( true ) . run ( ) ;
407388}
408389
409390#[ test]
410391fn test_vm_x86 ( ) {
411- transpile ( "vm_x86.c" )
412- . edition ( RustEdition :: Rust2024 )
413- . arch_specific ( true )
414- . run ( ) ;
392+ transpile ( "vm_x86.c" ) . arch_specific ( true ) . run ( ) ;
415393}
416394
417395// os-specific
418396
419397#[ test]
420398fn test_call_only_once ( ) {
421- transpile ( "call_only_once.c" )
422- . edition ( RustEdition :: Rust2024 )
423- . os_specific ( true )
424- . run ( ) ;
399+ transpile ( "call_only_once.c" ) . os_specific ( true ) . run ( ) ;
425400}
426401
427402#[ test]
428403fn test_macros_os_specific ( ) {
429- transpile ( "macros.c" )
430- . edition ( RustEdition :: Rust2024 )
431- . os_specific ( true )
432- . run ( ) ;
404+ transpile ( "macros.c" ) . os_specific ( true ) . run ( ) ;
433405}
434406
435407#[ test]
436408fn test_out_of_range_lit ( ) {
437- transpile ( "out_of_range_lit.c" )
438- . edition ( RustEdition :: Rust2024 )
439- . os_specific ( true )
440- . run ( ) ;
409+ transpile ( "out_of_range_lit.c" ) . os_specific ( true ) . run ( ) ;
441410}
442411
443412#[ test]
444413fn test_rnd ( ) {
445- transpile ( "rnd.c" )
446- . edition ( RustEdition :: Rust2024 )
447- . os_specific ( true )
448- . run ( ) ;
414+ transpile ( "rnd.c" ) . os_specific ( true ) . run ( ) ;
449415}
450416
451417#[ test]
452418fn test_rotate_os_specific ( ) {
453- transpile ( "rotate.c" )
454- . edition ( RustEdition :: Rust2024 )
455- . os_specific ( true )
456- . run ( ) ;
419+ transpile ( "rotate.c" ) . os_specific ( true ) . run ( ) ;
457420}
458421
459422#[ test]
460423fn test_sigign ( ) {
461- transpile ( "sigign.c" )
462- . edition ( RustEdition :: Rust2024 )
463- . os_specific ( true )
464- . run ( ) ;
424+ transpile ( "sigign.c" ) . os_specific ( true ) . run ( ) ;
465425}
466426
467427#[ test]
468428fn test_typedefidx ( ) {
469- transpile ( "typedefidx.c" )
470- . edition ( RustEdition :: Rust2024 )
471- . os_specific ( true )
472- . run ( ) ;
429+ transpile ( "typedefidx.c" ) . os_specific ( true ) . run ( ) ;
473430}
474431
475432#[ test]
476433fn test_types ( ) {
477- transpile ( "types.c" )
478- . edition ( RustEdition :: Rust2024 )
479- . os_specific ( true )
480- . run ( ) ;
434+ transpile ( "types.c" ) . os_specific ( true ) . run ( ) ;
481435}
482436
483437#[ test]
484438fn test_wide_strings ( ) {
485- transpile ( "wide_strings.c" )
486- . edition ( RustEdition :: Rust2024 )
487- . os_specific ( true )
488- . run ( ) ;
439+ transpile ( "wide_strings.c" ) . os_specific ( true ) . run ( ) ;
489440}
490441
491442// arch-os-specific
492443
493444#[ test]
494445fn test_varargs ( ) {
495446 transpile ( "varargs.c" )
447+ . edition ( RustEdition :: Rust2021 )
496448 . arch_specific ( true )
497449 . os_specific ( true )
498450 . run ( ) ;
0 commit comments