@@ -47,44 +47,47 @@ fn test_stable_mir() -> ControlFlow<()> {
4747 let krate = rustc_public:: local_crate ( ) ;
4848 for it in rustc_public:: all_local_items ( ) {
4949 match & * it. 0 . name ( ) {
50- "wrapper_mod::CONST_ITEM" => {
50+ "input:: wrapper_mod::CONST_ITEM" => {
5151 set_once ( & mut const_item, it. 0 ) ;
5252 }
53- "wrapper_mod::STATIC_ITEM" => {
53+ "input:: wrapper_mod::STATIC_ITEM" => {
5454 set_once ( & mut static_item, it. 0 ) ;
5555 }
56- "<wrapper_mod::MyStruct as wrapper_mod::MyTrait>::trait_method" => {
56+ "<input:: wrapper_mod::MyStruct as input:: wrapper_mod::MyTrait>::trait_method" => {
5757 set_once ( & mut trait_method, it. 0 ) ;
5858 }
59- "<wrapper_mod::MyStruct as wrapper_mod::MyTrait>::trait_method::trait_method_helper" => {
59+ "<input::wrapper_mod::MyStruct as input::wrapper_mod::MyTrait>::trait_method::trait_method_helper" =>
60+ {
6061 set_once ( & mut trait_method_helper, it. 0 ) ;
6162 }
62- "wrapper_mod::MyStruct::inherent_method" => {
63+ "input:: wrapper_mod::MyStruct::inherent_method" => {
6364 set_once ( & mut inherent_method, it. 0 ) ;
6465 }
65- "wrapper_mod::MyStruct::inherent_method::inherent_method_helper" => {
66+ "input:: wrapper_mod::MyStruct::inherent_method::inherent_method_helper" => {
6667 set_once ( & mut inherent_method_helper, it. 0 ) ;
6768 }
68- "main" => {
69+ "input:: main" => {
6970 set_once ( & mut main, it. 0 ) ;
7071 }
71- "wrapper_mod::MyStruct" => {
72+ "input:: wrapper_mod::MyStruct" => {
7273 set_once ( & mut mystruct_ctor, it. 0 ) ;
7374 mystruct_ctor_ty = Some ( it. ty ( ) ) ;
7475 }
75- _ => ( ) ,
76+ name => panic ! ( "Unexpected item: `{name}`" ) ,
7677 }
7778 }
7879 for it in krate. trait_decls ( ) {
7980 match & * it. 0 . name ( ) {
80- "wrapper_mod::MyTrait" => set_once ( & mut trait_decl, it. 0 ) ,
81+ "input:: wrapper_mod::MyTrait" => set_once ( & mut trait_decl, it. 0 ) ,
8182 _ => ( ) ,
8283 }
8384 }
8485 for it in krate. trait_impls ( ) {
8586 match & * it. 0 . name ( ) {
86- "<wrapper_mod::MyStruct as wrapper_mod::MyTrait>" => set_once ( & mut trait_impl, it. 0 ) ,
87- _ => ( ) ,
87+ "<input::wrapper_mod::MyStruct as input::wrapper_mod::MyTrait>" => {
88+ set_once ( & mut trait_impl, it. 0 )
89+ }
90+ name => panic ! ( "Unexpected trait impl: `{name}`" ) ,
8891 }
8992 }
9093
@@ -106,9 +109,10 @@ fn test_stable_mir() -> ControlFlow<()> {
106109 let inherent_impl = inherent_method. parent ( ) . unwrap ( ) ;
107110 let wrapper_mod = const_item. parent ( ) . unwrap ( ) ;
108111 let crate_root = wrapper_mod. parent ( ) . unwrap ( ) ;
109- assert_eq ! ( & * wrapper_mod. name( ) , "wrapper_mod" ) ;
112+ assert_eq ! ( & * wrapper_mod. name( ) , "input:: wrapper_mod" ) ;
110113
111114 // Check that each def-id has the correct parent
115+ assert_eq ! ( crate_root. name( ) , "input" ) ;
112116 assert_eq ! ( crate_root. parent( ) , None ) ;
113117 assert_eq ! ( inherent_impl. parent( ) , Some ( wrapper_mod) ) ;
114118 assert_eq ! ( const_item. parent( ) , Some ( wrapper_mod) ) ;
0 commit comments