summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2019-12-03 22:25:44 -0800
committerEsteban Küber <esteban@kuber.com.ar>2019-12-03 22:25:44 -0800
commit0103308ad3745109600541e139af5571838b8791 (patch)
tree0f94a49f54e328c15ed3542bc711eea41a439c73
parentreview comments: move test (diff)
downloadrust-0103308ad3745109600541e139af5571838b8791.tar.gz
rust-0103308ad3745109600541e139af5571838b8791.tar.bz2
rust-0103308ad3745109600541e139af5571838b8791.tar.xz
Account for raw idents in module file finding
-rw-r--r--src/librustc_parse/parser/module.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_parse/parser/module.rs b/src/librustc_parse/parser/module.rs
index 59d7c2b..807defc 100644
--- a/src/librustc_parse/parser/module.rs
+++ b/src/librustc_parse/parser/module.rs
@@ -212,13 +212,13 @@ impl<'a> Parser<'a> {
212 // `./<id>.rs` and `./<id>/mod.rs`. 212 // `./<id>.rs` and `./<id>/mod.rs`.
213 let relative_prefix_string; 213 let relative_prefix_string;
214 let relative_prefix = if let Some(ident) = relative { 214 let relative_prefix = if let Some(ident) = relative {
215 relative_prefix_string = format!("{}{}", ident, path::MAIN_SEPARATOR); 215 relative_prefix_string = format!("{}{}", ident.name, path::MAIN_SEPARATOR);
216 &relative_prefix_string 216 &relative_prefix_string
217 } else { 217 } else {
218 "" 218 ""
219 }; 219 };
220 220
221 let mod_name = id.to_string(); 221 let mod_name = id.name.to_string();
222 let default_path_str = format!("{}{}.rs", relative_prefix, mod_name); 222 let default_path_str = format!("{}{}.rs", relative_prefix, mod_name);
223 let secondary_path_str = format!("{}{}{}mod.rs", 223 let secondary_path_str = format!("{}{}{}mod.rs",
224 relative_prefix, mod_name, path::MAIN_SEPARATOR); 224 relative_prefix, mod_name, path::MAIN_SEPARATOR);