@@ -102,20 +102,18 @@ impl<'a> Parser<'a> {
102
102
id_sp : Span ,
103
103
) -> PResult < ' a , ModulePathSuccess > {
104
104
if let Some ( path) = Parser :: submod_path_from_attr ( outer_attrs, & self . directory . path ) {
105
- return Ok ( ModulePathSuccess {
106
- directory_ownership : match path. file_name ( ) . and_then ( |s| s. to_str ( ) ) {
107
- // All `#[path]` files are treated as though they are a `mod.rs` file.
108
- // This means that `mod foo;` declarations inside `#[path]`-included
109
- // files are siblings,
110
- //
111
- // Note that this will produce weirdness when a file named `foo.rs` is
112
- // `#[path]` included and contains a `mod foo;` declaration.
113
- // If you encounter this, it's your own darn fault :P
114
- Some ( _) => DirectoryOwnership :: Owned { relative : None } ,
115
- _ => DirectoryOwnership :: UnownedViaMod ,
116
- } ,
117
- path,
118
- } ) ;
105
+ let directory_ownership = match path. file_name ( ) . and_then ( |s| s. to_str ( ) ) {
106
+ // All `#[path]` files are treated as though they are a `mod.rs` file.
107
+ // This means that `mod foo;` declarations inside `#[path]`-included
108
+ // files are siblings,
109
+ //
110
+ // Note that this will produce weirdness when a file named `foo.rs` is
111
+ // `#[path]` included and contains a `mod foo;` declaration.
112
+ // If you encounter this, it's your own darn fault :P
113
+ Some ( _) => DirectoryOwnership :: Owned { relative : None } ,
114
+ _ => DirectoryOwnership :: UnownedViaMod ,
115
+ } ;
116
+ return Ok ( ModulePathSuccess { directory_ownership, path } ) ;
119
117
}
120
118
121
119
let relative = match self . directory . ownership {
0 commit comments