@@ -56,8 +56,6 @@ enum SubModKind<'a, 'ast> {
5656 External ( PathBuf , DirectoryOwnership , Cow < ' ast , ast:: Mod > ) ,
5757 /// `mod foo;` with multiple sources.
5858 MultiExternal ( Vec < ( PathBuf , DirectoryOwnership , Cow < ' ast , ast:: Mod > ) > ) ,
59- /// `#[path = "..."] mod foo {}`
60- InternalWithPath ( PathBuf ) ,
6159 /// `mod foo {}`
6260 Internal ( & ' a ast:: Item ) ,
6361}
@@ -173,12 +171,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
173171 self . find_external_module ( item. ident , & item. attrs , sub_mod)
174172 } else {
175173 // An internal module (`mod foo { /* ... */ }`);
176- if let Some ( path) = find_path_value ( & item. attrs ) {
177- let path = Path :: new ( & * path. as_str ( ) ) . to_path_buf ( ) ;
178- Ok ( Some ( SubModKind :: InternalWithPath ( path) ) )
179- } else {
180- Ok ( Some ( SubModKind :: Internal ( item) ) )
181- }
174+ Ok ( Some ( SubModKind :: Internal ( item) ) )
182175 }
183176 }
184177
@@ -218,14 +211,6 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
218211 } ;
219212 self . visit_sub_mod_after_directory_update ( sub_mod, Some ( directory) )
220213 }
221- SubModKind :: InternalWithPath ( mod_path) => {
222- // All `#[path]` files are treated as though they are a `mod.rs` file.
223- let directory = Directory {
224- path : mod_path,
225- ownership : DirectoryOwnership :: Owned { relative : None } ,
226- } ;
227- self . visit_sub_mod_after_directory_update ( sub_mod, Some ( directory) )
228- }
229214 SubModKind :: Internal ( ref item) => {
230215 self . push_inline_mod_directory ( item. ident , & item. attrs ) ;
231216 self . visit_sub_mod_after_directory_update ( sub_mod, None )
0 commit comments