File tree Expand file tree Collapse file tree 2 files changed +38
-1
lines changed
crates/hir-def/src/nameres Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ impl ModDir {
34
34
let path = match attr_path. map ( SmolStr :: as_str) {
35
35
None => {
36
36
let mut path = self . dir_path . clone ( ) ;
37
- path. push ( & name. to_smol_str ( ) ) ;
37
+ path. push ( & name. unescaped ( ) . to_smol_str ( ) ) ;
38
38
path
39
39
}
40
40
Some ( attr_path) => {
Original file line number Diff line number Diff line change @@ -156,6 +156,43 @@ pub struct Baz;
156
156
) ;
157
157
}
158
158
159
+ #[ test]
160
+ fn module_resolution_works_for_inline_raw_modules ( ) {
161
+ check (
162
+ r#"
163
+ //- /lib.rs
164
+ mod r#async {
165
+ pub mod a;
166
+ pub mod r#async;
167
+ }
168
+ use self::r#async::a::Foo;
169
+ use self::r#async::r#async::Bar;
170
+
171
+ //- /async/a.rs
172
+ pub struct Foo;
173
+
174
+ //- /async/async.rs
175
+ pub struct Bar;
176
+ "# ,
177
+ expect ! [ [ r#"
178
+ crate
179
+ Bar: t v
180
+ Foo: t v
181
+ r#async: t
182
+
183
+ crate::r#async
184
+ a: t
185
+ r#async: t
186
+
187
+ crate::r#async::a
188
+ Foo: t v
189
+
190
+ crate::r#async::r#async
191
+ Bar: t v
192
+ "# ] ] ,
193
+ ) ;
194
+ }
195
+
159
196
#[ test]
160
197
fn module_resolution_decl_path ( ) {
161
198
check (
You can’t perform that action at this time.
0 commit comments