44// ignore-stage1
55// ignore-cross-compile
66// ignore-remote
7+ // ignore-windows-gnu mingw has troubles with linking https://github.com/rust-lang/rust/pull/116837
78// edition: 2021
89
910#![ feature( rustc_private) ]
1314extern crate rustc_middle;
1415#[ macro_use]
1516extern crate rustc_smir;
16- extern crate stable_mir;
1717extern crate rustc_driver;
1818extern crate rustc_interface;
19+ extern crate stable_mir;
1920
2021use rustc_middle:: ty:: TyCtxt ;
2122
22- use stable_mir:: * ;
2323use rustc_smir:: rustc_internal;
24+ use stable_mir:: * ;
2425use std:: io:: Write ;
2526use std:: ops:: ControlFlow ;
2627
@@ -31,16 +32,16 @@ fn test_stable_mir(_tcx: TyCtxt<'_>) -> ControlFlow<()> {
3132 let items = stable_mir:: all_local_items ( ) ;
3233
3334 // Get all items and split generic vs monomorphic items.
34- let ( generic, mono) : ( Vec < _ > , Vec < _ > ) = items. into_iter ( ) . partition ( |item| {
35- item. requires_monomorphization ( )
36- } ) ;
35+ let ( generic, mono) : ( Vec < _ > , Vec < _ > ) =
36+ items. into_iter ( ) . partition ( |item| item. requires_monomorphization ( ) ) ;
3737 assert_eq ! ( mono. len( ) , 3 , "Expected 2 mono functions and one constant" ) ;
3838 assert_eq ! ( generic. len( ) , 2 , "Expected 2 generic functions" ) ;
3939
4040 // For all monomorphic items, get the correspondent instances.
41- let instances = mono. iter ( ) . filter_map ( |item| {
42- mir:: mono:: Instance :: try_from ( * item) . ok ( )
43- } ) . collect :: < Vec < mir:: mono:: Instance > > ( ) ;
41+ let instances = mono
42+ . iter ( )
43+ . filter_map ( |item| mir:: mono:: Instance :: try_from ( * item) . ok ( ) )
44+ . collect :: < Vec < mir:: mono:: Instance > > ( ) ;
4445 assert_eq ! ( instances. len( ) , mono. len( ) ) ;
4546
4647 // For all generic items, try_from should fail.
@@ -49,7 +50,6 @@ fn test_stable_mir(_tcx: TyCtxt<'_>) -> ControlFlow<()> {
4950 ControlFlow :: Continue ( ( ) )
5051}
5152
52-
5353/// This test will generate and analyze a dummy crate using the stable mir.
5454/// For that, it will first write the dummy crate into a file.
5555/// Then it will create a `StableMir` using custom arguments and then
0 commit comments