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 {
3434 let path = match attr_path. map ( SmolStr :: as_str) {
3535 None => {
3636 let mut path = self . dir_path . clone ( ) ;
37- path. push ( & name. to_smol_str ( ) ) ;
37+ path. push ( & name. unescaped ( ) . to_smol_str ( ) ) ;
3838 path
3939 }
4040 Some ( attr_path) => {
Original file line number Diff line number Diff line change @@ -156,6 +156,43 @@ pub struct Baz;
156156 ) ;
157157}
158158
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+
159196#[ test]
160197fn module_resolution_decl_path ( ) {
161198 check (
You can’t perform that action at this time.
0 commit comments